:root {
  --midnight: #07182a;
  --midnight-deep: #041221;
  --navy: #102840;
  --cyan: #47c8d4;
  --cyan-soft: #8bdde3;
  --gold: #c59142;
  --paper: #f4f6f8;
  --white: #ffffff;
  --ink: #12223d;
  --slate: #76849a;
  --line: #dfe4eb;
  --danger: #bf3f45;
  --green: #228350;
  --shadow: 0 12px 30px rgba(19, 35, 61, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 54%, rgba(54, 145, 171, .16), transparent 35%),
    linear-gradient(115deg, #0c2a41 0%, #07172c 82%);
  color: #e9f2fa;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(87, 137, 165, .20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 137, 165, .20) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(to right, black 0 72%, transparent 100%);
}
.grid-glow {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 9%;
  width: 2px;
  background: linear-gradient(transparent, rgba(71,200,212,.65), transparent);
  box-shadow: 0 0 40px rgba(71,200,212,.38);
  animation: scan 8s ease-in-out infinite;
}
@keyframes scan { 0%, 100% { transform: translateX(-160px); opacity: .25; } 50% { transform: translateX(1100px); opacity: .7; } }
.login-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(950px, calc(100% - 48px));
  margin-left: clamp(48px, 9vw, 175px);
  padding: 64px 0;
}
.brand-row { display: flex; align-items: center; gap: 18px; margin-bottom: 62px; }
.brand-mark {
  display: flex;
  align-items: center;
  height: 96px;
  padding: 0 24px;
  border: 1px solid rgba(202, 144, 68, .45);
  border-radius: 20px;
  background: #fff;
  color: #0d3a6f;
  box-shadow: 0 10px 30px rgba(0,0,0,.13);
  font: italic 900 42px/1 "Arial Black", sans-serif;
  letter-spacing: -7px;
}
.brand-mark span:last-child { color: #76808c; }
.brand-arrow { position: relative; color: #17528e; }
.brand-arrow::after { content: ""; position: absolute; width: 32px; height: 5px; right: -7px; top: 1px; background: #17528e; transform: rotate(-38deg); transform-origin: right center; }
.system-status { color: #7f93aa; letter-spacing: .12em; font: 500 16px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-dot { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; background: #c9df39; box-shadow: 0 0 16px rgba(201,223,57,.72); }
.status-divider { padding: 0 12px; }
.eyebrow { margin: 0 0 30px; color: var(--cyan); font: 500 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .33em; }
.eyebrow span { padding: 0 12px; }
.login-panel h1 { max-width: 800px; margin: 0; font-size: clamp(58px, 6vw, 98px); line-height: 1.08; letter-spacing: -.06em; font-weight: 820; }
.accent-line { width: 76px; height: 4px; margin: 30px 0 32px; background: var(--cyan); box-shadow: 0 0 18px rgba(71,200,212,.42); }
.login-copy { max-width: 670px; margin: 0 0 56px; color: #8196ad; font-size: 21px; line-height: 1.9; }
.login-form { display: grid; grid-template-columns: 285px 285px 220px; gap: 14px; }
.login-form input, .login-button {
  width: 100%; height: 70px; border: 1px solid rgba(214,228,244,.78); border-radius: 17px; outline: none;
}
.login-form input { padding: 0 26px; background: #edf3ff; color: #12223d; font-size: 20px; }
.login-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(71,200,212,.17); }
.login-button { border: 0; background: linear-gradient(180deg, #fff, #eaf5f7); color: #13233b; font-size: 20px; font-weight: 760; box-shadow: 0 16px 32px rgba(71,200,212,.15); }
.login-button:hover { transform: translateY(-2px); box-shadow: 0 20px 36px rgba(71,200,212,.22); }
.login-button span { padding-right: 9px; font-size: 26px; }
.form-note { min-height: 26px; color: #f4bc72; }
.login-index { position: absolute; right: 38px; bottom: 32px; color: rgba(125,153,181,.42); font: 12px/1 ui-monospace, monospace; letter-spacing: .25em; }

.workspace { display: none; min-height: 100vh; background: var(--paper); }
body.is-authenticated .login-screen { display: none; }
body.is-authenticated .workspace { display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 290px; overflow-y: auto; color: #aeb9c9; background: linear-gradient(180deg, #0a1b2e, #061524); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark--small { flex: 0 0 auto; height: 52px; padding: 0 11px; border-radius: 12px; font-size: 23px; letter-spacing: -4px; }
.brand-mark--small .brand-arrow::after { width: 18px; height: 3px; }
.sidebar-brand strong { display: block; color: #edf2f7; font-size: 15px; }
.sidebar-brand small { display: block; margin-top: 9px; color: #a5895b; letter-spacing: .24em; font: 10px/1 ui-monospace, monospace; }
.nav-list { padding: 12px 10px 28px; }
.nav-list p { margin: 20px 14px 10px; color: #58677a; font-size: 12px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 15px; width: 100%; height: 48px; padding: 0 15px; border: 0; border-radius: 12px; color: #aeb9c9; background: transparent; text-align: left; }
.nav-item span { width: 20px; color: #728196; text-align: center; }
.nav-item i { margin-left: auto; font-style: normal; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.045); }
.nav-item.is-active { color: #d9aa64; background: #142b45; }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 25px; border-radius: 3px; background: #d0a04e; }
.main-column { width: 100%; min-width: 0; margin-left: 290px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 26px; border-bottom: 1px solid #e1e5eb; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 22px; }
.breadcrumb { display: flex; gap: 14px; align-items: center; font-size: 14px; }.breadcrumb span { color: #a5895b; }.breadcrumb b { color: #b8c0cc; }.breadcrumb strong { font-size: 15px; }
.account { display: flex; align-items: center; gap: 10px; }.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: linear-gradient(135deg,#142a45,#397a91); font-size: 11px; }.account button { padding: 8px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.dashboard { padding: 28px; }
.panel { margin-bottom: 22px; padding: 26px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }.panel-heading h2 { margin: 0; font-size: 20px; }.panel-heading h2 span { display: inline-block; width: 3px; height: 20px; margin-right: 12px; border-radius: 3px; background: #c59752; vertical-align: -3px; }.panel-heading h2 em { font-style: normal; font-weight: 500; }.panel-heading p { margin: 0; color: #8a96a8; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 14px; }
.metric-card { min-height: 150px; padding: 20px 21px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 8px rgba(19,35,61,.05); }.metric-card small { display: block; margin-bottom: 15px; color: #9b8057; }.metric-card strong { display: block; color: #14264a; font-size: 34px; letter-spacing: -.03em; }.metric-card p { margin: 13px 0 0; color: #8a96a8; font-size: 13px; line-height: 1.55; }.metric-card .positive { color: var(--green); font-weight: 700; }.metric-card .positive span { color: #8a96a8; font-weight: 400; }.metric-card--gold strong { color: var(--gold); }.metric-card--alert strong { color: var(--danger); }.metric-card--green strong { color: var(--green); }.metric-card--blue strong { color: #28779b; }.metric-card .muted { color: #aeb6c2; }
.chart-panel { min-height: 420px; }.legend { display: flex; justify-content: center; gap: 8px; align-items: center; margin: -4px 0 8px; color: #667386; font-size: 12px; }.legend span { display: inline-block; width: 32px; height: 10px; margin-left: 12px; border: 3px solid #172a4e; }.legend .legend-ads { border-color: #c3995c; }.chart-wrap { overflow-x: auto; }.chart { display: block; width: 100%; min-width: 760px; height: auto; }.grid-lines path { fill: none; stroke: #e0e4e9; stroke-width: 1; }.axis-labels, .x-labels { fill: #8792a2; font: 11px sans-serif; }.area { fill: url(#area); }.sales-line, .ads-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }.sales-line { stroke: #172a4e; stroke-width: 4; }.ads-line { stroke: #c3995c; stroke-width: 3; }
.scrim { display: none; position: fixed; inset: 0; z-index: 15; border: 0; background: rgba(0,0,0,.45); }

@media (max-width: 1350px) { .metric-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); } }
@media (max-width: 980px) {
  .login-panel { margin: auto; }
  .login-form { grid-template-columns: 1fr; max-width: 520px; }
  .system-status { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { margin-left: 0; }
  .menu-toggle { display: block; }
  .scrim.is-open { display: block; }
}
@media (max-width: 680px) {
  .login-panel { width: calc(100% - 34px); padding: 36px 0; }
  .brand-row { margin-bottom: 42px; }.brand-mark { height: 70px; font-size: 31px; }
  .login-panel h1 { font-size: 48px; }
  .login-copy { font-size: 17px; line-height: 1.7; margin-bottom: 35px; }
  .eyebrow { font-size: 13px; letter-spacing: .22em; }
  .dashboard { padding: 14px; }.panel { padding: 18px; border-radius: 14px; }.panel-heading { display: block; }.panel-heading p { margin-top: 9px; text-align: left; }
  .metric-grid { grid-template-columns: 1fr; }.account strong { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
