/* ============================================================
   菲利信全公司费用管理平台 · 设计系统
   ============================================================ */
:root {
  --primary: #165DFF;
  --primary-dark: #0E42D2;
  --primary-light: #E8F3FF;
  --teal: #00B8A9;
  --green: #00B42A;
  --green-light: #E8FFEA;
  --orange: #FF7D00;
  --orange-light: #FFF7E8;
  --red: #F53F3F;
  --red-light: #FFECE8;
  --purple: #722ED1;
  --purple-light: #F5E8FF;
  --gray: #86909C;
  --gray-light: #F2F3F5;
  --bg: #F2F3F5;
  --card: #FFFFFF;
  --text: #1D2129;
  --text-2: #4E5969;
  --text-3: #86909C;
  --border: #E5E6EB;
  --border-light: #F2F3F5;
  --sidebar: #0F1B2D;
  --sidebar-2: #16233A;
  --sidebar-text: #A9B4C6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(29, 33, 41, 0.06);
  --shadow-lg: 0 8px 30px rgba(29, 33, 41, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: #C9DDFF; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sidebar); color: var(--sidebar-text);
  position: fixed; left: 0; top: 0; bottom: 0; display: flex; flex-direction: column; z-index: 40;
  overflow-y: auto; scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #2A3A55; border-radius: 4px; }
.sidebar-brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #165DFF, #00B8A9);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(22, 93, 255, .35);
}
.brand-text { line-height: 1.25; min-width: 0; }
.brand-name { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; }
.brand-sub { color: #6E7F99; font-size: 11px; margin-top: 2px; white-space: nowrap; }

.nav { flex: 1 1 auto; padding: 4px 10px 12px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-group-title { font-size: 11px; color: #5D6E88; padding: 0 10px 6px; letter-spacing: .06em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0; border-radius: 8px;
  color: var(--sidebar-text); font-size: 13.5px; cursor: pointer; user-select: none; transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(22, 93, 255, .35); }
.nav-item .nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; padding: 1px 6px; }
.sidebar-footer { padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11px; color: #5D6E88; flex: 0 0 auto; }
.sidebar-footer .mode-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.sidebar-footer .mode-dot.local { background: var(--orange); }

.main { flex: 1 1 auto; margin-left: 232px; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 16px; min-height: 62px;
}
.topbar-left { min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); position: relative;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot-red { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 20px; background: #fff; cursor: pointer; }
.user-chip:hover { border-color: var(--primary); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #165DFF, #00B8A9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.user-chip .u-name { font-size: 13px; font-weight: 500; }
.user-chip .u-role { font-size: 11px; color: var(--text-3); }

.content { padding: 20px 24px 40px; flex: 1 1 auto; min-width: 0; }
.page { animation: pageIn .18s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.footer { padding: 14px 24px 22px; color: var(--text-3); font-size: 11.5px; border-top: 1px solid var(--border-light); margin-top: auto; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-light); margin-bottom: 16px; overflow: hidden; }
.card-head { padding: 14px 18px 10px; display: flex; align-items: flex-start; gap: 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 4px 18px 18px; }
.card.no-pad .card-body { padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin-bottom: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  border: 1px solid var(--border-light); cursor: default; position: relative; overflow: hidden;
}
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kpi-label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: clamp(17px, 1.45vw, 22px); font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.kpi-sub { font-size: 11.5px; color: var(--text-3); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-icon { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; opacity: .9; }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-tone-blue .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-tone-green .kpi-icon { background: var(--green-light); color: var(--green); }
.kpi-tone-orange .kpi-icon { background: var(--orange-light); color: var(--orange); }
.kpi-tone-red .kpi-icon { background: var(--red-light); color: var(--red); }
.kpi-tone-purple .kpi-icon { background: var(--purple-light); color: var(--purple); }
.kpi-tone-teal .kpi-icon { background: #E6FFFB; color: var(--teal); }
.trend-up { color: var(--red); }
.trend-down { color: var(--green); }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1 1 auto; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-orange { color: var(--orange); } .text-blue { color: var(--primary); }

/* ---------- Section / banner / empty ---------- */
.section-title { font-size: 15px; font-weight: 600; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.banner { border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner-warn { background: var(--orange-light); color: #B85C00; border: 1px solid #FFE4BA; }
.banner-info { background: var(--primary-light); color: #0E42D2; border: 1px solid #C9DDFF; }
.banner-danger { background: var(--red-light); color: #B3261E; border: 1px solid #FFD2C8; }
.sample-notice { background: #FFF7E8; border: 1px dashed #FFC97A; color: #B85C00; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty svg { width: 34px; height: 34px; opacity: .5; display: block; margin: 0 auto 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 13px; cursor: pointer; white-space: nowrap; transition: all .15s; user-select: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--gray-light); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #D93030; border-color: #D93030; color: #fff; }
.btn-warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-warn:hover { background: #E66F00; border-color: #E66F00; color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn-danger-ghost { color: var(--red); border-color: #FFD2C8; }
.btn-danger-ghost:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; font-size: 13.5px; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; user-select: none; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- Filter bar ---------- */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); }
.filterbar .fb-label { font-size: 12px; color: var(--text-3); }
.filterbar .input, .filterbar .select { height: 32px; width: auto; min-width: 132px; }
.filterbar .select { padding-right: 26px; }
.filterbar .spacer { flex: 1 1 auto; }

/* ---------- Form ---------- */
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 0 10px; height: 34px;
  font-size: 13px; color: var(--text); outline: none; transition: border .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 8px 10px; min-height: 76px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, .12); }
.input[readonly], .input:disabled, .select:disabled { background: var(--gray-light); color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field-label { font-size: 12.5px; color: var(--text-2); display: flex; gap: 4px; align-items: center; }
.field-label .req { color: var(--red); }
.field-help { font-size: 11.5px; color: var(--text-3); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Data table ---------- */
.table-wrap { width: 100%; }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; flex-wrap: wrap; }
.table-toolbar .search { position: relative; width: 220px; max-width: 100%; }
.table-toolbar .search .input { padding-left: 30px; }
.table-toolbar .search svg { position: absolute; left: 9px; top: 9px; width: 15px; height: 15px; color: var(--text-3); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: #F7F8FA; color: var(--text-2); font-weight: 600; text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12.5px; position: relative;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--primary); }
.data-table th .sort-ind { color: var(--text-3); font-size: 10px; margin-left: 3px; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; color: var(--text); }
.data-table tbody tr:hover { background: #F7FAFF; }
.data-table tbody tr.clickable-row { cursor: pointer; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tr.totals-row td { background: #F7F8FA; font-weight: 700; border-top: 1.5px solid var(--border); }
.data-table .cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.data-table .col-actions { white-space: nowrap; text-align: right; }
.data-table .row-actions { display: inline-flex; gap: 4px; }
.data-table .link { color: var(--primary); cursor: pointer; }
.data-table .link:hover { text-decoration: underline; }
.table-foot { display: flex; align-items: center; gap: 10px; padding: 10px 2px 0; flex-wrap: wrap; color: var(--text-3); font-size: 12px; }
.pagination { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pagination .pg { min-width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; color: var(--text-2); padding: 0 6px; }
.pagination .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .pg:disabled { opacity: .4; cursor: default; }

/* ---------- Tags / badges ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.tag-green { background: var(--green-light); color: #00801E; }
.tag-red { background: var(--red-light); color: #B3261E; }
.tag-orange { background: var(--orange-light); color: #B85C00; }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-gray { background: var(--gray-light); color: var(--text-2); }
.tag-purple { background: var(--purple-light); color: #5B21B6; }
.tag-teal { background: #E6FFFB; color: #00847A; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot-green { background: var(--green); } .dot-red { background: var(--red); } .dot-orange { background: var(--orange); } .dot-gray { background: var(--gray); } .dot-blue { background: var(--primary); }

/* ---------- Charts ---------- */
.chart-box { width: 100%; min-height: 120px; position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.chart-legend .lg-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.chart-tooltip { position: absolute; pointer-events: none; background: rgba(29, 33, 41, .92); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; z-index: 10; white-space: nowrap; display: none; line-height: 1.6; }

/* ---------- Progress ---------- */
.progress-track { width: 100%; height: 8px; background: var(--gray-light); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 6px; background: var(--primary); transition: width .4s ease; }
.progress-bar.green { background: var(--green); } .progress-bar.orange { background: var(--orange); } .progress-bar.red { background: var(--red); } .progress-bar.teal { background: var(--teal); }
.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.progress-row .pr-label { width: 116px; flex: 0 0 auto; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-row .pr-track { flex: 1 1 auto; }
.progress-row .pr-value { width: 96px; flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ---------- Drawer / Modal / Toast ---------- */
.drawer-mask, .modal-mask { position: fixed; inset: 0; background: rgba(15, 27, 45, .45); z-index: 100; display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer { margin-left: auto; width: 520px; max-width: 94vw; background: #fff; height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border-light); display: flex; align-items: flex-start; gap: 12px; }
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.drawer-head .icon-btn { margin-left: auto; }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
.modal-mask { align-items: center; justify-content: center; }
.modal { width: 440px; max-width: 92vw; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: modalIn .18s ease; overflow: hidden; }
@keyframes modalIn { from { transform: scale(.96); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 20px 8px; font-size: 16px; font-weight: 600; }
.modal-body { padding: 4px 20px 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(29, 33, 41, .94); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease; display: flex; align-items: center; gap: 8px; }
.toast-success { background: #0E7A2E; } .toast-error { background: #B3261E; } .toast-warn { background: #B85C00; } .toast-info { background: #165DFF; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; background: linear-gradient(120deg, #0B1424 0%, #102A55 52%, #0B3B4A 100%); position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, rgba(22, 93, 255, .35), transparent 65%); top: -260px; left: -160px; }
.login-wrap::after { content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 184, 169, .22), transparent 65%); bottom: -280px; right: -160px; }
.login-left { flex: 1 1 auto; color: #fff; padding: 64px 6vw; display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 1; min-width: 0; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-logo .brand-logo { width: 46px; height: 46px; font-size: 19px; border-radius: 12px; }
.login-logo .lt { font-size: 19px; font-weight: 650; letter-spacing: .02em; }
.login-logo .lt small { display: block; font-size: 11.5px; color: #8FA3C0; font-weight: 400; margin-top: 3px; letter-spacing: .06em; }
.login-title { font-size: 34px; font-weight: 700; line-height: 1.35; max-width: 620px; letter-spacing: .01em; }
.login-desc { color: #9FB2CC; margin-top: 14px; font-size: 14px; line-height: 1.8; max-width: 560px; }
.login-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 36px; max-width: 620px; }
.login-point { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; padding: 13px 15px; font-size: 12.5px; color: #C6D4E6; display: flex; gap: 9px; align-items: flex-start; }
.login-point b { color: #fff; display: block; margin-bottom: 2px; font-weight: 600; }
.login-point svg { width: 16px; height: 16px; color: #56A8FF; flex: 0 0 auto; margin-top: 1px; }
.login-right { width: 460px; max-width: 96vw; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: 100%; background: rgba(255, 255, 255, .98); border-radius: 16px; padding: 30px 30px 24px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login-card .lc-sub { color: var(--text-3); font-size: 12.5px; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 40px; font-size: 14px; margin-top: 4px; }
.login-tip { margin-top: 16px; font-size: 11.5px; color: var(--text-3); line-height: 1.7; background: var(--gray-light); padding: 9px 11px; border-radius: 8px; }
.login-accounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 12px; }
.login-account { border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; font-size: 11.5px; cursor: pointer; color: var(--text-2); display: flex; justify-content: space-between; gap: 6px; }
.login-account:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.login-foot { text-align: center; color: var(--text-3); font-size: 11px; margin-top: 16px; }

/* ---------- Misc ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { padding: 80px 0; text-align: center; color: var(--text-3); }
.kv-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.kv-grid .k { color: var(--text-3); }
.mobile-only { display: none; }
.desktop-only { display: block; }
.divider { height: 1px; background: var(--border-light); margin: 14px 0; }
.matrix-cell { text-align: right; font-variant-numeric: tabular-nums; }
.cell-warn { background: #FFF7E8; }
.cell-danger { background: #FFECE8; color: #B3261E; font-weight: 600; }
.cell-empty { color: #C9CDD4; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend-inline .li { display: inline-flex; gap: 5px; align-items: center; }
.legend-inline .li i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; border: 1px solid transparent; }
.alert-item.red { background: var(--red-light); border-color: #FFD2C8; }
.alert-item.orange { background: var(--orange-light); border-color: #FFE4BA; }
.alert-item.blue { background: var(--primary-light); border-color: #C9DDFF; }
.alert-item .ai-main { flex: 1 1 auto; min-width: 0; }
.alert-item .ai-title { font-weight: 600; color: var(--text); }
.alert-item .ai-sub { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.alert-item .ai-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 9px; background: #fff; border: 1px solid var(--border-light); cursor: pointer; }
.todo-item:hover { border-color: var(--primary); }
.todo-item .ti-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.todo-item .ti-icon svg { width: 16px; height: 16px; }
.todo-item .ti-main { flex: 1 1 auto; min-width: 0; }
.todo-item .ti-title { font-size: 13px; font-weight: 500; }
.todo-item .ti-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.todo-item .ti-num { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 2px 14px; font-size: 12.5px; color: var(--text-2); }
.summary-strip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cell-input { width: 100%; height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-size: 12px; text-align: right; }
.cell-input:focus { border-color: var(--primary); outline: none; }
.inline-select { height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-size: 12px; background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar {
    width: 100%; height: 58px; top: auto; bottom: 0; left: 0; right: 0; flex-direction: row;
    overflow-x: auto; overflow-y: hidden; border-top: 1px solid #22314B; background: var(--sidebar);
  }
  .sidebar-brand, .sidebar-footer, .nav-group-title { display: none; }
  .nav { display: flex; padding: 4px 6px; gap: 2px; align-items: center; flex: 1 1 auto; }
  .nav-group { display: contents; }
  .nav-item { flex-direction: column; gap: 2px; font-size: 10px; padding: 5px 10px; margin: 0; border-radius: 8px; min-width: 62px; justify-content: center; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item .nav-badge { position: absolute; margin: 0; }
  .main { margin-left: 0; padding-bottom: 62px; }
  .topbar { padding: 10px 14px; min-height: 54px; }
  .topbar-title { font-size: 16px; }
  .topbar-sub { display: none; }
  .content { padding: 14px 12px 30px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 19px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 18px; }
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
  .card-head { padding: 12px 14px 8px; }
  .card-body { padding: 4px 14px 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100vw; max-width: 100vw; }
  .table-toolbar .search { width: 100%; }
  .user-chip .u-role { display: none; }
  .data-table { min-width: 720px; }
  .filterbar { padding: 8px 10px; }
  .login-points { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .sidebar, .topbar-actions, .filterbar, .card-actions, .table-toolbar, .pagination, .drawer-mask, .modal-mask, .toast-wrap, .footer { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
  .data-table { min-width: 0; font-size: 11px; }
  @page { size: A4 landscape; margin: 10mm; }
}
