:root {
  color-scheme: light;
  --canvas: #f4f5f7;
  --paper: #fff;
  --ink: #25272c;
  --muted: #60656f;
  --line: #e0e2e6;
  --charcoal: #24262b;
  --red: #cf2028;
  --red-dark: #ad1920;
  --round: 16px;
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #dc6269; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
[data-icon] { display: inline-flex; flex: none; align-items: center; justify-content: center; }
[data-icon] svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: #fff; color: var(--ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 26px 16px 19px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; margin: 0 5px 30px; }
.company-logo { display: block; width: 100%; max-width: 182px; height: auto; }
.brand-caption { display: block; padding-top: 13px; width: 100%; border-top: 1px solid var(--line); font-size: 20px; font-weight: 750; letter-spacing: -.035em; }
.sunmi-card { margin-top: 17px; }
.sunmi-expiry .pill { width: fit-content; margin-top: 4px; }
.sunmi-expiry time { display: block; }
.sunmi-fault { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 38ch; }
.sunmi-table td:nth-child(4) { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .sunmi-card .table-heading { flex-wrap: wrap; }
}
.sidebar nav { display: grid; gap: 5px; }
.nav-link { min-height: 43px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; color: #555b65; font-size: 13px; font-weight: 550; }
.nav-link:hover { background: #f4f5f7; color: var(--ink); }
.nav-link[aria-current="page"] { color: #af1b23; background: #fcebed; border-color: #f0c1c5; }
.nav-link [data-icon] svg { width: 17px; height: 17px; }
.sidebar-foot { display: flex; align-items: center; gap: 11px; margin-top: auto; border-top: 1px solid #e0e2e6; padding: 16px 6px 0; }
.sidebar-foot i { width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: #56d4a5; box-shadow: 0 0 0 4px #203d43; }
.sidebar-foot strong, .sidebar-foot small { display: block; font-size: 12px; }
.sidebar-foot small { color: #60656f; }

.workspace { margin-left: 224px; }
.topbar { min-height: 70px; padding: 13px 35px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar p { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.topbar strong { color: var(--ink); }
.slash { color: #7c8da5; }
.button { min-height: 40px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 7px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--red); border-color: var(--red); }
.button-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button-secondary { color: var(--ink); background: var(--paper); border-color: #cfd2d7; }
.button-secondary:hover { background: #f3f4f6; }
main { max-width: 1460px; margin: auto; padding: 26px 35px 40px; }

.hero { min-height: 156px; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 27px 31px; border: 1px solid #33353b; border-radius: var(--round); background: #292b30; color: #fff; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 0 0 66%; background: linear-gradient(110deg, #c91f28, #a31a23); clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%); }
.hero h1 { font-size: clamp(28px, 3vw, 41px); letter-spacing: -.05em; line-height: 1.13; }
.hero p { margin-top: 9px; color: #e2e3e6; font-size: 14px; }
.hero-art { display: flex; align-items: center; gap: 13px; padding-right: 4%; }
.device { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #ffffff40; border-radius: 13px; background: #ffffff12; color: #fff; }
.device svg { width: 27px; height: 27px; stroke-width: 1.4; }
.device-center { width: 68px; height: 68px; color: #fff; border-color: #ffffff9c; box-shadow: 0 0 24px #ffffff12; }
.device-center svg { width: 31px; height: 31px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 16px 0 20px; }
.stat { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 82px; padding: 13px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 13px; text-align: left; }
.stat:hover, .stat[aria-pressed="true"] { border-color: #df858b; background: #fff8f8; }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #fcebed; color: #b51c24; }
.stat[data-status="work"] .stat-icon { background: #fff1d9; color: #895200; }
.stat[data-status="waiting"] .stat-icon { background: #f0ebff; color: #623eb0; }
.stat[data-status="done"] .stat-icon { background: #e2f6ed; color: #126447; }
.stat-label { display: block; font-size: 12px; color: var(--muted); line-height: 1.25; }
.stat-number { display: block; font-size: 24px; font-weight: 750; line-height: 1.14; margin-top: 4px; letter-spacing: -.04em; }

.table-card, .case-card, .summary-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--round); }
.table-card { overflow: hidden; }
.table-heading { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 19px; }
.table-title { display: flex; align-items: center; gap: 9px; }
h2 { font-size: 20px; letter-spacing: -.035em; line-height: 1.25; }
.total { color: #555b65; background: #eeeff2; border-radius: 20px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 19px 15px; }
.filters select, .search, .dialog-body input, .dialog-body select, textarea { min-height: 37px; border: 1px solid #cfd2d7; border-radius: 8px; background: #fff; color: var(--ink); }
.filters select { max-width: 100%; padding: 5px 8px; font-size: 13px; }
.search { display: flex; flex: 1 1 230px; max-width: 420px; align-items: center; gap: 7px; padding: 0 9px; }
.search [data-icon] { color: #5f7596; }
.search svg { width: 16px; height: 16px; }
.search input { min-width: 0; flex: 1; min-height: 32px; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 2px solid #dc6269; outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: #6c7079; opacity: 1; }
.text-button { align-self: center; border: 0; padding: 5px 3px; background: transparent; color: #b51c24; font-size: 13px; font-weight: 650; }
.text-button:hover { text-decoration: underline; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
th { font-size: 12px; font-weight: 700; white-space: nowrap; color: #555b65; background: #f2f3f5; border-block: 1px solid var(--line); }
td { border-bottom: 1px solid #e8e9ed; color: #414650; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fafafa; }
.ticket-link { display: block; width: fit-content; max-width: 285px; margin: 0; padding: 1px 0; border: 0; background: transparent; color: #a91c24; text-align: left; font-size: 13px; font-weight: 720; line-height: 1.3; overflow-wrap: anywhere; }
.ticket-link:hover { color: #a91c24; text-decoration: underline; }
.cell-note { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
.cell-location { min-width: 108px; overflow-wrap: anywhere; }
.cell-date { min-width: 86px; }
.pill { display: inline-flex; gap: 5px; align-items: center; border-radius: 20px; padding: 3px 7px; font-size: 12px; line-height: 1.25; white-space: nowrap; font-weight: 750; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-new { background: #fcebed; color: #b51c24; }
.status-work { background: #fff1db; color: #805000; }
.status-waiting { background: #f0eaff; color: #6541a9; }
.status-done { background: #e5f5ec; color: #17674a; }
.priority-high { color: #a02c3c; background: #ffebee; }
.priority-normal { color: #555b65; background: #eeeff2; }
.priority-low { color: #3b5f55; background: #e9f4f0; }
.table-footer { padding: 11px 19px; font-size: 12px; color: var(--muted); }
.empty { padding: 27px 12px; text-align: center; border-bottom: 1px solid var(--line); color: var(--muted); }
.empty > [data-icon] { width: 34px; height: 34px; border-radius: 10px; color: var(--red); background: #fcebed; margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); }
.empty .button { margin-top: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.summary-card { padding: 21px; }
.summary-card p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bar-list { display: grid; gap: 15px; margin: 22px 0 0; padding: 0; list-style: none; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 13px; }
.bar-track { display: block; height: 8px; border-radius: 9px; background: #eeeff2; }
.bar-value { display: block; height: 100%; border-radius: inherit; background: #cf2028; }
.bar-value[data-key="work"] { background: #bb760b; }
.bar-value[data-key="waiting"] { background: #7956c3; }
.bar-value[data-key="done"] { background: #258362; }
.case-card { margin-top: 16px; padding: 23px; }
.case-card p { margin-top: 7px; color: var(--muted); }
.case-intro { max-width: 67ch; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.case-grid > div, .case-scenario { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: #fafafa; }
.case-card h3 { font-size: 15px; }
.case-scenario .button { margin-top: 13px; }
.case-card .case-note { margin: 17px 0 6px; font-size: 13px; }

dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--round); color: var(--ink); box-shadow: 0 24px 90px #0e1b3b4d; }
dialog::backdrop { background: #0b142ba8; }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 19px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header p { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-body { overflow-y: auto; display: grid; gap: 12px; padding: 15px 19px; }
.dialog-body label { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 650; }
.dialog-body input, .dialog-body select, textarea { width: 100%; padding: 6px 9px; font-size: 14px; font-weight: 400; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.icon-button { display: grid; place-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); }
.icon-button:hover { background: #f3f4f6; }
.form-error { color: #9e2636; font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 3; max-width: min(440px, calc(100% - 44px)); padding: 11px 15px; color: white; background: var(--charcoal); box-shadow: 0 8px 24px #1c2b4944; border-radius: 10px; font-size: 13px; }

@media (max-width: 1100px) {
  .sidebar { width: 187px; }
  .workspace { margin-left: 187px; }
  .topbar, main { padding-inline: 23px; }
  .stat { grid-template-columns: 32px minmax(0, 1fr); gap: 7px; padding: 10px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-icon svg { width: 17px; height: 17px; }
}
@media (max-width: 780px) {
  .sidebar { position: static; width: auto; padding: 13px 15px 8px; }
  .brand { margin: 0 0 10px; gap: 7px; padding-right: 105px; }
  .company-logo { width: 145px; }
  .brand-caption { width: auto; padding: 0; border: 0; font-size: 17px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 5px; }
  .nav-link { min-height: 35px; padding-inline: 8px; gap: 6px; font-size: 12px; }
  .sidebar-foot { position: absolute; top: 16px; right: 13px; padding: 0; border: 0; }
  .sidebar-foot small { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 55px; padding: 8px 14px; }
  .top-prefix, .slash { display: none; }
  main { padding: 14px 13px 26px; }
  .hero { min-height: 123px; padding: 18px; }
  .hero-art { padding: 0; gap: 6px; }
  .device { width: 38px; height: 38px; border-radius: 9px; }
  .device-center { width: 47px; height: 47px; }
  .device svg { width: 21px; height: 21px; }
  .stats-grid { gap: 8px; margin-block: 12px; }
}
@media (max-width: 560px) {
  .hero-art .device:not(.device-center) { display: none; }
  .hero p { font-size: 13px; }
  .stats-grid, .case-grid, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 64px; }
  .stat-number { font-size: 21px; }
  .table-heading, .filters, .table-footer { padding-inline: 13px; }
  .search { flex-basis: 100%; max-width: none; }
  .table-scroll { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 13px; border-top: 1px solid var(--line); }
  td, td:first-child, td:last-child { display: block; padding: 0; border: 0; }
  td:first-child { grid-column: 1 / -1; }
  td:last-child { align-self: center; }
  .ticket-link { max-width: none; }
  .summary-grid, .case-grid { grid-template-columns: 1fr; }
  .case-card, .summary-card { padding: 15px; }
}
@media (max-width: 360px) {
  .nav-link [data-icon] { display: none; }
  .table-heading { align-items: flex-start; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
}

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.role-picker { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.role-picker select, .date-filters input, .member-form input, .member-form select {
  min-height: 36px; border: 1px solid #cfd2d7; border-radius: 8px; background: white;
  color: var(--ink); padding: 5px 8px; font-size: 13px;
}
.mode-banner { margin-bottom: 13px; padding: 9px 13px; border: 1px solid #e1e3e7; border-radius: 9px; background: #f0f1f4; color: #505660; font-size: 13px; }
.cell-recipient { min-width: 80px; font-weight: 650; }
.report-card { margin-top: 16px; }
.date-filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.report-scroll td { overflow-wrap: anywhere; }
.report-scroll td:nth-child(3) { width: 38%; white-space: pre-wrap; }
.member-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 17px 0; }
.member-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 650; }
.technician-import { display: grid; justify-items: start; gap: 8px; max-width: 620px; padding: 16px 0; border-top: 1px solid var(--line); }
.technician-import p { margin: 0; }
.technician-import label { font-weight: 650; }
.technician-import textarea { box-sizing: border-box; width: 100%; padding: 8px 10px; }
.members-list { list-style: none; padding: 0; }
.members-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.dialog-body .checkbox-field { display: flex; align-items: center; gap: 8px; }
.dialog-body .checkbox-field input { width: 17px; height: 17px; min-height: 0; accent-color: var(--red); }
.dialog-body :disabled { background-color: #f5f7fb; color: #555b65; opacity: 1; }
#access-error .button { margin-top: 14px; }
@media (max-width: 560px) {
  .top-actions { gap: 5px; }
  .role-picker { gap: 4px; }
  .report-scroll td:nth-child(3) { grid-column: 1 / -1; width: auto; }
}

.report-toggle { min-height: 37px; }
.report-toggle input { accent-color: var(--red); }
.report-error { padding: 0 19px 10px; }
.report-scroll td:nth-child(3) { width: auto; white-space: normal; }
.cell-author { min-width: 90px; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .report-scroll td:nth-child(3) { grid-column: auto; }
}

.button:disabled { opacity: .56; cursor: default; }
.button-primary:disabled:hover { background: var(--red); border-color: var(--red); }

.contractor-reference { color: #7f3035; font-weight: 550; }

.deadline-list, .parts-list { display: grid; gap: 8px; }
.deadline-note { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.deadline-note[data-outcome="late"] { color: #a31a23; font-weight: 700; }
.deadline-note[data-outcome="on-time"] { color: #17674a; }
.card-section { display: grid; gap: 9px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.card-section legend, .card-section h3 { font-size: 14px; font-weight: 700; }
.part-row { display: grid; align-items: end; grid-template-columns: minmax(0, 1fr) minmax(94px, .42fr) auto; gap: 8px; }
.act-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.act-list { display: grid; gap: 5px; margin: 0; padding-left: 18px; overflow-wrap: anywhere; }
.act-list a { color: var(--red-dark); text-decoration: underline; font-size: 14px; }
@media (max-width: 480px) {
  .part-row { grid-template-columns: minmax(0, 1fr) minmax(90px, .45fr); }
  .part-row button { justify-self: start; grid-column: span 2; }
}
