/* ============================================================
   XPLEX LLC 货代管理系统 — visual system v3 (premium refinement)
   Deep-navy glass rail + frosted topbar + layered soft cards.
   Restrained, Linear/Stripe-grade polish on the teal-navy identity:
   refined tokens, multi-layer shadows, micro-interactions.
   ============================================================ */
:root {
  /* palette */
  --navy-1: #0d2145;
  --navy-2: #060f22;
  --rail-fg: #93a9c7;
  --teal: #0d9488;
  --teal-dark: #0a6e62;
  --teal-mid: #0ea08d;
  --teal-bright: #2dd4bf;
  --ink: #132639;
  --ink-2: #4b6178;
  --ink-3: #8496ab;
  --line: #e3eaf1;
  --line-soft: #ecf1f6;
  --bg: #e9eff5;
  /* layered shadow system (navy-tinted, soft) */
  --sh-xs: 0 1px 2px rgba(13, 34, 64, .05);
  --sh-sm: 0 1px 2px rgba(13, 34, 64, .05), 0 4px 14px rgba(13, 34, 64, .05);
  --sh-md: 0 2px 4px rgba(13, 34, 64, .05), 0 12px 28px rgba(13, 34, 64, .09);
  --sh-lg: 0 4px 8px rgba(13, 34, 64, .06), 0 24px 48px rgba(13, 34, 64, .13);
  --sh-teal: 0 6px 18px rgba(13, 148, 136, .32);
  --card-shadow: var(--sh-sm);
  /* radius scale */
  --r-sm: 10px;
  --radius: 16px;
  --r-lg: 20px;
  --ease: cubic-bezier(.22, .68, .36, 1);
}
* { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  margin: 0; min-height: 100%;
  background: linear-gradient(180deg, #f1f5f9 0%, var(--bg) 340px) fixed, var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(13, 148, 136, .24); }
a { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(13, 148, 136, .55); outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
h1 { font-size: 21px; font-weight: 700; margin: 2px 0 16px; letter-spacing: .02em; }
.hint { color: var(--ink-2); font-size: 13px; line-height: 1.65; }

/* slim, tinted scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #bfcfdf; border-radius: 8px; border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #9db4ca; background-clip: padding-box; border: 2px solid transparent; }

/* ---------------- layout ---------------- */
.layout { display: flex; min-height: 100vh; align-items: stretch; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-col .container { width: 100%; margin: 0; padding: 22px 28px 36px; animation: page-in .45s var(--ease) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.container.plain { max-width: 1180px; margin: 20px auto; padding: 0 16px 30px; width: 100%; }
.foot { margin-top: auto; text-align: center; color: var(--ink-3); font-size: 12px; letter-spacing: .04em; padding: 18px 16px; }

/* ---------------- sidebar: deep-navy icon rail ---------------- */
.sidebar {
  width: 78px; flex: 0 0 78px; position: sticky; top: 0; height: 100vh;
  background:
    radial-gradient(120% 34% at 50% 0%, rgba(64, 120, 210, .28), rgba(64, 120, 210, 0) 70%),
    radial-gradient(130% 26% at 50% 108%, rgba(13, 148, 136, .20), rgba(13, 148, 136, 0) 70%),
    linear-gradient(180deg, var(--navy-1) 0%, #081630 52%, var(--navy-2) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06), 6px 0 24px rgba(6, 15, 34, .14);
  display: flex; flex-direction: column; align-items: center;
  padding: 0 0 14px; z-index: 40;
  transition: margin-left .26s var(--ease);
}
body.rail-hidden .sidebar { margin-left: -78px; }
.sidebar .brand { padding: 19px 4px 15px; text-align: center; width: 100%;
  border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 11px; }
.sidebar .brand-name {
  font-weight: 800; font-size: 15px; letter-spacing: 2.2px;
  background: linear-gradient(180deg, #ffffff 20%, #b9cde6 100%);
  -webkit-background-clip: text; background-clip: text;
  color: #fff; -webkit-text-fill-color: transparent;
}
.sidebar .brand-sub { color: #68809f; font-size: 9.5px; margin-top: 5px; letter-spacing: .06em; white-space: nowrap; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; }
.rail-nav a, .rail-foot a {
  position: relative; width: 50px; height: 50px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--rail-fg); text-decoration: none;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.rail-nav a svg, .rail-foot a svg { width: 23px; height: 23px; transition: transform .2s var(--ease); }
.rail-nav a:hover, .rail-foot a:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-nav a:hover svg, .rail-foot a:hover svg { transform: translateY(-1px); }
.rail-nav a.active {
  background: linear-gradient(150deg, rgba(45, 212, 191, .24), rgba(13, 148, 136, .13));
  color: #5eead4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 6px 16px rgba(13, 148, 136, .22);
}
.rail-nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 11px; bottom: 11px;
  width: 3.5px; border-radius: 3px; background: var(--teal-bright);
  box-shadow: 0 0 10px rgba(45, 212, 191, .85);
}
/* hover tooltip — dark glass */
.rail-nav a::after, .rail-foot a::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%;
  transform: translateY(-50%) translateX(-5px);
  background: rgba(13, 27, 50, .92); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .09);
  color: #fff; font-size: 12.5px; font-weight: 500; padding: 7px 12px;
  border-radius: 8px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .18s ease, transform .18s var(--ease);
  box-shadow: 0 10px 26px rgba(6, 15, 34, .4); z-index: 60;
}
.rail-nav a:hover::after, .rail-foot a:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.rail-sep { width: 34px; border-top: 1px solid rgba(255,255,255,.11); margin: 10px 0; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; }

/* ---------------- topbar — frosted glass ---------------- */
.topbar {
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(227, 234, 241, .9);
  box-shadow: 0 10px 28px rgba(13, 34, 64, .05);
  padding: 0 22px; height: 58px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.icon-btn {
  width: 38px; height: 38px; border: none; background: transparent; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2);
  box-shadow: none; transition: background .18s ease, color .18s ease;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { background: rgba(19, 38, 57, .06); color: var(--ink); box-shadow: none; transform: none; }
.crumb { font-size: 16.5px; font-weight: 650; color: var(--ink); white-space: nowrap; letter-spacing: .02em; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.avatar {
  width: 37px; height: 37px; border-radius: 50%; flex: 0 0 37px;
  background: linear-gradient(135deg, #14b8a6, #0a6e62); color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(13, 34, 64, .07), 0 4px 10px rgba(13, 148, 136, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; color: var(--ink); font-weight: 600; }
.user-meta small { color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.logout-link {
  color: var(--ink-2); text-decoration: none; margin-left: 8px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.65);
  transition: all .18s ease;
}
.logout-link:hover { color: #b00020; border-color: #efc3c3; background: #fdf3f3; }

/* ---------------- tab strip ---------------- */
.tabbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 13px 28px 0;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line); color: var(--ink-2);
  font-size: 13.5px; padding: 7px 16px; border-radius: 999px; text-decoration: none;
  box-shadow: var(--sh-xs);
  transition: all .2s var(--ease);
}
a.tab:hover { border-color: #b7d8d1; color: var(--teal-dark); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.tab.active {
  background: linear-gradient(135deg, #0ea08d, #0a6e62); border-color: transparent;
  color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(13, 148, 136, .32);
}
.tab-x { font-size: 15px; line-height: 1; color: var(--ink-3); padding: 0 1px; border-radius: 50%; transition: color .15s ease; }
.tab-x:hover { color: #b00020; }

/* ---------------- flash ---------------- */
.flash {
  padding: 12px 16px 12px 18px; border-radius: 12px; margin-bottom: 14px; font-size: 14px;
  box-shadow: var(--sh-sm); border-left: 4px solid transparent;
  animation: page-in .35s var(--ease) both;
}
.flash.ok { background: #e9f8ee; border-color: #a9dcb6; border-left-color: #22a35a; color: #145c2e; }
.flash.error { background: #fdeeee; border-color: #f0b9b9; border-left-color: #d33; color: #8c1d1d; }

/* ---------------- buttons & forms ---------------- */
button, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #ccd8e4; color: #23405f;
  padding: 8px 16px; border-radius: var(--r-sm); font-size: 14px; cursor: pointer;
  text-decoration: none; font-family: inherit; box-shadow: var(--sh-xs);
  transition: all .18s var(--ease);
}
button:hover, .btn:hover { border-color: #9fb4c9; box-shadow: var(--sh-sm); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }
button.primary, .btn.primary {
  background: linear-gradient(135deg, #0ea08d, #0a6e62); border-color: transparent;
  color: #fff; font-weight: 600; box-shadow: var(--sh-teal);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); box-shadow: 0 9px 22px rgba(13, 148, 136, .38); }
.linkbtn { background: none; border: none; box-shadow: none; color: var(--teal-dark); padding: 0 4px; font-size: 13px; cursor: pointer; text-decoration: none; font-family: inherit; }
.linkbtn:hover { box-shadow: none; transform: none; text-decoration: underline; }
.linkbtn.danger { color: #c22727; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d3dee9; border-radius: var(--r-sm);
  font-size: 14px; margin-top: 5px; background: #fcfdfe; color: var(--ink);
  font-family: inherit; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:hover, select:hover, textarea:hover { border-color: #b7c8d9; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .15);
}
label { font-size: 13.5px; color: var(--ink-2); }

form.search {
  display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sh-sm); padding: 15px 18px; margin-bottom: 16px;
}
form.search input[name=q] { min-width: 300px; margin-top: 0; }
form.search input[type=date] { margin-top: 0; width: auto; }
form.search select { width: auto; margin-top: 0; }
form.search label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
form.search .spacer { flex: 1; }

/* ---------------- cards & tables ---------------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sh-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 17px 22px 6px;
}
.card-head h2, .card-head .card-title { font-size: 16.5px; font-weight: 700; margin: 0; letter-spacing: .02em; }
.card-head .card-actions { display: flex; gap: 10px; }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; }
table.list th, table.list td {
  padding: 13px 18px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
table.list th {
  background: linear-gradient(180deg, #fafcfe, #f5f8fb); color: var(--ink-2);
  font-weight: 600; font-size: 12.5px; letter-spacing: .05em; white-space: nowrap;
}
table.list tbody tr { transition: background .15s ease; }
table.list tbody tr:hover { background: #f2f8f7; }
table.list tbody tr:last-child td { border-bottom: none; }
td.ops { white-space: nowrap; }
td.ops a { margin-right: 10px; font-size: 13.5px; text-decoration: none; }
td.ops a:hover { text-decoration: underline; }
td.ops form { display: inline; }
td.empty { text-align: center; color: var(--ink-3); padding: 38px 30px; font-size: 13.5px; letter-spacing: .06em; }
tr.inactive td { color: var(--ink-3); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; }
.pill.on { background: #e3f6ea; color: #177245; box-shadow: inset 0 0 0 1px rgba(23, 114, 69, .14); }
.pill.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22a35a; }
.pill.off { background: #eef1f5; color: #71808f; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; padding: 3px 9px; border-radius: 7px; background: #e8f1fd; color: #2563eb; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .13); }
.badge.consignee { background: #e6f7f2; color: #0a6e62; box-shadow: inset 0 0 0 1px rgba(13, 148, 136, .16); }

/* ---------------- form sections ---------------- */
fieldset {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sh-sm); margin: 0 0 16px; padding: 20px 22px 22px;
}
legend { font-weight: 700; font-size: 15px; padding: 0 9px; color: var(--ink); letter-spacing: .03em; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px 18px; }
.grid label { font-size: 13px; color: var(--ink-2); display: block; }
.grid label.wide { grid-column: span 2; }
.grid label.check { display: flex; gap: 8px; align-items: center; padding-top: 22px; }
.grid label.check input { width: auto; margin: 0; accent-color: var(--teal); }
table.lines { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1120px; }
fieldset .table-scroll { margin: 0 -6px; padding: 0 6px; }
table.lines th { text-align: left; font-size: 12px; color: var(--ink-2); padding: 6px 4px; white-space: nowrap; letter-spacing: .03em; }
table.lines td { padding: 3px; }
table.lines input { padding: 7px 8px; font-size: 13px; margin-top: 0; border-radius: 8px; }
table.lines input.small { text-align: center; }
table.lines tbody.line-block { border-bottom: 2px solid var(--line); }
table.lines tr.line-extra td { padding: 4px 3px 10px; background: #f7fafc; }
.extra-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 10px; }
.extra-grid label { font-size: 11px; color: var(--ink-2); }
.extra-grid input { width: 100%; box-sizing: border-box; margin-top: 3px; }
.actions { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.actions a { text-decoration: none; }
.settings-form { max-width: 460px; background: #fff; padding: 24px 26px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--sh-sm); }
.settings-form label { display: block; margin-bottom: 14px; }
.settings-form .btn { margin-left: 8px; }
.edit-form { max-width: 1180px; }

/* ---------------- login — brand-grade ---------------- */
body.login-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 82% -10%, rgba(20, 184, 166, .28), rgba(20, 184, 166, 0) 62%),
    radial-gradient(760px 560px at -12% 108%, rgba(37, 99, 235, .22), rgba(37, 99, 235, 0) 60%),
    linear-gradient(128deg, #050d1f 0%, #0a2447 54%, #07332f 118%),
    #050d1f;
}
body.login-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .033) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .033) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(75% 65% at 50% 42%, #000 30%, transparent 100%);
  mask-image: radial-gradient(75% 65% at 50% 42%, #000 30%, transparent 100%);
}
body.login-page .container.plain {
  max-width: none; margin: 0; padding: 24px 16px; min-height: 100vh; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: none;
}
.login-box {
  position: relative; width: 400px; max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, #ffffff, #fbfcfe); padding: 40px 40px 34px;
  border: 1px solid rgba(255, 255, 255, .65); border-radius: var(--r-lg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 32px 70px rgba(0, 0, 0, .42);
  animation: login-rise .65s var(--ease) both;
}
.login-box::before {
  content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--teal-bright), #38bdf8);
}
@keyframes login-rise {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-box .brand-mark {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 20px;
  background: linear-gradient(135deg, #14b8a6, #0a6e62); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800; letter-spacing: .5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 24px rgba(13, 148, 136, .4);
}
.login-box .login-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .32em; color: var(--teal);
  margin-bottom: 7px;
}
.login-box h1 { font-size: 28px; margin: 0 0 5px; letter-spacing: .06em; font-weight: 800; }
.login-box .login-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 26px; letter-spacing: .05em; }
.login-box label { display: block; margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.login-box input { padding: 12px 13px; border-radius: 10px; margin-top: 7px; }
.login-box button[type=submit] {
  width: 100%; justify-content: center; padding: 12.5px; font-size: 15.5px; margin-top: 6px;
  background: linear-gradient(135deg, #0ea08d, #0a6e62); border-color: transparent;
  color: #fff; font-weight: 600; letter-spacing: .14em; border-radius: 10px; box-shadow: var(--sh-teal);
}
.login-box button[type=submit]:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(13, 148, 136, .4); }
body.login-page .foot { color: rgba(255,255,255,.42); }

/* ---------------- dashboard ---------------- */
.banner {
  position: relative; overflow: hidden; border-radius: var(--r-lg); color: #fff;
  background:
    radial-gradient(560px 300px at 88% -30%, rgba(45, 212, 191, .38), rgba(45, 212, 191, 0) 62%),
    radial-gradient(520px 300px at 58% 135%, rgba(56, 150, 255, .20), rgba(56, 150, 255, 0) 65%),
    linear-gradient(118deg, #0e8a76 0%, #0a6b5c 48%, #073f43 100%);
  padding: 30px 34px; margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 16px 36px rgba(8, 80, 70, .28);
}
.banner::before, .banner::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .09);
}
.banner::before { width: 360px; height: 360px; right: -120px; top: -210px; }
.banner::after { width: 240px; height: 240px; right: 120px; bottom: -170px; }
.banner .banner-art {
  position: absolute; right: 0; top: 0; height: 100%; opacity: .5; pointer-events: none;
}
.banner h1 { color: #fff; font-size: 28px; font-weight: 750; margin: 0 0 8px; letter-spacing: .04em; position: relative; z-index: 1; }
.banner p { margin: 0; font-size: 14.5px; color: rgba(255,255,255,.8); letter-spacing: .03em; position: relative; z-index: 1; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 20px; }
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--sh-sm); padding: 22px 22px 0; overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.kpi-top { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 19px; }
.kpi-icon {
  width: 62px; height: 62px; flex: 0 0 62px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.kpi-icon svg { width: 30px; height: 30px; }
.kpi-icon.teal { background: linear-gradient(145deg, #d9f5ef, #bdeae2); color: #0b8577; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 14px rgba(13, 148, 136, .18); }
.kpi-icon.blue { background: linear-gradient(145deg, #e2eefc, #c9def8); color: #2b74d6; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 14px rgba(47, 127, 224, .16); }
.kpi-icon.orange { background: linear-gradient(145deg, #fdefda, #fbe3ba); color: #d97a10; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 14px rgba(224, 127, 19, .16); }
.kpi-main { margin-left: auto; text-align: right; }
.kpi-label { font-size: 13.5px; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .04em; }
.kpi-num { font-size: 38px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-sub {
  display: flex; border-top: 1px solid var(--line-soft); background: #fafcfe;
  margin: 0 -22px; padding: 12px 22px 15px;
}
.kpi-sub .sub-item { flex: 1; text-align: center; }
.kpi-sub .sub-item + .sub-item { border-left: 1px solid var(--line-soft); }
.kpi-sub .sub-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; letter-spacing: .03em; }
.kpi-sub .sub-num { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-sub.single .sub-item { text-align: left; }

.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 20px; }
.chart-card { padding: 19px 22px 21px; transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.chart-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.chart-card h2 { font-size: 16.5px; margin: 0 0 4px; letter-spacing: .02em; }
.chart-card .chart-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.bar-chart {
  display: flex; align-items: stretch; gap: 10px; height: 192px; padding-top: 8px;
  background-image: repeating-linear-gradient(180deg, rgba(19, 38, 57, 0) 0, rgba(19, 38, 57, 0) 45px, rgba(19, 38, 57, .05) 45px, rgba(19, 38, 57, .05) 46px);
  background-position: 0 30px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bar-val { font-size: 13px; font-weight: 700; color: var(--ink); height: 20px; font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.bar {
  width: min(46px, 70%); border-radius: 8px 8px 2px 2px; min-height: 3px;
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 55%, #0a6e62 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 5px 12px rgba(13, 148, 136, .25);
  transition: filter .18s ease, box-shadow .18s ease;
}
.bar:hover { filter: brightness(1.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 7px 16px rgba(13, 148, 136, .35); }
.bar-lab { font-size: 12.5px; color: var(--ink-2); padding-top: 8px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-legend { flex: 1; }
.donut-legend .leg-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); padding: 7px 0; }
.donut-legend .dot { width: 11px; height: 11px; border-radius: 4px; flex: 0 0 11px; }
.donut-legend .leg-num { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-empty { color: var(--ink-3); font-size: 13.5px; padding: 26px 0 10px; text-align: center; letter-spacing: .05em; }

/* legacy dashboard helpers (kept for compatibility) */
.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-title { font-size: 16.5px; font-weight: 700; margin: 20px 0 12px; }

/* ---------------- placeholder ---------------- */
.placeholder-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sh-sm); padding: 62px 20px; text-align: center; color: var(--ink-2);
}
.placeholder-icon {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 22px;
  background: linear-gradient(145deg, #eef4f9, #dde8f2); color: #7d93ad;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 18px rgba(13, 34, 64, .07);
  display: flex; align-items: center; justify-content: center;
}
.placeholder-icon svg { width: 34px; height: 34px; }
.placeholder-box p { margin: 4px 0; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .extra-grid { grid-template-columns: repeat(3, 1fr); }
  .user-meta { display: none; }
}
@media (max-width: 720px) {
  .main-col .container { padding: 16px 14px 28px; }
  .tabbar { padding: 10px 14px 0; }
  .banner { padding: 24px 22px; }
  .banner h1 { font-size: 24px; }
  .kpi-num { font-size: 32px; }
  .grid { grid-template-columns: 1fr; }
  .grid label.wide { grid-column: span 1; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
