/* ==========================================================================
   Staff service management app
   ========================================================================== */
body.app { background: var(--surface-2); }
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--navy-900); color: #b8c3dc; display: flex; flex-direction: column; padding: 1.1rem .85rem; }
.sidebar .brand { color: #fff; padding: .25rem .5rem 1.25rem; }
.sidebar .brand small { color: #7f8db0; }
.side-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.side-nav .label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #6a7898; padding: 1rem .75rem .35rem; font-weight: 700; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: 10px; color: #c9d3ea; text-decoration: none; font-weight: 600; font-size: .93rem; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(47,107,255,.22); color: #fff; box-shadow: inset 3px 0 0 var(--blue-500); }
.side-nav .count { margin-left: auto; background: var(--amber-500); color: var(--navy-950); font-size: .72rem; font-weight: 800; padding: .05rem .45rem; border-radius: 999px; }
.side-user { margin-top: auto; padding: .9rem .75rem .25rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .88rem; }
.side-user strong { display: block; color: #fff; }
.side-user .role { display: inline-block; margin: .2rem 0 .6rem; padding: .1rem .5rem; border-radius: 999px; background: rgba(15,181,166,.2); color: #6fe6d9; font-size: .75rem; font-weight: 700; }
.side-user form { display: inline; }
.side-user a, .side-user button { color: #c9d3ea; font-size: .85rem; }
.side-user .links { display: flex; gap: 1rem; flex-wrap: wrap; }

.topbar { display: none; }
.main { min-width: 0; padding: clamp(1rem, 3vw, 2rem); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin: 0; font-weight: 800; }
.page-head .sub { margin: .25rem 0 0; color: var(--ink-3); }
.breadcrumb { font-size: .85rem; margin-bottom: .35rem; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-600); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; background: var(--navy-900); color: #fff; }
  .topbar .brand { color: #fff; font-size: 1rem; }
  .topbar .brand-mark { width: 34px; height: 34px; }
  .topbar .btn { --btn-fg: #fff; --btn-bd: rgba(255,255,255,.25); --btn-bg: transparent; }
  .sidebar { position: fixed; inset: 0 30% 0 0; max-width: 300px; z-index: 60; transform: translateX(-105%); transition: transform .25s ease; height: 100%; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(7,15,34,.5); z-index: 55; }
}

/* ---------- Stats ---------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin-bottom: 1.5rem; }
.stat { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: #c7d6f5; box-shadow: var(--shadow-sm); color: var(--ink); }
.stat .service-icon, .stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-100); color: var(--blue-600); flex: none; }
.stat-icon.warn { background: var(--amber-100); color: #9a5d00; }
.stat-icon.danger { background: var(--red-100); color: var(--red-600); }
.stat-icon.ok { background: var(--green-100); color: var(--green-600); }
.stat-icon.teal { background: var(--teal-100); color: #07857a; }
.stat strong { display: block; font-size: 1.6rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--ink-3); font-weight: 600; }

.dash-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }

/* ---------- Job list (mobile-friendly cards) ---------- */
.job-list { list-style: none; margin: 0; padding: 0; }
.job-list > li + li { border-top: 1px solid var(--line); }
.job { display: flex; gap: .9rem; padding: .95rem 1.25rem; align-items: flex-start; text-decoration: none; color: var(--ink); }
a.job:hover { background: var(--blue-50); color: var(--ink); }
.job-main { flex: 1; min-width: 0; }
.job-title { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; }
.job-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .84rem; color: var(--ink-3); margin-top: .15rem; }
.job-meta .icon { width: 1em; height: 1em; }
.job-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex: none; text-align: right; }
.job-type { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none; background: var(--blue-100); color: var(--blue-600); }
.job-type.installation { background: var(--teal-100); color: #07857a; }
.date-overdue { color: var(--red-600); font-weight: 700; }
.date-today { color: #9a5d00; font-weight: 700; }
.next-action { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 700; color: var(--blue-600); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--teal-500)); border-radius: inherit; }

/* ---------- Filters ---------- */
.filters { padding: 1rem 1.25rem; }
.filters .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .75rem; }
.filters .field > label { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.filters .field input, .filters .field select { min-height: 42px; font-size: .92rem; }
.filters .field-search { grid-column: span 2; }
@media (max-width: 560px) { .filters .field-search { grid-column: auto; } }
.filter-toggle { display: none; }
@media (max-width: 700px) {
  .filter-toggle { display: inline-flex; }
  .filters.collapsed .form-grid > .field:not(.field-search), .filters.collapsed .filter-extra { display: none; }
}
.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.seg a { padding: .4rem .85rem; border-radius: 999px; text-decoration: none; font-weight: 650; font-size: .88rem; color: var(--ink-2); }
.seg a[aria-current="true"] { background: var(--navy-900); color: #fff; }
.seg .n { opacity: .7; margin-left: .2rem; }

/* ---------- Ticket detail ---------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .ticket-layout { grid-template-columns: 1fr; } }
.ticket-side { display: grid; gap: 1.25rem; position: sticky; top: 1rem; }
@media (max-width: 1100px) { .ticket-side { position: static; order: -1; } }
.tracker { list-style: none; margin: 0; padding: 1rem 1.25rem; display: flex; gap: .25rem; overflow-x: auto; }
.tracker li { flex: 1 0 92px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; font-size: .74rem; font-weight: 650; color: var(--ink-3); position: relative; }
.tracker li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--line-2); z-index: 0; }
.tracker li:first-child::before { display: none; }
.tracker .pip { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); font-size: .75rem; }
.tracker li.done { color: var(--ink-2); }
.tracker li.done .pip { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.tracker li.done::before, .tracker li.current::before { background: var(--green-600); }
.tracker li.current { color: var(--blue-600); }
.tracker li.current .pip { border-color: var(--blue-600); background: var(--blue-100); color: var(--blue-600); box-shadow: 0 0 0 4px rgba(47,107,255,.15); }
.next-hint { display: flex; gap: .7rem; align-items: center; padding: .85rem 1.25rem; border-top: 1px solid var(--line); background: var(--blue-50); color: #1a3f9e; font-weight: 650; font-size: .93rem; border-radius: 0 0 var(--radius) var(--radius); }

.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: .55rem 1.25rem; margin: 0; font-size: .93rem; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.prose-pre { white-space: pre-line; }
.people { display: flex; flex-wrap: wrap; gap: .4rem; }
.person { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem .2rem .25rem; border-radius: 999px; background: var(--surface-3); font-size: .85rem; font-weight: 600; }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy-700); color: #fff; font-size: .7rem; font-weight: 800; text-transform: uppercase; }

.action-card { border-color: #c9d9ff; box-shadow: 0 8px 28px -14px rgba(22,83,240,.45); }
.action-card .card-head { background: var(--blue-50); border-radius: var(--radius) var(--radius) 0 0; }
.action-list { display: grid; gap: .6rem; }
.action-list .btn { justify-content: flex-start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface-2); }
.panel + .panel { margin-top: .75rem; }
details.panel > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "▾"; margin-left: auto; color: var(--ink-3); }
details.panel[open] > summary { margin-bottom: .85rem; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr; gap: .75rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .k { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); }
.feed .k .icon { width: 1.05rem; height: 1.05rem; }
.feed .k-quotation, .feed .k-agreement { background: var(--amber-100); color: #9a5d00; }
.feed .k-closed, .feed .k-report { background: var(--green-100); color: var(--green-600); }
.feed .k-assignment, .feed .k-created { background: var(--blue-100); color: var(--blue-600); }
.feed .k-schedule, .feed .k-reschedule { background: var(--teal-100); color: #07857a; }
.feed .msg { font-size: .93rem; overflow-wrap: anywhere; }
.feed .meta { font-size: .8rem; color: var(--ink-3); }

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; gap: .75rem; align-items: center; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .grow { flex: 1; min-width: 0; }
.doc-list strong { display: block; }

.sub-section + .sub-section { margin-top: 1.25rem; }
.card + .card { margin-top: 1.25rem; }
.dash-grid > .card + .card, .ticket-side > .card + .card { margin-top: 0; }
.ticket-main > .card + .card { margin-top: 1.25rem; }
.dash-grid > .card + .card, .ticket-side > .card + .card { margin-top: 0; }

/* Quotation editor */
.line-items-wrap { padding: 0 1.5rem 1.25rem; }
.items-table, .items-table tbody { display: block; width: 100%; }
.items-table tbody { display: grid; gap: .75rem; }
.items-table .item-row { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(85px, .65fr) minmax(90px, .7fr) minmax(145px, 1fr) minmax(105px, .8fr) auto; gap: .75rem; align-items: end; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.items-table td { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; }
.items-table td > label:not(.line-delete), .items-table .line-label { margin-bottom: .35rem; color: var(--ink-3); font-size: .74rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.items-table input:not([type=checkbox]) { width: 100%; min-width: 0; min-height: 44px; padding: .55rem .7rem; color: var(--ink); font: inherit; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); transition: background .15s, border-color .15s, box-shadow .15s; }
.items-table input:not([type=checkbox]):hover { border-color: #9fb8f5; background: var(--surface); }
.items-table input:not([type=checkbox]):focus { outline: none; border-color: var(--blue-500); background: var(--surface); box-shadow: var(--focus); }
.items-table input::placeholder { color: var(--ink-3); }
.items-table .line-total-cell { justify-content: end; min-height: 68px; padding: .45rem .75rem; border-radius: var(--radius-sm); background: var(--blue-50); }
.items-table .line-total { color: var(--navy-800); font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.items-table .line-remove { justify-content: end; min-height: 68px; }
.items-table .line-remove .btn { min-width: 42px; min-height: 44px; }
.items-table .line-delete { display: flex; align-items: center; gap: .35rem; min-height: 44px; padding: .5rem; border-radius: var(--radius-sm); color: var(--red-600); font-size: .8rem; font-weight: 650; cursor: pointer; }
.items-table .line-delete input { accent-color: var(--red-600); }
.items-table .error { margin: .35rem 0 0; color: var(--red-600); }
.items-table tr.deleted { opacity: .5; }
.items-table tr.deleted input:not([type=checkbox]) { text-decoration: line-through; }
@media (max-width: 1050px) {
  .items-table .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items-table .line-description { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .line-items-wrap { padding: 0 1rem 1rem; }
  .items-table .item-row { gap: .7rem; padding: .8rem; }
  .items-table td:nth-child(4) { grid-column: 1 / -1; }
}
.totals { margin-left: auto; width: min(100%, 340px); display: grid; grid-template-columns: 1fr auto; gap: .45rem 1.5rem; padding: 1rem 1.25rem; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-3); }
.totals dd { margin: 0; text-align: right; font-weight: 650; }
.totals .grand { font-size: 1.15rem; font-weight: 800; color: var(--ink); padding-top: .45rem; border-top: 1px solid var(--line); }
.item-errors td { padding-top: 0; }

.upcoming-dates { display: flex; flex-wrap: wrap; gap: .5rem; }
.upcoming-dates span { padding: .35rem .7rem; border-radius: 8px; background: var(--surface-3); font-weight: 650; font-size: .88rem; }
.upcoming-dates span:first-child { background: var(--blue-600); color: #fff; }

/* Status bars on reports */
.bar-row { display: grid; grid-template-columns: 190px 1fr 40px; gap: .75rem; align-items: center; padding: .35rem 0; font-size: .9rem; }
.bar-row .bar { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; background: var(--blue-500); border-radius: inherit; min-width: 2px; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr 40px; } .bar-row .bar { grid-column: 1 / -1; order: 3; } }

/* Pagination */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }

/* Responsive tables become cards on phones */
@media (max-width: 700px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
  .table.stack-sm td { border: 0; padding: .15rem 0; }
  .table.stack-sm td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
  .table.stack-sm td.primary { grid-column: 1 / -1; }
}

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: radial-gradient(700px 400px at 100% 0%, rgba(15,181,166,.3), transparent 60%), var(--navy-900); color: #c9d3ea; padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; }
.login-art .brand { color: #fff; }
.login-art h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.login-form-wrap { display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-card { width: min(420px, 100%); }
@media (max-width: 800px) { .login-page { grid-template-columns: 1fr; } .login-art { padding: 1.5rem; } .login-art .hide-sm { display: none; } }

/* ---------- Printable formal documents ---------- */
body.doc { background: var(--surface-3); }
.doc-toolbar { display: flex; gap: .75rem; justify-content: center; padding: 1rem; flex-wrap: wrap; }
.sheet { width: min(210mm, 100% - 1.5rem); margin: 0 auto 2rem; background: #fff; padding: clamp(1.25rem, 4vw, 16mm); box-shadow: var(--shadow); border-radius: 4px; font-size: .92rem; }
.sheet-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; padding-bottom: 1rem; border-bottom: 3px solid var(--navy-900); margin-bottom: 1.25rem; flex-wrap: wrap; }
.sheet-company { font-size: 1.15rem; font-weight: 800; color: var(--navy-900); letter-spacing: .01em; margin: 0 0 .25rem; }
.sheet-head .contact { font-size: .82rem; color: var(--ink-2); line-height: 1.5; }
.sheet-title { text-align: right; }
.sheet-title h1 { font-size: 1.6rem; margin: 0; color: var(--blue-600); letter-spacing: .04em; text-transform: uppercase; }
.sheet h2 { font-size: 1rem; margin: 1.5rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.sheet .table th { background: var(--navy-900); color: #fff; }
.sheet .kv { font-size: .88rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 2.5rem; }
.signatures div { border-top: 1px solid var(--ink); padding-top: .4rem; font-size: .85rem; color: var(--ink-2); }
.sheet-foot { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--ink-3); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@media print {
  @page { size: A4; margin: 12mm; }
  body, body.doc, body.app { background: #fff !important; }
  .no-print, .doc-toolbar, .sidebar, .topbar, .alerts { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .sheet { box-shadow: none; width: auto; margin: 0; padding: 0; }
  .sheet .table th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

.range-out { display: inline-block; font-weight: 800; color: var(--blue-600); font-variant-numeric: tabular-nums; }

/* ---------- Sectioned forms (customer form) ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } .form-aside { order: -1; } }
.form-aside { position: sticky; top: 1rem; }
.form-card { overflow: hidden; }
.form-card > .form-errors { margin: 1.25rem 1.5rem 0; }
.form-section { padding: 1.5rem; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section-head { display: flex; gap: .85rem; align-items: center; margin-bottom: 1.1rem; }
.form-section-head h2 { font-size: 1.05rem; margin: 0; }
.form-section-head p { margin: 0; font-size: .87rem; color: var(--ink-3); }
.form-section-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-100); color: var(--blue-600); flex: none; }
.form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-footer { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: var(--surface-2); border-top: 1px solid var(--line); }
@media (max-width: 560px) { .form-footer { flex-direction: column-reverse; align-items: stretch; } .form-footer .cluster { flex-direction: column; } .form-footer .btn { width: 100%; } }
.field input::placeholder, .field textarea::placeholder { color: #9aa6bd; }

.type-cards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.type-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; min-height: 92px; padding: .85rem .6rem; text-align: center; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: #fff; cursor: pointer; font-weight: 650; font-size: .88rem; color: var(--ink-2); transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; }
.type-card:hover { border-color: #9fb8f5; transform: translateY(-1px); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); transition: background .15s, color .15s; }
.type-card:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); color: var(--ink); box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
.type-card:has(input:checked) .type-card-icon { background: var(--blue-600); color: #fff; }
.type-card:has(input:focus-visible) { box-shadow: var(--focus); }
.type-card:has(input:checked)::after { content: "✓"; position: absolute; top: .4rem; right: .55rem; font-size: .75rem; font-weight: 800; color: var(--blue-600); }

.aside-title { display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.tip-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .6rem; font-size: .9rem; color: var(--ink-2); }
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field > legend { margin-bottom: .55rem; }

/* ---------- Shared pieces for redesigned forms ---------- */
.form-section > .form-grid + .form-grid, .form-section > .form-grid + .field, .form-section > .field + .form-grid { margin-top: 1rem; }
.aside-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; font-size: .9rem; }
.aside-facts li { display: flex; gap: .6rem; align-items: flex-start; }
.aside-facts .icon { color: var(--blue-600); margin-top: .15rem; }
.form-aside { display: grid; gap: 1.25rem; }

/* Large option cards with a description (ticket type, role) */
.option-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.option-card { position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.option-card:hover { border-color: #9fb8f5; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card strong { display: block; font-size: .98rem; }
.option-card small { display: block; color: var(--ink-3); font-size: .84rem; line-height: 1.45; margin-top: .15rem; }
.option-card .type-card-icon { flex: none; }
.option-card:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
.option-card:has(input:checked) .type-card-icon { background: var(--blue-600); color: #fff; }
.option-card:has(input:focus-visible) { box-shadow: var(--focus); }
.option-card:has(input:checked)::after { content: "✓"; position: absolute; top: .55rem; right: .7rem; font-size: .8rem; font-weight: 800; color: var(--blue-600); }

/* Pill radio group (priority) */
.pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.pill { position: relative; display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: .45rem 1rem; border: 1.5px solid var(--line-2); border-radius: 999px; background: #fff; font-weight: 650; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--dot, var(--ink-3)); }
.pill-low { --dot: #8b97ad; } .pill-normal { --dot: var(--blue-500); } .pill-high { --dot: var(--amber-500); } .pill-urgent { --dot: var(--red-600); }
.pill:has(input:checked) { border-color: var(--dot); background: color-mix(in srgb, var(--dot) 10%, #fff); color: var(--ink); }
.pill:has(input:focus-visible) { box-shadow: var(--focus); }

/* Big toggle row for single checkboxes (e.g. "job finished") */
.toggle-row { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.toggle-row input { width: 1.3rem; height: 1.3rem; margin-top: .1rem; accent-color: var(--blue-600); flex: none; }
.toggle-row strong { display: block; }
.toggle-row small { color: var(--ink-3); }
.toggle-row:has(input:checked) { border-style: solid; border-color: var(--green-600); background: var(--green-100); }

/* Compact sidebar so the account links stay visible on shorter screens */
.side-nav a { padding: .5rem .75rem; }
.side-nav .label { padding: .8rem .75rem .25rem; }
.sidebar .brand { padding-bottom: .9rem; }
.side-user { padding-top: .75rem; }
.spread > .form-section-head { margin-bottom: 0; }
.field .help ul { margin: .25rem 0 0; padding-left: 1.1rem; display: grid; gap: .1rem; }
