/* ============================================================
   综合管理平台 - 应用外壳视觉统一
   与登录页保持同一套深海军蓝 + 明亮蓝 + 白色卡片语言
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --primary-bg: #eef4ff;
    --primary-hover-bg: #e5efff;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --completed: #059669;
    --completed-bg: #d1fae5;
    --warning: #d97706;
    --warning-bg: #fff7ed;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #4f46e5;
    --info-bg: #eef2ff;
    --bg: #eef3fb;
    --surface: #ffffff;
    --surface-2: #f6f9fe;
    --border: #e2e9f3;
    --border-light: #edf2f8;
    --text: #0f172a;
    --text-secondary: #5f6f85;
    --text-muted: #94a3b8;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 12px 30px -24px rgba(15, 23, 42, .35);
    --shadow-lg: 0 30px 80px rgba(15, 23, 42, .22);
    --shadow-card: 0 1px 2px rgba(15, 23, 42, .03), 0 14px 34px -28px rgba(15, 23, 42, .40);
}

body {
    background:
        radial-gradient(circle at 8% -10%, rgba(37, 99, 235, .10), transparent 32rem),
        radial-gradient(circle at 96% 10%, rgba(14, 165, 233, .08), transparent 30rem),
        #eef3fb;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-container {
    background:
        radial-gradient(circle at 4% 14%, rgba(37, 99, 235, .045), transparent 26rem),
        radial-gradient(circle at 96% 70%, rgba(14, 165, 233, .04), transparent 26rem);
}

/* ---------------- Header ---------------- */
.header {
    height: 76px;
    padding: 0 28px;
    color: #eaf2ff;
    border: 0;
    background:
        linear-gradient(115deg, #06152f 0%, #0a2a5e 48%, #0f4aa6 100%);
    box-shadow: 0 14px 34px -18px rgba(2, 12, 34, .75);
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    width: auto;
    border-radius: 0;
    background:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
        radial-gradient(circle at 18% 0%, rgba(56, 189, 248, .20), transparent 24rem),
        radial-gradient(circle at 88% 100%, rgba(37, 99, 235, .32), transparent 26rem);
    background-size: 48px 48px, 48px 48px, auto, auto;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, .42), transparent);
}

.header > * { position: relative; z-index: 1; }

.header-brand {
    gap: 13px;
    min-width: 0;
}

.header-brand .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .20);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 26px -18px rgba(0, 0, 0, .7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.header-brand .brand-icon svg { stroke: #dbeafe; }

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 126px;
    margin-right: 2px;
}

.brand-copy strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.25;
}

.brand-copy span {
    color: rgba(191, 219, 254, .56);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.platform-switcher {
    min-width: 208px !important;
    max-width: 330px !important;
    height: 38px !important;
    padding: 0 34px 0 13px !important;
    border: 1px solid rgba(147, 197, 253, .27) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, .105) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #bfdbfe 50%),
        linear-gradient(135deg, #bfdbfe 50%, transparent 50%),
        linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .08)) !important;
    background-position:
        calc(100% - 17px) 16px,
        calc(100% - 12px) 16px,
        100% 0 !important;
    background-size: 5px 5px, 5px 5px, 1px 100% !important;
    background-repeat: no-repeat !important;
}

.platform-switcher:hover { background-color: rgba(255, 255, 255, .14); border-color: rgba(191, 219, 254, .45); }
.platform-switcher:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(147, 197, 253, .14); }
.platform-switcher option { color: #0f172a; background: #ffffff; }
.platform-switcher:disabled { background-color: rgba(255, 255, 255, .06); color: rgba(226, 232, 240, .55); border-color: rgba(255, 255, 255, .12); }

.header-actions { gap: 9px; }

.user-display {
    color: #eaf2ff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .13);
}

.status-indicator {
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    color: #bbf7d0;
    font-size: 12px;
    font-weight: 600;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(74, 222, 128, .20);
}

.status-indicator .dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, .12);
}

.worker-count {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(96, 165, 250, .13);
    border: 1px solid rgba(147, 197, 253, .20);
}

.header .btn-secondary,
.header .btn-outline {
    color: #eaf2ff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .17);
    box-shadow: none;
}

.header .btn-secondary:hover,
.header .btn-outline:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .30);
}

.org-badge {
    color: #dbeafe;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .16);
    padding: 6px 11px;
    border-radius: 999px;
}

/* ---------------- Navigation ---------------- */
.nav-tabs {
    height: 58px;
    padding: 9px 26px 8px;
    gap: 4px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #e6edf7;
    box-shadow: 0 10px 30px -26px rgba(15, 23, 42, .55);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.nav-tabs::-webkit-scrollbar { height: 4px; }

.tab-btn {
    height: 40px;
    padding: 0 15px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: color .16s, background .16s, border-color .16s, transform .16s;
}

.tab-btn:hover {
    color: #1d4ed8;
    background: #f4f8ff;
    border-color: #e5edfa;
}

.tab-btn.active {
    color: #1d4ed8;
    background: linear-gradient(180deg, #f0f6ff, #e8f1ff);
    border-color: #d7e5ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 18px -16px rgba(37, 99, 235, .8);
}

.tab-btn.active::after { display: none; }

/* ---------------- Content ---------------- */
.main-content { background: transparent; }

.tab-panel {
    padding: 24px 28px 30px;
    gap: 18px;
}

.panel-header {
    margin-bottom: 2px;
    min-height: 34px;
}

.panel-header h2 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.2px;
}

.panel-header h2::before {
    content: '';
    width: 4px;
    height: 19px;
    border-radius: 999px;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    box-shadow: 0 4px 10px rgba(37, 99, 235, .25);
}

.panel-header .btn { flex-shrink: 0; }

/* ---------------- Cards ---------------- */
.chart-card,
.kpi-card,
.billing-card,
.table-container,
.filter-bar,
.form-card {
    background: rgba(255, 255, 255, .97);
    border: 1px solid #e4ebf5;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.chart-card,
.kpi-card,
.billing-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.chart-card:hover,
.kpi-card:hover,
.billing-card:hover {
    transform: translateY(-2px);
    border-color: #d8e5fa;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .03), 0 22px 48px -34px rgba(15, 23, 42, .50);
}

.kpi-card {
    position: relative;
    padding: 20px;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    right: -34px;
    top: -42px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .07), transparent 70%);
    pointer-events: none;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.kpi-info { gap: 4px; }
.kpi-value { color: #0f172a; font-size: 29px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.kpi-label { color: #7b8aa0; font-size: 12px; font-weight: 600; }

.chart-card { padding: 18px 20px; }
.chart-card .chart-title {
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eef3fa;
    color: #0f172a;
    font-size: 15px;
    font-weight: 750;
}

.billing-card {
    padding: 20px 22px;
    min-height: 128px;
}

.billing-card-title { color: rgba(255, 255, 255, .82); font-size: 12px; font-weight: 600; }
.billing-card-value { color: #ffffff; font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.billing-card-desc { color: rgba(255, 255, 255, .65); }

.billing-card:not([style*="linear-gradient"]) {
    background: linear-gradient(145deg, #0b2a60, #124fa8);
    border-color: rgba(37, 99, 235, .30);
    box-shadow: 0 18px 36px -28px rgba(2, 12, 34, .85);
}

/* ---------------- Filters ---------------- */
.filter-bar {
    padding: 16px 18px;
    margin-bottom: 0;
}

.filter-row { gap: 12px; }
.filter-group { gap: 5px; }
.filter-group label { color: #7b8aa0; font-size: 11px; font-weight: 650; }

.input,
.select,
.textarea {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #dce6f3;
    border-radius: 9px;
    background: #fbfdff;
    color: #1e293b;
    font-size: 13px;
    transition: border-color .16s, box-shadow .16s, background .16s;
}

.input:hover,
.select:hover,
.textarea:hover { border-color: #c8d7eb; }

.input:focus,
.select:focus,
.textarea:focus {
    border-color: #60a5fa;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.filter-group .input,
.filter-group .select { height: 38px; }

/* ---------------- Buttons ---------------- */
.btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: .1px;
    transition: transform .14s, box-shadow .14s, background .14s, border-color .14s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .75);
}

.btn-primary:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 12px 26px -14px rgba(37, 99, 235, .85);
}

.btn-secondary {
    color: #334155;
    background: #ffffff;
    border-color: #dce5f2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
}

.btn-secondary:hover { background: #f6f9ff; border-color: #c9d8ec; }

.btn-success { background: linear-gradient(135deg, #34d399, #059669); border-color: transparent; box-shadow: 0 10px 22px -15px rgba(5, 150, 105, .7); }
.btn-success:hover { background: linear-gradient(135deg, #10b981, #047857); }

.btn-warning { background: linear-gradient(135deg, #fbbf24, #d97706); border-color: transparent; box-shadow: 0 10px 22px -15px rgba(217, 119, 6, .6); }
.btn-warning:hover { background: linear-gradient(135deg, #f59e0b, #b45309); }

.btn-danger { background: linear-gradient(135deg, #f87171, #dc2626); border-color: transparent; box-shadow: 0 10px 22px -15px rgba(220, 38, 38, .55); }
.btn-danger:hover { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.btn-sm { min-height: 29px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- Tables ---------------- */
.table-container {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid #e3eaf4;
}

.data-table { font-size: 13px; }

.data-table thead {
    background: #f5f8fe;
    box-shadow: 0 1px 0 #e9eff8;
}

.data-table th {
    padding: 13px 14px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .35px;
    text-transform: none;
    border-bottom: 1px solid #e8eef7;
}

.data-table td {
    padding: 13px 14px;
    color: #24324a;
    border-bottom: 1px solid #eff3f9;
}

.data-table tbody tr { transition: background .14s; }
.data-table tbody tr:hover { background: #f7faff; }
.data-table tbody tr:last-child td { border-bottom: none; }

.user-tree-group td { background: #f5f8fe; }
.user-tree-toggle { padding: 12px 14px; color: #1e293b; }
.user-tree-count { color: #8392a8; }

.pagination-wrap {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #edf2f9;
}

.page-num { border-radius: 8px; }
.page-num.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 8px 16px -12px rgba(37, 99, 235, .8);
}

/* ---------------- Status and badges ---------------- */
.status-pill,
.badge {
    min-height: 23px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1px;
}

.status-pill::before { width: 5px; height: 5px; opacity: .9; }
.status-pill.stopped { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.status-pill.incomplete { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge { background: #eef4ff; color: #2563eb; }

/* ---------------- Modals ---------------- */
.modal {
    background: rgba(6, 15, 34, .48);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.modal-dialog {
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 18px;
    box-shadow: 0 34px 90px rgba(2, 12, 34, .30);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    border-bottom: 1px solid #e9eff8;
}

.modal-header h3 { color: #0f172a; font-size: 17px; font-weight: 750; }
.modal-close { width: 30px; height: 30px; border-radius: 9px; color: #64748b; }
.modal-close:hover { background: #fef2f2; color: #dc2626; }
.modal-body { padding: 22px 24px; }
.modal-footer {
    padding: 16px 24px;
    background: #fbfdff;
    border-top: 1px solid #e9eff8;
}

.modal-tabs { background: #ffffff; border-bottom-color: #e9eff8; }
.modal-tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }

/* ---------------- Empty / misc ---------------- */
.empty-state {
    color: #94a3b8;
    padding: 34px 20px;
    font-size: 13px;
}

.form-hint {
    color: #64748b;
    background: #f7faff;
    border-color: #e8eef7;
    border-radius: 9px;
}

.list-item {
    border-color: #edf2f9;
    border-radius: 12px;
    background: #ffffff;
}

.notice-panel .notice-list { border-radius: 12px; }

/* ---------------- Scrollbars ---------------- */
* { scrollbar-width: thin; scrollbar-color: #c8d5e8 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #c8d5e8; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #aebfd7; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
    .brand-copy { display: none; }
    .header { padding: 0 20px; }
    .nav-tabs { padding-left: 20px; padding-right: 20px; }
    .tab-panel { padding: 20px; }
}

@media (max-width: 820px) {
    .header { height: 68px; padding: 0 14px; }
    .header-brand .brand-icon { width: 38px; height: 38px; }
    .platform-switcher { min-width: 160px; max-width: 220px; height: 36px; font-size: 13px; }
    .user-display, .status-indicator, .worker-count { display: none; }
    .nav-tabs { height: 54px; padding: 7px 14px; }
    .tab-btn { height: 38px; padding: 0 12px; }
    .tab-panel { padding: 16px 14px 22px; }
    .panel-header h2 { font-size: 18px; }
}

/* ---------------- Task card overflow menu ---------------- */
.enrollment-task-org-group:has(.task-more-menu[open]) {
    overflow: visible;
    z-index: 40;
}

.enrollment-task-card:has(.task-more-menu[open]) {
    position: relative;
    z-index: 50;
}

.task-more-menu[open] { z-index: 60; }

.task-more-menu-popover {
    z-index: 1000;
    width: 188px;
    padding: 6px;
    border: 1px solid #dbe5f3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 22px 48px -18px rgba(15, 23, 42, .34), 0 3px 10px rgba(15, 23, 42, .08);
}

.task-more-menu-popover button {
    padding: 9px 10px;
    border-radius: 8px;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .14s, color .14s;
}

.task-more-menu-popover button:hover { background: #f2f7ff; color: #1d4ed8; }
.task-more-menu-popover button.is-danger:hover { background: #fef2f2; color: #dc2626; }
.task-more-menu-popover button.hbut-release-btn { color: #b45309; }
.task-more-menu-popover button.hbut-release-btn:hover { background: #fff7ed; color: #c2410c; }

