:root {
  color-scheme: light;
  --ink: #10212b;
  --muted: #64748b;
  --line: #dbe3e8;
  --canvas: #f4f7f8;
  --card: #ffffff;
  --brand: #08766c;
  --brand-dark: #075c55;
  --brand-soft: #e7f7f4;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #b54708;
  --warning-soft: #fff7e8;
  --success: #067647;
  --success-soft: #ecfdf3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.loading-screen, .auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(8,118,108,.17), transparent 32%),
    radial-gradient(circle at 88% 85%, rgba(14,165,233,.12), transparent 34%),
    #edf4f3;
}

.loading-screen { align-content: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #cfe2df; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-card { width: min(100%, 460px); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; padding: 34px; box-shadow: 0 30px 80px rgba(15,45,52,.15); }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 22px; border-radius: 18px; background: var(--brand); color: white; font-weight: 800; letter-spacing: -.04em; }
.auth-card h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; }
.auth-card > p { margin: 10px 0 26px; color: var(--muted); line-height: 1.6; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 12px 24px; color: white; background: linear-gradient(105deg,#084f4a,#08766c); box-shadow: 0 5px 22px rgba(8,75,70,.18); }
.top-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-logo { display:grid; place-items:center; flex:0 0 auto; width:42px; height:42px; border-radius:14px; background:rgba(255,255,255,.14); font-weight:900; }
.top-brand h1 { margin:0; font-size:1rem; letter-spacing:-.015em; }
.top-brand p { margin:3px 0 0; font-size:.74rem; color:#c8ebe7; }
.user-box { display:flex; align-items:center; gap:12px; }
.user-copy { text-align:right; }
.user-copy strong,.user-copy span { display:block; }
.user-copy strong { font-size:.86rem; }
.user-copy span { margin-top:2px; color:#c8ebe7; font-size:.72rem; }

.layout { display:grid; grid-template-columns:240px minmax(0,1fr); min-height:calc(100vh - 72px); }
.sidebar { padding:24px 14px; border-right:1px solid var(--line); background:#fff; }
.nav { display:grid; gap:7px; position:sticky; top:96px; }
.nav-btn { display:flex; align-items:center; gap:11px; width:100%; padding:12px 14px; border:0; border-radius:13px; color:#475569; background:transparent; text-align:left; font-weight:650; }
.nav-btn:hover { background:#f2f7f6; color:var(--brand-dark); }
.nav-btn.active { background:var(--brand-soft); color:var(--brand-dark); }
.nav-icon { width:22px; text-align:center; }
.main { min-width:0; padding:26px; }
.page-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:20px; }
.page-head h2 { margin:0; font-size:1.55rem; letter-spacing:-.03em; }
.page-head p { margin:7px 0 0; color:var(--muted); }
.actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end; }

.grid { display:grid; gap:16px; }
.metrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
.metric { position:relative; overflow:hidden; padding:20px; border:1px solid var(--line); border-radius:20px; background:var(--card); box-shadow:0 1px 2px rgba(15,23,42,.03); }
.metric::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:var(--brand); }
.metric .label { color:var(--muted); font-size:.84rem; font-weight:650; }
.metric .value { margin-top:8px; font-size:2rem; font-weight:800; letter-spacing:-.04em; }
.metric .detail { margin-top:8px; color:var(--muted); font-size:.75rem; }
.metric.warn::before { background:#f59e0b; }
.metric.bad::before { background:#ef4444; }
.metric.blue::before { background:#0ea5e9; }

.panel { overflow:hidden; border:1px solid var(--line); border-radius:20px; background:var(--card); box-shadow:0 1px 2px rgba(15,23,42,.035); }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; border-bottom:1px solid #edf1f3; }
.panel-head h3 { margin:0; font-size:1rem; }
.panel-head p { margin:4px 0 0; color:var(--muted); font-size:.8rem; }
.panel-body { padding:20px; }
.filters { display:grid; grid-template-columns:minmax(220px,1.6fr) repeat(auto-fit,minmax(150px,1fr)); gap:10px; padding:16px 20px; border-bottom:1px solid #edf1f3; }
.filters.record-filter { grid-template-columns:minmax(260px,1fr); }
.dashboard-period { display:grid; grid-template-columns:auto 150px; align-items:center; gap:10px; min-width:245px; }
.dashboard-period label { color:var(--muted); font-size:.78rem; font-weight:750; }
.dashboard-fault-panel { display:grid; grid-template-columns:minmax(230px,300px) minmax(0,1fr); gap:16px; align-items:start; margin-top:18px; }
.dashboard-fault-summary { position:sticky; top:96px; }
.fault-summary-head,.fault-summary-item,.fault-summary-total { display:grid; grid-template-columns:minmax(0,1fr) 72px; align-items:center; width:100%; }
.fault-summary-head { min-height:40px; padding:0 14px; border-bottom:1px solid #d5dde1; background:#edf2f4; color:#475569; font-size:.7rem; font-weight:800; letter-spacing:.025em; }
.fault-summary-head span:last-child { text-align:right; }
.fault-summary-list { max-height:420px; overflow:auto; }
.fault-summary-item,.fault-summary-total { min-height:42px; padding:8px 14px; border:0; border-bottom:1px solid #edf1f3; background:#fff; color:var(--ink); text-align:left; font-size:.8rem; }
.fault-summary-item:hover,.fault-summary-total:hover { background:#f1faf8; }
.fault-summary-item.active,.fault-summary-total.active { background:#d9f3ee; color:var(--brand-dark); box-shadow:inset 4px 0 0 var(--brand); }
.fault-summary-item span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fault-summary-item strong,.fault-summary-total strong { text-align:right; font-size:.86rem; }
.fault-summary-total { border-top:1px solid #cad7dc; border-bottom:0; font-weight:800; }
.dashboard-detail-head { display:grid; grid-template-columns:minmax(0,1fr) auto auto; }
.dashboard-duration { display:grid; gap:2px; min-width:154px; padding:8px 14px; border:1px solid #9fd5cd; border-radius:12px; background:var(--brand-soft); color:var(--brand-dark); text-align:center; }
.dashboard-duration span { font-size:.63rem; font-weight:800; letter-spacing:.055em; }
.dashboard-duration strong { font-size:1rem; }
.dashboard-duration.pending { border-color:#f2cf88; background:var(--warning-soft); color:var(--warning); }
.dashboard-duration.is-empty { border-color:#dce5e8; background:#f7f9fa; color:var(--muted); }
.dashboard-fault-table { min-width:980px; }
.dashboard-fault-row { cursor:pointer; }
.dashboard-fault-row.open > td,.dashboard-fault-row.open:hover > td { background:#0bff26 !important; }
.dashboard-fault-row.open > td:first-child { box-shadow:inset 4px 0 0 #078718; }
.dashboard-fault-row:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.dashboard-fault-row.selected > td,.dashboard-fault-row.selected:hover > td { background:#bfe9e2 !important; }
.dashboard-fault-row.selected > td:first-child { box-shadow:inset 4px 0 0 var(--brand); }
.dashboard-fault-row.open.selected > td,.dashboard-fault-row.open.selected:hover > td { background:#0bff26 !important; }
.dashboard-fault-row.open.selected > td:first-child { box-shadow:inset 4px 0 0 #078718; }
.fault-record-row.open > td,.fault-record-row.open:hover > td { background:#0bff26 !important; }
.fault-record-row.open > td:first-child { box-shadow:inset 4px 0 0 #078718; }
.dashboard-fault-text { max-width:260px; overflow:hidden; text-overflow:ellipsis; }
.dashboard-footnote { margin:10px 4px 0; color:var(--muted); font-size:.76rem; text-align:right; }
.unit-browser { display:grid; grid-template-columns:minmax(240px,310px) minmax(0,1fr); gap:16px; align-items:start; }
.unit-directory { position:sticky; top:96px; }
.unit-directory-search,.unit-asset-search { padding:14px 16px; border-bottom:1px solid #edf1f3; }
.definition-search { padding:14px 20px; border-bottom:1px solid #edf1f3; background:#fbfcfc; }
.unit-list { display:grid; gap:6px; max-height:calc(100vh - 270px); padding:10px; overflow:auto; }
.unit-item { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:11px 12px; border:1px solid transparent; border-radius:11px; background:transparent; color:#475569; text-align:left; font-weight:650; }
.unit-item:hover { border-color:#d4e8e4; background:#f2f8f7; color:var(--brand-dark); }
.unit-item.active { border-color:#b9ded8; background:var(--brand-soft); color:var(--brand-dark); }
.unit-count { display:inline-grid; place-items:center; min-width:28px; height:24px; padding:0 7px; border-radius:999px; background:#e8eef0; color:#475569; font-size:.72rem; }
.unit-item.active .unit-count { background:#ccebe6; color:var(--brand-dark); }
.unit-summary { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.empty.compact { padding:28px 12px; }

.field { display:grid; gap:7px; min-width:0; }
.field label { color:#344054; font-size:.78rem; font-weight:700; }
.input,.select,.textarea { width:100%; border:1px solid #cfd9de; border-radius:11px; background:white; color:var(--ink); outline:none; transition:.15s; }
.input,.select { height:42px; padding:0 12px; }
.file-input { height:auto; min-height:42px; padding:8px 10px; }
.textarea { min-height:104px; padding:11px 12px; resize:vertical; }
.input:focus,.select:focus,.textarea:focus { border-color:#46a89f; box-shadow:0 0 0 3px rgba(8,118,108,.1); }
.help { color:var(--muted); font-size:.74rem; line-height:1.45; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.form-grid.four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.span-2 { grid-column:span 2; }
.span-4 { grid-column:span 4; }
.form-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; }
.asset-linked-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; margin-bottom:18px; border:1px solid #cfe5e1; border-radius:12px; background:#f3faf8; }
.asset-linked-actions strong { display:block; font-size:.9rem; }
.asset-linked-actions span { display:block; margin-top:3px; color:var(--muted); font-size:.78rem; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:8px 14px; border:1px solid transparent; border-radius:11px; background:var(--brand); color:white; font-weight:750; font-size:.84rem; }
.btn:hover { background:var(--brand-dark); }
.btn.secondary { border-color:#cfd9de; background:white; color:#334155; }
.btn.secondary:hover { background:#f7f9fa; }
.btn.danger { background:var(--danger); }
.btn.danger:hover { background:#912018; }
.btn.ghost { min-height:34px; padding:6px 9px; background:transparent; color:#475569; }
.btn.ghost:hover { background:#edf4f3; color:var(--brand-dark); }
.btn.small { min-height:32px; padding:5px 9px; font-size:.76rem; border-radius:9px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.danger-text { color:var(--danger) !important; }
.danger-text:hover { background:var(--danger-soft) !important; }

.table-top-scroll { height:18px; overflow-x:scroll; overflow-y:hidden; border-bottom:1px solid #dce5e8; background:#f7fafb; scrollbar-color:#77969b #e8eef0; scrollbar-width:auto; }
.table-top-scroll > div { height:1px; }
.table-top-scroll:focus-visible { outline:2px solid #46a89f; outline-offset:-2px; }
.table-top-scroll::-webkit-scrollbar,.table-wrap::-webkit-scrollbar { height:15px; }
.table-top-scroll::-webkit-scrollbar-track,.table-wrap::-webkit-scrollbar-track { background:#e8eef0; }
.table-top-scroll::-webkit-scrollbar-thumb,.table-wrap::-webkit-scrollbar-thumb { border:3px solid #e8eef0; border-radius:999px; background:#77969b; }
.table-top-scroll::-webkit-scrollbar-thumb:hover,.table-wrap::-webkit-scrollbar-thumb:hover { background:var(--brand); }
.table-wrap { overflow:auto; max-width:100%; scrollbar-color:#77969b #e8eef0; scrollbar-width:auto; }
.asset-master-panel > .panel-head { padding:8px 14px; }
.asset-table-count { margin:0 !important; color:var(--brand-dark) !important; font-weight:850; }
.asset-master-panel > .filters { gap:7px; padding:8px 14px; }
.asset-master-panel > .filters .input,.asset-master-panel > .filters .select { height:34px; padding:0 10px; }
.asset-master-wrap { max-height:min(32vh,330px); }
.asset-master-row { cursor:pointer; }
.asset-master-row:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.asset-master-row.selected > td,.asset-master-row.selected:hover > td { background:#b9e3f2 !important; }
.asset-master-row.selected > td:first-child { box-shadow:inset 4px 0 0 #0786b4; }
.asset-detail-panel { margin-top:14px; background:#e8f2f4; }
.asset-detail-selection { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:14px 18px; border-bottom:1px solid #dce6e9; background:#f7fafb; }
.asset-detail-selection > div:first-child { display:grid; gap:3px; min-width:0; }
.asset-detail-selection span { color:var(--muted); font-size:.66rem; font-weight:850; letter-spacing:.06em; }
.asset-detail-selection strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.92rem; }
.asset-detail-selection small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:.75rem; }
.asset-statistics-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:5px 16px; margin-left:auto; color:#475569; font-size:.78rem; font-weight:700; white-space:nowrap; }
.asset-statistics-summary strong { color:var(--brand-dark); font-weight:850; }
.asset-detail-tabs { display:flex; gap:3px; padding:8px 10px 0; border-bottom:1px solid #ccd8dc; background:#eef3f5; overflow-x:auto; }
.asset-detail-tab { display:inline-flex; align-items:center; gap:7px; min-height:38px; padding:8px 13px; border:1px solid transparent; border-bottom:0; border-radius:10px 10px 0 0; background:transparent; color:#52606d; white-space:nowrap; font-size:.78rem; font-weight:750; }
.asset-detail-tab:hover { background:#f8fbfc; color:var(--brand-dark); }
.asset-detail-tab.active { margin-bottom:-1px; border-color:#ccd8dc; background:#fff; color:var(--brand-dark); }
.asset-detail-tab span { display:inline-grid; place-items:center; min-width:23px; height:21px; padding:0 6px; border-radius:999px; background:#dde7ea; color:#475569; font-size:.68rem; }
.asset-detail-tab.active span { background:var(--brand-soft); color:var(--brand-dark); }
.asset-detail-content { min-height:230px; }
.asset-detail-content > .table-wrap,.asset-detail-table { max-height:410px; }
.asset-statistics-head { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 18px; border-bottom:1px solid #edf1f3; }
.asset-statistics-head h4 { margin:0; font-size:.95rem; }
.asset-statistics-head p { margin:4px 0 0; color:var(--muted); font-size:.76rem; }
.asset-statistics-inline { display:flex; flex-wrap:wrap; gap:6px 20px; }
.asset-statistics-inline span { color:#475569; }
.asset-statistics-inline strong { color:var(--brand-dark); font-weight:850; }
.asset-statistics-head label { display:grid; grid-template-columns:auto 150px; align-items:center; gap:9px; color:var(--muted); font-size:.74rem; font-weight:750; }
.asset-detail-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:14px 18px; border-bottom:1px solid #edf1f3; background:#fbfcfc; }
.asset-detail-stat { display:grid; gap:6px; padding:12px 14px; border:1px solid #dce6e9; border-radius:12px; background:#fff; box-shadow:inset 3px 0 0 var(--brand); }
.asset-detail-stat span { color:var(--muted); font-size:.72rem; font-weight:700; }
.asset-detail-stat strong { font-size:1.05rem; }
.asset-detail-stat.warn { box-shadow:inset 3px 0 0 #f59e0b; }
.asset-detail-stat.success { box-shadow:inset 3px 0 0 #16a34a; }
.asset-stat-table { max-height:340px; }
table { width:100%; border-collapse:collapse; font-size:.78rem; white-space:nowrap; }
th { position:sticky; top:0; z-index:2; padding:12px 11px; border-right:1px solid #d9e1e5; border-bottom:1px solid #d5dde1; background:#edf2f4; color:#475569; text-align:left; font-size:.7rem; letter-spacing:.025em; }
th.sortable { padding:0; }
.sort-button { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:40px; padding:12px 11px; border:0; background:transparent; color:inherit; font:inherit; font-weight:700; letter-spacing:inherit; text-align:left; white-space:nowrap; }
.sort-button:hover { background:#e2eaed; color:var(--brand-dark); }
.sort-button:focus-visible { position:relative; z-index:1; outline:2px solid #46a89f; outline-offset:-2px; }
.sort-indicator { color:#94a3b8; font-size:.72rem; line-height:1; }
th[aria-sort="ascending"] .sort-indicator,th[aria-sort="descending"] .sort-indicator { color:var(--brand-dark); }
td { padding:4px 8px; border-right:1px solid #edf1f3; border-bottom:1px solid #edf1f3; vertical-align:middle; }
.table-wrap .btn.small,.table-wrap .document-link { min-height:26px; padding:2px 7px; }
.fault-form-print-actions { justify-content:flex-start; padding:9px 10px; border:1px solid #d9e7e4; border-radius:11px; background:#f6fbfa; }
.column-resizable-table td { overflow:hidden; text-overflow:ellipsis; }
.column-resizable-table .sort-button > span:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.column-resizer { position:absolute; top:0; right:-1px; z-index:5; display:block; width:11px; height:100%; cursor:col-resize; touch-action:none; }
.column-resizer::after { position:absolute; top:7px; right:4px; bottom:7px; width:2px; border-radius:999px; background:#a7b7bd; content:""; opacity:.65; transition:background .15s ease,opacity .15s ease; }
th:hover > .column-resizer::after,.column-resizer:focus-visible::after { background:var(--brand); opacity:1; }
.column-resizer:focus-visible { outline:2px solid #46a89f; outline-offset:-3px; }
body.column-resizing,body.column-resizing * { cursor:col-resize !important; user-select:none !important; }
tbody tr:hover { background:#f1faf8; }
.empty { padding:54px 24px; text-align:center; color:var(--muted); }
.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.strong { font-weight:750; }
.brand-text { color:var(--brand-dark); }
.truncate { max-width:190px; overflow:hidden; text-overflow:ellipsis; }
.document-link { display:inline-flex; align-items:center; min-height:30px; padding:5px 9px; border:1px solid #b9ded8; border-radius:9px; background:var(--brand-soft); color:var(--brand-dark); font-size:.74rem; font-weight:750; text-decoration:none; }
.document-link:hover { border-color:var(--brand); background:#d8f1ed; }
.document-number { display:block; margin-top:4px; }
.current-document { display:flex; align-items:center; flex-wrap:wrap; gap:9px; padding:10px 12px; border:1px solid #d9e7e4; border-radius:11px; background:#f6fbfa; }
.current-document > span { min-width:180px; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#344054; font-size:.78rem; }
.current-document .check { margin-left:auto; background:white; }

.badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 9px; font-size:.7rem; font-weight:800; }
.badge.green { color:var(--success); background:var(--success-soft); }
.badge.red { color:var(--danger); background:var(--danger-soft); }
.badge.orange { color:var(--warning); background:var(--warning-soft); }
.badge.blue { color:#026aa2; background:#eff8ff; }
.badge.gray { color:#475467; background:#f2f4f7; }

.cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.list { display:grid; gap:8px; }
.list-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 12px; border:1px solid #e0e7ea; border-radius:12px; background:#fbfcfc; }
.list-row .meta { min-width:0; }
.list-row strong,.list-row span { display:block; }
.list-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.84rem; }
.list-row span { margin-top:3px; color:var(--muted); font-size:.73rem; }
.checkboxes { display:flex; flex-wrap:wrap; gap:8px; }
.check { display:flex; align-items:center; gap:6px; padding:7px 9px; border:1px solid var(--line); border-radius:9px; font-size:.75rem; }

dialog { width:min(920px,calc(100% - 28px)); max-height:90vh; padding:0; border:0; border-radius:22px; box-shadow:0 30px 100px rgba(15,30,36,.28); }
dialog::backdrop { background:rgba(7,27,31,.58); backdrop-filter:blur(3px); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:20px 22px; border-bottom:1px solid #e9eef0; }
.modal-head h3 { margin:0; font-size:1.15rem; }
.modal-head p { margin:5px 0 0; color:var(--muted); font-size:.8rem; }
.modal-body { max-height:calc(90vh - 82px); overflow:auto; padding:22px; }
.close { border:0; background:transparent; color:#64748b; font-size:1.35rem; }

.toast { position:fixed; z-index:100; right:22px; bottom:22px; max-width:min(390px,calc(100% - 44px)); padding:13px 16px; border-radius:12px; background:#132d31; color:white; box-shadow:0 14px 40px rgba(0,0,0,.2); transform:translateY(130%); opacity:0; transition:.22s; font-size:.85rem; }
.toast.show { transform:translateY(0); opacity:1; }
.toast.error { background:#8f221a; }
.notice { padding:12px 14px; border:1px solid #f6d48d; border-radius:12px; background:#fff9e9; color:#854a0e; font-size:.82rem; line-height:1.5; }
.error-line { min-height:20px; margin-top:10px; color:var(--danger); font-size:.8rem; }
.fault-print-root,.fault-print-toolbar { display:none; }

@media print, screen {
  @page { size:A4 portrait; margin:0; }
  body.printing { width:210mm; min-width:0; min-height:297mm; margin:0; background:#fff; }
  body.printing > :not(.fault-print-root):not(.fault-print-toolbar) { display:none !important; }
  body.printing .fault-print-toolbar {
    display:flex;
    align-items:center;
    justify-content:flex-end;
  }
  body.printing .fault-print-root {
    display:block !important;
    width:210mm;
    height:297mm;
    box-sizing:border-box;
    margin:0;
    padding:6.5mm 7.5mm 0;
    overflow:hidden;
    background:#fff;
    color:#111;
    font-family:Arial,Helvetica,sans-serif;
    font-size:3.4mm;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  .fault-print-header {
    display:grid;
    grid-template-columns:13mm minmax(0,1fr) 50mm;
    align-items:center;
    min-height:15mm;
    padding:0 2.5mm;
    background:#d7dde6;
  }
  .fault-print-icon {
    position:relative;
    display:grid;
    place-items:center;
    width:10mm;
    height:10mm;
    border:.25mm solid #aab2bc;
    background:#edf0ec;
  }
  .fault-print-icon::before {
    width:6.2mm;
    height:6.2mm;
    border:.25mm solid #537653;
    background:#90c58a;
    content:"";
  }
  .fault-print-icon span {
    position:absolute;
    width:3.5mm;
    height:3.5mm;
    border:.25mm solid #537653;
  }
  .fault-print-title {
    color:#36516e;
    font-size:5.4mm;
    font-weight:400;
    line-height:1;
    white-space:nowrap;
  }
  .fault-print-now {
    display:grid;
    justify-items:end;
    gap:1.7mm;
    color:#334155;
    font-size:3mm;
    font-weight:400;
  }
  .fault-print-now strong { font-weight:400; }
  .fault-print-fields {
    display:grid;
    grid-template-columns:11% 14% 24% 11% 28% 12%;
    margin-top:1.5mm;
  }
  .fault-print-field { min-width:0; padding-right:.8mm; }
  .fault-print-field:last-child { padding-right:0; }
  .fault-print-field > span {
    display:block;
    height:4.3mm;
    padding-left:2mm;
    color:#52606d;
    font-size:3mm;
    line-height:4.3mm;
    white-space:nowrap;
  }
  .fault-print-field > strong {
    display:flex;
    align-items:center;
    min-height:11.7mm;
    box-sizing:border-box;
    padding:1.2mm 1.4mm;
    overflow:hidden;
    border:.25mm solid #999;
    font-size:3.8mm;
    font-weight:400;
    line-height:1.15;
    overflow-wrap:anywhere;
  }
  .fault-print-description {
    min-height:8mm;
    box-sizing:border-box;
    margin-top:1.5mm;
    padding:1mm 1.2mm;
    overflow:hidden;
    border:.25mm solid #999;
    font-size:4mm;
    line-height:1.25;
    overflow-wrap:anywhere;
  }
  .fault-print-solution {
    display:grid;
    grid-template-columns:30mm minmax(0,1fr);
    align-items:stretch;
    min-height:12mm;
    box-sizing:border-box;
    margin-top:2mm;
    border:.25mm solid #888;
  }
  .fault-print-solution > span {
    display:flex;
    align-items:center;
    padding:1mm 1.5mm;
    border-right:.25mm solid #888;
    color:#5a6675;
    font-size:3mm;
    font-weight:400;
  }
  .fault-print-solution > strong {
    display:flex;
    align-items:center;
    min-width:0;
    padding:1mm 1.5mm;
    overflow:hidden;
    font-size:3.5mm;
    font-weight:400;
    line-height:1.2;
    overflow-wrap:anywhere;
  }
  .fault-print-condition {
    height:69mm;
    box-sizing:border-box;
    margin-top:2mm;
    border:.25mm solid #888;
  }
  .fault-print-condition > span,.fault-print-blank > span {
    display:block;
    padding:1mm .8mm;
    color:#5a6675;
    font-size:3mm;
    font-weight:400;
  }
  .fault-print-handover-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    margin:2mm .5mm 0;
    border-top:.25mm solid #888;
    border-left:.25mm solid #888;
  }
  .fault-print-blank {
    height:43mm;
    box-sizing:border-box;
    border-right:.25mm solid #888;
    border-bottom:.25mm solid #888;
  }
}

@media screen {
  body.printing.print-preview {
    width:auto;
    min-height:100vh;
    padding:14px;
    overflow:auto;
    background:#e8eef0;
  }
  body.printing.print-preview .fault-print-toolbar {
    position:sticky;
    z-index:10;
    top:0;
    width:210mm;
    max-width:100%;
    margin:0 auto 10px;
    padding:9px 10px;
    border:1px solid #cfd9de;
    border-radius:10px;
    background:#fff;
    box-shadow:0 5px 18px rgba(15,23,42,.12);
  }
  body.printing.print-preview .fault-print-root {
    max-width:100%;
    height:auto;
    min-height:297mm;
    margin:0 auto;
    box-shadow:0 8px 28px rgba(15,23,42,.18);
  }
}

@media print {
  body.printing .fault-print-toolbar { display:none !important; }
}

@media (max-width:1180px) {
  .filters { grid-template-columns:repeat(3,minmax(150px,1fr)); }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .form-grid.four { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .span-4 { grid-column:span 2; }
  .unit-browser { grid-template-columns:240px minmax(0,1fr); }
  .dashboard-fault-panel { grid-template-columns:240px minmax(0,1fr); }
}

@media (max-width:820px) {
  .topbar { padding:10px 14px; }
  .top-brand p,.user-copy { display:none; }
  .layout { display:block; }
  .sidebar { position:sticky; z-index:15; top:66px; padding:8px; border-right:0; border-bottom:1px solid var(--line); overflow:auto; }
  .nav { display:flex; width:max-content; position:static; }
  .nav-btn { width:auto; padding:9px 12px; }
  .main { padding:18px 13px; }
  .page-head { display:block; }
  .page-head .actions { justify-content:flex-start; margin-top:14px; }
  .dashboard-period { grid-template-columns:1fr; gap:6px; margin-top:14px; min-width:0; max-width:240px; }
  .dashboard-detail-head { grid-template-columns:1fr auto; }
  .dashboard-detail-head > div:first-child { grid-column:1 / -1; }
  .filters { grid-template-columns:repeat(2,minmax(130px,1fr)); padding:13px; }
  .cards { grid-template-columns:1fr; }
  .unit-browser { grid-template-columns:1fr; }
  .dashboard-fault-panel { grid-template-columns:1fr; }
  .dashboard-fault-summary { position:static; }
  .unit-directory { position:static; }
  .unit-list { max-height:280px; }
  .asset-master-wrap { max-height:55vh; }
  .asset-detail-selection,.asset-statistics-head { align-items:stretch; flex-direction:column; }
  .asset-detail-selection .actions { justify-content:flex-start; }
  .asset-statistics-summary { justify-content:flex-start; margin-left:0; white-space:normal; }
  .asset-statistics-head label { grid-template-columns:1fr; }
  .asset-detail-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:560px) {
  .auth-card { padding:25px 20px; border-radius:22px; }
  .metrics,.filters,.form-grid,.form-grid.four { grid-template-columns:1fr; }
  .span-2,.span-4 { grid-column:span 1; }
  .asset-linked-actions { align-items:stretch; flex-direction:column; }
  .asset-linked-actions .actions { width:100%; }
  .asset-linked-actions .btn { flex:1; }
  .panel-head { align-items:flex-start; }
  .dashboard-detail-head { grid-template-columns:1fr; }
  .dashboard-detail-head > div:first-child { grid-column:auto; }
  .dashboard-duration { width:100%; }
  .asset-detail-metrics { grid-template-columns:1fr; }
  .panel-head,.panel-body { padding:15px; }
  .modal-body { padding:16px; }
  .nav-btn { font-size:.78rem; }
  .nav-icon { display:none; }
}
