/* 场控报备管理系统 - dashboard.html 样式 */

:root {
    --primary-color: #3498db;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-sub: #7f8c8d;
    --border-color: #ecf0f1;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: var(--bg-color); 
    margin: 0; 
    padding: 20px; 
    color: var(--text-main);
    font-size: 16px;
}

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    background: var(--card-bg); 
    padding: 25px; 
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); 
}

/* 顶部导航 */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 20px; 
}
.header h1 { margin: 0; font-size: 24px; color: var(--text-main); }
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}
.btn-add { 
    background-color: var(--primary-color); 
    color: white; 
    padding: 10px 20px; 
    text-decoration: none; 
    border-radius: 6px; 
    font-weight: bold; 
    font-size: 16px;
    transition: background 0.2s;
}
.btn-add:hover { background-color: #2980b9; }
.btn-member-card {
    background-color: var(--success-color);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.2s;
}
.btn-member-card:hover { background-color: #27ae60; }

/* 用户信息栏 */
.user-info-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #e8f4fd;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
}
.user-info-bar strong {
    color: var(--primary-color);
}
.btn-edit-info {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.btn-edit-info:hover {
    background: #27ae60;
}
.btn-logout-small {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.btn-logout-small:hover {
    background: #7f8c8d;
}

/* 筛选区域 */
.filters { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px; 
    margin-bottom: 25px; 
    background: #f8f9fa; 
    padding: 20px; 
    border-radius: 8px; 
}
.filter-item { display: flex; flex-direction: column; }
.filter-item label { font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 600; }

/* 统一输入框样式 */
.filter-item input, 
.filter-item select,
.searchable-select-wrapper input { 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    font-size: 15px;
    height: 42px;
    box-sizing: border-box; 
    width: 100%;
}

.btn-search { 
    background-color: var(--success-color); 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold;
    height: 42px;
    font-size: 15px;
    margin-top: auto;
}

/* --- 桌面端表格样式 --- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse;}
th { 
    background-color: #f1f3f5; 
    color: #444; 
    font-weight: 700; 
    font-size: 15px; 
    padding: 16px; 
    text-align: left; 
    border-bottom: 2px solid #e0e0e0;
}
td { 
    padding: 16px; 
    border-bottom: 1px solid var(--border-color); 
    font-size: 15px; 
    color: #333; 
    vertical-align: middle; 
}
tr:hover td { background-color: #f8fbff; }

.badge { 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 14px; 
    font-weight: 600; 
    display: inline-block; 
}
.badge-qty { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.s-qty { display: none; }
.badge-role { background: #e2e6ea; color: #495057; border: 1px solid #dae0e5; }

/* 操作按钮样式 */
.btn-edit {
    background-color: var(--warning-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.btn-edit:hover { background-color: #d35400; }

/* --- 移动端样式 --- */
@media (max-width: 768px) {
    body { padding: 10px; background-color: #f0f2f5; }
    .container { padding: 0; box-shadow: none; max-width: 100%; background: transparent; }
    .header { padding: 20px; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
    
    .filters { margin: 0 0 15px 0; border-radius: 12px; padding: 15px; }

    thead { display: none; }
    tbody { display: block; padding: 0; }
    
    tr { 
        background: #fff;
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        padding: 18px;
        display: grid;
        grid-template-columns: 1fr auto; 
        grid-template-rows: auto auto auto; 
        gap: 12px;
        border: none;
    }

    td[data-label="单子名称"] {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        font-weight: 700;
        font-size: 17px;
        color: #2c3e50;
        line-height: 1.4;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }
    
    td[data-label="单子名称"] .s-qty {
        display: inline-block;
        margin-left: 10px;
        font-size: 14px;
        padding: 3px 10px;
        border-radius: 12px;
        background: #2ecc71;
        color: white;
        font-weight: bold;
    }

    td[data-label="时间"] {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        text-align: right;
        font-size: 14px;
        color: #7f8c8d;
        font-weight: 500;
        align-self: start;
    }

    td[data-label="陪陪"] {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        display: inline-flex;
        align-items: center;
        font-size: 15px;
        color: #555;
        background: #f8f9fa;
        padding: 8px 12px;
        border-radius: 8px;
        width: fit-content;
        border: 1px solid #eee;
    }
    td[data-label="陪陪"]:before { content: ""; margin-right: 8px; font-size: 14px; }
    td[data-label="陪陪"] .badge-role { 
        background: transparent; 
        color: #7b1fa2; 
        padding: 0; 
        font-weight: 700;
        font-size: 15px;
    }

    td[data-label="场控"] {
        grid-row: 2 / 3;
        display: inline-flex;
        align-items: center;
        font-size: 15px;
        color: #555;
        background: #f8f9fa;
        padding: 8px 12px;
        border-radius: 8px;
        width: fit-content;
        margin-left: 12px; 
        border: 1px solid #eee;
    }
    td[data-label="场控"]:before { content: ""; margin-right: 8px; font-size: 14px; }
    td[data-label="场控"] .badge-role { 
        background: transparent; 
        color: #2e7d32; 
        padding: 0; 
        font-weight: 700;
        font-size: 15px;
    }

    /* 移动端操作按钮 */
    td[data-label="操作"] {
        grid-column: 1 / -1;
        grid-row: 3 / 4;
        text-align: right;
        padding-top: 10px;
        border-top: 1px dashed #eee;
    }

    td[data-label="ID"], td[data-label="数量"] { display: none; }
}

/* --- 复用 Order 页面的下拉框样式 --- */
.searchable-select-wrapper { 
    position: relative; 
    display: flex; 
    gap: 10px; 
    width: 100%; 
}
.name-input-container { flex: 1; position: relative; }
.options-list {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd;
    border-radius: 6px; margin-top: 4px; max-height: 200px; overflow-y: auto; z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); display: none;
}
.options-list.show { display: block; }
.option-item { padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f0f0f0; transition: background-color 0.2s; }
.option-item:last-child { border-bottom: none; }
.option-item:hover { background-color: #f0f7ff; color: #4a90e2; }

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-overlay .modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    overflow: hidden;
}
.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}
.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}
.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-overlay .modal-close:hover { color: #333; }
.modal-overlay .modal-body { padding: 20px; }
.modal-overlay .user-info-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.modal-overlay .user-info-item:last-child { border-bottom: none; }
.modal-overlay .user-info-item .label {
    font-weight: 500;
    color: #666;
    min-width: 70px;
}
.modal-overlay .user-info-item span:last-child {
    color: #333;
    word-break: break-all;
}
.modal-overlay .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}
.modal-overlay .btn-logout,
.modal-overlay .btn-close {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.modal-overlay .btn-logout { background-color: #dc3545; color: white; }
.modal-overlay .btn-logout:hover { background-color: #c82333; }
.modal-overlay .btn-close { background-color: #6c757d; color: white; }
.modal-overlay .btn-close:hover { background-color: #5a6268; }
.modal-overlay .btn-save { background-color: #28a745; }
.modal-overlay .btn-save:hover { background-color: #218838; }

/* 可编辑字段样式 */
.editable-field { cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background-color 0.2s; }
.editable-field:hover { background-color: #e9ecef; }
.editable-field.editing { background-color: #fff3cd; }
.editable-input { width: 100%; padding: 5px 8px; border: 1px solid #ced4da; border-radius: 4px; font-size: 14px; }

/* 审核模式 */
.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.audit-title {
    font-size: 18px;
    font-weight: bold;
}
.btn-audit {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-audit:hover {
    background: #f0f0f0;
}
.btn-audit.active {
    background: #dc3545;
    color: white;
}

/* 数据统计栏 */
.stats-bar {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}
.stats-bar strong {
    color: var(--primary-color);
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.status-0 { background: #e3f2fd; color: #1565c0; } /* 待完成 */
.status-1 { background: #fff3e0; color: #ef6c00; } /* 待审核 */
.status-2 { background: #e8f5e9; color: #2e7d32; } /* 审核完成 */
.status-3 { background: #ffebee; color: #c62828; } /* 审核不通过 */

/* 操作按钮 */
.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
}
.btn-complete {
    background: var(--primary-color);
    color: white;
}
.btn-complete:hover { background: #2980b9; }
.btn-complete:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}
.btn-edit {
    background: #f39c12;
    color: white;
}
.btn-edit:hover { background: #e67e22; }
.btn-audit-pass {
    background: var(--success-color);
    color: white;
    padding: 5px 8px;
}
.btn-audit-pass:hover { background: #27ae60; }
.btn-audit-reject {
    background: var(--danger-color);
    color: white;
    padding: 5px 8px;
}
.btn-audit-reject:hover { background: #c0392b; }

/* 移动端卡片 - 默认隐藏 */
.mobile-cards {
    display: none;
}

/* Tab 切换样式 */
.tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 特殊订单容器样式 */
.special-order-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* 罚款类型徽章 */
.fine-type-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.fine-type-assessment {
    background: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
}

.fine-type-fine {
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}

/* 移动端罚款卡片 */
.fine-mobile-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.fine-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.fine-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.fine-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.fine-card-info span {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}

.fine-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* 响应式 - 移动端 */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    .header { flex-direction: column; gap: 10px; }
    .header h1 { font-size: 20px; }
    .btn-add {  text-align: center; }
    
    .user-info-bar {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .audit-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .filters {
        grid-template-columns: 1fr !important;
    }
    
    /* 隐藏桌面端表格，显示移动端卡片 */
    .desktop-table { display: none !important; }
    .mobile-cards { display: block; }
    
    /* 移动端卡片样式 */
    .order-card {
        background: white;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .order-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    .order-card-id {
        font-size: 12px;
        color: #999;
    }
    .order-card-title {
        font-size: 16px;
        font-weight: bold;
        color: #333;
        margin-bottom: 8px;
    }
    /* 完成时间独立标签 */
    .order-card-finish-tag {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 13px;
        margin-bottom: 8px;
        font-weight: 500;
        gap: 8px;
    }
    /* 未完成 - 橙色提示 */
    .finish-tag-pending {
        background: #fff7e6;
        border: 1px solid #ffd591;
        color: #d46b08;
    }
    /* 已完成 - 绿色 */
    .finish-tag-done {
        background: #f6ffed;
        border: 1px solid #b7eb8f;
        color: #389e0d;
    }
    .order-card-info {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        font-size: 13px;
        color: #666;
        margin-bottom: 10px;
    }
    .order-card-info span {
        background: #f5f5f5;
        padding: 3px 8px;
        border-radius: 4px;
    }
    .order-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }
    .order-card-actions .action-btn {
        flex: 1;
        text-align: center;
        min-width: 60px;
    }
    
    /* 移动端弹窗 */
    .modal-overlay .modal-content {
        max-width: 95%;
        margin: 10px;
    }
}