:root {
    --bg: #eef3f9;
    --panel: #ffffff;
    --text: #172033;
    --muted: #687287;
    --primary: #1f6feb;
    --primary-dark: #195ac0;
    --border: #dce4ef;
    --success: #0f9f6e;
    --warning: #f59e0b;
    --info: #0284c7;
    --purple: #7c3aed;
    --danger: #dc2626;
    --shadow: 0 12px 28px rgba(15, 23, 42, .07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
.layout { min-height: 100vh; display: flex; }
.sidebar { width: 252px; background: #0f172a; color: #fff; padding: 22px; position: fixed; inset: 0 auto 0 0; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #1f6feb, #7c3aed); font-weight: 800; }
.brand strong { display: block; font-size: 16px; }
.brand small { color: #94a3b8; display: block; margin-top: 3px; }
.sidebar nav { display: grid; gap: 10px; }
.sidebar nav a { padding: 11px 13px; border-radius: 8px; color: #cbd5e1; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.main { margin-left: 252px; width: calc(100% - 252px); min-height: 100vh; padding: 28px; }
.main.narrow { max-width: 1180px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 18px; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
h2 { margin: 0; font-size: 18px; }
p { color: var(--muted); line-height: 1.55; }
.topbar p { margin: 5px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 9px 13px; background: #fff; color: var(--text); font-weight: 750; cursor: pointer; min-height: 38px; font-size: 14px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.light { background: #f8fafc; }
.btn.small { padding: 6px 9px; min-height: auto; border-radius: 8px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn:disabled { cursor: not-allowed; opacity: .52; transform: none; box-shadow: none; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats-grid.compact { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.stat-card { background: var(--panel); padding: 16px; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); min-height: 108px; }
.stat-card span { color: var(--muted); font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat-card strong { display: block; font-size: 28px; margin-top: 10px; letter-spacing: 0; }
.stat-card small { color: var(--muted); }
.stat-card.success strong { color: var(--success); }
.stat-card.warning strong { color: var(--warning); }
.stat-card.info strong { color: var(--info); }
.stat-card.purple strong { color: var(--purple); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.two-column.wide-left { grid-template-columns: 1.25fr .75fr; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; }
.filter-panel { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.panel-head a, .panel-head span { color: var(--muted); font-weight: 700; font-size: 13px; }
.status-list { display: grid; gap: 10px; }
.status-row { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; }
.status-row span { color: var(--muted); font-weight: 700; }
.status-row strong { font-size: 18px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table { min-width: 760px; }
.client-table { min-width: 1120px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #f8fbff; }
tbody tr.is-selected { background: #eff6ff; }
td a { font-weight: 800; color: var(--primary); }
td small { display: block; color: var(--muted); margin-top: 4px; }
.notes-cell { max-width: 340px; color: var(--muted); }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.blue { background: #e0f2fe; color: #0369a1; }
.badge.green { background: #dcfce7; color: #15803d; }
.filters { display: grid; grid-template-columns: minmax(240px, 1fr) 220px 220px auto auto; gap: 10px; align-items: center; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font: inherit; color: var(--text); background: #fff; outline: none; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31,111,235,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.one { grid-template-columns: 1fr; }
label { color: var(--muted); font-weight: 800; font-size: 12px; display: grid; gap: 7px; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.button-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.activity-list, .documents { display: grid; gap: 12px; }
.activity-list article, .document-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.activity-list strong, .document-card strong { display: block; }
.activity-list span, .document-card span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.activity-list p { margin: 8px 0 0; }
.upload-form { display: grid; gap: 14px; margin-bottom: 18px; }
.document-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.doc-actions { display: flex; gap: 8px; }
.timeline { display: grid; gap: 14px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; }
.timeline-item .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); margin-top: 6px; }
.timeline-item strong { display: block; }
.timeline-item span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.timeline-item p { margin: 8px 0 0; background: #f8fafc; border: 1px solid var(--border); padding: 11px; border-radius: 8px; }
.muted { color: var(--muted); }
@media (max-width: 1100px) {
    .sidebar { position: static; width: 100%; }
    .layout { display: block; }
    .main { margin-left: 0; width: 100%; }
    .stats-grid, .stats-grid.compact, .two-column, .two-column.wide-left { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
}
.user-box { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.13); border-radius: 8px; padding: 12px 13px; margin: -10px 0 20px; }
.user-box strong, .user-box small { display: block; }
.user-box small { color: #cbd5e1; margin-top: 4px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #eef3f9, #dbeafe); }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 26px; }
.login-card h1 { margin: 10px 0 0; }
.login-brand { margin-bottom: 18px; }
.login-brand span { color: #fff; }
.alert { padding: 10px 12px; border-radius: 8px; margin: 12px 0; font-weight: 750; }
.alert.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert.warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.three-column { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.report-filters { grid-template-columns: repeat(5, minmax(150px, 1fr)) auto auto; align-items: end; }
.role-guide { margin-top: 16px; padding: 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.role-guide p { margin: 8px 0; }
.form-section { padding-top: 4px; border-top: 1px solid var(--border); margin-top: 2px; }
.form-section h2 { font-size: 15px; }
.import-panel { margin-top: 18px; }
.import-actions-panel .panel-head { margin-bottom: 0; }
.swal2-popup { font-family: Inter, Arial, Helvetica, sans-serif; border-radius: 8px; }
.swal-import-form { text-align: left; }
.swal-import-field { color: var(--muted); font-weight: 800; font-size: 12px; display: grid; gap: 7px; }
.swal-import-field input { margin-top: 2px; }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.bulk-toolbar span { color: var(--muted); font-weight: 700; }
.bulk-toolbar strong { color: var(--text); }
.select-col { width: 42px; text-align: center; }
.select-col input { display: inline-block; vertical-align: middle; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.detail-grid div { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-width: 0; }
.detail-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 5px; }
.detail-grid strong { display: block; overflow-wrap: anywhere; }
.tab-shell { margin-bottom: 18px; }
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px; margin-bottom: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.tab-button { border: 0; border-radius: 7px; padding: 9px 12px; background: transparent; color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; }
.tab-button:hover { color: var(--text); background: #eef4fb; }
.tab-button.is-active { color: #fff; background: var(--primary); box-shadow: 0 6px 14px rgba(31, 111, 235, .18); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panels { min-height: 220px; }
.tab-filters { padding: 12px; margin-bottom: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.report-tab-shell .status-list { max-width: 680px; }
.report-table { min-width: 980px; }
@media (max-width: 1200px) { .three-column { grid-template-columns: 1fr; } .report-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .sidebar { position: static; width: 100%; } .layout { display: block; } .main { margin-left: 0; width: 100%; padding: 18px; } .stats-grid, .stats-grid.compact, .two-column, .two-column.wide-left, .form-grid, .filters, .report-filters, .detail-grid { grid-template-columns: 1fr; } .tab-button { flex: 1 1 100%; } }
