@font-face {
    font-family: "Inter Local";
    src: url("fonts/InterVariable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "Inter Local";
    src: url("fonts/InterVariable-Italic.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: "Inter Local", "Segoe UI", system-ui, sans-serif;
    font-synthesis: none;
    color: var(--ink);
    background: var(--canvas);
    --brand-black: #0d283b;
    --brand-white: #fff;
    --brand-orange: #ed7d27;
    --canvas: var(--brand-white);
    --canvas-glow: #eeedeb;
    --canvas-clear: #fcfcfc;
    --ink: var(--brand-black);
    --muted: #52616a;
    --surface: var(--brand-white);
    --input: var(--brand-white);
    --panel: #f6f6f5;
    --hover: #f2f2f1;
    --glass: rgb(255 255 255 / .82);
    --glass-solid: var(--brand-white);
    --edge: #e1e3e4;
    --input-edge: #c6cbce;
    --shine: rgb(255 255 255 / .97);
    --shadow: 0 8px 20px rgb(13 40 59 / .07), 0 2px 3px rgb(13 40 59 / .045);
    --lift: 0 12px 24px rgb(13 40 59 / .13), 0 2px 4px rgb(13 40 59 / .05);
    --modal-shadow: 0 24px 90px rgb(13 40 59 / .24);
    --scrim: rgb(13 40 59 / .49);
    --accent: var(--brand-black);
    --focus: #52697a;
    --action: var(--brand-black);
    --action-hover: #213e50;
    --action-ink: var(--brand-white);
    --selected: #f3f3f2;
    --selected-border: #d6d8d9;
    --selected-ink: var(--brand-black);
    --hero-end: #19394b;
    --hero-edge: #375365;
    --hero-ink: var(--brand-white);
    --hero-muted: #d5dce0;
    --toast: var(--brand-black);
    --toast-ink: var(--brand-white);
    --signal-bg: #efefee;
    --signal-ink: #394750;
    --ok-bg: #e3f2eb;
    --ok-ink: #215b42;
    --warn-bg: #faf0da;
    --warn-ink: #674308;
    --design-bg: #f0e9fd;
    --design-ink: #62448c;
    --error-bg: #fae9ee;
    --error-ink: #862b42;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at 85% -15%, var(--canvas-glow), transparent 54%), var(--canvas);
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(input:not([type="checkbox"]), select, textarea):focus-visible { outline-offset: 1px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 750; letter-spacing: -.053em; line-height: 1.1; }
h2 { font-size: 1.08rem; font-weight: 720; letter-spacing: -.022em; }
small, .muted { color: var(--muted); }
small { font-size: .77rem; }

.shell { display: grid; grid-template-columns: 266px minmax(0, 1fr); min-height: 100vh; }
.sidebar, .topbar, .kpi, .auth-card {
    background: var(--glass-solid);
    border: 1px solid var(--edge);
    box-shadow: inset 0 1px 0 var(--shine), var(--shadow);
}
@supports (backdrop-filter: blur(1px)) {
    .sidebar, .topbar, .kpi, .auth-card {
        background: var(--glass);
        backdrop-filter: blur(16px) saturate(135%);
    }
}
.sidebar {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 32px);
    margin: 16px 0 16px 16px;
    padding: 17px 10px 11px;
    border-radius: 20px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.sidebar .brand { margin: 0 6px 20px; }
.brand-copy { display: grid; gap: 1px; font-size: .83rem; font-weight: 740; line-height: 1.18; letter-spacing: -.021em; }
.brand-copy > span { display: block; }
.brand-copy > span::first-letter { color: var(--brand-orange); }
.brand-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 45px;
    height: 45px;
    padding: 4px;
    overflow: hidden;
    background: var(--brand-white);
    border: 1px solid var(--edge);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgb(13 40 59 / .12);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.sidebar nav { flex: 1; min-height: 0; overflow: auto; padding: 1px 3px 4px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.sidebar [data-route] { -webkit-touch-callout: none; user-select: none; }
.section-context-menu {
    position: fixed;
    z-index: 11;
    width: min(294px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--edge);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--lift);
    overscroll-behavior: contain;
}
.section-context-menu .context-title { padding: 6px 8px; font-size: .87rem; font-weight: 700; overflow-wrap: anywhere; }
.section-context-menu [role="group"] { padding: 4px 0; border-top: 1px solid var(--edge); }
.section-context-menu .context-group-label { padding: 3px 8px; color: var(--muted); font-size: .7rem; font-weight: 650; }
.section-context-menu [role="menuitem"] {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font-size: .8rem;
}
.section-context-menu [role="menuitem"]:is(:hover, :focus-visible) { background: var(--hover); }
.section-context-menu [role="menuitem"]:focus-visible { outline-offset: -2px; }
@media (pointer: coarse) {
    .section-context-menu [role="menuitem"] { min-height: 42px; }
}
.nav-group { margin: 0 0 14px; }
.nav-label { margin: 0 9px 5px; text-transform: uppercase; font-size: .62rem; font-weight: 720; letter-spacing: .11em; color: var(--muted); }
.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--ink);
    font-size: .81rem;
    line-height: 1.2;
    text-decoration: none;
}
.nav-link:hover { background: var(--hover); }
.nav-link[aria-current="page"] {
    background: var(--selected);
    border-color: var(--selected-border);
    color: var(--selected-ink);
    font-weight: 700;
    box-shadow: inset 0 1px 0 var(--shine);
}
.nav-count {
    display: grid;
    place-items: center;
    min-width: 22px;
    margin-inline-start: auto;
    padding: 3px 6px;
    border-radius: 999px;
    background: #b22940;
    color: #fff;
    font-size: .68rem;
    font-weight: 730;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.account { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--edge); padding: 11px 3px 0; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 10px; color: var(--selected-ink); background: var(--selected); font-size: .76rem; font-weight: 760; }
.account-name { flex: 1; min-width: 0; }
.account-name strong, .account-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-name strong { font-size: .77rem; }
.account-name small { margin-top: 3px; font-size: .71rem; }
.icon-button { display: grid; place-items: center; min-width: 36px; min-height: 36px; padding: 0; border: 1px solid var(--edge); border-radius: 9px; color: var(--brand-orange); background: var(--brand-black); font-size: 1.32rem; }
.icon-button:hover { border-color: var(--brand-orange); }

.workspace { min-width: 0; --inset: clamp(18px, 2.2vw, 34px); }
/* Keep sticky table controls in the workspace layer, below the search header. */
.workspace-content { isolation: isolate; }
.topbar {
    position: sticky;
    z-index: 2;
    top: 12px;
    margin: 16px var(--inset) 0;
    border-radius: 14px;
}
.erp-search { position: relative; }
.erp-search > input[type="search"] { width: 100%; min-height: 49px; padding: 8px 46px 8px 43px; border: 0; border-radius: 14px; background: var(--surface); }
.erp-search-spinner { position: absolute; inset: 50% 15px auto auto; transform: translateY(-50%); pointer-events: none; }
.erp-search-popup {
    position: absolute;
    z-index: 1;
    inset: calc(100% + 7px) 0 auto;
    max-height: min(62dvh, 490px);
    overflow: auto;
    padding: 5px;
    border: 1px solid var(--input-edge);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--lift);
}
#erp-search-status, .erp-search-group > p { padding: 8px 10px; color: var(--muted); font-size: .74rem; }
#erp-search-status.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.erp-search-group + .erp-search-group { margin-top: 4px; border-top: 1px solid var(--edge); }
.erp-search-group > p { font-weight: 680; }
.erp-search-option { display: grid; gap: 2px; padding: 7px 10px; border-radius: 7px; cursor: pointer; overflow-wrap: anywhere; }
.erp-search-option:hover, .erp-search-option[aria-selected="true"] { background: var(--hover); }
.erp-search-option strong { font-size: .82rem; font-weight: 650; }
.erp-search-option small { color: var(--muted); font-size: .71rem; }
select option { background: var(--surface); color: var(--ink); }
.mobile-nav { display: none; }

main { max-width: 1580px; margin: auto; padding: 24px var(--inset) 44px; }
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.heading p { margin-top: 8px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.hero {
    --focus: #d5e2e9;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 178px;
    overflow: hidden;
    margin-bottom: 17px;
    padding: 26px 28px;
    border: 1px solid var(--hero-edge);
    border-radius: 19px;
    background: linear-gradient(110deg, var(--brand-black) 24%, var(--hero-end));
    color: var(--hero-ink);
    box-shadow: inset 0 1px 0 var(--shine), var(--shadow);
}
.hero-copy { max-width: 580px; }
.hero-copy p { margin-top: 10px; color: var(--hero-muted); line-height: 1.5; font-size: .88rem; }
.energy-arcs {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    width: min(48%, 445px);
    height: 100%;
    inset: 0 0 0 auto;
    overflow: hidden;
    background: radial-gradient(ellipse at 80% 55%, color-mix(in srgb, var(--brand-orange) 12%, transparent), transparent 66%);
    mask-image: linear-gradient(to right, transparent, black 36%);
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--brand-orange) 45%, transparent));
}
.energy-arcs::before, .energy-arcs::after {
    position: absolute;
    content: "";
    inset: 10% -5% 0 6%;
    background: linear-gradient(80deg, transparent, var(--brand-orange), #ffd2ae, var(--brand-orange));
    clip-path: polygon(0% 82%, 21% 74%, 31% 63%, 41% 66%, 50% 51%, 62% 43%, 71% 27%, 79% 29%, 88% 15%, 100% 6%,
        100% 7%, 88% 16%, 79% 30%, 71% 28%, 62% 44%, 50% 52%, 41% 67%, 31% 64%, 21% 75%, 0% 83%);
    opacity: .61;
}
.energy-arcs::after {
    inset: 0 -3% 1% 17%;
    transform: scaleY(-1) rotate(7deg);
    opacity: .25;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid var(--edge);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-size: .8rem;
    font-weight: 680;
    white-space: nowrap;
    text-decoration: none;
}
.button:hover { background: var(--hover); }
.action-icon { color: var(--brand-orange); }
.primary { background: var(--action); border-color: transparent; color: var(--action-ink); }
.primary:hover { background: var(--action-hover); }
.hero .primary {
    background: var(--brand-white);
    color: var(--brand-black);
    box-shadow: 0 5px 16px rgb(4 15 23 / .35);
}
.hero .primary:hover { background: #e2e7e9; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0 0 19px; }
.kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 128px;
    padding: 15px 17px;
    border-radius: 15px;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.kpi::before { content: ""; position: absolute; top: -1px; right: 16%; left: 16%; height: 1px; background: linear-gradient(90deg, transparent, var(--selected-border), transparent); }
.kpi:hover { transform: translateY(-2px); border-color: var(--selected-border); box-shadow: inset 0 1px 0 var(--shine), var(--lift); }
.kpi-label { color: var(--muted); font-size: .78rem; font-weight: 650; }
.kpi-value { font-size: 2.18rem; line-height: 1.15; font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.065em; }
.kpi small { margin-top: auto; line-height: 1.35; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(225px, 1fr); align-items: start; gap: 14px; }
.card { min-width: 0; border: 1px solid var(--edge); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 16px 17px 13px; }
.card-header a { color: var(--accent); font-size: .77rem; font-weight: 660; white-space: nowrap; }
.stage-list { display: grid; margin: 0; padding: 0 17px 7px; list-style: none; }
.stage-list a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; gap: 10px; border-top: 1px solid var(--edge); text-decoration: none; font-size: .81rem; }
.stage-list a:hover { color: var(--accent); text-decoration: underline; }
.stage-value { font-weight: 710; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: #7d898e; }
.dot.design { background: #9977c7; }
.dot.installation { background: #c08a38; }
.dot.completed { background: #49a67e; }
.dot.cancelled { background: #bd708a; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: .85rem; }
.empty strong { display: block; color: var(--ink); margin-bottom: 5px; }
.empty strong:last-child { margin-bottom: 0; }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--edge); }
.search { width: min(390px, 100%); }
input:not([type="checkbox"]), select, textarea {
    width: 100%;
    min-height: 41px;
    padding: 8px 10px;
    background: var(--input);
    color: var(--ink);
    border: 1px solid var(--input-edge);
    border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { accent-color: var(--action); }
input[type="file"]::file-selector-button { background: var(--selected); color: var(--selected-ink); border: 1px solid var(--selected-border); border-radius: 5px; font: inherit; padding: 4px 8px; margin-inline-end: 8px; cursor: pointer; }
textarea { resize: vertical; min-height: 91px; }
.toolbar select { width: auto; max-width: 45%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .82rem; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--edge); vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; font-weight: 690; background: var(--panel); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
.record-button { text-align: left; padding: 0; background: none; border: 0; color: var(--accent); font-weight: 700; }
.record-button:hover { text-decoration: underline; }
td.text-cell { min-width: 136px; overflow-wrap: anywhere; }
td.status-cell, td.date-cell { white-space: nowrap; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 20px; color: var(--signal-ink); background: var(--signal-bg); font-size: .72rem; font-weight: 670; white-space: nowrap; }
.badge.new, .badge.completed, .badge.converted { color: var(--ok-ink); background: var(--ok-bg); }
.badge.in_review, .badge.installation { color: var(--warn-ink); background: var(--warn-bg); }
.badge.design { color: var(--design-ink); background: var(--design-bg); }
.badge.rejected, .badge.cancelled { color: var(--error-ink); background: var(--error-bg); }
.common-toolbar { flex-wrap: wrap; }
.common-table-actions { margin-inline-start: auto; }
.common-table-body { min-width: 0; }
.table-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--edge); }
.table-chip {
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid var(--selected-border);
    border-radius: 20px;
    color: var(--selected-ink);
    background: var(--selected);
    font-size: .76rem;
    overflow-wrap: anywhere;
}
.table-chip:hover { border-color: var(--brand-orange); }
.table-chips .button { min-height: 30px; padding: 4px 8px; }
.common-table-viewport { position: relative; max-height: min(64dvh, 650px); overflow: auto; overflow-anchor: none; }
.common-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    --table-row-height: 44px;
    --table-font-scale: 1;
    font-size: calc(.82rem * var(--table-font-scale));
}
.common-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: calc(98px * var(--table-font-scale));
    padding: 8px 13px 7px 9px;
    background: var(--panel);
    vertical-align: top;
    font-size: calc(.74rem * var(--table-font-scale));
}
.common-table th:not(:last-child), .common-table td[data-column]:not(:last-child) { border-inline-end: 1px solid var(--edge); }
.common-table th[aria-sort] { box-shadow: inset 0 2px 0 var(--brand-orange); }
.common-table td[data-column], .common-table td.table-select { height: var(--table-row-height); padding: 0 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.common-table.compact td[data-column] { font-size: calc(.77rem * var(--table-font-scale)); }
.common-table .badge { font-size: calc(.72rem * var(--table-font-scale)); }
.common-table tbody .table-spacer td { padding: 0; border: 0; background: transparent; }
.common-table td .record-button { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; vertical-align: middle; }
.common-table .table-select { position: sticky; left: 0; z-index: 2; padding: 0; text-align: center; background: var(--surface); border-inline-end: 1px solid var(--edge); }
.common-table th.table-select { z-index: 5; background: var(--panel); vertical-align: middle; }
.table-select-tools { display: grid; justify-items: center; align-content: center; gap: 3px; }
.table-select-tools input { margin: 0; }
.table-excel-toggle.column-button { width: 26px; height: 22px; color: var(--brand-orange); background: var(--brand-black); }
.table-excel-menu {
    position: fixed;
    z-index: 10;
    display: grid;
    gap: 4px;
    min-width: 195px;
    padding: 6px;
    border: 1px solid var(--edge);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--lift);
}
.table-excel-menu .button { justify-content: flex-start; width: 100%; min-height: 32px; }
.common-table .pinned-left { position: sticky; left: var(--column-offset); }
.common-table .pinned-right { position: sticky; right: var(--column-offset); }
.common-table td:is(.pinned-left, .pinned-right) { z-index: 1; background: var(--surface); }
.common-table th:is(.pinned-left, .pinned-right) { z-index: 4; }
.common-table tr:hover td:is(.table-select, .pinned-left, .pinned-right) { background: var(--hover); }
.common-table tr.is-selected td { background: var(--selected); }
.column-heading { display: grid; grid-template-rows: 16px 27px 27px; gap: 5px; min-width: 0; }
.column-title { display: block; max-width: 100%; overflow: hidden; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; cursor: grab; }
.column-tools { display: flex; align-items: center; gap: 5px; }
.column-heading .column-search { min-width: 0; min-height: 27px; padding: 3px 6px; border-radius: 5px; font-size: .72rem; }
.common-table .column-heading {
    grid-template-rows: calc(16px * var(--table-font-scale)) 27px minmax(27px, calc(27px * var(--table-font-scale)));
}
.common-table .column-title { line-height: calc(16px * var(--table-font-scale)); }
.common-table .column-search { font-size: calc(.72rem * var(--table-font-scale)); }
.local-table .column-heading { min-width: 92px; }
.local-table .column-title { cursor: default; }
.local-filter-form { padding: 15px 16px 17px; }
.column-button {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px solid var(--edge);
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink);
    font-size: .92rem;
}
.column-button:hover, .column-button.filter-active { color: var(--brand-orange); background: var(--brand-black); }
.filter-symbol { display: block; width: 12px; height: 12px; background: currentColor; clip-path: polygon(0 10%, 100% 10%, 61% 56%, 61% 91%, 41% 79%, 41% 56%); }
.column-resize { position: absolute; z-index: 1; top: 3px; bottom: 3px; right: 0; width: 7px; touch-action: none; cursor: col-resize; }
.column-resize:hover { background: var(--brand-orange); }
.column-resize:focus-visible { background: var(--edge); outline-offset: -2px; }
.common-table.resizing, .common-table.resizing * { cursor: col-resize; user-select: none; }
.common-table-footer, .table-tail { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--muted); font-size: .77rem; }
.common-table-footer { border-top: 1px solid var(--edge); }
.table-tail { justify-content: center; }
.column-settings, .table-filter-values { max-height: min(45dvh, 380px); overflow: auto; }
.column-setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(108px, 145px) auto; align-items: center; gap: 8px; padding: 6px 1px; border-bottom: 1px solid var(--edge); }
.column-setting label, .form-stack label.table-compact, .table-filter-values label { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 530; overflow-wrap: anywhere; }
.column-setting select { min-height: 33px; padding: 4px; font-size: .74rem; }
.column-setting-order { display: flex; gap: 3px; }
.column-setting-order .button { min-height: 29px; padding: 4px 7px; }
.table-filter-values label { min-height: 32px; padding: 3px; }

.auth {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 22px;
    background: radial-gradient(ellipse at 86% 30%, var(--canvas-glow), transparent 64%), radial-gradient(ellipse at 14% 84%, var(--canvas-clear), transparent 60%);
}
.auth .energy-arcs { width: min(67%, 850px); height: 78%; top: 12%; right: 0; opacity: .56; }
.auth-card { width: min(100%, 425px); padding: clamp(20px, 4vw, 30px); border-radius: 23px; box-shadow: inset 0 1px 0 var(--shine), var(--modal-shadow); }
.auth-brand { margin-bottom: 22px; }
.auth-brand .brand-copy { font-size: .93rem; }
.auth-card h1 { font-size: 1.62rem; margin-bottom: 18px; }
.form-stack, .form-grid { display: grid; gap: 14px; }
.form-stack label, .form-grid label, legend { display: grid; gap: 6px; color: var(--ink); font-size: .81rem; font-weight: 630; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label.check { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.form-grid input:disabled, .form-grid select:disabled { color: var(--muted); background: var(--panel); }
fieldset { min-width: 0; margin: 0; padding: 9px 11px; border: 1px solid var(--edge); border-radius: 9px; }
.choices { display: grid; gap: 8px; max-height: 140px; overflow: auto; }
.error { color: var(--error-ink); background: var(--error-bg); border-radius: 8px; padding: 8px 10px; font-size: .82rem; line-height: 1.45; }
dialog {
    padding: 0;
    width: min(660px, calc(100% - 24px));
    max-height: calc(100dvh - 30px);
    border: 1px solid var(--edge);
    border-radius: 17px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 1px 0 var(--shine), var(--modal-shadow);
}
dialog::backdrop { background: var(--scrim); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--edge); }
#editor-content { padding: 15px 16px 17px; }
dialog:has(.article-form) { width: min(1080px, calc(100% - 24px)); }
.article-form > label:first-child { grid-column: 1 / -1; }
.markdown-editor { display: grid; gap: 14px; }
.markdown-editor.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.markdown-source { display: grid; gap: 8px; align-content: start; }
.markdown-source textarea { font-family: ui-monospace, Consolas, monospace; min-height: 320px; }
.markdown-editor h3 { margin: 0 0 6px; color: var(--ink); font-size: .81rem; font-weight: 630; }
.markdown-preview { min-width: 0; padding: 15px; border: 1px solid var(--edge); border-radius: 9px; min-height: 90px; overflow-wrap: anywhere; line-height: 1.55; }
.markdown-editor.split .markdown-preview { height: 320px; overflow: auto; }
.markdown-preview > :first-child { margin-top: 0; }
.markdown-preview > :last-child { margin-bottom: 0; }
.markdown-preview h1 { font-size: 1.65rem; }
.markdown-preview h2 { font-size: 1.35rem; }
.markdown-preview h3 { font-size: 1.12rem; color: inherit; }
.markdown-preview p, .markdown-preview blockquote, .markdown-preview table, .markdown-preview pre { margin-block: 10px; }
.markdown-preview blockquote { padding-left: 12px; border-left: 3px solid var(--selected-border); margin-inline: 0; }
.markdown-preview img { max-width: 100%; height: auto; border-radius: 7px; }
.markdown-preview code, .markdown-preview pre { background: var(--panel); border-radius: 4px; font-family: ui-monospace, Consolas, monospace; }
.markdown-preview code { padding: 1px 4px; }
.markdown-preview pre { overflow: auto; padding: 9px; }
.markdown-preview pre code { padding: 0; }
.markdown-preview .task-list-item { list-style: none; }
.markdown-preview a { color: var(--accent); }
.markdown-preview table { display: block; width: max-content; max-width: 100%; overflow: auto; }
.markdown-preview .align-left { text-align: left; }
.markdown-preview .align-center { text-align: center; }
.markdown-preview .align-right { text-align: right; }
.permissions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.import-errors { max-height: 265px; overflow: auto; border: 1px solid var(--edge); border-radius: 8px; margin-top: 9px; }
.import-errors th { position: sticky; top: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 6px; }
.dialog-actions .spacer { margin-right: auto; }
.editor-media { display: block; max-height: 240px; max-width: 100%; border-radius: 8px; }
.field-travel { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--edge); border-radius: 12px; }
.field-map { display: block; width: 100%; max-height: 270px; object-fit: contain; border-radius: 8px; }
.field-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.field-photos img { display: block; width: 112px; height: 78px; object-fit: cover; border-radius: 8px; }
.payroll-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.payroll-tabs .button[aria-current="page"] { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.payroll-balance { padding-inline: 5px; }
.payroll-links { display: grid; gap: 4px; margin: 0; padding-inline-start: 22px; }
.loading-indicator { display: flex; align-items: center; justify-content: center; min-height: 130px; }
.loading-indicator.compact-loader { min-height: 27px; }
.form-note { font-size: .82rem; line-height: 1.5; }
.toast { position: fixed; z-index: 5; right: 16px; bottom: 16px; padding: 11px 14px; color: var(--toast-ink); background: var(--toast); border-radius: 9px; box-shadow: var(--lift); }
.startup { display: grid; min-height: 100dvh; place-items: center; padding: 20px; color: var(--muted); }
.startup-content { display: grid; justify-items: center; gap: 12px; font-size: .84rem; }

.news-feed { display: grid; gap: 18px; }
.news-date { color: var(--muted); font-size: .76rem; font-weight: 630; font-variant-numeric: tabular-nums; }
.news-back { margin-bottom: 14px; }
.news-article { max-width: 900px; padding: clamp(17px, 3vw, 31px); }
.news-article h1 { margin-top: 7px; overflow-wrap: anywhere; }
.news-article h2 { margin-top: 7px; font-size: clamp(1.35rem, 2.6vw, 2rem); overflow-wrap: anywhere; }
.news-article h2 a { text-decoration: none; }
.news-article h2 a:hover { text-decoration: underline; }
.news-article-cover { display: block; width: 100%; max-height: 380px; margin-top: 17px; border-radius: 12px; object-fit: contain; background: var(--panel); }
.news-body { margin-top: 17px; padding: 0; border: 0; line-height: 1.65; }

@media (max-width: 1090px) {
    .shell { grid-template-columns: 237px minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .workspace { --inset: 13px; }
    .sidebar {
        display: none;
        position: fixed;
        top: 114px;
        left: 0;
        z-index: 3;
        width: min(274px, calc(100vw - 26px));
        height: calc(100dvh - 127px);
        margin: 0 0 0 13px;
        background: var(--glass-solid);
        box-shadow: var(--lift);
    }
    .sidebar.open { display: flex; }
    .mobile-nav { display: grid; margin: 12px var(--inset) 0; }
    .topbar { top: 7px; z-index: 4; margin-top: 7px; }
    main { padding-top: 16px; }
    .hero { min-height: 145px; padding: 18px; flex-wrap: wrap; gap: 12px; }
    .energy-arcs { opacity: .72; }
    .kpis { gap: 9px; }
    .kpi { min-height: 109px; padding: 12px 11px; }
    .kpi-value { font-size: 1.9rem; }
    .section-actions { justify-content: flex-start; }
    .markdown-editor.split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) {
    .heading { align-items: center; flex-wrap: wrap; }
    .toolbar { gap: 6px; }
    .form-grid, .permissions-grid { grid-template-columns: minmax(0, 1fr); }
    .common-table-actions { margin-inline-start: 0; }
    th, td { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .kpi { transition: none; }
    .kpi:hover { transform: none; }
}

