:root {
  color-scheme: light;
  --ink: #12263a;
  --ink-soft: #486581;
  --navy: #102a43;
  --navy-2: #173f5f;
  --teal: #0f9f92;
  --teal-dark: #0b7f75;
  --blue: #2f80ed;
  --orange: #f59e0b;
  --green: #22a06b;
  --violet: #7c5ce7;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --line: #dce6ee;
  --line-soft: #edf2f6;
  --danger: #dc3c4d;
  --shadow: 0 12px 34px rgba(16, 42, 67, 0.09);
  --shadow-lg: 0 28px 80px rgba(8, 28, 48, 0.2);
  --radius: 18px;
  --font: Inter, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  background: #fbfcfe;
}

.auth-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 22% 20%, rgba(53, 210, 191, 0.28), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(47, 128, 237, 0.32), transparent 35%),
    linear-gradient(140deg, #0b253d 0%, #123e5e 58%, #0b716c 130%);
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000, transparent 75%);
}

.auth-art > p {
  z-index: 2;
  position: absolute;
  left: 11%;
  bottom: 9%;
  margin: 0;
  font-weight: 800;
  font-size: clamp(42px, 6vw, 90px);
  line-height: .84;
  letter-spacing: -.06em;
  opacity: .1;
}

.auth-device {
  z-index: 2;
  position: relative;
  width: 210px;
  height: 350px;
  border: 5px solid rgba(255,255,255,.9);
  border-radius: 42px;
  transform: rotate(8deg);
  background: linear-gradient(155deg, rgba(255,255,255,.16), rgba(255,255,255,.03));
  box-shadow: 0 30px 90px rgba(0,0,0,.28), inset 0 0 45px rgba(255,255,255,.08);
}

.auth-device::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 72px;
  height: 9px;
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  transform: translateX(-50%);
}

.auth-device span {
  position: absolute;
  left: 34px;
  right: 34px;
  height: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.18);
}
.auth-device span:nth-child(1) { top: 96px; }
.auth-device span:nth-child(2) { top: 136px; right: 70px; }
.auth-device span:nth-child(3) { top: 202px; height: 72px; border-radius: 18px; background: rgba(18,207,184,.36); }

.auth-orbit { position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.orbit-one { width: 580px; height: 580px; }
.orbit-two { width: 780px; height: 780px; }

.auth-card {
  width: min(440px, calc(100% - 56px));
  margin: auto;
  padding: 44px 0;
}

.brand { display: flex; align-items: center; gap: 13px; color: #fff; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #14b8a6, #0c8178);
  box-shadow: 0 8px 20px rgba(15,159,146,.25);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.57); font-size: 10px; letter-spacing: .035em; }
.brand-dark { margin-bottom: 72px; color: var(--ink); }
.brand-dark small { color: #829ab1; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-card h1 { margin: 0 0 12px; font-size: 36px; letter-spacing: -.04em; }
.auth-copy { margin: 0 0 30px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.auth-form > label { display: block; margin-bottom: 9px; color: var(--ink); font-weight: 650; }
.auth-form input { width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 13px; padding: 0 45px 0 14px; background: #fff; outline: none; }
.auth-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,159,146,.12); }
.password-field { position: relative; }
.password-field .icon-button { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); }
#auth-confirm-wrap { margin-top: 17px; }
#auth-confirm-label { display: block; margin-bottom: 9px; }
.form-error { min-height: 22px; margin: 10px 0; color: var(--danger); font-size: 12px; }
.auth-language { width: fit-content; margin: 24px auto 0; }

.button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(135deg, #0f9f92, #087f75); box-shadow: 0 9px 22px rgba(15,159,146,.2); }
.button-primary:hover { box-shadow: 0 12px 27px rgba(15,159,146,.28); }
.button-secondary { color: var(--navy); background: #e7f0f7; }
.button-secondary:hover { background: #dce9f2; }
.button-ghost { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); }
.button-danger { color: #fff; background: var(--danger); }
.button-wide { width: 100%; min-height: 50px; }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { color: var(--ink); background: var(--line-soft); }
.language-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.language-switch button { min-width: 48px; height: 30px; border: 0; border-radius: 7px; color: #829ab1; background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.language-switch button.active { color: var(--navy); background: #e5edf4; box-shadow: 0 1px 3px rgba(16,42,67,.08); }
.language-switch.large button { min-width: 90px; height: 38px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: 242px;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  color: #d8e5ee;
  background:
    radial-gradient(circle at 10% 95%, rgba(15,159,146,.22), transparent 30%),
    linear-gradient(180deg, #102a43, #0c2133);
}
.sidebar .brand { padding: 0 10px; margin-bottom: 34px; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aac0d0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 650;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(20,184,166,.25), rgba(20,184,166,.08)); box-shadow: inset 3px 0 #2dd4bf; }
.nav-item b { margin-left: auto; min-width: 26px; border-radius: 12px; padding: 3px 7px; color: #a7f3d0; background: rgba(20,184,166,.13); font-size: 10px; text-align: center; }
.privacy-card { margin-top: auto; padding: 15px 13px; display: flex; gap: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.04); }
.privacy-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52,211,153,.1); }
.privacy-card strong, .privacy-card small { display: block; }
.privacy-card strong { color: #dce9f2; font-size: 11px; }
.privacy-card small { margin-top: 4px; color: #6f8da3; font-size: 10px; }
.logout { margin-top: 9px; }

.main { min-height: 100vh; margin-left: 242px; }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 82px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(220,230,238,.8);
  background: rgba(244,247,250,.9);
  backdrop-filter: blur(16px);
}
.topbar h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.topbar .eyebrow { margin-bottom: 2px; color: #829ab1; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.mobile-menu { display: none; }

.view { display: none; padding: 30px 34px 48px; }
.view.active { display: block; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.welcome-band {
  position: relative;
  min-height: 172px;
  padding: 31px 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
  color: #fff;
  border-radius: 22px;
  background: linear-gradient(125deg, #123d5c, #135b72 58%, #11877d);
  box-shadow: var(--shadow);
}
.welcome-band::before { content: ""; position: absolute; inset: auto -30px -110px auto; width: 330px; height: 250px; border: 45px solid rgba(255,255,255,.06); border-radius: 50%; }
.welcome-band > div:first-child { position: relative; z-index: 2; }
.welcome-band .eyebrow { color: #8ce8de; }
.welcome-band h1 { margin: 0 0 10px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; }
.welcome-band p:last-child { margin: 0; color: #c9e1ec; font-size: 14px; }
.welcome-graphic { position: absolute; right: 62px; width: 190px; height: 108px; transform: rotate(-4deg); }
.welcome-graphic span { position: absolute; border: 2px solid rgba(255,255,255,.35); border-radius: 16px; background: rgba(255,255,255,.07); backdrop-filter: blur(2px); }
.welcome-graphic span:nth-child(1) { inset: 4px 75px 20px 0; }
.welcome-graphic span:nth-child(2) { inset: 22px 0 2px 88px; }
.welcome-graphic span:nth-child(3) { width: 52px; height: 52px; left: 70px; top: 30px; border-radius: 50%; background: rgba(45,212,191,.3); }

.metric-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 13px; }
.metric-card { min-width: 0; min-height: 130px; padding: 20px 17px; display: flex; align-items: flex-start; gap: 13px; border: 1px solid rgba(220,230,238,.8); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 22px rgba(16,42,67,.045); }
.metric-icon { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-size: 18px; font-weight: 800; }
.metric-card small, .metric-card strong, .metric-card em { display: block; }
.metric-card small { margin: 1px 0 7px; overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.metric-card strong { color: var(--ink); font-size: 25px; line-height: 1; letter-spacing: -.04em; }
.metric-card em { margin-top: 9px; color: #9aabb9; font-size: 9px; font-style: normal; letter-spacing: .04em; }
.metric-blue .metric-icon { color: #2f80ed; background: #e8f2ff; }
.metric-green .metric-icon { color: #16895a; background: #e5f7ed; }
.metric-violet .metric-icon { color: #7453db; background: #f0ecff; }
.metric-orange .metric-icon { color: #c97900; background: #fff2d9; }
.metric-slate .metric-icon { color: #526d82; background: #edf2f6; }
.metric-teal .metric-icon { color: #0b8177; background: #dff7f3; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(270px, .75fr); gap: 20px; }
.panel { border: 1px solid rgba(220,230,238,.85); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(16,42,67,.04); }
.panel-heading { min-height: 78px; padding: 21px 23px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); }
.panel-heading h3 { margin: 0; font-size: 17px; }
.panel-heading .eyebrow { margin-bottom: 4px; color: #829ab1; }
.text-button { display: inline-flex; align-items: center; gap: 5px; border: 0; color: var(--teal-dark); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.text-button svg { width: 15px; height: 15px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; color: #829ab1; background: #fbfcfd; font-size: 10px; font-weight: 750; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { height: 58px; padding: 9px 14px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: middle; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #fafcfd; }
.primary-cell { color: var(--ink); font-weight: 700; }
.secondary-line { display: block; max-width: 220px; margin-top: 3px; overflow: hidden; color: #829ab1; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.amount { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.pending-amount { color: #c97900; }
.row-action { width: 32px; height: 32px; }
.status-stack { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; min-height: 23px; border-radius: 20px; padding: 0 8px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.chip::before { content: ""; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.chip-progress { color: #936116; background: #fff4dc; }
.chip-pickup { color: #167756; background: #e5f7ef; }
.chip-done { color: #526d82; background: #edf2f6; }
.chip-tech { color: #6e4dcc; background: #f0ecff; }
.chip-here { color: #1769aa; background: #e6f2ff; }
.chip-reserved { color: #a45612; background: #fff0df; }
.problem-panel { min-width: 0; }
.problem-bars { padding: 22px; display: grid; gap: 18px; }
.problem-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.problem-row strong { min-width: 0; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.problem-row em { color: #829ab1; font-size: 10px; font-style: normal; }
.bar-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 10px; background: #edf2f6; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f9f92, #37c7b8); }

.section-heading { margin: 5px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading h1 { margin: 0 0 7px; font-size: 30px; letter-spacing: -.035em; }
.section-heading p:last-child { margin: 0; color: var(--ink-soft); }
.muted { color: #829ab1 !important; font-size: 12px; }
.filter-bar { margin-bottom: 15px; display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(120px, .6fr)) auto; gap: 9px; }
.filter-bar input, .filter-bar select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: 0 11px; color: var(--ink); background: #fff; outline: none; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,159,146,.1); }
.search-box { position: relative; }
.search-box svg { position: absolute; top: 12px; left: 12px; color: #829ab1; }
.search-box input { padding-left: 40px; }
.records-panel { overflow: hidden; }
.records-table { min-width: 1060px; }
.records-table td { height: 62px; }
.empty-state { padding: 70px 20px; text-align: center; }
.empty-state > span { width: 52px; height: 52px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 50%; color: #829ab1; background: #edf2f6; font-size: 25px; }
.empty-state h3 { margin: 0 0 7px; }
.empty-state p { margin: 0; color: #829ab1; }
.pagination { min-height: 62px; padding: 10px 18px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line-soft); }
.pagination span { min-width: 70px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.pagination .flip { transform: rotate(180deg); }

.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.backup-card { min-height: 260px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.backup-icon { width: 62px; height: 62px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 17px; font-size: 12px; font-weight: 850; }
.backup-icon.csv { color: #087b6f; background: #dcf5f1; }
.backup-icon.json { color: #5e47c5; background: #eeeaff; }
.backup-card h3 { margin: 0 0 9px; font-size: 18px; }
.backup-card p { max-width: 520px; margin: 0 0 28px; color: var(--ink-soft); line-height: 1.7; }
.backup-card .button { margin-top: auto; }
.notice-card { margin-top: 18px; padding: 20px 22px; border-left: 4px solid var(--orange); border-radius: 12px; background: #fff8e8; }
.notice-card strong { display: block; margin-bottom: 5px; color: #8c5e16; }
.notice-card p { margin: 0; color: #8b7045; line-height: 1.6; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { padding: 25px; }
.settings-card h3 { margin: 0 0 8px; }
.settings-card > p { margin: 0 0 22px; color: var(--ink-soft); line-height: 1.6; }
.system-card { grid-column: 1 / -1; }
.system-card dl { margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.system-card dl div { padding: 16px; border-radius: 12px; background: var(--canvas); }
.system-card dt { color: #829ab1; font-size: 10px; text-transform: uppercase; }
.system-card dd { margin: 7px 0 0; font-weight: 750; }
.stack-form { display: grid; gap: 10px; }
.stack-form input { height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; outline: none; }
.stack-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,159,146,.1); }
.form-message { min-height: 18px; margin: 0; font-size: 11px; }

.drawer-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(5,22,35,.42); backdrop-filter: blur(3px); }
.drawer { position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(680px, 96vw); overflow: auto; background: #fff; box-shadow: -20px 0 70px rgba(5,22,35,.23); transform: translateX(102%); transition: transform .25s ease; }
.drawer.open { transform: translateX(0); }
.drawer-header { position: sticky; z-index: 4; top: 0; min-height: 82px; padding: 18px 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.drawer-header h2 { margin: 0; font-size: 22px; }
.drawer-header .eyebrow { margin-bottom: 3px; }
.repair-form { padding: 0 25px 30px; }
.form-section { padding: 24px 0; border-bottom: 1px solid var(--line-soft); }
.form-section h3 { margin: 0 0 16px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid label > span, .form-section > label > span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.form-grid input, .form-grid select, .form-grid textarea, .form-section > textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: #fff; outline: none; resize: vertical; }
.form-grid input, .form-grid select { height: 42px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .form-section > textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,159,146,.09); }
.form-hint { display: block; margin-top: 7px; color: #829ab1; font-size: 9px; line-height: 1.45; }
.field-label { display: block; margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.field-help { margin: 0 0 10px; color: #829ab1; font-size: 10px; }
.problem-list { display: grid; gap: 10px; }
.problem-item { padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--canvas); }
.problem-select-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: end; gap: 8px; }
.problem-select-row label { min-width: 0; }
.problem-remove { color: var(--danger); background: #fff; font-size: 20px; line-height: 1; }
.problem-custom-wrap { display: block; margin-top: 10px; }
.add-problem { margin-top: 10px; }
.span-2 { grid-column: 1 / -1; }
.money-grid { grid-template-columns: repeat(3, 1fr); }
.calculated { min-height: 65px; padding: 12px 14px; border-radius: 11px; background: var(--canvas); }
.calculated span, .calculated strong { display: block; }
.calculated span { color: #829ab1; font-size: 10px; }
.calculated strong { margin-top: 7px; font-size: 17px; }
.toggle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.check-card { position: relative; min-height: 72px; padding: 14px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.check-card:has(input:checked) { border-color: rgba(15,159,146,.45); background: #effbf9; }
.check-card input { position: absolute; opacity: 0; pointer-events: none; }
.check-ui { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #b9c8d5; border-radius: 7px; }
.check-card input:checked + .check-ui { border-color: var(--teal); background: var(--teal); }
.check-card input:checked + .check-ui::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 900; }
.check-card strong, .check-card small { display: block; }
.check-card strong { font-size: 11px; }
.check-card small { margin-top: 3px; color: #829ab1; font-size: 9px; }
.drawer-actions { position: sticky; bottom: 0; margin: 0 -25px -30px; padding: 16px 25px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }

.detail-dialog { width: min(850px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.detail-dialog::backdrop { background: rgba(5,22,35,.55); backdrop-filter: blur(3px); }
.detail-toolbar { position: sticky; z-index: 3; top: 0; min-height: 68px; padding: 12px 18px; display: flex; justify-content: flex-end; gap: 9px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.detail-toolbar .icon-button { margin-left: 4px; }
.print-card { padding: 40px 44px 48px; }
.print-head { padding-bottom: 25px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--navy); }
.print-brand { display: flex; align-items: center; gap: 12px; }
.print-brand .brand-mark { width: 48px; height: 48px; }
.print-brand h1 { margin: 0; font-size: 22px; }
.print-brand p { margin: 4px 0 0; color: #829ab1; font-size: 10px; }
.print-order { text-align: right; }
.print-order strong, .print-order span { display: block; }
.print-order strong { font-size: 19px; }
.print-order span { margin-top: 6px; color: #829ab1; }
.print-status { margin: 22px 0; display: flex; flex-wrap: wrap; gap: 7px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.detail-cell { min-height: 70px; padding: 13px; border-radius: 10px; background: var(--canvas); }
.detail-cell.wide { grid-column: span 2; }
.detail-cell.full { grid-column: 1 / -1; }
.detail-cell dt { color: #829ab1; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.detail-cell dd { margin: 8px 0 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 650; }
.print-summary { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.print-summary div { padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.print-summary span, .print-summary strong { display: block; }
.print-summary span { color: #829ab1; font-size: 9px; text-transform: uppercase; }
.print-summary strong { margin-top: 8px; font-size: 19px; }
.print-foot { margin: 34px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: #829ab1; font-size: 10px; line-height: 1.6; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; max-width: min(440px, calc(100% - 40px)); padding: 12px 17px; border-radius: 11px; color: #fff; background: var(--navy); box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

@media (max-width: 1240px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-bar { grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(130px, .5fr)); }
  .filter-bar input[type="date"] { display: none; }
}

@media (max-width: 920px) {
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .problem-panel { min-height: 300px; }
  .auth-view { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  .brand-dark { margin-bottom: 70px; }
}

@media (max-width: 680px) {
  .topbar { height: 70px; padding: 0 16px; }
  .topbar > div:nth-child(2) .eyebrow { display: none; }
  .topbar h2 { font-size: 16px; }
  .topbar-actions > .language-switch { display: none; }
  .topbar .button span { display: none; }
  .topbar .button { width: 40px; padding: 0; }
  .view { padding: 20px 15px 36px; }
  .welcome-band { min-height: 180px; padding: 25px; }
  .welcome-graphic { opacity: .35; right: -40px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 116px; padding: 16px 13px; gap: 9px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric-card strong { font-size: 21px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .backup-grid, .settings-grid { grid-template-columns: 1fr; }
  .system-card { grid-column: auto; }
  .system-card dl { grid-template-columns: 1fr; }
  .form-grid, .money-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toggle-grid { grid-template-columns: 1fr; }
  .detail-grid, .print-summary { grid-template-columns: 1fr 1fr; }
  .detail-cell.wide { grid-column: auto; }
  .detail-cell.full { grid-column: 1 / -1; }
  .print-card { padding: 28px 20px; }
  .print-head { display: block; }
  .print-order { margin-top: 22px; text-align: left; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body > *:not(.detail-dialog) { display: none !important; }
  .detail-dialog { position: static; width: 100%; max-height: none; display: block; overflow: visible; border-radius: 0; box-shadow: none; }
  .detail-dialog::backdrop, .detail-toolbar { display: none; }
  .print-card { padding: 0; }
  .detail-cell { break-inside: avoid; }
}
