:root {
  --bg: #F5F2EC;
  --surface: #FFFFFF;
  --text: #1A2238;
  --accent: #2E56D6;
  --accent-dark: #182C6B;
  --neutral: #667085;
  --success: #157A4D;
  --attention: #A15C00;
  --danger: #B23A3A;
  --line: #E4E0D7;
  --line-strong: #D4CFC4;
  --shadow: 0 10px 30px rgba(24, 44, 107, 0.09);
  --shadow-soft: 0 4px 14px rgba(24, 44, 107, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--neutral); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.req { color: var(--danger); }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 12px; }

/* ---------- brand / buttons ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid transparent; font-weight: 600; font-size: 15px; line-height: 1;
  white-space: nowrap; text-decoration: none; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(46, 86, 214, 0.25); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--accent-dark); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent-dark); border-color: transparent; }
.btn-ghost:hover { background: rgba(24, 44, 107, 0.07); }
.btn-sm { height: 36px; min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- demo banner ---------- */
.demo-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--attention); color: #fff; padding: 10px 18px;
  display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
  font-size: 14px;
}
.demo-banner .link-btn { color: #fff; text-decoration: underline; }

/* ---------- landing ---------- */
.site-header {
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; gap: 24px;
}
.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); font-weight: 500; font-size: 15px; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-header > .btn { margin-left: 8px; }

.hero {
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 64px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
h1 {
  font-size: clamp(32px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -0.02em;
  margin: 0 0 16px; font-weight: 700;
}
h2 { font-size: clamp(24px, 3vw, 28px); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font-size: 20px; line-height: 1.25; margin: 0 0 8px; font-weight: 600; }
.lead { font-size: 18px; color: var(--neutral); max-width: 54ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--neutral); font-size: 14px; }
.hero-points li { position: relative; padding-left: 18px; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.hero-media { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.hero-media img { width: 100%; }

.section { max-width: 1200px; margin: 0 auto; padding: 56px 24px; }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-lead { color: var(--neutral); font-size: 17px; margin: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); padding: 24px;
}
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature img { margin-bottom: 14px; }
.feature p { color: var(--neutral); margin: 0; font-size: 15px; }

.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service-card { position: relative; display: flex; flex-direction: column; gap: 8px; }
.service-card .price { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: auto; font-variant-numeric: tabular-nums; }
.service-card .tagline { color: var(--neutral); font-size: 14px; min-height: 42px; }
.service-card .badge { align-self: flex-start; }

.process-section { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 40px; align-items: center; }
.process-copy p { color: var(--neutral); }
.process-steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.process-steps li { display: flex; gap: 14px; align-items: flex-start; }
.process-steps li > span { font-family: var(--mono); font-size: 13px; color: var(--accent); background: rgba(46, 86, 214, 0.08); border-radius: 8px; padding: 6px 8px; }
.process-steps p { margin: 2px 0 0; color: var(--neutral); font-size: 15px; }
.process-media img { border-radius: 20px; box-shadow: var(--shadow); background: var(--surface); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.split-media img { border-radius: 22px; box-shadow: var(--shadow); }
.split-copy p { color: var(--neutral); }
.check-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(21, 122, 77, 0.12); color: var(--success);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.check-list.compact { margin-top: 12px; gap: 6px; }

.empty-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.empty-card { display: flex; flex-direction: column; align-items: flex-start; }
.empty-card img { margin-bottom: 15px; }
.empty-card p { color: var(--neutral); margin: 0; }

.request-section { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 44px; align-items: start; }
.request-copy p { color: var(--neutral); }
.note-card { margin-top: 26px; padding: 18px 20px; border-radius: 14px; background: rgba(24, 44, 107, 0.06); border: 1px solid rgba(24, 44, 107, 0.12); }
.note-card p { margin: 6px 0 0; font-size: 14px; }

.form { display: grid; gap: 16px; }
.form h3 { margin: 0; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: 400; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(46, 86, 214, 0.13);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 500; min-height: 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--neutral); }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.form-hint { color: var(--neutral); font-size: 13px; margin: 0; }
.form-errors {
  border: 1.5px solid rgba(178, 58, 58, 0.35); background: rgba(178, 58, 58, 0.07);
  color: var(--danger); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px;
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.success { text-align: left; }
.success-mark {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(21, 122, 77, 0.12); color: var(--success); font-size: 24px; font-weight: 700; margin-bottom: 12px;
}

.site-footer {
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 56px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px;
  border-top: 1px solid var(--line);
}
.footer-brand p { color: var(--neutral); max-width: 44ch; margin: 12px 0 0; }
.footer-nav { display: grid; gap: 8px; align-content: start; }
.footer-team { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-team figure { margin: 0; display: flex; align-items: center; gap: 8px; }
.footer-team figcaption { font-size: 13px; color: var(--neutral); }
.footer-note { grid-column: 1 / -1; color: var(--neutral); font-size: 13px; margin: 8px 0 0; }

/* ---------- auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 0.9fr 1.1fr; }
.auth-aside { background: var(--accent-dark); display: flex; align-items: stretch; }
.auth-aside img { width: 100%; height: 100%; object-fit: cover; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 48px clamp(24px, 6vw, 88px); max-width: 620px; width: 100%; margin: 0 auto; }
.auth-panel h1 { margin: 8px 0 0; }
.auth-panel .form { margin-top: 8px; }
.demo-logins { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.back-link { margin-top: 12px; font-weight: 600; }

/* ---------- app ---------- */
.app-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; min-width: 0; max-width: 100%; }
.app-sidebar {
  background: var(--accent-dark); color: #fff; padding: 22px 18px;
  display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh;
}
.app-sidebar .brand { color: #fff; }
.app-sidebar .brand img { background: #fff; }
.app-nav { display: grid; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
  padding: 9px 12px; border-radius: 10px; border: 0; background: transparent; color: rgba(255, 255, 255, 0.82);
  font-weight: 500; text-align: left; transition: background 160ms var(--ease), color 160ms var(--ease);
}
.nav-btn img { width: 22px; height: 22px; filter: brightness(0) invert(1); opacity: .78; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-btn.is-active { background: #fff; color: var(--accent-dark); }
.nav-btn.is-active img { filter: none; opacity: 1; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.16); padding-top: 16px; }
.sidebar-user div { display: grid; min-width: 0; flex: 1; }
.sidebar-user strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .muted { color: rgba(255,255,255,.65); font-size: 12px; }
.sidebar-user .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.sidebar-user img { border-radius: 50%; background: #fff; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: rgba(245, 242, 236, 0.92);
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(8px);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 24px; margin: 0; }
.topbar-title p { margin: 2px 0 0; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: rgba(46, 86, 214, 0.1); color: var(--accent-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.demo-inline { background: rgba(161, 92, 0, 0.12); color: var(--attention); padding: 8px 28px; font-size: 14px; border-bottom: 1px solid rgba(161,92,0,.2); }

.app-content { padding: 24px 28px 48px; min-width: 0; }
.tab-panel { min-width: 0; animation: fadeUp 260ms var(--ease-in) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select {
  min-height: 38px; padding: 7px 12px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--text);
}
.toolbar input[type="search"] { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.toolbar-spacer { flex: 1 1 auto; }
.segmented { display: inline-flex; align-items: center; height: 36px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0; }
.segmented button { height: 100%; border: 0; background: transparent; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 13px; line-height: 1; color: var(--neutral); }
.segmented button.is-active { background: var(--accent-dark); color: #fff; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-soft); }
.kpi .kpi-label { color: var(--neutral); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kpi .kpi-value { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.kpi .kpi-note { color: var(--neutral); font-size: 12px; }
.kpi.kpi-new { border-top: 4px solid var(--accent); }
.kpi.kpi-work { border-top: 4px solid var(--attention); }
.kpi.kpi-result { border-top: 4px solid var(--success); }
.kpi.kpi-paid { border-top: 4px solid var(--success); }
.kpi.kpi-closed { border-top: 4px solid var(--neutral); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 20px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 8px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart .bar { width: 100%; max-width: 54px; border-radius: 8px 8px 4px 4px; background: var(--accent); transition: height 320ms var(--ease-in); min-height: 3px; }
.chart .bar-label { font-size: 12px; color: var(--neutral); }
.chart .bar-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 13px; color: var(--neutral); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.quick-card p { margin-top: 0; }
.recent-list { display: grid; gap: 8px; }
.recent-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color 150ms var(--ease), transform 150ms var(--ease); }
.recent-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.recent-item .meta { color: var(--neutral); font-size: 13px; }
.recent-item > * { min-width: 0; overflow-wrap: anywhere; }
.notify-item > * { min-width: 0; overflow-wrap: anywhere; }
.detail-row > * { min-width: 0; overflow-wrap: anywhere; }
.employee-row > * { min-width: 0; }
.recent-item .amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* status / priority */
.status-pill, .priority-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-new { background: rgba(46, 86, 214, .12); color: var(--accent); }
.status-in_progress { background: rgba(161, 92, 0, .12); color: var(--attention); }
.status-result_ready { background: transparent; color: var(--success); box-shadow: inset 0 0 0 1.5px var(--success); }
.status-paid { background: var(--success); color: #fff; }
.status-rejected, .status-cancelled { background: rgba(178, 58, 58, .12); color: var(--danger); }
.priority-normal { background: rgba(102, 112, 133, .12); color: var(--neutral); }
.priority-urgent { background: rgba(161, 92, 0, .14); color: var(--attention); }
.priority-vip { background: var(--accent-dark); color: #fff; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 320px; transition: background 150ms var(--ease), border-color 150ms var(--ease); }
.kanban-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--neutral); margin: 4px 6px 10px; }
.kanban-col.is-over { background: rgba(46, 86, 214, 0.08); border-color: var(--accent); }
.kanban-list { display: grid; gap: 8px; align-content: start; min-height: 40px; }
.lead-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--neutral);
  border-radius: 12px; padding: 12px; cursor: grab; box-shadow: var(--shadow-soft);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.lead-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.lead-card:active { cursor: grabbing; }
.lead-card.is-dragging { opacity: .55; }
.lead-card.priority-urgent-card { border-left-color: var(--attention); }
.lead-card.priority-vip-card { border-left-color: var(--accent-dark); }
.lead-card .lead-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lead-card .lead-id { font-family: var(--mono); font-size: 12px; color: var(--neutral); }
.lead-card h4 { margin: 6px 0 4px; font-size: 15px; }
.lead-card .lead-client { font-size: 13px; color: var(--neutral); }
.lead-card .lead-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--neutral); }
.lead-card .lead-amount { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kanban-empty { color: var(--neutral); font-size: 13px; text-align: center; padding: 18px 8px; border: 1px dashed var(--line-strong); border-radius: 10px; }

/* tables */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.data-table th { color: var(--neutral); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: rgba(245, 242, 236, .7); position: sticky; top: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: rgba(46, 86, 214, 0.04); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .nowrap { white-space: nowrap; }

/* clients */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.client-card { display: flex; flex-direction: column; gap: 12px; }
.client-head { display: flex; gap: 12px; align-items: center; }
.client-head img { border-radius: 50%; background: rgba(46, 86, 214, .08); }
.client-head h3 { margin: 0; font-size: 17px; }
.client-meta { display: grid; gap: 4px; color: var(--neutral); font-size: 14px; word-break: break-word; }
.client-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.client-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* employees */
.employees-list { display: grid; gap: 10px; }
.employee-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.employee-row .who { display: grid; min-width: 0; }
.employee-row .who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employee-row .who span { color: var(--neutral); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.employee-row select { min-height: 36px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); padding: 4px 8px; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--success); }
.state-dot.off { background: var(--neutral); }

/* notifications */
.compact-form { gap: 10px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.switch-row input { width: 42px; height: 24px; accent-color: var(--accent); }
.notify-list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.notify-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.notify-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.notify-item .dot.no_route { background: var(--attention); }
.notify-item .dot.error { background: var(--danger); }
.notify-item .when { color: var(--neutral); font-size: 12px; white-space: nowrap; }

/* empty */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 28px 16px; text-align: center; color: var(--neutral); }
.empty-state img { opacity: .95; }
.empty-state p { margin: 0; max-width: 40ch; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26, 34, 56, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 24px; z-index: 80; overflow-y: auto; animation: fadeIn 180ms var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(720px, 100%); background: var(--surface); border-radius: 18px; box-shadow: 0 24px 70px rgba(24, 44, 107, .3); padding: 24px; animation: modalIn 220ms var(--ease-in) both; margin: auto 0; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-close { border: 0; background: rgba(102,112,133,.12); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1; }
.modal-body { display: grid; gap: 16px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--neutral); font-size: 13px; }
.detail-row dd { margin: 0; font-weight: 500; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 2px; }
.progress-step { height: 8px; border-radius: 999px; background: var(--line); }
.progress-step.done { background: var(--success); }
.progress-step.current { background: var(--accent); }
.timeline { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.timeline li { border-left: 2px solid var(--line); padding-left: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .when { color: var(--neutral); font-size: 12px; }
.timeline .who { font-size: 13px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.inline-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* toast */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--accent-dark); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: toastIn 240ms var(--ease-in) both; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process-section { grid-template-columns: 1fr; }
  .process-media { order: -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .site-nav { display: none; }
  .site-header { justify-content: space-between; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 20px; }
  .hero-media { order: -1; }
  .service-grid { grid-template-columns: 1fr; }
  .split, .request-section, .site-footer { grid-template-columns: 1fr; }
  .empty-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { max-height: 240px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar { position: static; height: auto; min-width: 0; max-width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .app-sidebar .brand span { display: none; }
  .app-nav { display: flex; gap: 4px; overflow-x: auto; min-width: 0; max-width: 100%; flex: 1 1 100%; order: 3; }
  .app-nav .nav-btn { width: auto; flex: 0 0 auto; white-space: nowrap; min-height: 38px; padding: 6px 10px; }
  .app-nav .nav-btn span { font-size: 13px; }
  .sidebar-user { margin-left: auto; border: 0; padding: 0; }
  .sidebar-user div { display: none; }
  .app-topbar { padding: 14px 18px; }
  .app-content { padding: 18px 16px 40px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-grid, .inline-inputs { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 110px 1fr; }
  .employee-row { grid-template-columns: 1fr; gap: 8px; }
  .toolbar input[type="search"] { max-width: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions .btn { width: 100%; }
  .site-footer { padding-bottom: 40px; }
  .card { padding: 18px; }
  .toast-root { left: 16px; right: 16px; }
}

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