:root {
    --ink-950: #07111f;
    --ink-900: #0c1728;
    --ink-800: #172338;
    --ink-700: #2f3b50;
    --ink-600: #4d596c;
    --ink-500: #697487;
    --ink-400: #8d96a6;
    --line: #dfe5ec;
    --line-soft: #e9edf2;
    --surface: #ffffff;
    --canvas: #f5f7fa;
    --cyan: #0e9ea5;
    --cyan-dark: #08757b;
    --cyan-soft: #e3f6f6;
    --violet: #7257c7;
    --violet-soft: #f0edfb;
    --green: #16865f;
    --green-soft: #e7f5ef;
    --red: #c33f50;
    --red-soft: #fbeaec;
    --amber: #a66a12;
    --amber-soft: #fbf1de;
    --blue: #3476b9;
    --blue-soft: #e8f1fa;
    --shadow: 0 10px 30px rgba(7, 17, 31, 0.07);
    --sidebar: 260px;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink-800); background: var(--canvas); font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
svg { width: 19px; height: 19px; flex: 0 0 auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { color: var(--ink-950); }
.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; }
.hp-field { position: absolute !important; inset-inline-start: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.brand { display: inline-flex; direction: ltr; align-items: baseline; font-size: 25px; font-weight: 750; line-height: 1; }
.brand span { color: inherit; }
.brand strong { color: #31c5c8; font-weight: 800; }
.brand-on-dark { color: #f8fbff; }

.auth-layout { display: grid; grid-template-columns: minmax(370px, 44%) 1fr; min-height: 100vh; background: var(--surface); }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-height: 100vh; padding: 42px clamp(34px, 5vw, 74px); color: #c4ccda; background: var(--ink-950); }
.auth-brand::after { content: ""; position: absolute; inset-inline-end: -10%; bottom: 10%; width: 55%; height: 1px; background: #2b405a; transform: rotate(-24deg); transform-origin: center; box-shadow: 0 42px 0 #22344b, 0 84px 0 #192a40; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-brand-copy .eyebrow { color: #55d4d2; }
.auth-brand-copy h1 { max-width: 440px; margin: 12px 0 18px; color: #fff; font-size: 42px; line-height: 1.2; }
.auth-brand-copy > p { max-width: 470px; margin-bottom: 34px; color: #aab5c6; font-size: 17px; line-height: 1.9; }
.auth-feature { display: flex; gap: 12px; align-items: center; margin-top: 15px; color: #d9e0ea; }
.auth-feature svg { color: #31c5c8; }
.site-link { position: relative; z-index: 1; display: inline-flex; gap: 8px; align-items: center; width: fit-content; color: #aab5c6; }
.site-link:hover { color: #fff; }
.auth-content { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 80px clamp(24px, 6vw, 90px) 50px; background: #fff; }
.auth-topline { position: absolute; top: 28px; inset-inline-end: 34px; }
.language-link { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-600); font-weight: 650; }
.auth-card { width: min(100%, 450px); }
.auth-card-wide { width: min(100%, 720px); }
.auth-mobile-brand { display: none; direction: ltr; }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2 { margin-bottom: 8px; font-size: 30px; line-height: 1.25; }
.auth-heading p { margin-bottom: 0; color: var(--ink-500); font-size: 15px; }
.auth-switch { margin: 25px 0 0; color: var(--ink-500); text-align: center; }
.auth-switch a, .form-between a { color: var(--cyan-dark); font-weight: 700; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar); height: 100vh; overflow-y: auto; color: #b7c1d0; background: var(--ink-950); }
.sidebar-head { display: flex; flex-direction: column; gap: 10px; min-height: 106px; padding: 28px 24px 22px; border-bottom: 1px solid #1c2a3d; }
.portal-label { color: #748198; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.primary-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; }
.nav-link { position: relative; display: flex; gap: 13px; align-items: center; width: 100%; min-height: 43px; padding: 9px 13px; color: #aab5c6; border: 0; border-radius: 6px; background: transparent; font-weight: 600; text-align: start; }
.nav-link:hover { color: #fff; background: #101f32; }
.nav-link.active { color: #fff; background: #14283c; }
.nav-link.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #31c5c8; }
.nav-link svg { width: 18px; }
.nav-count { min-width: 22px; margin-inline-start: auto; padding: 1px 6px; color: #fff; border-radius: 10px; background: var(--red); font-size: 10px; text-align: center; }
.sidebar-foot { padding: 14px 12px 22px; border-top: 1px solid #1c2a3d; }
.nav-button { cursor: pointer; font-family: inherit; }
.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.97); }
.topbar-title { color: var(--ink-600); font-weight: 700; }
.topbar-actions, .header-actions, .inline-actions { display: flex; gap: 9px; align-items: center; }
.user-chip { display: flex; gap: 10px; align-items: center; margin-inline-start: 6px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; border-radius: 50%; background: var(--ink-800); font-weight: 800; }
.user-chip-copy { display: flex; flex-direction: column; max-width: 220px; line-height: 1.25; }
.user-chip-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-copy small { overflow: hidden; color: var(--ink-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; color: var(--ink-600); border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.icon-button:hover { color: var(--ink-950); border-color: #c7d0dc; background: #f7f9fb; }
.has-indicator b { position: absolute; top: -5px; inset-inline-end: -5px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; color: #fff; border: 2px solid #fff; border-radius: 10px; background: var(--red); font-size: 9px; }
.mobile-menu, .sidebar-backdrop { display: none; }
.page-content { width: min(100%, 1540px); margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 55px; }

.page-header { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { margin: 3px 0 4px; font-size: 27px; line-height: 1.3; }
.page-header p { max-width: 720px; margin-bottom: 0; color: var(--ink-500); font-size: 14px; }
.eyebrow { color: var(--cyan-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.header-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--ink-500); }

.button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 6px; font-weight: 750; line-height: 1.25; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-primary { color: #fff; border-color: var(--ink-950); background: var(--ink-950); }
.button-primary:hover { background: var(--ink-800); }
.button-secondary { color: var(--ink-800); border-color: var(--line); background: #fff; }
.button-secondary:hover, .button-ghost:hover { border-color: #bec8d5; background: #f8fafc; }
.button-ghost { color: var(--ink-600); border-color: transparent; background: transparent; }
.button-danger { color: #fff; background: var(--red); }
.button-danger-ghost { color: var(--red); border-color: #ebc3ca; background: #fff; }
.button-wide { width: 100%; }
.text-link { display: inline-flex; gap: 5px; align-items: center; color: var(--cyan-dark); font-weight: 700; }
.text-link svg { width: 15px; height: 15px; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgba(7, 17, 31, 0.025); }
.panel-head { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head p { margin: 3px 0 0; color: var(--ink-500); font-size: 12px; }
.table-panel { overflow: hidden; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); text-align: start; vertical-align: middle; white-space: nowrap; }
th { color: var(--ink-500); background: #f9fafc; font-size: 11px; font-weight: 800; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
.table-title { color: var(--ink-950); font-weight: 750; }
a.table-title:hover { color: var(--cyan-dark); }
.table-subtitle { display: block; max-width: 250px; overflow: hidden; margin-top: 2px; color: var(--ink-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.table-action { width: 32px; height: 32px; }

.badge { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.badge-success { color: #096342; background: var(--green-soft); }
.badge-danger { color: #a8293b; background: var(--red-soft); }
.badge-warning { color: #865408; background: var(--amber-soft); }
.badge-neutral { color: var(--ink-600); background: #edf0f4; }

.metrics-grid { display: grid; gap: 14px; margin-bottom: 24px; }
.metrics-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metrics-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric-card { display: flex; gap: 13px; align-items: flex-start; min-height: 116px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.metric-card:hover { border-color: #bdc9d6; box-shadow: var(--shadow); }
.metric-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 6px; }
.metric-icon.cyan { color: var(--cyan-dark); background: var(--cyan-soft); }
.metric-icon.violet { color: var(--violet); background: var(--violet-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-copy { display: flex; flex-direction: column; min-width: 0; }
.metric-copy small { color: var(--ink-500); font-size: 11px; font-weight: 700; }
.metric-copy strong { margin-top: 4px; font-size: 25px; line-height: 1.2; }
.metric-copy .money-value { font-size: 17px; margin-top: 8px; }
.metric-copy em { margin-top: 4px; overflow: hidden; color: var(--ink-500); font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.content-grid { display: grid; gap: 20px; align-items: start; }
.content-grid.two-one { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr); }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 66px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border-bottom: 0; }
a.activity-row:hover { background: #fafcfd; }
.activity-icon { display: grid; place-items: center; width: 33px; height: 33px; color: var(--cyan-dark); border-radius: 6px; background: var(--cyan-soft); }
.activity-icon svg { width: 16px; }
.activity-row > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.activity-row strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.activity-row small { color: var(--ink-500); font-size: 11px; }

.alert { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px; border: 1px solid; border-radius: 6px; font-weight: 600; }
.alert-success { color: #075f40; border-color: #b9e2d1; background: var(--green-soft); }
.alert-error { color: #96273a; border-color: #edc1c8; background: var(--red-soft); }
.alert-warning { color: #815109; border-color: #ead5aa; background: var(--amber-soft); }
.auth-content > .alert { position: absolute; top: 78px; width: min(calc(100% - 48px), 720px); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 210px; padding: 28px; color: var(--ink-500); text-align: center; }
.empty-state svg { width: 32px; height: 32px; margin-bottom: 10px; color: var(--ink-400); }
.empty-state p { margin-bottom: 12px; }
.empty-state.small { min-height: 110px; }

.form-panel { padding: 23px; }
.compact-form { padding: 0 20px 20px; }
.compact-form .panel-head { margin: 0 -20px 18px; }
.narrow-panel { max-width: 680px; }
.form-stack { display: flex; flex-direction: column; gap: 17px; }
.form-grid { display: grid; gap: 19px; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.tight { gap: 13px; }
.full-span { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { color: var(--ink-700); font-size: 12px; font-weight: 750; }
.field small { color: var(--ink-500); font-size: 10px; }
input, textarea, select { width: 100%; color: var(--ink-900); border: 1px solid #ccd4df; border-radius: 5px; outline: 0; background: #fff; }
input, select { min-height: 42px; padding: 8px 11px; }
textarea { min-height: 90px; padding: 10px 11px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(14, 158, 165, 0.12); }
input:disabled { color: var(--ink-500); background: #f1f3f6; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-inline-end: 44px; }
.field-icon { position: absolute; top: 2px; bottom: 2px; inset-inline-end: 2px; display: grid; place-items: center; width: 40px; color: var(--ink-500); border: 0; background: transparent; }
.form-between { display: flex; justify-content: flex-end; margin-top: -5px; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.form-action-cell { display: flex; align-items: flex-end; }
.toggle-field { display: flex; gap: 10px; align-items: center; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; }
.toggle-field input { width: 18px; min-height: 18px; accent-color: var(--cyan-dark); }
.form-section-title { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; padding: 15px 0 5px; border-top: 1px solid var(--line-soft); }
.form-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section-title svg { color: var(--cyan-dark); }
.form-section-title h2 { margin: 0; font-size: 16px; }
.form-section-title p { margin: 2px 0 0; color: var(--ink-500); font-size: 11px; }
.filter-bar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 15px; }
.filter-bar label { display: flex; gap: 7px; align-items: center; color: var(--ink-500); font-size: 11px; font-weight: 700; }
.filter-bar select { width: 190px; min-height: 38px; }
.search-input { position: relative; display: block; }
.search-input svg { position: absolute; top: 10px; inset-inline-start: 10px; width: 17px; color: var(--ink-400); }
.search-input input { width: min(340px, 70vw); padding-inline-start: 36px; }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-card { display: grid; grid-template-rows: auto 1fr auto; min-height: 245px; padding: 22px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.service-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; color: var(--cyan-dark); border-radius: 6px; background: var(--cyan-soft); }
.service-card h2 { margin-bottom: 8px; font-size: 17px; }
.service-card p { color: var(--ink-500); line-height: 1.8; }
.service-card .button { margin-top: 16px; }
.service-admin-list { display: flex; flex-direction: column; gap: 10px; }
.service-admin-row { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 15px 17px; }
.service-admin-row .service-icon { margin: 0; }
.service-admin-actions { display: flex; gap: 7px; align-items: center; }
.service-admin-actions form { margin: 0; }
.service-admin-copy h2 { margin: 0; font-size: 15px; }
.service-admin-copy h2 small { margin-inline-start: 8px; color: var(--ink-500); font-size: 11px; font-weight: 600; }
.service-admin-copy p { margin: 3px 0 0; overflow: hidden; color: var(--ink-500); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.7fr); gap: 20px; align-items: start; }
.main-stack, .side-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.detail-panel { padding-bottom: 23px; }
.detail-list { display: grid; gap: 0; margin: 0; padding: 6px 21px 10px; }
.detail-list.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-list > div { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.detail-list.two-column > div { padding-inline-end: 20px; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--ink-500); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.detail-list dd { margin: 2px 0 0; color: var(--ink-900); font-weight: 650; }
.detail-list.compact { padding: 6px 0; }
.detail-list.compact > div { display: flex; justify-content: space-between; }
.long-copy { padding: 5px 21px; color: var(--ink-700); font-size: 14px; line-height: 1.9; white-space: normal; }
.note-box, .bank-box { margin: 17px 21px 0; padding: 14px; border-inline-start: 3px solid var(--amber); border-radius: 4px; background: var(--amber-soft); }
.note-box p, .bank-box p { margin: 5px 0 0; color: var(--ink-700); }
.quote-card { padding: 19px; }
.quote-card .panel-head { margin: -19px -19px 18px; }
.quote-card .panel-head small { color: var(--ink-500); }
.quote-total { display: flex; flex-direction: column; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.quote-total small, .quote-total span { color: var(--ink-500); font-size: 11px; }
.quote-total strong { margin: 3px 0; font-size: 26px; }
.quote-description { color: var(--ink-600); line-height: 1.8; }
.quote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }

.invoice-summary { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.invoice-main { padding: 25px; }
.invoice-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-bottom: 30px; }
.invoice-parties small { color: var(--ink-500); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.invoice-parties h2 { margin: 5px 0 6px; font-size: 17px; }
.invoice-parties p { margin: 0; overflow-wrap: anywhere; color: var(--ink-500); line-height: 1.8; }
.invoice-items { border: 1px solid var(--line); border-radius: 5px; }
.invoice-items table { min-width: 680px; }
.invoice-items th:first-child, .invoice-items td:first-child { min-width: 250px; white-space: normal; line-height: 1.55; }
.invoice-lower { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; margin-top: 25px; }
.invoice-note { margin-bottom: 18px; }
.invoice-note strong { font-size: 12px; }
.invoice-note p { margin: 5px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.8; }
.totals-list { margin: 0; }
.totals-list > div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.totals-list dt { color: var(--ink-500); }
.totals-list dd { margin: 0; color: var(--ink-900); font-weight: 700; }
.totals-list .grand-total { padding-top: 13px; font-size: 16px; }
.totals-list .balance-total { margin-top: 5px; padding: 12px; color: #fff; border: 0; border-radius: 5px; background: var(--ink-950); }
.totals-list .balance-total dt, .totals-list .balance-total dd { color: #fff; }
.invoice-aside { display: flex; flex-direction: column; gap: 18px; }
.due-panel { display: flex; flex-direction: column; padding: 20px; }
.due-panel span { color: var(--ink-500); font-size: 11px; }
.due-panel strong { margin: 3px 0; font-size: 22px; }
.due-panel small { color: var(--ink-500); }
.bank-box { margin: 0 0 16px; border-inline-start-color: var(--cyan); background: var(--cyan-soft); }
.payments-panel { margin-top: 20px; overflow: hidden; }
.danger-text { color: var(--red); }
.danger-zone { margin-top: 20px; padding: 16px 19px; border: 1px solid #ebc3ca; border-radius: 7px; background: #fff; }
.danger-zone summary { display: flex; gap: 9px; align-items: center; color: var(--red); cursor: pointer; font-weight: 800; }
.danger-zone form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px; align-items: end; margin-top: 16px; }
.success-button { color: var(--green); border-color: #b9e2d1; }
.danger-button { color: var(--red); border-color: #edc1c8; }
.inline-select-form { display: flex; gap: 6px; align-items: center; }
.inline-select-form select { width: 130px; min-height: 34px; }

.notification-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 13px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); }
.notification-row:last-child { border-bottom: 0; }
.notification-row.unread { background: #f5fbfb; }
.notification-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--cyan-dark); border-radius: 6px; background: var(--cyan-soft); }
.notification-copy { display: flex; flex-direction: column; }
.notification-copy span { color: var(--ink-600); }
.notification-copy small { margin-top: 3px; color: var(--ink-400); }
.json-preview { display: block; max-width: 360px; overflow: hidden; color: var(--ink-600); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 62vh; text-align: center; }
.error-page > span { color: var(--cyan); font-size: 72px; font-weight: 850; line-height: 1; }
.error-page h1 { margin: 12px 0 8px; font-size: 28px; }
.error-page p { max-width: 520px; color: var(--ink-500); }

.modal { width: min(720px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 7px; box-shadow: 0 30px 80px rgba(7, 17, 31, 0.25); }
.modal::backdrop { background: rgba(7, 17, 31, 0.62); }
.modal-card { padding: 22px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.modal-head h2 { margin: 2px 0 0; font-size: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line-soft); }

.print-body { background: #e9edf2; }
.print-toolbar { display: flex; justify-content: center; padding: 18px; }
.print-sheet { width: 210mm; min-height: 297mm; margin: 0 auto 30px; padding: 18mm; background: #fff; box-shadow: 0 8px 30px rgba(7, 17, 31, 0.12); }
.print-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 20px; border-bottom: 2px solid var(--ink-950); }
.print-brand { display: flex; direction: ltr; flex-wrap: wrap; align-items: baseline; font-size: 28px; font-weight: 800; }
.print-brand strong { color: var(--cyan); }
.print-brand small { flex-basis: 100%; margin-top: 6px; color: var(--ink-500); font-size: 10px; font-weight: 600; }
.print-title { text-align: end; }
.print-title span { color: var(--ink-500); font-size: 10px; text-transform: uppercase; }
.print-title h1 { margin: 2px 0 5px; font-size: 23px; }
.print-meta { display: flex; justify-content: flex-end; padding: 18px 0; }
.print-meta dl { display: flex; gap: 28px; margin: 0; }
.print-meta dt { color: var(--ink-500); font-size: 9px; text-transform: uppercase; }
.print-meta dd { margin: 2px 0 0; font-weight: 700; }
.print-parties { padding: 18px; border: 1px solid var(--line); border-radius: 5px; }
.print-lower { grid-template-columns: 1fr 290px; }
.print-footer { display: flex; justify-content: space-between; margin-top: 55px; padding-top: 12px; color: var(--ink-400); border-top: 1px solid var(--line); font-size: 9px; }

@media (max-width: 1280px) {
    .metrics-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-summary { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 980px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; inset-inline-start: 0; transform: translateX(calc((var(--sidebar) + 10px) * -1)); transition: transform 180ms ease; }
    [dir="rtl"] .sidebar { transform: translateX(calc(var(--sidebar) + 10px)); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; border: 0; background: rgba(7, 17, 31, 0.55); }
    .sidebar-open .sidebar-backdrop { display: block; }
    .mobile-menu { display: inline-grid; }
    .topbar-title { display: none; }
    .topbar { padding: 10px 18px; }
    .metrics-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid.two-one, .content-grid.equal, .detail-grid, .invoice-summary { grid-template-columns: 1fr; }
    .invoice-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-aside > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .auth-layout { display: block; }
    .auth-brand { display: none; }
    .auth-content { min-height: 100vh; padding: 85px 22px 42px; }
    .auth-mobile-brand { display: inline-block; margin-bottom: 24px; color: var(--ink-950); font-size: 22px; font-weight: 750; }
    .auth-mobile-brand strong { color: var(--cyan); }
    .auth-heading h2 { font-size: 26px; }
    .page-content { padding: 23px 14px 45px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header .header-actions { width: 100%; flex-wrap: wrap; }
    .page-header .button { flex: 1; }
    .metrics-grid.four, .metrics-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { min-height: 105px; padding: 14px; }
    .service-grid, .form-grid.two-cols, .detail-list.two-column, .invoice-parties, .invoice-lower, .invoice-aside { grid-template-columns: 1fr; }
    .service-admin-row { grid-template-columns: 43px minmax(0, 1fr) auto; }
    .service-admin-row > .badge { display: none; }
    .user-chip-copy { display: none; }
    .topbar-actions { gap: 6px; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar label { align-items: stretch; flex-direction: column; }
    .filter-bar select, .search-input input { width: 100%; }
    .quote-actions { grid-template-columns: 1fr; }
    .invoice-main { padding: 17px; }
    .danger-zone form { grid-template-columns: 1fr; }
    .print-sheet { width: 100%; min-height: 0; margin: 0; padding: 20px; }
}

@media (max-width: 430px) {
    .metrics-grid.four, .metrics-grid.six { grid-template-columns: 1fr; }
    .metric-card { min-height: 92px; }
    .form-panel { padding: 18px; }
    .topbar { padding-inline: 12px; }
    .topbar-actions .icon-button:first-child { display: none; }
}

@media print {
    @page { size: A4; margin: 0; }
    .print-body { background: #fff; }
    .print-toolbar { display: none; }
    .print-sheet { width: 210mm; min-height: 297mm; margin: 0; padding: 14mm 16mm; box-shadow: none; }
    .responsive-table { overflow: visible; }
    th, td { white-space: normal; }
}
