/* Coopernut ONE — design system
   One stylesheet for the public site, customer app and control centre.
   Deep navy, white, cool greys, restrained blue accents. Light & dark themes. */

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

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --navy-950: #060E1C; --navy-900: #0A1628; --navy-800: #0F2140; --navy-700: #17305A; --navy-600: #22417A;
  --blue-700: #1D55CF; --blue-600: #2F6FED; --blue-500: #4C84F5; --blue-100: #DCE8FF; --blue-50: #EEF4FF;
  --grey-25: #FCFCFD; --grey-50: #F7F8FA; --grey-100: #EEF0F4; --grey-200: #E4E7EC; --grey-300: #CDD3DD; --grey-400: #98A2B3; --grey-500: #667085; --grey-600: #475467; --grey-700: #344054; --grey-800: #1D2939; --grey-900: #101828;

  --bg: #F5F7FA; --surface: #FFFFFF; --surface-2: #F9FAFB; --surface-3: #F2F4F7; --border: #E4E7EC; --border-strong: #CDD3DD;
  --text: #101828; --text-2: #344054; --muted: #667085; --faint: #98A2B3;
  --primary: #2F6FED; --primary-hover: #1D55CF; --primary-soft: #EEF4FF; --primary-ink: #FFFFFF; --focus: rgba(47, 111, 237, .35);
  --success: #12805C; --success-soft: #E7F6EF; --warning: #B54708; --warning-soft: #FEF4E6; --danger: #C4320A; --danger-soft: #FEEDEA; --info: #1D55CF; --info-soft: #EEF4FF;
  --sidebar-bg: #0A1628; --sidebar-text: #B8C4D8; --sidebar-active: #FFFFFF; --sidebar-hover: rgba(255,255,255,.06); --sidebar-accent: #4C84F5;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06); --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04); --shadow-lg: 0 12px 32px -8px rgba(16,24,40,.18), 0 4px 8px -4px rgba(16,24,40,.06);
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-xl: 20px;
  --chart-1: #2F6FED; --chart-2: #12A594; --chart-3: #E8A33D; --chart-4: #8A63D2; --chart-5: #D9534F; --chart-grid: #E4E7EC;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A111F; --surface: #101A2C; --surface-2: #142036; --surface-3: #1A2742; --border: #22314D; --border-strong: #2F4166;
  --text: #E7ECF4; --text-2: #C3CCDA; --muted: #93A1B8; --faint: #6B7A94;
  --primary: #5B8DF6; --primary-hover: #7AA3F8; --primary-soft: rgba(91,141,246,.14); --primary-ink: #0A1220; --focus: rgba(91,141,246,.45);
  --success: #4CC38A; --success-soft: rgba(76,195,138,.14); --warning: #F3A74B; --warning-soft: rgba(243,167,75,.14); --danger: #F97066; --danger-soft: rgba(249,112,102,.14); --info: #7AA3F8; --info-soft: rgba(91,141,246,.14);
  --sidebar-bg: #060D1A; --sidebar-text: #9DAAC2; --sidebar-hover: rgba(255,255,255,.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-lg: 0 12px 32px -8px rgba(0,0,0,.6);
  --chart-grid: #22314D;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A111F; --surface: #101A2C; --surface-2: #142036; --surface-3: #1A2742; --border: #22314D; --border-strong: #2F4166;
    --text: #E7ECF4; --text-2: #C3CCDA; --muted: #93A1B8; --faint: #6B7A94;
    --primary: #5B8DF6; --primary-hover: #7AA3F8; --primary-soft: rgba(91,141,246,.14); --primary-ink: #0A1220; --focus: rgba(91,141,246,.45);
    --success: #4CC38A; --success-soft: rgba(76,195,138,.14); --warning: #F3A74B; --warning-soft: rgba(243,167,75,.14); --danger: #F97066; --danger-soft: rgba(249,112,102,.14); --info: #7AA3F8; --info-soft: rgba(91,141,246,.14);
    --sidebar-bg: #060D1A; --sidebar-text: #9DAAC2; --sidebar-hover: rgba(255,255,255,.05);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-lg: 0 12px 32px -8px rgba(0,0,0,.6);
    --chart-grid: #22314D;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.015em; color: var(--text); font-weight: 650; }
h1 { font-size: clamp(1.6rem, 2.2vw + .9rem, 2.25rem); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-3); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--surface-3); padding: 12px 14px; border-radius: var(--radius-sm); overflow: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 3px solid var(--primary); background: var(--surface-2); color: var(--text-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .xsmall { font-size: .76rem; } .strong { font-weight: 600; }
.mono { font-family: var(--mono); } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; } .flex-wrap { flex-wrap: wrap; } .flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; } .gap-sm { gap: 6px; } .gap-lg { gap: 20px; }
.stack > * + * { margin-top: 12px; } .stack-sm > * + * { margin-top: 8px; } .stack-lg > * + * { margin-top: 24px; }
.mt-0 { margin-top: 0 !important; } .mt-sm { margin-top: 8px; } .mb-0 { margin-bottom: 0 !important; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-lg { margin-top: 32px; } .mb-lg { margin-bottom: 32px; }
.grid { display: grid; gap: 16px; } .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.hidden { display: none !important; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 16px; }
.sticky-top { position: sticky; top: 16px; }
@media (max-width: 1100px) { .sticky-top { position: static; } }
input.input-sm, select.input-sm { min-height: 32px; padding: 4px 8px; font-size: .88rem; }
.table input.input-sm[type=number] { width: 84px; text-align: right; }
.tabs-pill { border-bottom: 0; gap: 6px; margin-bottom: 16px; }
.tabs.tabs-pill a { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; margin-bottom: 0; }
.tabs.tabs-pill a.active { background: var(--primary); color: var(--primary-ink, #fff); border-color: var(--primary); }
.w-full { width: 100%; } .max-w-sm { max-width: 420px; } .max-w-md { max-width: 640px; } .max-w-lg { max-width: 880px; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hide-tablet { display: none !important; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } .hide-mobile { display: none !important; } }

/* ---------- buttons ---------- */
.btn { --btn-bg: var(--surface); --btn-fg: var(--text-2); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 15px; border-radius: 8px;
  border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-weight: 550; font-size: .9rem; line-height: 1.2;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); border-color: var(--grey-400); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--primary-ink); --btn-border: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-dark { --btn-bg: var(--navy-900); --btn-fg: #fff; --btn-border: var(--navy-900); }
.btn-dark:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-success { --btn-bg: var(--success); --btn-fg: #fff; --btn-border: var(--success); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; box-shadow: none; min-height: 0; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: .82rem; border-radius: 7px; }
.btn-lg { min-height: 46px; padding: 12px 22px; font-size: 1rem; border-radius: 10px; }
.btn-icon { padding: 7px; min-width: 36px; }
.btn-block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading { pointer-events: none; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .label { display: block; font-weight: 550; font-size: .86rem; color: var(--text-2); margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 2px; }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=month], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-size: .93rem; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--primary); vertical-align: -3px; margin: 0; }
input[type=file] { font: inherit; font-size: .88rem; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.is-invalid, .field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .82rem; margin: 5px 0 0; }
.hint { color: var(--muted); font-size: .8rem; margin: 5px 0 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: .92rem; cursor: pointer; margin-bottom: 8px; }
.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding-top: 8px; flex-wrap: wrap; }
.form-section { padding: 20px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section h3 { margin-bottom: 4px; }
.input-group { display: flex; align-items: stretch; }
.input-group > input, .input-group > select { border-radius: 0; flex: 1; min-width: 0; }
.input-group > :first-child { border-radius: 8px 0 0 8px; }
.input-group > :last-child { border-radius: 0 8px 8px 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--muted); font-size: .88rem; }
.input-group .addon:first-child { border-right: 0; } .input-group .addon:last-child { border-left: 0; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-input input { padding-left: 36px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- cards & panels ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card + .card { margin-top: 20px; }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.panel-muted { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; }
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a.row-link { color: var(--text); font-weight: 550; }
.table a.row-link:hover { color: var(--primary); }
.table th a { color: inherit; }
.table-compact td, .table-compact th { padding: 7px 10px; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 14px; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  .table-stack td.num { text-align: right; }
}

/* ---------- badges, alerts, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: .8rem; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; font-size: .92rem; }
.alert .icon { margin-top: 2px; }
.alert > div { flex: 1; min-width: 0; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--text); }
.alert-success .icon { color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); }
.alert-error .icon { color: var(--danger); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); }
.alert-warning .icon { color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text); }
.alert-info .icon { color: var(--info); }
.banner { padding: 9px 16px; font-size: .88rem; text-align: center; background: var(--navy-800); color: #E6ECF8; }
.banner a { color: #fff; text-decoration: underline; }
.banner-warning { background: var(--warning-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.banner-info { background: var(--primary-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.banner-info a, .banner-warning a { color: var(--primary); }

/* ---------- empty states, loaders ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty .empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 440px; margin: 0 auto 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress.success > span { background: var(--success); }
.progress.warning > span { background: var(--warning); }
.progress.danger > span { background: var(--danger); }

/* ---------- avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 650; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar-sm { width: 24px; height: 24px; font-size: .66rem; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 550; font-size: .9rem; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; font-family: inherit; text-decoration: none !important; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active, .tabs [aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 6px 12px; border-radius: 7px; font-size: .84rem; color: var(--text-2); font-weight: 550; border: 0; background: none; cursor: pointer; text-decoration: none !important; font-family: inherit; }
.seg a.active, .seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- dropdown (details/summary) ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown-menu.left { right: auto; left: 0; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--text-2); font-size: .9rem; border: 0; background: none; text-align: left; cursor: pointer; font-family: inherit; text-decoration: none !important; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu hr { margin: 6px 0; }
.dropdown-menu .menu-label { padding: 6px 10px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; }

/* ---------- dialog ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); }
dialog.modal::backdrop { background: rgba(6, 14, 28, .55); backdrop-filter: blur(2px); }
dialog.modal .modal-header { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
dialog.modal .modal-header h2 { font-size: 1.1rem; margin: 0; }
dialog.modal .modal-body { padding: 16px 22px; }
dialog.modal .modal-footer { padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--navy-900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in .2s ease-out; display: flex; gap: 10px; align-items: center; }
.toast.error { background: #8E1F0B; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- application shell ---------- */
.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #4C84F5, #1D55CF); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .95rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.sidebar-org { margin: 0 12px 10px; }
.sidebar-org summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.05); color: #E6ECF8; font-size: .88rem; font-weight: 550; }
.sidebar-org summary:hover { background: rgba(255,255,255,.09); }
.sidebar-org .dropdown-menu { left: 0; right: 0; min-width: 0; }
.nav-section { padding: 6px 12px; }
.nav-label { padding: 12px 10px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #6F7F9C; font-weight: 650; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-size: .9rem; font-weight: 500; text-decoration: none !important; position: relative; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: rgba(76,132,245,.16); color: var(--sidebar-active); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sidebar-accent); }
.nav-link .icon { opacity: .85; }
.nav-link .count { margin-left: auto; background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 7px; font-weight: 600; }
.nav-link .lock { margin-left: auto; opacity: .55; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.plan-pill { display: block; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); color: #DCE4F2; font-size: .82rem; text-decoration: none !important; }
.plan-pill strong { color: #fff; }
.plan-pill:hover { background: rgba(255,255,255,.09); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar .search-input { width: min(420px, 100%); }
.topbar .search-input input { background: var(--surface); min-height: 38px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; color: var(--text-2); border: 0; background: none; cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.content { padding: 26px 28px 60px; width: 100%; max-width: 1440px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { margin-bottom: 4px; font-size: 1.55rem; }
.page-header p { margin: 0; color: var(--muted); }
.breadcrumbs { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search-input { flex: 1 1 240px; max-width: 360px; }
.toolbar select { width: auto; min-width: 140px; }
.menu-toggle { display: none; }
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.layout-split-left { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .layout-split, .layout-split-left { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 90; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(6,14,28,.5); z-index: 80; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 16px 48px; }
}

/* ---------- stats & dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat .stat-label { color: var(--muted); font-size: .8rem; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat .stat-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); overflow-wrap: anywhere; }
.stat .stat-sub { color: var(--muted); font-size: .78rem; margin-top: 2px; }
a.stat { text-decoration: none !important; color: inherit; display: block; }
a.stat:hover { border-color: var(--primary); }
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.list-row { display: flex; align-items: center; gap: 12px; }
.list-row .grow { flex: 1; min-width: 0; }
.widget .list-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.widget .list-row:last-child { border-bottom: 0; }
.widget .list-row .grow { flex: 1; min-width: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- charts (server-rendered SVG) ---------- */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--chart-1); }
.chart .bar-2 { fill: var(--chart-2); }
.chart .line { fill: none; stroke: var(--chart-1); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-1); opacity: .1; }
.chart .dot { fill: var(--surface); stroke: var(--chart-1); stroke-width: 2; }
.chart .value-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .bar:hover, .chart .bar-2:hover { opacity: .85; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c, var(--chart-1)); vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; margin-bottom: 8px; }
.hbar .track { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--chart-1); border-radius: 999px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kanban-col { background: var(--surface-3); border-radius: var(--radius-lg); padding: 10px; min-height: 220px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 600; font-size: .88rem; }
.kanban-col-head .muted { font-weight: 500; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 10px; transition: background .15s; }
.kanban-list.drag-over { background: var(--primary-soft); outline: 2px dashed var(--primary); outline-offset: 2px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; box-shadow: var(--shadow-sm); cursor: grab; font-size: .88rem; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kanban-card a { color: var(--text); font-weight: 550; }
.kanban-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: .78rem; }

/* ---------- calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.calendar .dow { padding: 8px; font-size: .74rem; font-weight: 600; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: center; }
.calendar .day { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .78rem; min-width: 0; }
.calendar .day:nth-child(7n) { border-right: 0; }
.calendar .day.other { background: var(--surface-2); color: var(--faint); }
.calendar .day.today .day-num { background: var(--primary); color: var(--primary-ink); }
.calendar .day-num { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; margin-bottom: 4px; }
.calendar .event { display: block; padding: 2px 6px; border-radius: 5px; background: var(--primary-soft); color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none !important; }
.calendar .event.done { opacity: .55; text-decoration: line-through !important; }
.calendar .event.overdue { background: var(--danger-soft); }
@media (max-width: 700px) { .calendar .day { min-height: 70px; } .calendar .event { font-size: .68rem; } }

/* ---------- timeline / gantt ---------- */
.gantt { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; background: var(--surface); }
.gantt-row { display: grid; grid-template-columns: 240px minmax(600px, 1fr); border-bottom: 1px solid var(--border); min-height: 38px; }
.gantt-row:last-child { border-bottom: 0; }
.gantt-label { padding: 8px 12px; font-size: .84rem; border-right: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface); position: sticky; left: 0; z-index: 1; }
.gantt-track { position: relative; background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: var(--day-w, 24px) 100%; }
.gantt-bar { position: absolute; top: 9px; height: 20px; border-radius: 6px; background: var(--chart-1); color: #fff; font-size: .7rem; padding: 2px 6px; overflow: hidden; white-space: nowrap; }
.gantt-bar.done { background: var(--success); }
.gantt-bar.overdue { background: var(--danger); }
.gantt-head { font-size: .7rem; color: var(--muted); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { position: relative; padding: 0 0 16px 22px; font-size: .88rem; }
.activity li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.activity li::after { content: ""; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.activity li:last-child::after { display: none; }
.activity .when { color: var(--faint); font-size: .76rem; }

/* ---------- line items editor ---------- */
.items-table input, .items-table select, .items-table textarea { min-height: 36px; padding: 6px 8px; font-size: .88rem; }
.items-table textarea { min-height: 36px; height: 36px; }
.items-table td { padding: 6px 6px; vertical-align: top; }
.items-table .col-desc { min-width: 230px; }
.items-table .col-num { width: 104px; }
.items-table .col-sm { width: 82px; }
.totals { margin-left: auto; width: min(360px, 100%); }
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals .row.grand { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }
.autocomplete { position: relative; }
.autocomplete-list { position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; }
.autocomplete-list button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; font: inherit; font-size: .88rem; color: var(--text); cursor: pointer; }
.autocomplete-list button:hover, .autocomplete-list button.active { background: var(--surface-3); }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-aside { background: radial-gradient(1200px 600px at 20% 0%, #17305A 0%, transparent 60%), var(--navy-900); color: #DCE4F2; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { color: #fff; font-size: 1.9rem; letter-spacing: -.02em; max-width: 460px; }
.auth-aside ul { list-style: none; padding: 0; margin: 24px 0; }
.auth-aside li { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.auth-aside li .icon { color: #7AA3F8; margin-top: 3px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; }
@media (max-width: 900px) { .auth-page { grid-template-columns: minmax(0, 1fr); } .auth-aside { display: none; } }
.workspace-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.workspace-option { position: relative; }
.workspace-option input { position: absolute; opacity: 0; }
.workspace-option label { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; font-size: .84rem; font-weight: 550; height: 100%; }
.workspace-option label .icon { color: var(--primary); }
.workspace-option input:checked + label { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.workspace-option input:focus-visible + label { outline: 3px solid var(--focus); }

/* ---------- public website ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.site-nav { display: flex; align-items: center; gap: 24px; height: 66px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 820px; }
.site-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.08rem; color: var(--text); text-decoration: none !important; letter-spacing: -.02em; }
.site-brand small { font-weight: 600; color: var(--primary); }
.site-menu { display: flex; gap: 4px; align-items: center; }
.site-menu > a, .site-menu > details > summary { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; font-size: .92rem; text-decoration: none !important; cursor: pointer; }
.site-menu > a:hover, .site-menu > details > summary:hover { background: var(--surface-3); color: var(--text); }
.site-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.mega { width: min(720px, 92vw); display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 10px; left: 0; right: auto; }
.mega a { align-items: flex-start; }
.mega a .icon { color: var(--primary); margin-top: 2px; }
.mega a strong { display: block; color: var(--text); font-size: .9rem; }
.mega a span { color: var(--muted); font-size: .8rem; }
.site-mobile-toggle { display: none; }
@media (max-width: 1020px) {
  .site-menu, .site-actions .hide-mobile-nav { display: none; }
  .site-mobile-toggle { display: inline-flex; }
  body.site-nav-open .site-menu { display: flex; position: fixed; inset: 66px 0 0 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 16px; overflow-y: auto; z-index: 60; gap: 2px; }
  body.site-nav-open .site-menu .dropdown-menu { position: static; box-shadow: none; border: 0; width: auto; grid-template-columns: 1fr; padding: 0 0 0 8px; }
}
.hero { padding: 84px 0 56px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto -10%; height: 700px; background: radial-gradient(600px 300px at 70% 30%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%); pointer-events: none; }
.hero .eyebrow, .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .8rem; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 4.2vw + .6rem, 3.6rem); line-height: 1.06; letter-spacing: -.035em; max-width: 900px; }
.hero .lead { font-size: clamp(1.05rem, .5vw + .95rem, 1.25rem); color: var(--text-2); max-width: 680px; margin: 18px 0 28px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; position: relative; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero { padding-top: 48px; } }
.hero-visual { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 18px; }
.mock-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--grey-300); }
.mock-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; background: var(--surface-2); margin-bottom: 8px; font-size: .84rem; }
.mock-row .grow { flex: 1; }
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-dark { background: var(--navy-900); color: #DCE4F2; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 1.8vw + 1rem, 2.4rem); letter-spacing: -.03em; }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.section-dark .section-head p { color: #A9B6CC; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; transition: border-color .15s, transform .15s, box-shadow .15s; color: inherit; text-decoration: none !important; display: block; }
a.feature:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.feature .f-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature h3 { font-size: 1.02rem; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.check-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li { display: flex; gap: 10px; padding: 5px 0; align-items: flex-start; }
.check-list li .icon { color: var(--success); margin-top: 3px; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; counter-reset: flow; }
.flow-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font-size: .88rem; position: relative; }
.flow-step::before { counter-increment: flow; content: counter(flow); display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: .74rem; font-weight: 700; align-items: center; justify-content: center; margin-bottom: 8px; }
.cta-band { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; border-radius: var(--radius-xl); padding: 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { color: #B8C4D8; margin: 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px; display: flex; flex-direction: column; position: relative; }
.price-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg); }
.price-card .ribbon { position: absolute; top: -12px; left: 26px; background: var(--primary); color: var(--primary-ink); font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.price { font-size: 2.2rem; font-weight: 750; letter-spacing: -.03em; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
.price small { font-size: .9rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.price-card .check-list { margin: 16px 0 22px; font-size: .9rem; flex: 1; }
.compare-table td, .compare-table th { text-align: center; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; }
.site-footer { background: var(--navy-950); color: #9DAAC2; padding: 56px 0 28px; font-size: .9rem; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.site-footer a { color: #B8C4D8; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.prose { max-width: 760px; font-size: 1.02rem; color: var(--text-2); }
.prose h2 { margin-top: 1.8em; font-size: 1.4rem; } .prose h3 { margin-top: 1.5em; } .prose h4 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin-bottom: .35em; }
.prose img { border-radius: var(--radius); }
.prose table { font-size: .9rem; }
.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 16px; color: var(--text-2); }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } }
.tool-output { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.result-big { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.upsell { background: linear-gradient(160deg, var(--primary-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border)); border-radius: var(--radius-lg); padding: 20px; }
.upsell h3 { font-size: 1rem; }
.upsell p { color: var(--text-2); font-size: .9rem; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .moon { display: none; } }

/* ---------- document preview (quotations, invoices) ---------- */
.doc-paper { background: #fff; color: #101828; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto; }
.doc-paper table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.doc-paper th { text-align: left; background: #F2F4F7; padding: 8px; font-size: .76rem; text-transform: uppercase; color: #475467; }
.doc-paper td { padding: 8px; border-bottom: 1px solid #EAECF0; }
.doc-paper .num { text-align: right; }

/* ---------- labels ---------- */
.layout-split-wide { grid-template-columns: minmax(0, 1fr) 380px; }
.label-preview { background: var(--surface-3); border-radius: var(--radius); padding: 16px; overflow: auto; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.label-preview .lp-box { position: relative; background: #fff; box-shadow: var(--shadow); flex: none; }
.label-preview .lp-inner { position: absolute; left: 0; top: 0; transform-origin: top left; }
.label-preview .lb { position: relative !important; overflow: hidden; }
.label-geom { background: var(--surface-3); border-radius: var(--radius); padding: 12px; }
.label-geom svg { display: block; width: 100%; height: auto; max-height: 420px; }
.label-geom .pg { fill: #fff; stroke: var(--border-strong, #98A2B3); }
.label-geom .cell { fill: var(--primary-soft, #E8EFFD); stroke: var(--primary); stroke-width: .3; }

/* ---------- scanner ---------- */
.scanner-box { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; max-width: 560px; }
.scanner-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-box .reticle { position: absolute; inset: 22% 12%; border: 2px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.scan-log { max-height: 320px; overflow-y: auto; }
.scan-flash { animation: flash .5s; }
@keyframes flash { from { background: var(--success-soft); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .sidebar, .topbar, .site-header, .site-footer, .no-print, .toasts, .banner, .page-header .btn-group, .tabs, .toolbar { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  .doc-paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .print-only { display: block; }
  a { color: #000; }
}

/* ---------- public forms ---------- */
body.public-form.is-embed { background: transparent; }
body.public-form.is-embed .card { box-shadow: none; }
.field-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.field-row .grip { color: var(--faint); padding-top: 6px; cursor: grab; }
.field-row .field-row-actions { display: flex; flex-direction: column; gap: 4px; }
.field-row details summary { cursor: pointer; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.field-row.is-heading { background: var(--surface-2); }
.embed-code { font-family: var(--mono); font-size: .8rem; width: 100%; min-height: 92px; }
.qr-box { display: inline-block; background: #fff; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); }
.qr-box svg { display: block; width: 200px; height: 200px; }

/* ---------- documents ---------- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.folder-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none !important; font-weight: 550; font-size: .9rem; }
.folder-tile:hover { border-color: var(--primary); }
.folder-tile > .icon:first-child { color: var(--chart-3); }
.icon.icon-xs { width: 12px; height: 12px; vertical-align: -1px; }
.toolbar input[type=date], .toolbar input[type=time], .toolbar input[type=number] { width: auto; }
.toolbar input[type=search] { flex: 1 1 220px; max-width: 360px; width: auto; }
.check-grid.list-plain li { border-bottom: 0; padding: 4px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .9rem; color: var(--text); }
@media (min-width: 901px) { .hide-tablet-up { display: none !important; } }

/* Generic selectable link list (template pickers etc.) */
.link-list { display: flex; flex-direction: column; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .9rem; }
.link-list a:last-child { border-bottom: 0; }
.link-list a:hover { background: var(--surface-2, rgba(0,0,0,.03)); }
.link-list a.active { background: var(--primary-soft, rgba(37,99,235,.08)); box-shadow: inset 3px 0 0 var(--primary); }
.qr-preview { max-width: 240px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.inline-form { display: inline; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-on-dark { --btn-bg: rgba(255,255,255,.08); --btn-border: rgba(255,255,255,.22); color: #fff; }
.btn-on-dark:hover { background: rgba(255,255,255,.16); color: #fff; }
.section-dark .flow-step { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #E6ECF8; }
.page-hero { padding: 56px 0 32px; }
.page-hero h1 { font-size: clamp(1.8rem, 2.6vw + .8rem, 2.8rem); letter-spacing: -.03em; max-width: 860px; }
.page-hero .lead { font-size: 1.12rem; color: var(--text-2); max-width: 720px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.pain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pain-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.pain-list li .icon { color: var(--danger, #D92D20); margin-top: 3px; flex: none; }
.status-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--success); }
.status-dot.bad { background: var(--warning); }
.tool-cat { margin-top: 36px; }
.tool-cat h2 { font-size: 1.15rem; margin-bottom: 14px; }
.btn-whatsapp { --btn-bg: #1FA855; --btn-border: #1FA855; color: #fff; }
.btn-whatsapp:hover { background: #178C46; border-color: #178C46; color: #fff; }

/* ---------------------------------------------------------------- free tools */
.tool .tabs-pill { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 10px; border: 0; }
.tool .tabs-pill label { padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .88rem; font-weight: 550; color: var(--text-2); }
.tool .tabs-pill label input { position: absolute; opacity: 0; pointer-events: none; }
.tool .tabs-pill label.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08)); }
.tool .tabs-pill label:focus-within { outline: 2px solid var(--focus); }
.tool-result { margin-top: 16px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.result { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.result span { font-size: .8rem; color: var(--muted); }
.result strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.result small { font-size: .74rem; color: var(--muted); }
.result-main { background: var(--primary-soft); border-color: transparent; }
.result-main strong { color: var(--primary); font-size: 1.35rem; }
.doc-items input { min-width: 64px; }
.doc-items input.num { text-align: right; max-width: 110px; }
.barcode-out svg { max-width: 100%; height: auto; }
.qr-out svg { max-width: 100%; height: auto; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; padding: 3px 0; }
.hbar-row .hbar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; display: block; }
.hbar-row .hbar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.planner-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .planner-grid { grid-template-columns: minmax(0, 1fr); } }
.planner-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 120px; }
.planner-col h3 { font-size: .9rem; margin-bottom: 10px; }
.planner-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.planner-card.prio-high { border-left-color: var(--danger); } .planner-card.prio-medium { border-left-color: var(--warning); }
.planner-card p { margin: 0 0 6px; font-size: .9rem; overflow-wrap: anywhere; }
.planner-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.planner-actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 4px; }

/* Printable documents (white paper look in both themes) */
.doc-preview { overflow-x: auto; }
.doc { background: #fff; color: #1d2433; border: 1px solid var(--border); border-radius: 6px; padding: 32px; font-size: 13px; line-height: 1.5; min-width: 560px; max-width: 820px; }
.doc h2 { font-size: 22px; margin: 0 0 8px; color: #1d2433; text-transform: uppercase; letter-spacing: .04em; }
.doc h3 { font-size: 16px; margin: 18px 0 6px; color: #1d2433; }
.doc h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #667085; margin: 0 0 4px; }
.doc p { margin: 0 0 6px; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #1d2433; padding-bottom: 14px; margin-bottom: 16px; }
.doc-head h3 { margin-top: 0; }
.doc-logo { max-height: 56px; max-width: 180px; display: block; margin-bottom: 6px; }
.doc-title { text-align: right; }
.doc-title table td { padding: 1px 0 1px 12px; font-size: 12px; } .doc-title table td:first-child { color: #667085; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 14px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.doc-table th { background: #f2f4f7; color: #1d2433; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 7px 8px; border: 0; }
.doc-table td { padding: 7px 8px; border-bottom: 1px solid #e4e7ec; vertical-align: top; color: #1d2433; }
.doc-table .num, .doc-totals .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-bottom { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.doc-words { flex: 1; font-size: 12px; padding-top: 6px; }
.doc-totals { border-collapse: collapse; min-width: 260px; margin-left: auto; }
.doc-totals td { padding: 4px 8px; color: #1d2433; }
.doc-grand td { font-weight: 700; font-size: 15px; border-top: 2px solid #1d2433; padding-top: 8px; }
.doc-note { margin-top: 14px; }
.doc-sign { margin-top: 36px; text-align: right; }
.doc-sign-line { border-bottom: 1px solid #1d2433; width: 200px; height: 40px; margin-left: auto; }
.doc-sign-two { display: flex; justify-content: space-between; text-align: left; } .doc-sign-two .doc-sign-line { margin-left: 0; }
.doc-credit { margin-top: 24px; font-size: 10px; color: #98a2b3; text-align: center; }
.doc-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: #667085; }
.doc-cover { border-bottom: 2px solid #1d2433; padding-bottom: 16px; margin-bottom: 8px; }
.doc-cover h2 { text-transform: none; letter-spacing: -.01em; font-size: 26px; }
.doc-proposal ul { padding-left: 18px; margin: 0 0 8px; }
.doc-form .form-q { margin: 10px 0 14px; }
.doc-form .form-line { border-bottom: 1px solid #98a2b3; height: 22px; }
@media (max-width: 640px) { .doc { padding: 18px; } .doc-parties { grid-template-columns: 1fr; } }

/* Label sheets */
.label-preview { overflow: auto; background: var(--surface-3); border-radius: 10px; padding: 16px; max-height: 80vh; }
.sheet { background: #fff; position: relative; overflow: hidden; margin: 0 auto 16px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.sheet-a4 { width: 210mm; height: 297mm; }
.lbl { position: absolute; box-sizing: border-box; padding: .8mm 1.5mm; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; color: #000; font-family: Arial, Helvetica, sans-serif; text-align: center; line-height: 1.12; }
.lbl-outline { outline: .2mm dashed #98a2b3; outline-offset: -.1mm; }
.lbl-brand { font-size: 2mm; text-transform: uppercase; letter-spacing: .03em; color: #333; }
.lbl-name { font-size: 2.6mm; font-weight: 700; max-height: 6.2mm; overflow: hidden; }
.lbl-code { font-size: 2.2mm; font-family: 'Courier New', monospace; }
.lbl-price { font-size: 3mm; font-weight: 700; }
.lbl-bar { width: 100%; margin: .4mm 0; }
.lbl-bar svg { width: 100%; height: 100%; display: block; }
.lbl-qr svg { width: 100%; height: 100%; display: block; }
.lbl-err { font-size: 2mm; color: #b42318; }
.lbl-big { font-weight: 800; line-height: 1.05; }
.lbl-note { font-size: 2mm; color: #333; }
.lbl-asset { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6mm; }
.lbl-asset.lbl-row { flex-direction: row; gap: 2mm; }
.lbl-asset-text { display: flex; flex-direction: column; gap: .4mm; min-width: 0; }
.lbl-tag { font-size: 3.6mm; font-weight: 800; font-family: 'Courier New', monospace; }

/* Print mode used by the tools: only #print-sheet is printed */
@media print {
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing { background: #fff !important; }
  #print-sheet { display: block !important; }
  #print-sheet .doc { border: 0; padding: 0; max-width: none; min-width: 0; }
  #print-sheet .sheet { box-shadow: none; margin: 0; page-break-after: always; break-after: page; }
  #print-sheet .sheet:last-child { page-break-after: auto; break-after: auto; }
  #print-sheet .lbl-outline { outline: none; }
}
#print-sheet { display: none; }
.hbar-row .hbar { margin: 0; }
@media print { #print-sheet .sheet-a4 { height: 296mm; } }
@media (max-width: 520px) {
  .site-nav { gap: 10px; }
  .site-actions { gap: 4px; }
  .site-actions .btn-primary { padding: 7px 11px; font-size: .86rem; min-height: 36px; }
  .site-brand small { display: none; }
}
@media (max-width: 520px) { .hide-xs { display: none; } }
@media print {
  #print-sheet.label-preview, #print-sheet.doc-preview { padding: 0 !important; margin: 0 !important; background: none !important; max-height: none !important; overflow: visible !important; border-radius: 0 !important; }
}
.lbl-bar { flex: 1 1 0; min-height: 4mm; }
.lbl-small .lbl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lbl > * { flex-shrink: 0; }
.lbl > .lbl-bar { flex-shrink: 1; }
.toc ol { margin: 6px 0 0; padding-left: 1.2em; } .toc { margin-bottom: 20px; }
