@font-face { font-family: "Inter"; src: url("/inter-400.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/inter-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/inter-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/inter-700.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --font: "Inter", Arial, sans-serif;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --surface-strong: #eef1f5;
  --text: #151922;
  --text-soft: #5e6675;
  --text-faint: #8b93a1;
  --border: #e1e5eb;
  --border-strong: #cfd5de;
  --accent: #1f4fc5;
  --accent-hover: #183fa0;
  --accent-soft: #e8eefe;
  --success: #16845b;
  --success-soft: #e5f5ee;
  --warning: #a25a08;
  --warning-soft: #fff2dc;
  --danger: #c63d43;
  --danger-soft: #fdebec;
  --neutral-soft: #edf0f4;
  --shadow-sm: 0 1px 2px rgba(23, 28, 38, 0.04);
  --shadow-lg: 0 22px 70px rgba(17, 23, 35, 0.16);
  --sidebar: 244px;
  --topbar: 76px;
  --mobile-nav: 68px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1116;
  --surface: #171a21;
  --surface-subtle: #1c2028;
  --surface-strong: #232833;
  --text: #f2f4f8;
  --text-soft: #aab1be;
  --text-faint: #777f8d;
  --border: #292e39;
  --border-strong: #3a414f;
  --accent: #5f88f5;
  --accent-hover: #7a9bf7;
  --accent-soft: #202d50;
  --success: #58c99c;
  --success-soft: #17372d;
  --warning: #f0ae54;
  --warning-soft: #3b2c19;
  --danger: #f1777d;
  --danger-soft: #412126;
  --neutral-soft: #282d37;
  --shadow-sm: none;
  --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 400; letter-spacing: 0; }
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
input, select, textarea { width: 100%; }
textarea { resize: vertical; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-weight: 600; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 2px; }

.app-loading { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg); }
.loading-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 12px; background: var(--accent); color: #fff; font-size: 19px; font-weight: 700; animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.95); } }

/* Authentication */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.12fr) minmax(420px, 0.88fr); background: #f4f6fa; }
.auth-intro { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: 42px clamp(42px, 7vw, 110px); background: #10255d; color: #fff; }
.auth-intro::before, .auth-intro::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,0.13); border-radius: 50%; pointer-events: none; }
.auth-intro::before { width: 420px; height: 420px; right: -180px; top: 8%; }
.auth-intro::after { width: 620px; height: 620px; left: -330px; bottom: -390px; }
.auth-logo { position: relative; z-index: 1; display: flex; width: fit-content; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.auth-logo > span { display: grid; min-width: 58px; height: 32px; place-items: center; border: 1px solid rgba(255,255,255,0.34); border-radius: 8px; font-size: 13px; font-weight: 700; }
.auth-logo small { color: rgba(255,255,255,0.62); font-size: 12px; font-weight: 500; text-transform: uppercase; }
.auth-message { position: relative; z-index: 1; width: min(610px, 100%); margin: auto 0; padding: 70px 0; }
.overline { color: var(--text-faint); font-size: 11px; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.auth-message .overline { color: #91adff; margin-bottom: 20px; }
.auth-message h1 { max-width: 620px; font-size: clamp(40px, 5vw, 70px); line-height: 1.03; font-weight: 600; }
.auth-message h1 span { color: #8fb0ff; }
.auth-message > p:not(.overline) { max-width: 540px; margin-top: 26px; color: rgba(255,255,255,0.68); font-size: 16px; line-height: 1.65; }
.auth-points { display: grid; gap: 14px; margin: 42px 0 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: center; gap: 13px; color: rgba(255,255,255,0.82); font-size: 13px; font-weight: 500; }
.point-icon { display: grid; width: 34px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,0.18); border-radius: 7px; color: #9bb5ff; font-size: 10px; }
.auth-footnote { position: relative; z-index: 1; color: rgba(255,255,255,0.42); font-size: 11px; }
.auth-access { display: grid; min-height: 100vh; place-items: center; padding: 38px; background: #f4f6fa; }
.auth-card { width: min(420px, 100%); }
.auth-card-head { margin-bottom: 28px; }
.auth-status { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; color: #5d6676; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.auth-status i { width: 7px; height: 7px; border-radius: 50%; background: #2f8d6a; box-shadow: 0 0 0 4px #ddefe8; }
.auth-card h2 { color: #151922; font-size: 30px; line-height: 1.2; }
.auth-card-head p { margin-top: 9px; color: #6d7583; line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 24px; padding: 4px; border-radius: 11px; background: #e7eaf0; }
.auth-tab { min-height: 42px; border: 0; border-radius: 8px; background: transparent; color: #6d7583; font-weight: 600; }
.auth-tab.is-active { background: #fff; color: #172140; box-shadow: 0 1px 3px rgba(20, 30, 55, 0.1); }
.auth-card .field > span:first-child { color: #303644; }
.auth-card input { border-color: #d9dee7; background: #fff; color: #151922; }
.auth-card input:focus { border-color: #1f4fc5; box-shadow: 0 0 0 3px rgba(31,79,197,0.12); }

/* Controls */
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; max-width: 100%; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; font-weight: 600; line-height: 1.2; }
.button > svg { width: 17px; height: 17px; flex: 0 0 auto; }
.button-large { min-height: 48px; padding: 12px 18px; }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button-secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
.button-ghost { border-color: transparent; background: transparent; color: var(--text-soft); }
.button-ghost:hover { background: var(--surface-strong); color: var(--text); }
.button-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.link-button { border: 0; background: transparent; color: var(--accent); font-weight: 600; }
.icon-button { display: inline-grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-soft); font-size: 18px; }
.icon-button:hover { border-color: var(--border-strong); color: var(--text); }
.input-icon { position: absolute; top: 50%; right: 8px; width: auto; min-height: 34px; padding: 0 8px; transform: translateY(-50%); border: 0; background: transparent; color: #667080; font-size: 11px; font-weight: 600; }
.input-action-wrap { position: relative; display: block; }
.input-action-wrap input { padding-right: 76px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span:first-child { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea, .select-control select, .search-control input { min-height: 42px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: var(--surface); color: var(--text); font-weight: 400; }
.field textarea { min-height: 96px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .select-control select:focus, .search-control input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.field input::placeholder, .field textarea::placeholder, .search-control input::placeholder { color: var(--text-faint); opacity: 1; }
.field-error { min-height: 0; color: var(--danger); font-size: 11px; }
.field-error:empty { display: none; }
.form-error { color: var(--danger); font-size: 12px; line-height: 1.45; }
.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.select-control { display: block; min-width: 0; }
.select-control select { padding-right: 32px; }
.compact-select { width: 88px; }
.sort-select { width: 200px; }
.search-control { position: relative; display: block; min-width: 220px; flex: 1 1 420px; }
.search-control input { padding-left: 40px; padding-right: 48px; }
.search-icon { position: absolute; top: 50%; left: 14px; z-index: 1; transform: translateY(-50%); color: var(--text-faint); font-size: 18px; pointer-events: none; }
.search-control kbd { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-subtle); color: var(--text-faint); font-size: 10px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-strong); }
.segmented button { min-height: 34px; padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); white-space: nowrap; font-weight: 500; }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented-small button { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.danger-text { color: var(--danger) !important; }

/* Application layout */
.app-layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); display: flex; flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--border); background: var(--surface); transition: width 180ms ease; }
.sidebar-head { display: flex; min-height: 48px; align-items: center; gap: 6px; padding: 0 3px; }
.workspace-brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; padding: 0; border: 0; background: transparent; text-align: left; }
.brand-copy { display: grid; min-width: 0; gap: 3px; }
.brand-copy strong, .brand-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy strong { font-size: 13px; }
.brand-copy small { color: var(--text-faint); font-size: 10px; font-weight: 500; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; object-fit: cover; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-md { width: 38px; height: 38px; }
.avatar-sm { width: 34px; height: 34px; border-radius: 9px; font-size: 11px; }
.avatar-lg { width: 60px; height: 60px; border-radius: 14px; font-size: 18px; }
.sidebar-collapse { width: 32px; height: 32px; flex-basis: 32px; border: 0; background: transparent; }
.sidebar-nav { display: grid; gap: 5px; margin-top: 28px; }
.nav-button { position: relative; display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-soft); text-align: left; font-weight: 500; }
.nav-button:hover { background: var(--surface-subtle); color: var(--text); }
.nav-button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-button small { margin-left: auto; color: var(--text-faint); font-size: 10px; }
.nav-icon { display: grid; width: 19px; height: 19px; flex: 0 0 22px; place-items: center; color: currentColor; font-size: 17px; font-weight: 400; }
.sidebar-bottom { display: grid; gap: 4px; margin-top: auto; }
.profile-menu-wrap { position: relative; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.profile-button { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 10px; padding: 5px 7px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.profile-button:hover { background: var(--surface-subtle); }
.profile-button .brand-copy { flex: 1; }
.profile-chevron { color: var(--text-faint); }
.menu { position: absolute; z-index: 100; min-width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-lg); }
.menu button { display: flex; width: 100%; min-height: 38px; align-items: center; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; }
.menu button:hover { background: var(--surface-subtle); }
.menu hr { margin: 5px 0; border: 0; border-top: 1px solid var(--border); }
.profile-popover { left: 0; bottom: 58px; width: 100%; }
.main-column { min-width: 0; grid-column: 2; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(20px, 3.2vw, 44px); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); }
.page-heading { display: flex; min-width: 0; align-items: center; gap: 12px; }
.page-heading h1 { font-size: 23px; line-height: 1.2; }
.page-heading p { margin-top: 4px; color: var(--text-soft); font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.page-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 26px clamp(20px, 3.2vw, 44px) 48px; }
.page-view { min-width: 0; }
.surface { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.surface-head { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.surface-head h2 { font-size: 15px; }
.surface-head p { margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.count-badge, .button-count { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 6px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }

/* Dashboard */
.dashboard-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.control-row { display: flex; align-items: center; gap: 8px; }
.custom-period { width: 100%; display: flex; align-items: end; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.field-inline { width: 168px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi-card { min-width: 0; min-height: 116px; padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.kpi-card span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.kpi-card strong { display: block; margin-top: 20px; overflow: hidden; color: var(--text); font-size: clamp(20px, 2vw, 27px); line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card small { display: block; margin-top: 7px; color: var(--text-faint); font-size: 10px; }
.kpi-card.is-danger { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); }
.kpi-card.is-danger strong { color: var(--danger); }
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr); gap: 14px; }
.chart-wrap { position: relative; height: 318px; padding: 18px; }
#mainChart { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); font-size: 12px; }
.attention-list { display: grid; max-height: 318px; overflow: auto; }
.attention-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover { background: var(--surface-subtle); }
.attention-item strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.attention-item p { margin-top: 4px; overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attention-item small { color: var(--warning); font-size: 10px; font-weight: 600; }
.attention-ok { display: grid; min-height: 230px; place-items: center; padding: 28px; color: var(--text-soft); text-align: center; }
.attention-ok strong { display: block; margin-bottom: 6px; color: var(--text); }
.recent-surface { margin-top: 14px; }
.compact-list { display: grid; }
.compact-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, 1.3fr) auto auto auto; align-items: center; gap: 18px; min-height: 58px; padding: 10px 18px; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.compact-row:last-child { border-bottom: 0; }
.compact-row:hover { background: var(--surface-subtle); }
.compact-row strong { font-size: 12px; }
.compact-row p, .compact-row small { overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

/* Lists and tables */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.quick-filters { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.quick-filters::-webkit-scrollbar { display: none; }
.quick-filters button { min-height: 34px; flex: 0 0 auto; padding: 6px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-soft); font-size: 12px; font-weight: 500; }
.quick-filters button.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-chip { display: inline-flex; min-height: 28px; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px; background: var(--surface-strong); color: var(--text-soft); font-size: 10px; }
.filter-chip button { padding: 0; border: 0; background: transparent; color: var(--text-faint); }
.list-surface { overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 44px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-faint); font-size: 10px; font-weight: 600; text-align: left; text-transform: uppercase; }
.data-table td { height: 68px; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background 120ms ease; }
.data-table tbody tr:hover { background: var(--surface-subtle); }
.data-table strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.data-table small { display: block; margin-top: 4px; overflow: hidden; color: var(--text-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.orders-table th:nth-child(1) { width: 112px; }
.orders-table th:nth-child(2) { width: 150px; }
.orders-table th:nth-child(3) { width: 210px; }
.orders-table th:nth-child(4) { width: 125px; }
.orders-table th:nth-child(5), .orders-table th:nth-child(6) { width: 120px; }
.orders-table th:nth-child(7) { width: 110px; }
.orders-table th:nth-child(8), .clients-table th:last-child { width: 54px; }
.clients-table th:first-child { width: 240px; }
.clients-table th:not(:first-child):not(:last-child) { width: 130px; }
.money-cell strong { font-size: 13px; }
.deadline-overdue { color: var(--danger) !important; }
.deadline-soon { color: var(--warning) !important; }
.badge { display: inline-flex; min-height: 25px; align-items: center; max-width: 100%; padding: 4px 8px; border-radius: 7px; font-size: 10px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-grey { background: var(--neutral-soft); color: var(--text-soft); }
.row-menu-button { width: 34px; height: 34px; border-color: transparent; background: transparent; font-size: 17px; }
.row-menu { right: 10px; margin-top: 4px; }
.mobile-cards { display: none; }
.empty-state { display: grid; min-height: 330px; place-items: center; align-content: center; padding: 34px; color: var(--text-soft); text-align: center; }
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state p { max-width: 340px; margin: 8px auto 18px; line-height: 1.55; }

/* Entity detail */
.entity-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.entity-title-group { display: flex; min-width: 0; align-items: center; gap: 14px; }
.entity-title-group h2 { font-size: 23px; }
.entity-title-group p { margin-top: 5px; color: var(--text-soft); }
.entity-actions { display: flex; gap: 8px; }
.entity-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr); gap: 14px; }
.entity-stack { display: grid; align-content: start; gap: 14px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-item { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-item:nth-child(2n) { border-right: 0; }
.detail-item:nth-last-child(-n+2) { border-bottom: 0; }
.detail-item span { color: var(--text-faint); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.detail-item strong, .detail-item a { display: block; margin-top: 7px; overflow-wrap: anywhere; font-size: 13px; text-decoration: none; }
.inline-status { width: 100%; min-height: 38px; margin-top: 7px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); color: var(--text); }
.items-list, .payments-list, .client-orders-list { display: grid; }
.item-row, .payment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.item-row:last-child, .payment-row:last-child { border-bottom: 0; }
.item-row p, .payment-row p { margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.finance-summary { display: grid; gap: 10px; padding: 16px 18px; }
.finance-line { display: flex; justify-content: space-between; gap: 18px; color: var(--text-soft); }
.finance-line strong { color: var(--text); }
.finance-line.is-total, .finance-line.is-balance { padding-top: 11px; border-top: 1px solid var(--border); color: var(--text); font-size: 14px; }
.finance-line.is-balance strong { color: var(--accent); font-size: 18px; }
.note-block { padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft); line-height: 1.65; }
.client-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.client-metric { padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.client-metric span { color: var(--text-soft); font-size: 10px; }
.client-metric strong { display: block; margin-top: 10px; font-size: 19px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 760px); gap: 24px; }
.settings-nav { display: grid; align-content: start; gap: 4px; }
.settings-nav button { min-height: 40px; padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); text-align: left; font-weight: 500; }
.settings-nav button:hover { background: var(--surface-subtle); color: var(--text); }
.settings-nav button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-content { min-width: 0; }
.settings-section { display: grid; gap: 14px; }
.settings-card { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.settings-card-head { padding: 18px; border-bottom: 1px solid var(--border); }
.settings-card-head h2 { font-size: 16px; }
.settings-card-head p { margin-top: 6px; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.settings-card-body { padding: 18px; }
.settings-card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-subtle); }
.profile-editor { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 18px; }
.avatar-upload { position: relative; display: block; cursor: pointer; }
.avatar-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-upload::after { content: "+"; position: absolute; right: -4px; bottom: -4px; display: grid; width: 24px; height: 24px; place-items: center; border: 2px solid var(--surface); border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; }
.services-table { width: 100%; border-collapse: collapse; }
.services-table td, .services-table th { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.services-table th { color: var(--text-faint); font-size: 10px; text-transform: uppercase; }
.services-table tr:last-child td { border-bottom: 0; }
.setting-options { display: grid; gap: 8px; }
.radio-row { display: flex; min-height: 48px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; }
.radio-row input { width: auto; }
.radio-row div { display: grid; gap: 3px; }
.radio-row small { color: var(--text-soft); }
.rate-display { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border-radius: 9px; background: var(--surface-subtle); }
.rate-display strong { font-size: 20px; }
.rate-display small { display: block; margin-top: 4px; color: var(--text-soft); }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.session-row:last-child { border-bottom: 0; }

/* Dialogs */
.dialog { width: min(620px, calc(100vw - 30px)); max-width: none; max-height: min(900px, calc(100dvh - 30px)); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(13, 18, 30, 0.52); backdrop-filter: blur(3px); }
.dialog-wide { width: min(900px, calc(100vw - 30px)); height: min(820px, calc(100dvh - 30px)); }
.dialog-small { width: min(480px, calc(100vw - 30px)); }
.voice-order-dialog { width: min(640px, calc(100vw - 30px)); }
.dialog-report { width: min(1180px, calc(100vw - 24px)); height: min(900px, calc(100dvh - 24px)); }
.dialog-shell { width: 100%; height: auto; min-height: 0; max-height: inherit; display: flex; flex-direction: column; overflow: hidden; margin: 0; }
.dialog-wide .dialog-shell, .dialog-report .dialog-shell { height: 100%; }
.dialog-head { min-height: 70px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dialog-head h2 { margin-top: 4px; font-size: 18px; }
.dialog-scroll { min-width: 0; min-height: 0; flex: 0 1 auto; overflow-x: hidden; overflow-y: auto; padding: 20px; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.dialog-wide .dialog-scroll { flex: 1 1 0; scrollbar-gutter: stable; }
.dialog-footer { min-height: 66px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.footer-actions { display: flex; gap: 8px; }
.form-section { padding: 20px 0; border-bottom: 1px solid var(--border); }
.form-section:first-child { padding-top: 0; }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; }
.form-section-title > span { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }
.form-section-title h3 { font-size: 14px; }
.form-section-title p { margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.client-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.client-picker-result { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; }
.order-items { display: grid; gap: 10px; margin-bottom: 12px; }
.order-item-editor { display: grid; grid-template-columns: minmax(180px, 1.4fr) 100px 130px 110px 40px; align-items: end; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-subtle); }
.order-item-editor .item-total { min-height: 42px; display: flex; align-items: center; padding: 0 2px; font-weight: 600; }
.order-item-remove { margin-bottom: 1px; }
.order-totals { width: min(360px, 100%); display: grid; gap: 9px; margin: 18px 0 0 auto; padding: 14px; border-radius: 10px; background: var(--surface-subtle); }
.order-totals div { display: flex; justify-content: space-between; gap: 18px; color: var(--text-soft); }
.order-totals .grand-total { padding-top: 9px; border-top: 1px solid var(--border); color: var(--text); font-size: 15px; }
.voice-order-body { display: grid; gap: 20px; }
.voice-stage { display: flex; align-items: center; gap: 16px; min-height: 98px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-subtle); }
.voice-stage > div { display: grid; gap: 5px; min-width: 0; }
.voice-stage strong { font-size: 15px; }
.voice-stage span { color: var(--text-soft); font-size: 12px; }
.voice-timer { width: max-content; margin-top: 3px; color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.voice-record-button { position: relative; display: grid; width: 58px; height: 58px; flex: 0 0 58px; place-items: center; border: 0; border-radius: 18px; background: var(--accent); color: #fff; box-shadow: 0 9px 24px color-mix(in srgb, var(--accent) 24%, transparent); }
.voice-record-button svg { width: 23px; height: 23px; }
.voice-record-button:hover { background: var(--accent-hover); }
.voice-stage.is-listening .voice-record-button::before, .voice-stage.is-listening .voice-record-button::after { content: ""; position: absolute; inset: -7px; border: 2px solid color-mix(in srgb, var(--accent) 42%, transparent); border-radius: 23px; animation: voice-pulse 1.5s ease-out infinite; pointer-events: none; }
.voice-stage.is-listening .voice-record-button::after { animation-delay: 0.65s; }
.voice-stage.is-listening .voice-record-button { background: var(--danger); }
.voice-stage.is-processing .voice-record-button { cursor: wait; opacity: 0.64; }
.voice-stage.is-processing .voice-record-button svg { animation: voice-spin 1s linear infinite; }
.voice-transcript-field textarea { min-height: 160px; }
.voice-warnings { padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: 9px; background: var(--accent-soft); color: var(--text-soft); font-size: 11px; line-height: 1.55; }
.voice-warnings strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 11px; }
@keyframes voice-pulse { from { opacity: 0.8; transform: scale(0.86); } to { opacity: 0; transform: scale(1.18); } }
@keyframes voice-spin { to { transform: rotate(360deg); } }
.confirm-dialog .dialog-scroll { display: grid; justify-items: center; padding: 32px 24px 22px; text-align: center; }
.confirm-dialog h2 { margin-top: 16px; font-size: 18px; }
.confirm-dialog p { margin-top: 8px; color: var(--text-soft); line-height: 1.55; }
.confirm-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 20px; font-weight: 700; }
.report-builder { min-height: 0; display: grid; flex: 1; grid-template-columns: 280px minmax(0,1fr); overflow: hidden; }
.report-controls { min-height: 0; overflow-y: auto; padding: 16px; border-right: 1px solid var(--border); background: var(--surface-subtle); }
.report-preview-wrap { min-width: 0; overflow: auto; padding: 24px; background: #e9ecf1; }
.report-page { width: min(760px, 100%); min-height: 980px; margin: 0 auto; padding: 46px; border-radius: 6px; background: #fff; color: #151a24; box-shadow: 0 10px 34px rgba(22, 28, 40, 0.12); font-size: 13px; line-height: 1.5; }
.report-headline { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #dfe4eb; }
.report-headline h2 { margin-top: 9px; font-size: 25px; line-height: 1.18; }
.report-brand { display: block; color: #1f4fc5; font-size: 12px; font-weight: 700; }
.report-document-meta { display: grid; flex: 0 0 auto; gap: 5px; max-width: 46%; padding-top: 2px; color: #697386; font-size: 11px; text-align: right; }
.report-document-meta small { color: #98a0ad; font-size: 10px; }
.report-overview { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin: 24px 0 32px; overflow: hidden; border-radius: 10px; background: #f4f6f9; }
.report-overview > div { min-width: 0; padding: 17px 19px; }
.report-overview > div + div { border-left: 1px solid #e0e5ec; }
.report-overview span, .report-notes > span { display: block; color: #6d7685; font-size: 9px; font-weight: 600; }
.report-overview strong { display: block; margin-top: 8px; overflow-wrap: anywhere; font-size: 17px; line-height: 1.28; }
.report-overview small { display: block; margin-top: 6px; color: #7a8290; font-size: 10px; overflow-wrap: anywhere; }
.report-orders { display: grid; gap: 34px; }
.report-order { min-width: 0; break-inside: avoid; }
.report-order + .report-order { padding-top: 30px; border-top: 1px solid #dfe4eb; }
.report-order-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.report-order-head span { display: block; color: #1f4fc5; font-size: 10px; font-weight: 600; }
.report-order-head h3 { margin-top: 5px; font-size: 19px; line-height: 1.3; }
.report-order-head > small { flex: 0 0 auto; padding-bottom: 2px; color: #7a8290; font-size: 10px; }
.report-service-list { margin-top: 15px; border-top: 1px solid #dfe4eb; }
.report-service { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 24px; padding: 14px 0; border-bottom: 1px solid #e7eaf0; }
.report-service > div { min-width: 0; }
.report-service strong { overflow-wrap: anywhere; font-size: 15px; line-height: 1.35; }
.report-service > strong { text-align: right; white-space: nowrap; }
.report-service small { display: block; margin-top: 5px; color: #737c8c; font-size: 11px; }
.report-inline-fact { display: flex; justify-content: space-between; gap: 18px; margin-top: 13px; color: #697386; }
.report-inline-fact strong { color: #2b313d; }
.report-notes { margin-top: 16px; padding: 15px 17px; border-radius: 9px; background: #f4f6f9; }
.report-notes p { margin-top: 8px; color: #343b48; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.report-total { width: min(390px, 100%); margin: 30px 0 0 auto; }
.report-price-row { display: flex; justify-content: space-between; gap: 20px; padding: 7px 2px; color: #697386; }
.report-price-row strong { color: #2b313d; }
.report-grand-total { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 20px; margin-top: 10px; padding: 16px 18px; border-radius: 10px; background: #eaf0ff; }
.report-grand-total span { color: #46536a; font-size: 11px; font-weight: 600; }
.report-grand-total strong { grid-row: 1 / span 2; grid-column: 2; color: #1f4fc5; font-size: 22px; white-space: nowrap; }
.report-grand-total small { color: #697386; font-size: 9px; }
.report-extra { margin-top: 28px; }
.report-empty, .report-empty-state { color: #7a8290; }
.report-empty { padding: 16px 0; border-top: 1px solid #dfe4eb; }
.report-empty-state { padding: 42px 0; text-align: center; }
.report-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid #e3e7ed; color: #7a8290; font-size: 10px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; width: min(340px, calc(100vw - 40px)); }
.toast { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); color: var(--text); animation: toast-in 180ms ease-out; }
.toast.is-error { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.mobile-nav, .mobile-create { display: none; }

/* Collapsed sidebar */
body.sidebar-collapsed { --sidebar: 72px; }
body.sidebar-collapsed .sidebar { padding-inline: 10px; }
body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .nav-button > span:not(.nav-icon), body.sidebar-collapsed .nav-button small, body.sidebar-collapsed .profile-chevron { display: none; }
body.sidebar-collapsed .workspace-brand, body.sidebar-collapsed .nav-button, body.sidebar-collapsed .profile-button { justify-content: center; }
body.sidebar-collapsed .sidebar-collapse { position: absolute; right: -16px; top: 24px; border: 1px solid var(--border); background: var(--surface); transform: rotate(180deg); }
body.sidebar-collapsed .profile-popover { left: 52px; bottom: 0; width: 190px; }

@media (max-width: 1279px) {
  :root { --sidebar: 78px; }
  .sidebar { padding-inline: 11px; }
  .sidebar .brand-copy, .sidebar .nav-button > span:not(.nav-icon), .sidebar .nav-button small, .sidebar .profile-chevron, .sidebar-collapse { display: none; }
  .sidebar .workspace-brand, .sidebar .nav-button, .sidebar .profile-button { justify-content: center; }
  .profile-popover { left: 56px; bottom: 0; width: 190px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: 390px; padding: 30px 34px; }
  .auth-message { margin: auto 0 0; padding: 50px 0 20px; }
  .auth-message h1 { font-size: 42px; }
  .auth-message > p:not(.overline) { max-width: 600px; }
  .auth-points { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 28px; }
  .auth-points li { align-items: flex-start; font-size: 11px; }
  .auth-footnote { display: none; }
  .auth-access { min-height: auto; padding: 42px 24px 60px; }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .attention-list { max-height: none; }
  .compact-row { grid-template-columns: minmax(130px, 1fr) minmax(140px, 1fr) auto auto; }
  .compact-row > :nth-child(4) { display: none; }
  .entity-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 180px minmax(0,1fr); gap: 16px; }
  .order-item-editor { grid-template-columns: minmax(160px,1fr) 84px 110px 92px 40px; }
}

@media (max-width: 767px) {
  :root { --topbar: 64px; }
  body { padding-bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea { font-size: 16px; }
  .app-layout { display: block; }
  .sidebar { display: none; }
  .main-column { width: 100%; }
  .topbar { height: auto; min-height: var(--topbar); padding: 10px 16px; }
  .page-heading h1 { font-size: 20px; }
  .page-heading p { display: none; }
  .page-actions .button-secondary { display: none; }
  .page-actions .voice-order-button { display: inline-flex; width: 40px; padding-inline: 0; }
  .page-actions [data-create-order] { display: none; }
  .voice-order-button span { display: none; }
  .page-actions .button { min-height: 38px; padding-inline: 11px; }
  .page-content { padding: 16px 12px 28px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 80; height: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); }
  .mobile-nav button { display: grid; min-width: 0; min-height: 54px; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 9px; background: transparent; color: var(--text-faint); }
  .mobile-nav button > svg { width: 18px; height: 18px; stroke-width: 1.8; }
  .mobile-nav button small { font-size: 10px; font-weight: 500; }
  .mobile-nav button.is-active { color: var(--accent); }
  .mobile-create { position: fixed; right: 16px; bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 14px); z-index: 75; width: 50px; height: 50px; place-items: center; border: 0; border-radius: 14px; background: var(--accent); color: #fff; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 32%, transparent); font-size: 26px; }
  .mobile-create:not(.is-hidden) { display: grid; }
  .dashboard-controls { align-items: stretch; }
  .dashboard-controls > .segmented { width: 100%; overflow-x: auto; }
  .dashboard-controls > .segmented button { flex: 1 0 auto; }
  .control-row { width: 100%; }
  .control-row .button { flex: 1; }
  .custom-period { display: grid; grid-template-columns: 1fr 1fr; }
  .custom-period .field { width: 100%; }
  .custom-period .button { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .kpi-card { min-height: 104px; padding: 14px; }
  .kpi-card strong { margin-top: 16px; font-size: 21px; }
  .surface { border-radius: 11px; }
  .surface-head { min-height: 62px; padding: 13px 14px; }
  .chart-wrap { height: 260px; padding: 10px; }
  .recent-surface { margin-top: 10px; }
  .compact-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; min-height: 66px; padding: 11px 14px; }
  .compact-row > :nth-child(2), .compact-row > :nth-child(4), .compact-row > :nth-child(5) { display: none; }
  .list-toolbar { align-items: stretch; }
  .search-control { min-width: 0; }
  .search-control kbd { display: none; }
  .sort-select { width: 46px; }
  .sort-select select { color: transparent; }
  .table-scroll { display: none; }
  .mobile-cards { display: grid; gap: 9px; padding: 9px; background: var(--bg); }
  .mobile-card { position: relative; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); text-align: left; }
  .mobile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .mobile-card h3 { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-card p { margin-top: 4px; overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-card-amount { flex: 0 0 auto; font-size: 14px; }
  .mobile-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
  .mobile-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 10px; }
  .list-surface { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .empty-state { min-height: 280px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
  .entity-header { align-items: center; }
  .entity-title-group h2 { font-size: 19px; }
  .entity-actions .button-secondary { width: 40px; overflow: hidden; padding: 0; color: transparent; }
  .entity-actions .button-secondary::before { content: "⋯"; color: var(--text); font-size: 18px; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-item, .detail-item:nth-child(2n), .detail-item:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--border); }
  .detail-item:last-child { border-bottom: 0; }
  .client-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .settings-layout { display: block; }
  .settings-nav { display: flex; gap: 5px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); }
  .profile-editor { grid-template-columns: 1fr; justify-items: start; }
  .dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
  .dialog-wide, .dialog-report { width: 100vw; height: min(100dvh, var(--app-viewport-height, 100dvh)); max-height: min(100dvh, var(--app-viewport-height, 100dvh)); margin: 0; border: 0; border-radius: 0; }
  .dialog-wide .dialog-shell, .dialog-report .dialog-shell { height: min(100dvh, var(--app-viewport-height, 100dvh)); max-height: min(100dvh, var(--app-viewport-height, 100dvh)); }
  .dialog-head { min-height: 62px; padding: 11px 14px; }
  .dialog-scroll { padding: 16px 14px; }
  .dialog-footer { min-height: 64px; padding-inline: 14px; }
  .dialog-footer .button { flex: 1; }
  .voice-stage { min-height: 90px; padding: 15px; }
  .voice-record-button { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .order-item-editor { grid-template-columns: minmax(0,1fr) 78px 110px 40px; align-items: end; }
  .order-item-editor .item-service { grid-column: 1 / -1; }
  .order-item-editor .item-total { display: none; }
  .client-picker { grid-template-columns: 1fr; }
  .report-builder { grid-template-columns: 1fr; overflow-y: auto; }
  .report-controls { border-right: 0; border-bottom: 1px solid var(--border); }
  .report-preview-wrap { overflow: visible; padding: 12px; }
  .report-page { min-height: 0; padding: 24px 18px; }
  .report-headline { gap: 14px; }
  .report-headline h2 { font-size: 21px; }
  .report-document-meta { max-width: 44%; }
  .report-overview { grid-template-columns: 1fr; }
  .report-overview > div + div { border-top: 1px solid #e0e5ec; border-left: 0; }
  .report-service { gap: 12px; }
  .report-service > strong { font-size: 14px; }
  .report-grand-total { grid-template-columns: 1fr; }
  .report-grand-total strong { grid-row: auto; grid-column: auto; font-size: 21px; text-align: left; }
  .toast-region { right: 12px; bottom: calc(var(--mobile-nav) + 12px); width: calc(100vw - 24px); }
}

@media (max-width: 479px) {
  .auth-shell { display: block; background: #f4f6fa; }
  .auth-intro { min-height: 310px; padding: 24px 20px 32px; }
  .auth-message { margin: auto 0 0; padding: 52px 0 0; }
  .auth-message h1 { font-size: 34px; }
  .auth-message > p:not(.overline) { margin-top: 16px; font-size: 13px; }
  .auth-points, .auth-footnote { display: none; }
  .auth-access { min-height: auto; padding: 28px 18px 40px; }
  .auth-card h2 { font-size: 25px; }
  .kpi-card { min-height: 96px; }
  .kpi-card strong { font-size: 19px; }
  .quick-filters { margin-inline: -12px; padding-inline: 12px; }
  .order-item-editor { grid-template-columns: minmax(0,1fr) 70px 40px; }
  .order-item-editor .item-price { grid-column: 1 / 3; }
  .order-item-remove { grid-column: 3; grid-row: 2; }
  .footer-actions { display: grid; flex: 1; grid-template-columns: 1fr 1fr; }
}

@media print {
  body > *:not(#reportDialog) { display: none !important; }
  #reportDialog { position: static; display: block; width: auto; height: auto; max-height: none; border: 0; box-shadow: none; }
  #reportDialog .dialog-head, #reportDialog .report-controls, #reportDialog .dialog-footer { display: none; }
  #reportDialog .report-builder, #reportDialog .report-preview-wrap { display: block; overflow: visible; padding: 0; background: #fff; }
  #reportDialog .report-page { width: 100%; min-height: 0; padding: 14mm; box-shadow: none; }
}
