* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #f5f2e9;
  --ink: #23261c;
  --muted: #585a49;
  --line: #dfdacb;
  --surface: #fff;
  --olive: #485438;
  --olive-dark: #333e28;
  --sand: #eee7d2;
  --sidebar: #20241a;
  --sidebar-muted: #c0b99e;
  --gold-light: #e9ce82;
  --radius: 16px;
  --shadow: 0 8px 24px #292a2010;
}
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
a { color: var(--olive-dark); text-underline-offset: .23em; }
aside {
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  background: radial-gradient(ellipse at 0 0, #3b442c 0, transparent 58%), var(--sidebar);
  color: #ede8dc; padding: 26px 15px 20px;
  display: flex; flex-direction: column; gap: 24px;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px; color: #fff; text-decoration: none; font-size: 1.23rem; letter-spacing: -.035em; }
.brand strong { overflow-wrap: anywhere; }
.brand small { display: block; margin: 2px 0 0; color: var(--sidebar-muted); font-size: .72rem; letter-spacing: 0; overflow-wrap: anywhere; }
.brand-mark { display: block; flex: 0 0 auto; width: 44px; height: 48px; }
nav { display: grid; gap: 18px; }
.nav-group { display: grid; gap: 4px; }
.nav-group > p { margin: 0 10px 4px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); }
nav a { display: flex; align-items: center; gap: 10px; min-height: 41px; padding: 6px 9px; border: 1px solid transparent; border-radius: 10px; color: inherit; text-decoration: none; font-size: .91rem; font-weight: 600; }
nav a:hover { background: #ffffff12; color: white; }
nav a[aria-current] { color: #fff; background: #d7bd722b; border-color: #d7bd7266; }
.nav-icon, .page-icon, .card-icon { flex-shrink: 0; }
.nav-icon, .page-icon svg, .card-icon svg {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.nav-icon { color: var(--gold-light); width: 21px; height: 21px; }
.page-icon, .card-icon { display: inline-grid; place-items: center; }
.page-icon svg { width: 26px; height: 26px; }
.card-icon svg { width: 21px; height: 21px; }
.payment-signature { display: block; width: min(100%, 32rem); max-height: 14rem; object-fit: contain; }
.sign-out { margin-top: auto; align-self: start; }
aside .sign-out.quiet { background: #ffffff12; color: #efe8d4; border-color: #ffffff25; }
aside .sign-out.quiet:hover { background: #ffffff24; }
main { min-width: 0; width: min(100%, 1680px); margin-inline: auto; padding: clamp(22px, 4vw, 55px); }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-header { min-height: 78px; margin-bottom: 22px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.page-heading { display: flex; align-items: center; gap: 15px; min-width: 0; }
.page-icon { width: 49px; height: 49px; border-radius: 15px; background: var(--sand); color: var(--olive-dark); border: 1px solid #ded2ae; }
h1 { margin: 0; color: var(--ink); font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.048em; line-height: 1.13; overflow-wrap: anywhere; }
h2 { margin: 0 0 14px; font-size: 1.12rem; letter-spacing: -.025em; }
h2 + p, #view > p { color: var(--muted); }
#view > a { display: inline-block; margin-bottom: 14px; font-weight: 650; }
#message { margin: 0; }
#message:not(:empty) { margin-bottom: 14px; padding: 10px 14px; background: var(--sand); color: var(--olive-dark); border-radius: 10px; }
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid transparent; padding: 9px 14px; min-height: 38px; border-radius: 10px;
  background: var(--olive); color: white; cursor: pointer; font-weight: 650;
}
button:hover { background: var(--olive-dark); }
button:disabled { opacity: .53; cursor: not-allowed; }
.quiet { background: #f3eddb; color: #353e29; border-color: #e2d8bb; }
.quiet:hover { background: #eee4c7; }
:focus-visible { outline: 3px solid #80631f; outline-offset: 3px; }
aside :focus-visible { outline-color: var(--gold-light); }
#create { flex: 0 0 auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 15px; margin-bottom: 23px; }
.card, .panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card { color: var(--ink); text-decoration: none; text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.card strong { display: block; margin: 4px 0; font-size: clamp(1.45rem, 2.7vw, 2.1rem); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
a.card:hover, button.card:hover { background: #faf6e8; border-color: #b59b60; }
.card-icon { width: 36px; height: 36px; border-radius: 11px; margin-bottom: 9px; background: var(--sand); color: var(--olive-dark); }
.metric[aria-pressed="true"] { outline: 2px solid var(--olive); outline-offset: -2px; }
.metric small { font-weight: 500; }
.panel { overflow: auto; margin-bottom: 17px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: .92rem; }
td, th { padding: 12px 13px; border-bottom: 1px solid #eae5d8; vertical-align: top; }
th { background: #eee9dc; color: #4b4f3d; font-weight: 700; white-space: nowrap; }
th:first-child { border-top-left-radius: 9px; }
th:last-child { border-top-right-radius: 9px; }
tbody tr:nth-child(even) { background: #fcfbf8; }
tbody tr:hover { background: #f5f1e4; }
td button { margin: 2px; padding-inline: 9px; min-height: 31px; white-space: nowrap; font-size: .84rem; }
td a { font-weight: 650; }
small { display: block; margin-top: 5px; color: var(--muted); white-space: pre-wrap; }
.status { display: inline-block; border-radius: 999px; padding: 4px 9px; background: #edf1f8; color: #465470; white-space: nowrap; font-size: .83rem; font-weight: 650; }
.status.open, .status.ordered, .status.in-progress { color: #214b96; background: #e4eeff; }
.status.overdue, .status.offline, .status.urgent { color: #912d4b; background: #fde9ef; }
.status.paid, .status.resolved, .status.received, .status.healthy, .status.active { color: #116247; background: #e1f5ed; }
.status.waiting, .status.partially-received, .status.high, .status.attention { color: #73490a; background: #fff0d5; }
dialog { width: min(93vw, 550px); max-height: 91dvh; border: 1px solid var(--line); border-radius: 22px; padding: 24px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 100px #25271b77; }
dialog::backdrop { background: #1f2319aa; }
dialog header h2 { margin: 0; }
dialog header { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
dialog:has(.profile-fields) { width: min(94vw, 930px); }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding-top: 12px; }
.profile-fields fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 7px 14px 15px; }
.profile-fields legend { color: #434f35; font-weight: 700; }
.profile-fields fieldset:last-child, .profile-fields .customer-repeat, .profile-note { grid-column: 1 / -1; }
.profile-note { margin: 0; color: var(--muted); }
.customer-repeat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-items: end; gap: 10px; }
.customer-repeat > button { margin-top: 14px; }
.customer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
label { display: grid; gap: 6px; margin-top: 13px; font-weight: 650; }
input, select, textarea { width: 100%; padding: 9px 10px; min-height: 40px; border: 1px solid #c9c4b2; border-radius: 9px; background: white; color: inherit; }
input::placeholder, textarea::placeholder { color: #626550; }
textarea { resize: vertical; }
.check-field { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; }
.check-field input { width: auto; min-height: auto; accent-color: var(--olive); }
.invoice-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 16px; }
.invoice-filters label { margin: 0; }
.invoice-filters label:first-child { flex: 1 1 200px; }
.invoice-filters .check-field { min-height: 40px; }
.purchase-filter { width: min(100%, 290px); margin: 0 0 16px; }
.panel > button { margin-top: 14px; }
.panel > button + button { margin-left: 8px; }
.ticket-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(390px, 1.6fr); gap: 16px; }
.ticket-layout > div { min-width: 0; }
.ticket-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.timer-display { font-size: 1.65rem; font-variant-numeric: tabular-nums; font-weight: 700; margin-bottom: 0; }
.tax-preview { margin-top: 16px; border: 1px solid var(--line); padding: 12px; border-radius: 10px; }
.tax-preview summary, .workspace-chooser summary { cursor: pointer; font-weight: 650; color: var(--olive-dark); }
.tax-preview button { margin-top: 12px; }
#error, #login-error { color: #a12246; }
.login-page {
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center;
  min-height: 100dvh; padding: 24px;
  background:
    radial-gradient(ellipse at 15% 15%, #8d75364d, transparent 42%),
    radial-gradient(ellipse at 82% 85%, #6878494d, transparent 42%),
    linear-gradient(140deg, #1e2218, #2a3323 57%, #20271c);
}
.login-panel {
  width: min(100%, 450px); margin: 0; padding: clamp(24px, 6vw, 43px);
  border-radius: 26px; border-color: #fff9; box-shadow: 0 22px 75px #10130ca0;
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 25px; }
.portal-panel:has(#portal-view:not([hidden])) { width: min(100%, 720px); }
.portal-panel section, #portal-ticket { margin-top: 24px; }
.portal-panel li { margin-bottom: 8px; overflow-wrap: anywhere; }
.login-brand strong { font-size: 1.32rem; letter-spacing: -.025em; }
.login-panel h1 { font-size: 2.14rem; margin-bottom: 19px; }
.login-panel input { min-height: 46px; }
.login-panel form > button[type="submit"] { width: 100%; margin-top: 5px; min-height: 45px; }
.password-control { position: relative; margin-top: 6px; }
.password-control input { padding-right: 74px; }
.password-toggle { position: absolute; top: 6px; right: 6px; min-height: 34px; padding: 4px 9px; font-size: .84rem; }
.workspace-chooser { margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }
.workspace-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 6px 0 9px; }
.workspace-field input { flex: 1 1 115px; min-width: 0; }
.workspace-field span { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  .ticket-layout { grid-template-columns: 1fr; }
}
@media (max-width: 740px) {
  body:not(.login-page) { display: block; }
  aside { position: static; height: auto; flex-direction: column; padding: 13px 12px; gap: 10px; }
  aside > nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; }
  .nav-group { display: flex; gap: 3px; }
  .nav-group > p { display: none; }
  nav a { white-space: nowrap; }
  aside .sign-out { align-self: end; }
  main { padding: 19px 14px; }
  .page-header { min-height: 64px; gap: 9px; flex-wrap: wrap; }
  .page-heading { gap: 9px; }
  .page-icon { width: 40px; height: 40px; }
  .page-icon svg { width: 23px; height: 23px; }
  .profile-fields { grid-template-columns: 1fr; }
}
@media print {
  body:has(.receipt) { display: block; background: white; }
  body:has(.receipt) aside, body:has(.receipt) #view > a, body:has(.receipt) button,
  body:has(.receipt) #message, body:has(.receipt) .page-icon { display: none; }
  body:has(.receipt) main { padding: 0; }
  .receipt .panel { break-inside: avoid; box-shadow: none; }
}
.admin-directory { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:1rem; }
.admin-directory .panel a { display:block; padding:.55rem 0; }
.document-sheet { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; padding:2rem; background:white; color:#172033; }
@media print { body:has(.document-sheet) .page-header { display:none; } .document-sheet { padding:0; } }
.paper-choice { display:block; margin:1rem 0; }
.document-sheet[data-paper="roll"] { max-width:80mm; padding:4mm; font:10pt/1.45 monospace; }
@page msp-letter { size:letter; margin:16mm; }
@page msp-a4 { size:A4; margin:16mm; }
@media print {
  .paper-choice { display:none; }
  .document-sheet[data-paper="letter"] { page:msp-letter; }
  .document-sheet[data-paper="a4"] { page:msp-a4; }
  .document-sheet[data-paper="roll"] { width:72mm; max-width:100%; padding:0; }
}
.document-logo { display:block; max-width:min(190px,100%); max-height:84px; object-fit:contain; margin:0 0 1rem; }
.document-footer { margin-top:1.5rem; border-top:1px solid #cbd5db; padding-top:.6rem; font-size:.9em; }
.skip-link { position:fixed; left:1rem; top:1rem; transform:translateY(-220%); z-index:100; background:white; padding:.7rem 1rem; border:2px solid currentColor; border-radius:.4rem; }
.skip-link:focus { transform:none; }
.site-links { display:flex; gap:.35rem 1rem; flex-wrap:wrap; margin-top:2rem; padding-top:1rem; border-top:1px solid var(--line); font-size:.94rem; }
.site-links a { padding-block:.35rem; }
body.information { display:block; }
.information main { max-width:52rem; background:white; margin:1rem auto; line-height:1.6; }
.information section { padding-block:.65rem; }
.information h2 { margin-top:1rem; }
.information summary { cursor:pointer; font-weight:600; padding:.5rem 0; }
.information .info-nav { margin-bottom:1.5rem; }
.information form button { margin-top:.6rem; }
.program-map { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(19rem,100%),1fr)); gap:1rem; margin:1.5rem 0; align-items:start; }
.information .program-map section { border:1px solid #dfdacb; border-top:4px solid #62704e; border-radius:.55rem; padding:.8rem 1rem; }
.program-map section h2 { margin:0 0 .75rem; }
.program-map p { margin:.45rem 0; }
@media print { .program-map { display:block; columns:2; font-size:9pt; } .program-map section { margin-bottom:.7rem; } }
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}
@media (forced-colors:active) { :focus-visible { outline:3px solid Highlight; } }
@media print { .site-links,.skip-link,.information .info-nav { display:none; } .information main { max-width:none; margin:0; padding:0; } .information section { break-inside:avoid; } }
