/* Datay design system v2.1 — "white engineering blueprint"
   White canvas, Carbon type, one lavender accent, hairline borders, pill controls. */
:root {
  --bg: #fafafa;          /* Linen page */
  --bg-2: #f5f5f5;        /* Mist: inputs, ghost fills */
  --panel: #ffffff;       /* Paper White cards */
  --panel-solid: #ffffff;
  --panel-2: #fafafa;
  --line: #e8e8e8;        /* Fog hairlines */
  --line-2: #dedede;
  --text: #181925;        /* Carbon */
  --muted: #666666;       /* Graphite */
  --faint: #999999;       /* Ash */
  --accent: #918df6;      /* Lavender */
  --accent-2: #9580ff;    /* Iris */
  --accent-wash: #f1f0fe;
  --glow: rgba(145, 141, 246, 0.22);
  --ok: #33c758; --ok-wash: #def6e4;
  --warn: #ffa600; --warn-wash: #fff3db;
  --err: #ff3e00; --err-wash: #ffe8e0;
  --sky: #2c78fc; --magenta: #d6409f;
  --radius: 16px;
  --shadow-btn: rgba(0, 0, 0, 0.08) 0 1px 1px 1px, rgba(0, 0, 0, 0.06) 0 0 0 0.5px;
  --shadow-ghost: rgba(0, 0, 0, 0.08) 0 1px 1px 0, rgba(0, 0, 0, 0.05) 0 0 0 1px;
  --shadow: rgba(0, 0, 0, 0.06) 0 1px 3px 0, rgba(0, 0, 0, 0.06) 0 8px 16px 0, rgba(0, 0, 0, 0.02) 0 0 0 1px;
  --font: 'Inter', 'OpenRunde', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0f14;
  --bg-2: #17181f;
  --panel: #15161d;
  --panel-solid: #15161d;
  --panel-2: #1b1c24;
  --line: #26272f;
  --line-2: #32333d;
  --text: #ededf0;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent-wash: rgba(145, 141, 246, 0.14);
  --ok-wash: rgba(51, 199, 88, 0.14);
  --warn-wash: rgba(255, 166, 0, 0.14);
  --err-wash: rgba(255, 62, 0, 0.14);
  --shadow: rgba(0, 0, 0, 0.3) 0 1px 3px 0, rgba(0, 0, 0, 0.25) 0 8px 16px 0;
  --shadow-ghost: rgba(255, 255, 255, 0.06) 0 0 0 1px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
pre { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow: auto; white-space: pre-wrap; word-break: break-all; color: var(--text); }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ logo */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.03em; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; flex-shrink: 0; box-shadow: var(--shadow-btn); }
.logo-mark svg { width: 16px; height: 16px; }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: -0.01em; margin-top: -2px; }

/* ------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: 9999px; border: 0;
  background: var(--panel); color: var(--text); font: 500 14px var(--font); letter-spacing: -0.02em; cursor: pointer;
  box-shadow: var(--shadow-ghost); transition: background .15s, box-shadow .15s, transform .15s, color .15s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: var(--bg-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: #8580f0; color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--err); box-shadow: inset 0 0 0 1px var(--err-wash); }
.btn-danger:hover { background: var(--err-wash); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-sm.btn-icon { width: 32px; height: 32px; }
.btn[disabled] { opacity: .55; cursor: wait; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 14px var(--font); letter-spacing: -0.01em; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
textarea { height: auto; min-height: 110px; padding: 10px 12px; font-family: var(--mono); font-size: 13px; letter-spacing: 0; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=file] { font: 13px var(--font); color: var(--muted); }
input[type=file]::file-selector-button { font: 500 13px var(--font); margin-right: 10px; height: 34px; padding: 0 14px; border-radius: 9999px; border: 0; box-shadow: var(--shadow-ghost); background: var(--panel); color: var(--text); cursor: pointer; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { accent-color: var(--accent); }
.field + .field { margin-top: 14px; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 6px; }

/* ------------------------------------------------------------ cards, badges, tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card.link-card { transition: box-shadow .15s, transform .15s, border-color .15s; display: block; color: inherit; }
.card.link-card:hover { box-shadow: var(--shadow); border-color: var(--line-2); text-decoration: none; transform: translateY(-1px); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; background: var(--bg-2); color: var(--muted); white-space: nowrap; letter-spacing: -0.01em; }
.badge.ok { color: #1f9a40; background: var(--ok-wash); }
.badge.warn { color: #b27400; background: var(--warn-wash); }
.badge.err { color: #d23400; background: var(--err-wash); }
.badge.acc { color: #6a64e8; background: var(--accent-wash); }
[data-theme="dark"] .badge.ok { color: var(--ok); } [data-theme="dark"] .badge.acc { color: var(--accent); }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text); font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.tbl td b, .tbl td a { color: var(--text); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--panel-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; white-space: pre-line; border: 1px solid transparent; }
.flash.ok { background: var(--ok-wash); color: #14532d; }
.flash.warn { background: var(--warn-wash); color: #7a4a00; }
.flash.err { background: var(--err-wash); color: #8a1f00; }
[data-theme="dark"] .flash { color: var(--text); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }
.steps { counter-reset: s; list-style: none; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin: 14px 0; color: var(--muted); }
.steps li b { color: var(--text); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-wash); color: #6a64e8; }
details.box { border: 1px solid var(--line); border-radius: 16px; padding: 0 20px; background: var(--panel); }
details.box + details.box { margin-top: 10px; }
details.box summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.box summary::-webkit-details-marker { display: none; }
details.box summary::after { content: '+'; color: var(--faint); font-size: 20px; font-weight: 400; }
details.box[open] summary::after { content: '–'; }
details.box[open] { padding-bottom: 18px; }
.copy { display: flex; gap: 8px; align-items: stretch; }
.copy input { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; background: var(--bg-2); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--faint); font: 500 14px var(--font); letter-spacing: -0.02em; padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.src-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; margin-right: 4px; vertical-align: -4px; }
.src-ico.xl { background: #1d6f42; }

/* ------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); background: var(--panel); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side > .logo { padding: 0 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9999px; color: var(--muted); font-weight: 500; letter-spacing: -0.02em; }
.side nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.side nav a.on { background: var(--accent-wash); color: var(--text); }
.side nav a.on .ico { color: var(--accent); }
.side nav .ico { width: 18px; text-align: center; color: var(--faint); font-size: 15px; }
.side .ws select { height: 38px; font-size: 13px; border-radius: 9999px; background-color: var(--bg-2); border-color: transparent; font-weight: 500; }
.side .foot { margin-top: auto; font-size: 12.5px; color: var(--faint); padding: 0 6px; }
.side .foot form { display: inline; }
.side .foot button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.main { padding: 32px 40px 64px; max-width: 1240px; width: 100%; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-h p { color: var(--muted); margin-top: 6px; }
.page-h a.small { color: var(--faint); font-weight: 500; }
.mobile-top { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 25% 0 0; z-index: 50; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .mobile-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: var(--panel); }
  .main { padding: 22px 16px 50px; }
}

/* ------------------------------------------------------------ auth / bare */
.bare { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(900px 420px at 50% -10%, var(--accent-wash), transparent 70%); }
.auth-card { width: 100%; max-width: 420px; padding: 32px; box-shadow: var(--shadow); border-color: transparent; }
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.bare { grid-template-rows: 1fr auto; }
.bare > .auth-card { align-self: center; }
.btn-block { width: 100%; justify-content: center; }
.auth-legal { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.5; }
.auth-legal a, .auth-alt a, .auth-pw a, .auth-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover, .auth-alt a:hover, .auth-pw a:hover, .auth-foot a:hover { color: var(--text); }
.auth-alt { font-size: 13px; color: var(--muted); text-align: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-alt a { color: var(--accent-ink, var(--text)); text-decoration: none; font-weight: 500; }
.auth-pw { text-align: center; margin-top: 10px; font-size: 12px; }
.auth-foot { display: flex; gap: 18px; justify-content: center; padding-top: 22px; font-size: 12.5px; }
.auth-foot a { text-decoration: none; }
.auth-mail { width: 54px; height: 54px; margin: -6px auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.auth-email { color: var(--text); font-weight: 600; word-break: break-all; }
.code-input { text-align: center; font-size: 28px !important; letter-spacing: .32em; font-variant-numeric: tabular-nums; font-weight: 600; padding: 14px 10px !important; height: auto !important; }
.code-input::placeholder { color: var(--line-strong, #d4d4d4); letter-spacing: .32em; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink, var(--text)); font-weight: 500; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* ------------------------------------------------------------ dashboard viewer */
.v-wrap { padding: 28px 32px 56px; max-width: 1600px; margin: 0 auto; }
.v-embed .v-wrap { padding: 14px; }
.v-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.v-head h1 { font-size: 30px; letter-spacing: -0.04em; }
.v-head .desc { color: var(--muted); margin-top: 6px; max-width: 900px; font-size: 15px; }
.v-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; margin-top: 10px; flex-wrap: wrap; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(51, 199, 88, .5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(51, 199, 88, .45); } 70% { box-shadow: 0 0 0 7px rgba(51, 199, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(51, 199, 88, 0); } }
.v-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.v-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.v-filters:empty { display: none; }
.flt { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; background: var(--panel); border-radius: 9999px; box-shadow: var(--shadow-ghost); padding: 3px 4px 3px 14px; }
.flt > span { color: var(--faint); font-size: 13px; font-weight: 500; margin-right: 2px; }
.flt select, .flt input { height: 30px; font-size: 13px; padding: 0 28px 0 8px; width: auto; border: 0; background-color: transparent; font-weight: 500; border-radius: 9999px; box-shadow: none; }
.flt input[type=date] { width: 138px; padding-right: 8px; }
.flt select:focus, .flt input:focus { box-shadow: none; background-color: var(--bg-2); }
.ms { position: relative; }
.ms-btn { height: 30px; padding: 0 12px 0 8px; border-radius: 9999px; border: 0; background: transparent; color: var(--text); font: 500 13px var(--font); cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-btn:hover { background: var(--bg-2); }
.ms-pop { position: absolute; top: 38px; left: -14px; z-index: 60; width: 270px; max-height: 360px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; }
.ms-pop input[type=search] { height: 34px; font-size: 13px; margin-bottom: 6px; background: var(--bg-2); border-color: transparent; }
.ms-list { overflow: auto; flex: 1; }
.ms-list label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 400; padding: 6px 8px; border-radius: 8px; margin: 0; cursor: pointer; }
.ms-list label input { accent-color: var(--accent); }
.ms-list label:hover { background: var(--bg-2); }
.ms-list .cnt { margin-left: auto; color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ms-foot { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 14px; border-radius: 9999px; font-size: 13px; font-weight: 500; background: var(--accent-wash); color: var(--text); }
.chip button { border: 0; background: rgba(145, 141, 246, .2); color: inherit; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 11px; }
.v-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; }
.w { grid-column: span var(--w, 6); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 16px; display: flex; flex-direction: column; min-width: 0; position: relative; transition: box-shadow .2s; }
.w:hover { box-shadow: var(--shadow); }
.w-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-height: 22px; }
.w-title { font-weight: 600; font-size: 15px; line-height: 1.35; letter-spacing: -0.02em; }
.w-sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.w-menu-btn { opacity: 0; background: none; border: 0; color: var(--faint); cursor: pointer; width: 28px; height: 28px; border-radius: 9999px; font-size: 16px; line-height: 1; flex-shrink: 0; margin: -4px -6px 0 0; }
.w:hover .w-menu-btn, .w-menu-btn:focus { opacity: 1; }
.w-menu-btn:hover { background: var(--bg-2); color: var(--text); }
.w-menu { position: absolute; right: 12px; top: 42px; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; }
.w-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: 500 13px var(--font); padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.w-menu button:hover { background: var(--bg-2); }
.w-body { flex: 1 0 auto; min-height: 0; margin-top: 10px; position: relative; }
.h-sm .w-body { height: 140px; } .h-md .w-body { height: 300px; } .h-lg .w-body { height: 420px; } .h-xl .w-body { height: 560px; }
.w-kpi .w-body { height: auto; min-height: 84px; }
.w-kpi .w-title { font-size: 13.5px; font-weight: 500; color: var(--muted); letter-spacing: -0.015em; }
.w-text .w-body { height: auto; }
.w-table .w-body, .w-pivot .w-body { overflow: auto; height: auto !important; max-height: 460px; }
.w-table.h-xl .w-body, .w-pivot.h-xl .w-body { max-height: 640px; }
.w-table.h-sm .w-body, .w-pivot.h-sm .w-body { max-height: 220px; }
.w-err { color: #b02a00; background: var(--err-wash); font-size: 13px; padding: 12px 14px; border-radius: 10px; }
.w-empty { display: grid; place-items: center; height: 100%; color: var(--faint); font-size: 13px; }
.kpi-v { font-size: 32px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.kpi-row > div:first-child { flex: 0 0 auto; max-width: 100%; }
.kpi-d { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.kpi-d b { font-weight: 600; padding: 2px 8px; border-radius: 9999px; font-variant-numeric: tabular-nums; }
.kpi-d b.up { color: #1f9a40; background: var(--ok-wash); }
.kpi-d b.down { color: #d23400; background: var(--err-wash); }
.kpi-d b.flat { color: var(--muted); background: var(--bg-2); }
[data-theme="dark"] .kpi-d b.up { color: var(--ok); } [data-theme="dark"] .kpi-d b.down { color: #ff7a4d; }
.kpi-prev { color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-cap { font-size: 12.5px; color: var(--faint); margin-top: 4px; font-weight: 500; }
.kpi-prev strong { color: var(--text); font-weight: 600; }
.spark { flex: 1 1 90px; min-width: 90px; max-width: 170px; height: 40px; }
.w table.tbl { font-size: 13px; }
.w .tbl th { cursor: pointer; user-select: none; position: sticky; top: 0; }
.w .tbl th:hover { color: var(--accent); }
.w .tbl tr.total td { font-weight: 600; color: var(--text); border-top: 1px solid var(--line-2); background: var(--panel-2); }
.w .tbl td.rh { font-weight: 500; color: var(--text); white-space: nowrap; }
.w .tbl-wrap, .w .tbl { border-radius: 0; }
.md h1, .md h2, .md h3 { margin: 6px 0; } .md p { margin: 6px 0; color: var(--muted); } .md ul, .md ol { margin: 6px 0 6px 20px; color: var(--muted); } .md strong { color: var(--text); } .md a { color: var(--accent); }
.skel { position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(90deg, var(--bg-2) 0%, var(--panel-2) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; padding: 12px 18px; border-radius: 9999px; background: var(--text); color: var(--panel); box-shadow: var(--shadow); font-size: 13.5px; font-weight: 500; animation: up .25s ease-out; max-width: 420px; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 150; background: rgba(24, 25, 37, .35); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal-c { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; width: min(1100px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-b { padding: 18px 20px; overflow: auto; flex: 1; min-height: 0; }
.modal-b .chart-xl { height: 64vh; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100%); z-index: 120; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer .msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.drawer .msg { padding: 10px 14px; border-radius: 16px; font-size: 14px; white-space: pre-wrap; max-width: 92%; }
.drawer .msg.u { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.drawer .msg.a { background: var(--bg-2); border-bottom-left-radius: 4px; }
.drawer form { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.drawer textarea { min-height: 44px; height: 44px; font-family: var(--font); border-radius: 12px; }
.v-foot { margin-top: 28px; color: var(--faint); font-size: 12.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.v-foot a { color: var(--muted); }
@media (max-width: 1100px) { .w { grid-column: span var(--w2, 12); } }
@media (max-width: 700px) {
  .v-wrap { padding: 16px 12px 40px; }
  .v-head h1 { font-size: 24px; }
  .v-grid { gap: 10px; }
  .w { grid-column: span 12 !important; padding: 14px; }
  .w.w-kpi { grid-column: span 6 !important; }
  .kpi-v { font-size: 24px; }
  .spark { display: none; }
  .h-md .w-body { height: 260px; } .h-lg .w-body { height: 340px; }
}
@media print {
  .v-actions, .w-menu-btn, .v-filters .ms-pop { display: none !important; }
  .w { break-inside: avoid; box-shadow: none !important; }
}
