@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/source-sans-3:vf@5.2.8/latin-wght-normal.woff2") format("woff2");
}

:root {
  --ink: #080838;
  --ink-2: #12124a;
  --paper: #f5f6f8;
  --card: #ffffff;
  --line: #e8ebf1;
  --text: #12203a;
  --muted: #4f586c;
  --accent: #f86028;
  --accent-2: #d94c16;
  --info: #f86028;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #ef4444;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
  --sidebar: 232px;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent-2); text-decoration: none; }
.muted { color: var(--muted); }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input:not([type="color"]), .inline-form select { flex: 1 1 140px; min-width: 0; border: 1px solid #d7dee8; border-radius: 10px; padding: 9px 12px; background: #fff; }
.inline-form input[type="number"] { flex: 0 1 110px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list-row form, table.data td form { display: inline-flex; flex: 0 0 auto; margin: 0; }
table.data td form + form { margin-left: 6px; }
.list-row > span { min-width: 0; flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
a:hover { color: var(--info); }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { letter-spacing: -0.02em; }
h3 { margin: 0 0 12px; font-size: 16px; }

html, body { height: 100%; }
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: #fff;
  color: #475569;
  padding: 16px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eef2f7;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 10px 14px; position: sticky; top: 0; background: #fff; z-index: 2; min-width: 0; max-width: 100%; }
.brand-logo { height: 32px; width: auto; max-width: 100%; display: block; object-fit: contain; object-position: left center; image-rendering: auto; }
.auth-copy .brand-logo { height: 48px; width: auto; max-width: 168px; align-self: flex-start; object-fit: contain; background: transparent; border-radius: 0; padding: 0; }
.brand strong { display: block; color: var(--ink); font-size: 18px; letter-spacing: 0.04em; }
.brand span { color: #94a3b8; font-size: 12px; }
.nav-group { margin: 2px 0 6px; }
.nav-group summary {
  list-style: none; cursor: pointer; color: #94a3b8; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; margin: 8px 12px 4px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "+"; font-size: 14px; line-height: 1; }
.nav-group[open] summary::after { content: "–"; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  color: #475569; border-radius: 8px; padding: 7px 12px; margin-bottom: 1px; font-weight: 600;
}
.side-link i { width: 18px; text-align: center; color: #64748b; font-size: 16px; }
.side-link:hover { background: #f1f5f9; color: #0f172a; }
.side-link.active { background: var(--ink); color: white; }
.side-link.active i { color: white; }
.sidebar-user {
  margin-top: auto; padding: 12px; border-top: 1px solid #eef2f7;
  display: flex; gap: 10px; align-items: center;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #fff1eb; color: var(--accent-2);
  display: grid; place-items: center; font-weight: 700; flex: 0 0 34px;
}
.sidebar-user > div:last-child { min-width: 0; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #0f172a; font-size: 14px; }
.sidebar-user span { color: #94a3b8; font-size: 12px; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
  padding: 12px 22px; background: var(--paper);
  position: relative; z-index: 25; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.search-form { display: flex; gap: 8px; flex: 1 1 160px; max-width: 360px; min-width: 0; align-items: center; margin-right: auto; }
.search-form input {
  width: 100%; min-width: 0; border: 1px solid #e7edf5; background: #fff; border-radius: 999px; padding: 8px 14px;
}
.top-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.icon-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 999px; position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; min-width: 0; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip:hover { color: var(--accent-2); }
.content { padding: 18px 22px 32px; flex: 1; min-height: 0; overflow: auto; }

.page-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.page-header h1 { margin: 0; font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.page-header p { margin: 4px 0 0; }
.page-header > div:last-child:not(:only-child),
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; max-width: 100%;
}
.card:has(table.data) { overflow-x: auto; }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { display: block; width: 100% !important; height: 100% !important; }
.grid-4, .grid-3, .grid-2, .stat-grid { display: grid; gap: 14px; }
.grid-4, .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; align-items: start; }
.grid-3, .grid-4 { align-items: start; }
.content > .card, .content > form.card, .content > .grid-2, .content > .grid-3 { margin-bottom: 14px; }
.stack { display: grid; gap: 14px; }

.kpi { display: flex; gap: 12px; align-items: flex-start; min-height: 92px; }
.kpi .icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 40px;
  background: #fff1eb; color: var(--accent-2); font-size: 18px;
}
.kpi .icon.blue { background: #fff1eb; color: var(--accent-2); }
.kpi .icon.amber { background: #fff7ed; color: var(--warn); }
.kpi .icon.slate { background: #f1f5f9; color: #334155; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi strong { display: block; font-size: 26px; margin-top: 2px; line-height: 1.1; }
.kpi em { font-style: normal; color: var(--muted); font-size: 12px; }

.meter { display: flex; height: 10px; background: #e8eef6; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; }
.meter .won { background: var(--good); }
.meter .pending { background: #f59e0b; }
.conv { margin-bottom: 14px; }
.conv header { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.track { height: 8px; background: #e8eef6; border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.activity-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.activity-pills div { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.activity-pills strong { display: block; font-size: 20px; }

.table-wrap { overflow: auto; max-width: 100%; }
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
table.data tbody tr:hover { background: #f8fafc; }
table.data a { font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px;
  font-size: 12px; font-weight: 700; background: #f1f5f9; color: #334155; text-transform: capitalize;
}
.badge.good { background: #dcfce7; color: #166534; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #ffedd5; color: #9a3412; }
.badge.info { background: #fff1eb; color: #9f3400; }
.badge.neutral { background: #f1f5f9; color: #475569; }

.btn {
  border: 0; border-radius: 8px; padding: 8px 14px; background: var(--accent); color: white;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; line-height: 1.2;
}
.btn:hover { background: var(--accent-2); color: white; }
.btn.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #f8fafc; color: var(--ink); }
.btn.danger { background: var(--bad); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: var(--accent-2); }
.btn.small { padding: 6px 10px; font-size: 13px; }
button.menu-btn { display: none; }

.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.alert.success { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.demo-bar { background: #fff7ed; color: #9a3412; border-bottom: 1px solid #fdba74; padding: 8px 16px; font-size: 14px; font-weight: 600; text-align: center; flex: 0 0 auto; }
.banner > div { min-width: 0; }
.banner strong { display: block; }
.content a, .content code, .banner { overflow-wrap: anywhere; }
.nav-toggle { display: inline-flex; }
.sidebar.collapsed { width: 76px; flex-basis: 76px; padding-left: 8px; padding-right: 8px; }
.sidebar.collapsed .brand div,
.sidebar.collapsed .nav-group summary { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 8px 8px 12px; }
.sidebar.collapsed .brand { width: 100%; }
.sidebar.collapsed .brand-logo { width: 56px; height: 21px; max-width: 56px; max-height: 21px; object-fit: contain; }
.sidebar.collapsed .side-link { justify-content: center; padding: 8px; }
.sidebar.collapsed .side-link span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.desk { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.desk-nav {
  position: sticky; top: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  max-height: calc(100dvh - 84px); overflow: auto;
}
.desk-label { margin: 10px 8px 4px; color: #94a3b8; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.desk-link {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0;
  border-radius: 8px; padding: 8px 10px; color: #475569; font-weight: 600; cursor: pointer;
}
.desk-link i { width: 16px; text-align: center; }
.desk-link:hover { background: #f1f5f9; color: #0f172a; }
.desk-link.active { background: var(--ink); color: #fff; }
.desk-pane[hidden] { display: none !important; }
.desk-tabs { grid-template-columns: 1fr; }
.desk-tabs .desk-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; }
.desk-tabs .desk-link { width: auto; }
.desk-body > .card { margin-bottom: 0; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.section-nav a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--ink); font-weight: 700; font-size: 13px; }
.section-nav a:hover { border-color: var(--accent); color: var(--accent-2); }
[id] { scroll-margin-top: 12px; }

.field { margin-bottom: 12px; }
.field label, .filters label { display: block; font-size: 13px; margin-bottom: 5px; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea,
.form-grid > input, .form-grid > select, .form-grid > textarea,
.filters input, .filters select, .inline-input, .search-form input {
  width: 100%; border: 1px solid #d7dee8; background: white; border-radius: 10px; padding: 9px 12px; color: var(--text);
}
.field textarea, textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.form-grid > input:focus, .filters input:focus, .filters select:focus, .search-form input:focus {
  outline: 2px solid rgba(248, 96, 40, 0.28); border-color: var(--accent);
}
.field-error { color: var(--bad); font-size: 12px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.span-2 { grid-column: span 2; }
.section-title { margin: 8px 0 12px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px;
  background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.filters .field { flex: 1 1 180px; margin: 0; min-width: 0; }
.filters input:not([type="file"]), .filters select { flex: 1 1 200px; width: auto; min-width: 0; }
.filters input[type="file"] { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.filters .btn { flex: 0 0 auto; min-height: 40px; }
.field:has(input[required]) > label::after,
.field:has(select[required]) > label::after,
.field:has(textarea[required]) > label::after { content: " *"; color: var(--bad); }
label:has(> input[type="checkbox"]) { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 8px 0; }
label:has(> input[type="checkbox"]) input { width: auto; flex: 0 0 auto; }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; scroll-snap-type: x proximity; max-width: 100%; }
.kanban-col { width: 272px; flex: 0 0 272px; background: #eef2f7; border-radius: 16px; padding: 10px; min-height: 180px; scroll-snap-align: start; max-width: 100%; }
.kanban-col header { display: flex; justify-content: space-between; align-items: flex-start; padding: 4px 6px 10px; gap: 8px; }
.kanban-col header strong { display: block; }
.kanban-col header span { color: var(--muted); font-size: 12px; }
.deal-card { background: white; border-radius: 12px; padding: 12px; margin-bottom: 8px; border-left: 4px solid var(--accent); cursor: grab; box-shadow: var(--shadow); }
.deal-card a { font-weight: 700; color: var(--text); }
.deal-card .value { font-weight: 700; margin: 8px 0 2px; font-size: 16px; }
.deal-card .meta { color: var(--muted); font-size: 13px; }

.timeline { position: relative; margin-left: 6px; }
.timeline-item { position: relative; padding: 0 0 16px 36px; }
.timeline-item .dot {
  position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff1eb; color: var(--accent-2); display: grid; place-items: center; border: 1px solid #ffd7c4; font-size: 13px;
}
.timeline-item strong { font-size: 12px; color: var(--muted); font-weight: 700; }
.record-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.score { font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: 14px; }
.kv span { color: var(--muted); }

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar .day, .calendar .head { min-height: 96px; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 0; overflow: hidden; }
.calendar .head { min-height: 0; background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.event { display: block; font-size: 12px; background: #fff1eb; border-radius: 6px; padding: 3px 5px; margin-top: 4px; color: var(--accent-2); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.bell { position: relative; }
.bell-count { position: absolute; top: -2px; right: -2px; background: var(--bad); color: white; border-radius: 99px; font-size: 10px; padding: 1px 5px; margin: 0; }
.bell-menu { position: absolute; right: 0; top: 44px; width: min(320px, calc(100vw - 24px)); background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: none; padding: 8px; z-index: 30; }
.bell.open .bell-menu { display: block; }
.bell-menu a { display: block; padding: 8px; border-radius: 8px; color: var(--text); }
.bell-menu a:hover { background: #f8fafc; }
.backdrop { display: none; }
.check, .check-line { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: 600; }
.check input, .check-line input { width: auto; flex: 0 0 auto; }
.line-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 90px 130px; gap: 8px; margin-bottom: 8px; }
.line-row select, .line-row input { width: 100%; min-width: 0; border: 1px solid #d7dee8; border-radius: 10px; padding: 9px 12px; background: white; }
.check input { width: auto; }
input[type="color"] {
  width: 42px; height: 38px; padding: 4px; flex: 0 0 42px;
  border: 1px solid #d7dee8; border-radius: 10px; background: #fff;
}
.catalog-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.catalog-item:last-of-type { border-bottom: 0; }
.catalog-edit { display: grid; grid-template-columns: minmax(0, 1fr) 42px auto; gap: 8px; align-items: center; }
.catalog-edit.no-swatch { grid-template-columns: minmax(0, 1fr) auto; }
.catalog-edit input:not([type="color"]) { width: 100%; min-width: 0; border: 1px solid #d7dee8; border-radius: 10px; padding: 9px 12px; }
.catalog-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.rule-row input, .rule-row select { width: 100%; min-width: 0; border: 1px solid #d7dee8; border-radius: 10px; padding: 9px 12px; background: white; }

.auth-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--ink); }
.auth-copy { color: #f8fafc; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.auth-copy h1 { font-size: 48px; line-height: 1.05; margin: 16px 0; }
.auth-points { margin: 12px 0 0; padding: 0; list-style: none; }
.auth-points li { margin: 8px 0; color: #cbd5e1; }
.auth-panel { background: var(--paper); margin: 20px; border-radius: 24px; display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(420px, 100%); background: white; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.print-sheet { max-width: 840px; margin: 24px auto; background: white; padding: 32px; border: 1px solid var(--line); }

.home-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 14px; }
.home-head h1 { margin: 0; font-size: 22px; font-weight: 700; }
.home-head p { margin: 2px 0 0; }
.home-stats, .home-row, .home-bottom { display: grid; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.home-stats { grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); }
.home-row, .home-bottom { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-row > .rise-card,
.home-bottom > .rise-card,
.home-stats > .tile { height: 100%; }
.home-bottom > .stack { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.home-bottom > .stack > .rise-card { flex: 1 1 auto; }
.tile { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); min-height: 92px; color: var(--text); }
a.tile:hover { color: var(--text); }
.tile-ico { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; color: white; font-size: 24px; flex: 0 0 54px; }
.tile-ico.rose { background: #fb7185; }
.tile-ico.blue { background: var(--ink); }
.tile-ico.violet { background: #8b5cf6; }
.tile-ico.pink { background: #f43f5e; }
.tile strong { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -0.03em; }
.tile em, .tile .tile-note { font-style: normal; color: var(--muted); font-size: 13px; }
.rise-card h3 { font-size: 15px; margin-bottom: 14px; }
.stat-pips { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.stat-pips strong { display: block; font-size: 22px; }
.stat-pips span { color: var(--muted); font-size: 12px; }
.pip { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 4px; }
.pip.green { background: #22c55e; }
.pip.red { background: #ef4444; }
.pip.amber { background: #f59e0b; }
.pip.blue { background: var(--ink); }
.pip.slate { background: #94a3b8; }
.rise-bar { height: 8px; background: #e8eef6; border-radius: 99px; overflow: hidden; }
.rise-bar span { display: block; height: 100%; background: #22c55e; border-radius: 99px; }
.rise-card { container-type: inline-size; display: flex; flex-direction: column; }
.inv-line { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto minmax(48px, 1.2fr) auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.inv-line > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-track { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.inv-track span { display: block; height: 100%; border-radius: 99px; }
.inv-amt { color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-box.sm { height: 180px; }
.legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; font-size: 13px; margin-top: 8px; }
.legend-row > div { min-width: 0; }
.legend-row strong { display: block; }
.feed-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.todo-line { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.todo-line.done span { text-decoration: line-through; color: var(--muted); }
.clock-note { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
@container (max-width: 520px) {
  .inv-line { grid-template-columns: 10px minmax(0, 1fr) auto auto; }
  .inv-line > span:nth-child(2) { grid-column: 2; grid-row: 1; }
  .inv-line > span:nth-child(3) { grid-column: 3; grid-row: 1; }
  .inv-amt { grid-column: 4; grid-row: 1; }
  .inv-track { grid-column: 2 / -1; grid-row: 2; }
}

@media (max-width: 1400px) {
  .home-stats { grid-template-columns: 1fr 1fr; }
  .home-row, .home-bottom { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .grid-4, .stat-grid, .home-stats { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .home-row, .home-bottom { grid-template-columns: 1fr; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .line-row select, .line-row [data-line-desc] { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .auth-copy { padding: 28px 20px 4px; }
  .auth-copy h1 { font-size: 32px; }
  .auth-panel { margin: 8px 12px 16px; padding: 8px; }
  button.menu-btn { display: inline-flex; }
  .nav-toggle { display: none; }
  .sidebar.collapsed { width: min(84vw, 280px); flex-basis: auto; padding: 16px 12px; }
  .sidebar.collapsed .brand { justify-content: flex-start; padding: 6px 10px 14px; }
  .sidebar.collapsed .brand-logo { width: auto; height: 32px; max-height: none; }
  .sidebar.collapsed .brand div, .sidebar.collapsed .nav-group summary { display: flex; }
  .sidebar.collapsed .side-link { justify-content: flex-start; padding: 7px 12px; }
  .sidebar.collapsed .side-link span { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  .desk { grid-template-columns: 1fr; }
  .desk-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .desk-label { width: 100%; }
  .sidebar {
    position: fixed; z-index: 40; transform: translateX(-105%); transition: transform .18s ease; width: min(84vw, 280px);
  }
  .sidebar.open { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 35; }
  .form-grid, .auth-body, .kv, .rule-row { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .content { padding: 16px; }
  .topbar { padding: 12px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header .actions { justify-content: flex-start; }
  .record-hero { flex-direction: column; }
  .line-row { grid-template-columns: 1fr; }
  .line-row select, .line-row [data-line-desc] { grid-column: auto; }
  .kanban-col { width: 100%; flex-basis: 100%; }
  .user-name { display: none; }
  .table-wrap, .card:has(table.data) { overflow: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: auto; }
  table.data tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 12px; background: #fff; }
  table.data tbody tr:hover { background: #fff; }
  table.data td { display: block; border: 0; padding: 7px 0; text-align: left; overflow-wrap: anywhere; }
  table.data td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
  table.data td[data-label=""]::before, table.data td:not([data-label])::before { content: none; }
}
@media (max-width: 640px) {
  .grid-4, .stat-grid, .activity-pills, .home-stats { grid-template-columns: 1fr; }
  .filters .field, .filters input, .filters select { flex-basis: 100%; width: 100%; }
  .filters .btn { width: 100%; justify-content: center; }
  .topbar { flex-wrap: wrap; }
  .search-form { flex: 1 1 100%; max-width: none; order: 3; }
  .top-actions { margin-left: auto; }
  .calendar { gap: 3px; }
  .calendar .day { min-height: 64px; padding: 3px; }
  .calendar .head, .event { font-size: 10px; }
  .catalog-edit, .catalog-edit.no-swatch { grid-template-columns: minmax(0, 1fr) auto; }
  .catalog-edit .btn { grid-column: 1 / -1; justify-self: start; }
}
@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  html, body, .app-shell, .main, .content { height: auto; overflow: visible; background: white; }
  .content { padding: 0; }
}
