:root {
  --bg: #080808;
  --surface: #111111;
  --surface-2: #171717;
  --surface-3: #1d1d1d;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(225, 179, 80, .34);
  --text: #f7f4ec;
  --muted: #aaa69d;
  --gold: #dfb352;
  --gold-light: #f1d38e;
  --gold-dark: #85621c;
  --success: #69c999;
  --warning: #e7b25b;
  --danger: #df7373;
  --info: #7ca7df;
  --sidebar-width: 248px;
  --radius: 16px;
  --radius-small: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .24);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 85% -10%, rgba(223, 179, 82, .08), transparent 34rem), var(--bg); }
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .55rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; font-weight: 500; letter-spacing: -.035em; }
h2 { margin-bottom: .35rem; font-size: 1.08rem; }
h3 { margin-bottom: .3rem; font-size: .95rem; }
p { line-height: 1.6; }
small { line-height: 1.45; }
code, pre, .technical-value { font-family: "SFMono-Regular", Consolas, monospace; }
code { padding: .12rem .38rem; border: 1px solid var(--line); border-radius: 6px; background: #090909; color: var(--gold-light); }
pre { max-width: 100%; overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: #070707; color: #d7d4cd; white-space: pre-wrap; overflow-wrap: anywhere; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 1rem; border-right: 1px solid var(--line); background: rgba(10, 10, 10, .98); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.brand { min-width: 0; display: flex; align-items: center; gap: .8rem; padding: .4rem .35rem 1rem; }
.brand img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(223, 179, 82, .12)); }
.brand > span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { color: var(--gold-light); font-family: Georgia, "Times New Roman", serif; font-size: 1rem; letter-spacing: .16em; }
.brand small { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.nav-close { display: none; width: 38px; height: 38px; border: 0; border-radius: 10px; color: var(--text); background: transparent; font-size: 1.6rem; cursor: pointer; }
.nav { min-height: 0; flex: 1; overflow-y: auto; padding: .2rem 0 1rem; scrollbar-width: thin; }
.nav-section { margin: 1.15rem .7rem .45rem; color: #77736c; font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: .7rem; min-height: 42px; margin: .18rem 0; padding: .6rem .7rem; border: 1px solid transparent; border-radius: 10px; color: #c7c3ba; font-size: .87rem; font-weight: 650; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav a.active { border-color: rgba(223, 179, 82, .22); color: var(--gold-light); background: linear-gradient(90deg, rgba(223, 179, 82, .14), rgba(223, 179, 82, .04)); }
.nav-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #aaa69e; font-size: .72rem; font-weight: 900; }
.nav a.active .nav-icon { border-color: rgba(223, 179, 82, .34); color: var(--gold-light); background: rgba(223, 179, 82, .09); }
.sidebar-account { display: flex; align-items: center; gap: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sidebar-account > div { min-width: 0; display: flex; flex-direction: column; }
.sidebar-account strong, .sidebar-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: .82rem; }
.sidebar-account small { margin-top: .15rem; color: var(--gold); font-size: .68rem; }
.avatar { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--line-strong); border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar-large { width: 52px; height: 52px; flex-basis: 52px; }
.avatar-fallback { display: grid; place-items: center; color: var(--gold); font-family: Georgia, serif; }
.sidebar-backdrop { display: none; }

.main-shell { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem clamp(1rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line); background: rgba(8, 8, 8, .88); backdrop-filter: blur(16px); }
.topbar-title { min-width: 0; display: flex; flex-direction: column; }
.topbar-title span { color: var(--gold); font-size: .65rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.topbar-title strong { overflow: hidden; margin-top: .1rem; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); cursor: pointer; }
.content-shell { width: min(100%, 1460px); margin: 0 auto; padding: clamp(1rem, 3vw, 2.2rem); }

.section-tabs { display: flex; gap: .35rem; margin-bottom: 1.2rem; padding: .35rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs a { flex: 0 0 auto; padding: .58rem .85rem; border-radius: 8px; color: var(--muted); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.section-tabs a:hover { color: var(--text); background: var(--surface-2); }
.section-tabs a.active { color: #120e06; background: var(--gold-light); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.25rem; }
.page-heading > div { max-width: 850px; }
.page-heading p { max-width: 760px; margin-bottom: 0; color: var(--muted); }
.eyebrow { display: block; margin-bottom: .4rem; color: var(--gold); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.clamp { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.back-link, .text-link { color: var(--gold-light); font-weight: 750; }
.back-link { display: inline-flex; margin-bottom: 1rem; }
.text-link:hover, .back-link:hover { text-decoration: underline; }

.panel, .vehicle-card, .metric, .message-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.012), transparent), var(--surface); box-shadow: var(--shadow); }
.panel { min-width: 0; padding: 1.15rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 500; }
.panel-heading .eyebrow { margin-bottom: .2rem; }
.subpanel { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #0c0c0c; }
.settings-panel { max-width: 820px; }

.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-2); font-size: .78rem; font-weight: 800; cursor: pointer; transition: transform .14s ease, border-color .14s ease, background .14s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(223, 179, 82, .28); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { border-color: rgba(223, 179, 82, .45); color: #171006; background: linear-gradient(180deg, #f1d38e, #d6a641); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #f7dfa7, #dfb352); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(223, 115, 115, .35); color: #ffd2d2; background: rgba(223, 115, 115, .09); }
.btn-small { min-height: 34px; padding: .45rem .7rem; font-size: .72rem; }
.btn-wide { width: 100%; }
.button-row, .action-row, .action-stack, .inline-fields, .inline-action { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.action-stack { align-items: stretch; flex-direction: column; }
.inline-form { margin: 0; }

.metric-grid { display: grid; gap: .8rem; margin-bottom: 1rem; }
.metric-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-width: 0; min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; box-shadow: none; }
.metric span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.metric strong { margin: .45rem 0 .2rem; overflow-wrap: anywhere; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 500; }
.metric small { color: #77746d; font-size: .69rem; }
.metric.featured { border-color: rgba(223, 179, 82, .28); background: linear-gradient(145deg, rgba(223, 179, 82, .12), rgba(223, 179, 82, .025)), var(--surface); }
.metric.featured strong { color: var(--gold-light); }
.metric-card { display: block; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.metric-card:hover { border-color: rgba(223, 179, 82, .3); }
.big-value { margin: .65rem 0 1rem; color: var(--gold-light); font-family: Georgia, serif; font-size: 2.2rem; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.panel-wide { grid-column: 1 / -1; }
.two-column-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.4fr); gap: 1rem; align-items: start; }
.sync-grid, .employee-grid, .review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-card-list, .message-list { display: grid; gap: .8rem; }

.stat-list { display: grid; gap: .15rem; margin-bottom: 1rem; }
.stat-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .62rem 0; border-bottom: 1px solid var(--line); }
.stat-list span, .detail-list dt, .detail-list > div > span { color: var(--muted); }
.detail-list { display: grid; gap: 0; margin: .5rem 0 0; }
.detail-list > div { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .68rem 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt, .detail-list dd { margin: 0; }
.detail-list dd, .detail-list strong { max-width: 65%; text-align: right; overflow-wrap: anywhere; }
.detail-list.compact > div { padding: .48rem 0; }
.technical-block { margin-top: 1rem; padding-top: .5rem; border-top: 1px solid var(--line); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: .76rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .76rem; }
th { position: sticky; top: 0; z-index: 1; color: #858179; background: #101010; font-size: .65rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .018); }
td strong { color: #f2eee5; }
.empty-cell { padding: 2rem !important; color: var(--muted); text-align: center !important; }

form { min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-grid label, .period-filter label { min-width: 0; display: flex; flex-direction: column; gap: .35rem; color: #d4d0c7; font-size: .73rem; font-weight: 720; }
.full-span { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 42px; padding: .66rem .72rem; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--text); background: #0b0b0b; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
select { appearance: none; padding-right: 2.6rem; cursor: pointer; background-color: #0b0b0b; background-image: linear-gradient(45deg, transparent 50%, #dfb352 50%), linear-gradient(135deg, #dfb352 50%, transparent 50%), linear-gradient(to right, rgba(223, 179, 82, .18), rgba(223, 179, 82, .18)); background-position: calc(100% - 17px) 18px, calc(100% - 11px) 18px, calc(100% - 2.4rem) 50%; background-size: 6px 6px, 6px 6px, 1px 22px; background-repeat: no-repeat; }
select:hover { border-color: rgba(223, 179, 82, .34); background-color: #10100f; }
select option { color: var(--text); background: #111111; }
textarea { min-height: 100px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #69665f; }
input:focus, select:focus, textarea:focus { border-color: rgba(223, 179, 82, .55); box-shadow: 0 0 0 3px rgba(223, 179, 82, .08); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
label > small { color: #77746d; font-weight: 450; }
.required-mark { color: var(--gold); }
.field-error { color: #ffaaaa; font-size: .68rem; }
.check-row { display: grid !important; grid-template-columns: auto 1fr; align-items: start; gap: .55rem !important; }
.check-row input { width: 18px; min-height: 18px; margin-top: .08rem; accent-color: var(--gold); }
.search-bar, .period-filter { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; margin-bottom: 1rem; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.search-bar input { min-width: 220px; flex: 1; }
.search-bar select { max-width: 260px; }
.period-filter label { min-width: 180px; }
.period-filter .custom-period-field { min-width: 150px; }
.period-filter [hidden] { display: none !important; }
.inline-fields input, .inline-fields select, .action-row input { width: auto; min-width: 150px; }
.danger-row { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; padding: .8rem; border: 1px solid rgba(223, 115, 115, .22); border-radius: 10px; background: rgba(223, 115, 115, .045); }
.danger-row input { flex: 1; min-width: 220px; }
.danger-panel { border-color: rgba(223, 115, 115, .24); }

.alert { display: flex; align-items: flex-start; gap: .55rem; margin-bottom: 1rem; padding: .78rem .9rem; border: 1px solid var(--line); border-radius: 10px; color: #d9d5cc; background: var(--surface); font-size: .78rem; line-height: 1.5; }
.alert-success { border-color: rgba(105, 201, 153, .26); background: rgba(105, 201, 153, .07); }
.alert-warning { border-color: rgba(231, 178, 91, .28); background: rgba(231, 178, 91, .075); }
.alert-danger { border-color: rgba(223, 115, 115, .30); background: rgba(223, 115, 115, .08); }
.alert-info { border-color: rgba(124, 167, 223, .28); background: rgba(124, 167, 223, .08); }

.status { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .3rem .52rem; border: 1px solid var(--line); border-radius: 999px; color: #c7c3ba; background: rgba(255,255,255,.025); font-size: .65rem; font-weight: 800; white-space: nowrap; }
.status-processed, .status-complete, .status-in, .status-manual, .status-validated { border-color: rgba(105, 201, 153, .26); color: #aee5c9; background: rgba(105, 201, 153, .07); }
.status-pending, .status-partial, .status-open { border-color: rgba(231, 178, 91, .28); color: #f0cf91; background: rgba(231, 178, 91, .07); }
.status-error, .status-conflict, .status-incomplete, .status-out { border-color: rgba(223, 115, 115, .28); color: #f1aaaa; background: rgba(223, 115, 115, .07); }
.status-ignored, .status-cancelled, .status-reversal { color: #8e8a82; }
.status-discord { color: #b8b0ff; border-color: rgba(151, 137, 255, .25); }

.ranking-list { list-style: none; display: grid; gap: .45rem; margin: 0; padding: 0; }
.ranking-list li { display: flex; align-items: center; gap: .7rem; padding: .68rem; border: 1px solid var(--line); border-radius: 10px; background: #0c0c0c; }
.ranking-list li > span, .rank-number { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid rgba(223, 179, 82, .25); border-radius: 50%; color: var(--gold-light); font-size: .72rem; font-weight: 850; }
.ranking-list li > div { min-width: 0; display: flex; flex-direction: column; }
.ranking-list strong, .ranking-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-list small { margin-top: .15rem; color: var(--muted); }

.split-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.split-preview-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-preview div { padding: .72rem; border: 1px solid var(--line); border-radius: 9px; background: #0b0b0b; }
.split-preview span, .split-preview strong { display: block; }
.split-preview span { color: var(--muted); font-size: .68rem; }
.split-preview strong { margin-top: .2rem; color: var(--gold-light); }

.message-card { padding: 1rem; box-shadow: none; }
.message-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.message-card-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.1rem; font-weight: 500; }
.message-normalized { margin: .8rem 0; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.message-normalized h3 { color: var(--gold-light); }
.message-normalized dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .7rem 0 0; }
.message-normalized dl div { min-width: 0; padding: .62rem; border: 1px solid var(--line); border-radius: 8px; background: #0e0e0e; }
.message-normalized dt { color: var(--muted); font-size: .66rem; overflow-wrap: anywhere; }
.message-normalized dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.technical-history { margin-top: .8rem; }
.nested-detail { margin-top: .5rem; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.comparison-grid > div { padding: .8rem; border: 1px solid var(--line); border-radius: 9px; background: #0b0b0b; }
.reason-list { color: var(--muted); }
.instruction-list { display: grid; gap: .55rem; margin: .6rem 0 0; padding-left: 1.25rem; color: var(--muted); }

.employee-card, .role-card { min-width: 0; }
.employee-profile { display: flex; align-items: center; gap: .7rem; }
.employee-profile h2 { margin: 0; }
.employee-profile p { margin: .1rem 0 0; color: var(--gold); font-size: .72rem; }
.role-card { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.permission-groups { display: grid; gap: .65rem; }
.permission-groups fieldset { display: grid; gap: .25rem; padding: .75rem; border: 1px solid var(--line); border-radius: 9px; }
.permission-groups legend { color: var(--gold); font-size: .7rem; font-weight: 850; }
.permission-row { display: grid !important; grid-template-columns: auto 1fr; gap: .55rem !important; align-items: start; padding: .28rem 0; }
.permission-row input { width: 17px; min-height: 17px; }
.permission-row span { display: flex; flex-direction: column; }
.permission-row small { color: var(--muted); font-weight: 450; }

.edit-card { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
details > summary { cursor: pointer; }
.edit-card > summary { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; list-style: none; }
.edit-card > summary::-webkit-details-marker { display: none; }
.edit-card > summary::after { content: "+"; width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; order: 3; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.edit-card[open] > summary::after { content: "−"; color: var(--gold-light); }
.edit-card > summary > div { min-width: 0; display: flex; align-items: center; gap: .7rem; }
.edit-card > summary > div > div { min-width: 0; display: flex; flex-direction: column; }
.edit-card > summary strong, .edit-card > summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-card > summary small { color: var(--muted); }
.edit-card > form, .edit-card > .detail-list, .edit-card > .subpanel, .edit-card > .danger-row { margin: 0; padding: 1rem; border-top: 1px solid var(--line); }
.edit-card summary img, .mini-logo { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.mini-logo { display: grid; place-items: center; color: var(--gold); font-family: Georgia, serif; }

.empty-state { grid-column: 1 / -1; padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-state h2 { color: var(--text); }

.inventory-preview { display: grid; gap: .45rem; margin-bottom: 1rem; }
.inventory-preview > div { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .62rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: #0b0b0b; }
.inventory-preview span { color: #d8d4ca; font-size: .78rem; }
.inventory-preview strong { color: var(--gold-light); }
.inventory-panel { margin-bottom: 1rem; }
.inventory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.inventory-card { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: .2rem .7rem; padding: .85rem; border: 1px solid var(--line); border-radius: 11px; background: #0b0b0b; }
.inventory-card span { grid-column: 1 / -1; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; }
.inventory-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-card b { color: var(--gold-light); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.inventory-card-warning { border-color: rgba(223, 115, 115, .34); }
.text-danger { color: var(--danger) !important; }
.page-divider { height: 1px; margin: 1.5rem 0; background: var(--line); }
.compact-heading { align-items: flex-start; margin-bottom: .8rem; }
.form-help { margin: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #0b0b0b; font-size: .75rem; }
.employee-summary-card { display: flex; flex-direction: column; gap: 1rem; }
.employee-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.employee-period-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.employee-period-grid > div { min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.employee-period-grid > div.featured { border-color: rgba(223, 179, 82, .28); background: rgba(223, 179, 82, .07); }
.employee-period-grid span, .employee-period-grid strong, .employee-period-grid small { display: block; }
.employee-period-grid span { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.employee-period-grid strong { margin-top: .28rem; color: var(--text); }
.employee-period-grid small { margin-top: .18rem; color: #77746d; }
.employee-detail-heading { display: flex; align-items: center; gap: 1rem; }
.employee-detail-avatar { width: 76px; height: 76px; flex-basis: 76px; }
.lifetime-panel .employee-period-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chest-period-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.chest-period-summary > div { padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.chest-period-summary span, .chest-period-summary strong, .chest-period-summary small { display: block; }
.chest-period-summary span { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chest-period-summary strong { margin-top: .35rem; color: var(--gold-light); font-size: 1.05rem; }
.chest-period-summary small { margin-top: .18rem; color: #8f8b82; }
.simple-details { margin-top: 1rem; border-top: 1px solid var(--line); }
.simple-details > summary { padding: .85rem 0; color: var(--gold-light); cursor: pointer; font-weight: 750; }
.version-panel { max-width: 820px; margin-top: 1rem; }
.version-panel h2 { margin-bottom: 0; font-size: 1.35rem; }

.public-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 5vw, 4rem); border-bottom: 1px solid var(--line); background: rgba(8,8,8,.9); backdrop-filter: blur(14px); }
.public-brand { display: flex; align-items: center; gap: .7rem; color: var(--gold-light); font-family: Georgia, serif; letter-spacing: .16em; }
.public-brand img { width: 50px; height: 50px; object-fit: contain; }
.public-header nav { display: flex; align-items: center; gap: 1rem; }
.public-main { width: min(100%, 1460px); margin: 0 auto; padding: clamp(1rem, 4vw, 3rem); }
.hero { min-height: 320px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; padding: clamp(1.5rem, 4vw, 3.5rem); overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at 85% 50%, rgba(223,179,82,.13), transparent 22rem), linear-gradient(135deg, #151515, #0a0a0a); }
.hero > div { max-width: 720px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
.hero p { color: var(--muted); font-size: 1rem; }
.hero img { width: min(32vw, 340px); max-height: 290px; object-fit: contain; filter: drop-shadow(0 25px 45px rgba(223,179,82,.14)); }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.vehicle-card { min-width: 0; overflow: hidden; box-shadow: none; transition: transform .16s ease, border-color .16s ease; }
.vehicle-card:hover { transform: translateY(-2px); border-color: rgba(223, 179, 82, .28); }
.vehicle-image { min-height: 230px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, rgba(223,179,82,.07), transparent 60%), #0b0b0b; }
.vehicle-image img { width: 100%; height: 230px; object-fit: cover; }
.vehicle-image span { color: rgba(223,179,82,.34); font-family: Georgia, serif; letter-spacing: .25em; }
.vehicle-card-body { padding: 1rem; }
.vehicle-card-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; color: var(--gold); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.vehicle-card-head strong { color: var(--gold-light); font-family: Georgia, serif; font-size: 1.05rem; letter-spacing: 0; }
.vehicle-card h2 { margin: .85rem 0 .08rem; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.vehicle-name { margin-bottom: .75rem; color: #cac6bd; }
.vehicle-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 1.25rem; align-items: center; }
.vehicle-detail-image { min-height: 500px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(circle, rgba(223,179,82,.09), transparent 55%), var(--surface); }
.vehicle-detail-image img { width: 100%; height: 500px; object-fit: contain; }
.vehicle-detail-copy { padding: 1rem; }
.vehicle-detail-copy h1 span { color: var(--gold-light); }
.price-display { margin: 1rem 0; color: var(--gold-light); font-family: Georgia, serif; font-size: 2.5rem; }

.login-layout { min-height: calc(100vh - 120px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 1.5rem; }
.login-visual { min-height: 520px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle, rgba(223,179,82,.12), transparent 55%), #0b0b0b; }
.login-visual img { width: min(80%, 460px); max-height: 460px; object-fit: contain; }
.login-panel { max-width: 520px; padding: 2rem; }
.login-panel p { color: var(--muted); }

.site-modal[hidden] { display: none; }
.site-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.site-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.site-modal-panel { position: relative; width: min(100%, 440px); padding: 1.35rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.site-modal-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: .9rem; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); }
.site-modal-actions { display: flex; justify-content: flex-end; gap: .55rem; }
.modal-open { overflow: hidden; }

.error-page { min-height: 60vh; display: grid; place-content: center; justify-items: start; max-width: 680px; }
.cef-body { overflow: auto; background: transparent; }
.cef-shell { min-height: 100vh; padding: 1rem; background: rgba(8,8,8,.97); }
.cef-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cef-header img { width: 54px; height: 54px; object-fit: contain; }
.cef-header div { display: flex; flex: 1; flex-direction: column; }
.cef-header span { color: var(--gold); font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; }
.cef-header strong { font-family: Georgia, serif; font-size: 1.15rem; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 225px; }
  .metric-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column-layout { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .nav-open .sidebar { transform: translateX(0); }
  .nav-close, .nav-toggle { display: grid; place-items: center; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; pointer-events: none; opacity: 0; background: rgba(0,0,0,.68); transition: opacity .2s ease; }
  .nav-open .sidebar-backdrop { pointer-events: auto; opacity: 1; }
  .main-shell { grid-column: auto; }
  .topbar { min-height: 64px; }
  .content-shell { padding: 1rem; }
  .dashboard-grid, .sync-grid, .employee-grid, .review-grid, .role-card { grid-template-columns: 1fr; }
  .message-normalized dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-detail { grid-template-columns: 1fr; }
  .vehicle-detail-image { min-height: 350px; }
  .vehicle-detail-image img { height: 350px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { min-height: 320px; }
  .login-visual img { max-height: 300px; }
  .hero { min-height: 280px; }
  .hero img { width: 220px; }
}

@media (max-width: 620px) {
  h1 { font-size: 2rem; }
  .topbar { padding: .7rem .8rem; }
  .topbar-title span { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading > .btn, .page-heading > form { width: 100%; }
  .metric-grid-2, .metric-grid-3, .metric-grid-4 { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; }
  .metric strong { font-size: 1.55rem; }
  .form-grid { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .search-bar, .period-filter { align-items: stretch; flex-direction: column; }
  .search-bar input, .search-bar select, .period-filter label { width: 100%; max-width: none; min-width: 0; }
  .button-row, .action-row, .inline-fields, .danger-row { align-items: stretch; flex-direction: column; }
  .button-row .btn, .action-row .btn, .inline-fields .btn, .danger-row .btn, .inline-fields input, .inline-fields select, .action-row input, .danger-row input { width: 100%; min-width: 0; }
  .split-preview, .split-preview-2 { grid-template-columns: 1fr; }
  .message-normalized dl { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-period-grid, .lifetime-panel .employee-period-grid, .chest-period-summary { grid-template-columns: 1fr; }
  .hero { min-height: 0; align-items: flex-start; flex-direction: column; }
  .hero img { align-self: center; width: 180px; }
  .public-header { padding: .65rem .8rem; }
  .public-brand span, .public-header nav > a:first-child { display: none; }
  .vehicle-detail-image { min-height: 280px; }
  .vehicle-detail-image img { height: 280px; }
  .edit-card > summary { align-items: flex-start; }
  .edit-card > summary .status { display: none; }
  .detail-list > div { flex-direction: column; gap: .22rem; }
  .detail-list dd, .detail-list strong { max-width: 100%; text-align: left; }
  table { min-width: 650px; }
}

@media (max-width: 420px) {
  .metric-grid-2, .metric-grid-3, .metric-grid-4 { grid-template-columns: 1fr; }
  .topbar .btn { padding-inline: .6rem; }
}
.inventory-card-positive { border-color: rgba(105, 201, 153, .34); background: rgba(105, 201, 153, .045); }
.inventory-row-positive { border-color: rgba(105, 201, 153, .2) !important; background: rgba(105, 201, 153, .035) !important; }
.inventory-row-warning { border-color: rgba(223, 115, 115, .25) !important; background: rgba(223, 115, 115, .045) !important; }
.text-success { color: var(--success) !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.alert-list { display: grid; gap: .55rem; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .85rem; border: 1px solid rgba(223, 115, 115, .24); border-radius: 10px; background: rgba(223, 115, 115, .055); }
.alert-row > div { min-width: 0; display: flex; flex-direction: column; }
.alert-row small { color: var(--muted); }
.alert-row > span { color: #f2b1b1; font-size: .76rem; font-weight: 750; text-align: right; }
.allowance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: .8rem; }
.allowance-grid > div { padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.allowance-grid span, .allowance-grid strong, .allowance-grid small { display: block; }
.allowance-grid span { color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .05em; }
.allowance-grid strong { margin-top: .25rem; color: var(--gold-light); font-size: 1.15rem; }
.allowance-grid small { margin-top: .18rem; color: #858178; }
.role-create-panel, .roles-list-panel { width: 100%; margin-bottom: 1rem; }
.role-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.permission-groups-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.tax-bracket-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.tax-bracket { padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.tax-bracket span, .tax-bracket strong, .tax-bracket small { display: block; }
.tax-bracket span { color: var(--muted); font-size: .68rem; }
.tax-bracket strong { margin-top: .25rem; color: var(--gold-light); font-size: 1.05rem; }
.tax-bracket small { margin-top: .2rem; color: #858178; }
.tax-lines { display: grid; gap: .45rem; }
.tax-line { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: #0b0b0b; }
.tax-line small { color: var(--muted); }
@media (max-width: 900px) {
  .permission-groups-wide, .tax-bracket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-options { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .role-create-form, .permission-groups-wide, .tax-bracket-grid, .allowance-grid { grid-template-columns: 1fr; }
  .alert-row { align-items: flex-start; flex-direction: column; }
  .alert-row > span { text-align: left; }
  .tax-line { grid-template-columns: 1fr; }
}
.status-to_pay { border-color: rgba(231, 178, 91, .28); color: #f0cf91; background: rgba(231, 178, 91, .07); }
.status-overdue { border-color: rgba(223, 115, 115, .3); color: #f1aaaa; background: rgba(223, 115, 115, .08); }
.status-paid { border-color: rgba(105, 201, 153, .28); color: #aee5c9; background: rgba(105, 201, 153, .07); }

.nav-section { position: relative; padding-left: .7rem; }
.nav-section::before { content: ""; position: absolute; left: 0; top: .08rem; bottom: .08rem; width: 3px; border-radius: 99px; background: currentColor; opacity: .85; }
.nav-section-personal { color: #7eb7e8; }
.nav-section-management { color: var(--gold-light); }
.nav-section-admin { color: #bd91e6; }

.custom-select { position: relative; width: 100%; min-width: 0; }
.custom-select-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.custom-select-button { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .78rem; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: linear-gradient(180deg, #11110f, #0b0b0b); cursor: pointer; text-align: left; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.custom-select-button:hover, .custom-select.open .custom-select-button { border-color: rgba(223, 179, 82, .46); background: #121210; }
.custom-select-button:focus-visible { outline: none; border-color: rgba(223, 179, 82, .62); box-shadow: 0 0 0 3px rgba(223, 179, 82, .09); }
.custom-select-button.placeholder { color: #827e76; }
.custom-select-arrow { flex: 0 0 auto; color: var(--gold); font-size: 1rem; transition: transform .15s ease; }
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }
.custom-select-menu { position: absolute; z-index: 80; top: calc(100% + .4rem); left: 0; right: 0; max-height: 280px; display: none; overflow-y: auto; padding: .35rem; border: 1px solid rgba(223, 179, 82, .3); border-radius: 11px; background: #10100f; box-shadow: 0 18px 48px rgba(0, 0, 0, .55); }
.custom-select.open .custom-select-menu { display: grid; gap: .18rem; }
.custom-select-option { width: 100%; padding: .62rem .7rem; border: 0; border-radius: 8px; color: #d9d5cc; background: transparent; cursor: pointer; text-align: left; }
.custom-select-option:hover, .custom-select-option:focus-visible { outline: none; color: #fff; background: rgba(223, 179, 82, .1); }
.custom-select-option.selected { color: var(--gold-light); background: rgba(223, 179, 82, .13); font-weight: 750; }
.custom-select-option:disabled { opacity: .45; cursor: not-allowed; }
.custom-select + .field-error, .custom-select[aria-invalid="true"] { margin-top: .3rem; }
.inline-fields .custom-select, .action-row .custom-select, .danger-row .custom-select { width: auto; min-width: 180px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 1rem; align-items: start; }
.version-panel form { margin-top: 1rem; }

.contract-list { display: grid; gap: 1rem; }
.contract-card { overflow: hidden; }
.contract-pending { border-color: rgba(223, 179, 82, .35); }
.contract-content { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #0b0b0b; color: #d7d3cb; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.contract-sign-form { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.contract-accept { padding: .75rem .9rem; border: 1px solid rgba(223, 179, 82, .24); border-radius: 10px; background: rgba(223, 179, 82, .05); }
.signature-proof { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem .9rem; border: 1px solid rgba(105, 201, 153, .25); border-radius: 10px; background: rgba(105, 201, 153, .055); }
.signature-proof strong { color: #aee5c9; }
.signature-proof span { color: var(--muted); }
.contracts-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contract-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.contract-template-card { margin: 0; }
.contract-template-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.contract-template-card > summary > span:first-child { display: flex; min-width: 0; flex-direction: column; }
.contract-template-card > summary small { margin-top: .18rem; color: var(--muted); }
.details-form { margin-top: .8rem; }
.info-card { margin-top: 1rem; padding: .85rem; border: 1px solid rgba(126, 183, 232, .2); border-radius: 10px; background: rgba(126, 183, 232, .045); }
.info-card p { margin: .3rem 0 0; color: var(--muted); }

.absence-layout { grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); }
.absence-list { display: grid; gap: .55rem; max-height: 430px; overflow-y: auto; }
.absence-list-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.absence-list-item > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.absence-list-item span { margin-top: .12rem; color: var(--gold-light); font-size: .76rem; }
.absence-list-item small { margin-top: .18rem; color: var(--muted); overflow-wrap: anywhere; }
.calendar-panel { overflow: hidden; }
.calendar-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.calendar-toolbar > div { text-align: center; }
.calendar-toolbar h2 { margin: .15rem 0 0; }
.absence-calendar { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); min-width: 820px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-panel { overflow-x: auto; }
.calendar-weekday { padding: .6rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--gold); font-size: .7rem; font-weight: 850; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 125px; padding: .55rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #0b0b0b; }
.calendar-day.outside-month { opacity: .38; background: #080808; }
.calendar-date { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #bdb8ae; font-size: .74rem; }
.calendar-events { display: grid; gap: .3rem; margin-top: .35rem; }
.calendar-event { padding: .38rem .45rem; border: 1px solid rgba(126, 183, 232, .24); border-radius: 7px; background: rgba(126, 183, 232, .08); overflow: hidden; }
.calendar-event strong, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { color: #b9dcfa; font-size: .68rem; }
.calendar-event span { margin-top: .08rem; color: #8e9eab; font-size: .61rem; }

.warning-form { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.warning-list { display: grid; gap: .65rem; }
.warning-card { padding: .85rem; border: 1px solid rgba(231, 178, 91, .24); border-radius: 11px; background: rgba(231, 178, 91, .045); }
.warning-card-notice { border-color: rgba(126, 183, 232, .25); background: rgba(126, 183, 232, .045); }
.warning-card-serious { border-color: rgba(223, 115, 115, .3); background: rgba(223, 115, 115, .06); }
.warning-card.warning-resolved { opacity: .65; border-color: var(--line); background: #0b0b0b; }
.warning-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.warning-card-head > div { display: flex; flex-direction: column; }
.warning-card-head > div span { margin-top: .15rem; color: var(--muted); font-size: .68rem; }
.warning-card p { margin: .65rem 0; color: #d4d0c7; }
.warning-card small { color: var(--muted); }
.resolution-note { display: flex; gap: .45rem; margin-top: .65rem; color: var(--muted); font-size: .74rem; }
.personal-notices-panel { display: grid; gap: .6rem; }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0b; }
.notice-row > div { min-width: 0; display: flex; flex-direction: column; }
.notice-row span, .notice-row small { margin-top: .15rem; color: var(--muted); }
.notice-contract { border-color: rgba(223, 179, 82, .28); }
.notice-warning { border-color: rgba(231, 178, 91, .25); }
.notice-warning-serious { border-color: rgba(223, 115, 115, .32); }

.treasury-total-panel { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; border-color: rgba(223, 179, 82, .3); background: radial-gradient(circle at left, rgba(223, 179, 82, .08), transparent 45%), var(--surface); }
.treasury-total-main { display: flex; flex-direction: column; }
.treasury-total-main > span { color: var(--gold); font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.treasury-total-main > strong { margin-top: .25rem; color: var(--gold-light); font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; }
.treasury-total-main > small { color: var(--muted); }
.treasury-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.treasury-breakdown > div { padding: .7rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,8,8,.65); }
.treasury-breakdown span, .treasury-breakdown strong { display: block; }
.treasury-breakdown span { color: var(--muted); font-size: .65rem; }
.treasury-breakdown strong { margin-top: .2rem; color: #ddd8ce; }
.treasury-form { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid var(--line); }

@media (max-width: 1000px) {
  .settings-grid, .contracts-admin-grid, .absence-layout, .treasury-total-panel { grid-template-columns: 1fr; }
  .treasury-breakdown { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contract-template-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .contract-sign-form, .signature-proof, .notice-row, .absence-list-item { align-items: stretch; flex-direction: column; }
  .calendar-toolbar { grid-template-columns: 1fr 1fr; }
  .calendar-toolbar > div { grid-column: 1 / -1; grid-row: 1; }
  .treasury-breakdown { grid-template-columns: 1fr; }
  .inline-fields .custom-select, .action-row .custom-select, .danger-row .custom-select { width: 100%; min-width: 0; }
}
.cef-hidden { display: none !important; }
