:root {
  --blue:#2563eb; --blue-soft:#dbeafe; --green:#15803d; --green-soft:#dcfce7;
  --red:#dc2626; --red-soft:#fee2e2; --amber:#b45309; --amber-soft:#fef3c7;
  --purple:#7c3aed; --purple-soft:#ede9fe;
  --navy:#0b1739; --bg:#f4f7fb; --card:#fff; --border:#e2e8f0;
  --text:#0f172a; --muted:#64748b; --shadow:0 8px 28px rgba(15,23,42,.08);
}
.tone-blue { --tone:var(--blue); --tone-soft:var(--blue-soft); }
.tone-green { --tone:var(--green); --tone-soft:var(--green-soft); }
.tone-amber { --tone:var(--amber); --tone-soft:var(--amber-soft); }
.tone-red { --tone:var(--red); --tone-soft:var(--red-soft); }
.tone-purple { --tone:var(--purple); --tone-soft:var(--purple-soft); }
* { box-sizing:border-box; }
body { margin:0; font-family:system-ui,-apple-system,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); }
html::before { content:""; position:fixed; z-index:100; top:0; left:0; width:0; height:3px; background:linear-gradient(90deg,#2563eb,#06b6d4); opacity:0; transition:width .25s ease,opacity .15s ease; }
html.is-navigating::before { width:78%; opacity:1; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
[hidden] { display:none !important; }
.login-view { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(420px,100%); padding:28px; border:1px solid var(--border); border-radius:18px; background:#fff; box-shadow:var(--shadow); }
.login-card h1 { margin:0 0 8px; font-size:24px; }
.login-card p { margin:0 0 20px; color:var(--muted); font-size:13px; line-height:1.5; }
.field { min-width:0; }
.field label { display:block; margin-bottom:5px; color:#475569; font-size:12px; font-weight:650; }
.field input,.field select,.field textarea { width:100%; min-height:40px; padding:8px 10px; border:1px solid #cbd5e1; border-radius:9px; background:#fff; color:var(--text); }
.field textarea { resize:vertical; }
.login-card .field { margin-top:13px; }
.btn { min-height:38px; border:0; border-radius:9px; padding:8px 14px; font-weight:700; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-secondary { background:#e8eef7; color:#334155; }
.btn-danger { background:var(--red); color:#fff; }
.btn-small { min-height:32px; padding:5px 10px; font-size:12px; }
.login-card .btn { width:100%; margin-top:18px; }
.error { min-height:20px; margin-top:10px; color:var(--red); font-size:13px; }
.app-shell { min-height:100vh; display:grid; grid-template-columns:230px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100vh; padding:22px 14px; background:var(--navy); color:#cbd5e1; }
.brand { margin:0 10px 24px; color:#fff; font-size:17px; font-weight:850; }
.sidebar a { display:block; margin:4px 0; padding:10px 12px; border-radius:9px; color:#b8c4dc; text-decoration:none; font-size:13px; font-weight:650; }
.sidebar a:hover,.sidebar a.active { background:rgba(59,130,246,.18); color:#fff; }
.main-col { min-width:0; }
.topbar { min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 24px; border-bottom:1px solid var(--border); background:#fff; }
.product-name { font-weight:800; }
.topbar-right { display:flex; align-items:center; gap:10px; }
.avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:var(--blue-soft); color:#1d4ed8; font-weight:850; }
.content { max-width:1500px; margin:0 auto; padding:24px; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.page-head h1 { margin:0 0 5px; font-size:25px; }
.page-head p { margin:0; color:var(--muted); font-size:13px; }
.filters { display:grid; grid-template-columns:minmax(180px,1.4fr) repeat(3,minmax(130px,1fr)) minmax(190px,1.3fr) auto; gap:12px; align-items:end; margin-bottom:16px; padding:15px; border:1px solid var(--border); border-radius:14px; background:#fff; box-shadow:0 4px 16px rgba(15,23,42,.04); }
.summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.summary-card {
  position:relative; overflow:hidden; padding:15px 16px; border:1px solid var(--border);
  border-left:4px solid var(--tone,var(--blue)); border-radius:13px; background:#fff;
  transition:transform .16s ease, box-shadow .16s ease;
}
.summary-card:hover { transform:translateY(-3px); box-shadow:0 12px 26px rgba(15,23,42,.10); }
.summary-card::after {
  content:""; position:absolute; inset:auto -22px -30px auto; width:86px; height:86px;
  border-radius:50%; background:var(--tone-soft,var(--blue-soft)); opacity:.6; z-index:0;
}
.summary-card span { position:relative; z-index:1; color:var(--muted); font-size:12px; }
.summary-card strong { position:relative; z-index:1; display:block; margin-top:6px; font-size:26px; color:var(--tone,var(--text)); }
.risk-cockpit { margin:-2px 0 18px; padding:18px; border:1px solid #cbdcf7; border-radius:16px; background:linear-gradient(145deg,#fff 0%,#f5f9ff 70%,#eef6ff 100%); box-shadow:0 9px 28px rgba(37,99,235,.07); }
.risk-cockpit-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:16px; }
.risk-eyebrow { display:block; margin-bottom:5px; color:#2563eb; font-size:10px; font-weight:850; letter-spacing:.13em; }
.risk-cockpit h2 { margin:0 0 5px; font-size:17px; }
.risk-cockpit p { margin:0; color:var(--muted); font-size:12px; }
.risk-level { flex:none; padding:6px 10px; border-radius:99px; font-size:11px; font-weight:800; }
.risk-level-critical { background:var(--red-soft); color:var(--red); }
.risk-level-warning { background:var(--amber-soft); color:var(--amber); }
.risk-level-stable { background:var(--green-soft); color:var(--green); }
.risk-cockpit-grid { display:grid; grid-template-columns:190px minmax(0,1fr); gap:24px; align-items:center; }
.risk-gauge-wrap { display:grid; justify-items:center; gap:8px; text-align:center; }
.risk-gauge-wrap small { max-width:170px; color:var(--muted); font-size:10px; line-height:1.4; }
.risk-gauge { --gauge-color:var(--green); width:124px; height:124px; display:grid; place-items:center; border-radius:50%; background:conic-gradient(var(--gauge-color) var(--risk-score),#e2e8f0 0); position:relative; }
.risk-gauge::after { content:""; position:absolute; inset:13px; border-radius:50%; background:#fff; box-shadow:inset 0 0 0 1px #e5e7eb; }
.risk-gauge > div { position:relative; z-index:1; display:grid; text-align:center; }
.risk-gauge strong { font-size:29px; line-height:1; }
.risk-gauge span { margin-top:4px; color:var(--muted); font-size:10px; font-weight:700; }
.risk-gauge-critical { --gauge-color:var(--red); }
.risk-gauge-warning { --gauge-color:#f59e0b; }
.risk-signal-list { display:grid; gap:12px; }
.risk-signal-label { display:flex; justify-content:space-between; gap:12px; margin-bottom:5px; color:#334155; font-size:12px; }
.risk-signal-label strong { color:var(--text); }
.risk-track { height:9px; overflow:hidden; border-radius:99px; background:#e2e8f0; }
.risk-fill { display:block; height:100%; border-radius:inherit; background:#64748b; transition:width .3s ease; }
.risk-fill-critical { background:linear-gradient(90deg,#ef4444,#dc2626); }
.risk-fill-warning { background:linear-gradient(90deg,#fbbf24,#d97706); }
.risk-fill-good { background:linear-gradient(90deg,#22c55e,#15803d); }
.risk-fill-neutral { background:linear-gradient(90deg,#60a5fa,#2563eb); }
.risk-signal small { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.risk-signal-clickable { cursor:pointer; border-radius:10px; padding:6px 8px; margin:-6px -8px; transition:background .12s ease; }
.risk-signal-clickable:hover, .risk-signal-clickable:focus-visible { background:#f1f5f9; outline:none; }
.risk-signal-clickable .risk-signal-label span::after { content:" ›"; color:var(--muted); font-weight:800; }
.signal-drawer-title { margin:0 0 4px; font-size:18px; }
.signal-drawer-subtitle { margin:0; color:var(--muted); font-size:12.5px; }
.signal-drawer-body { display:grid; gap:8px; }
.signal-drawer-item { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; width:100%; text-align:left; padding:12px 14px; border:1px solid var(--border); border-radius:11px; background:#fff; cursor:pointer; transition:border-color .12s ease, background .12s ease; }
.signal-drawer-item:hover, .signal-drawer-item:focus-visible { border-color:#93c5fd; background:#f8fbff; outline:none; }
.signal-drawer-item-static, .signal-drawer-item-static:hover { opacity:1; color:inherit; cursor:default; border-color:var(--border); background:#fff; }
.signal-drawer-item-title { font-size:13px; font-weight:750; color:var(--text); }
.signal-drawer-item-subtitle { margin-top:3px; font-size:12px; color:var(--muted); }
.signal-drawer-more { width:100%; justify-content:center; margin-top:4px; }
.signal-drawer-count { padding:4px 0; text-align:center; color:var(--muted); font-size:11.5px; }
.risk-donut-row { display:flex; align-items:center; gap:18px; margin-top:16px; padding-top:16px; border-top:1px solid var(--border); flex-wrap:wrap; }
.risk-donut { width:88px; height:88px; border-radius:50%; display:grid; place-items:center; position:relative; flex:none; }
.risk-donut::after { content:""; position:absolute; inset:14px; background:#fff; border-radius:50%; }
.risk-donut-center { position:relative; z-index:1; text-align:center; font-size:18px; font-weight:850; line-height:1.1; }
.risk-donut-center small { display:block; margin-top:2px; font-size:9px; color:var(--muted); font-weight:700; letter-spacing:.02em; }
.risk-donut-legend { list-style:none; margin:0; padding:0; display:grid; gap:6px; font-size:12px; color:#334155; }
.risk-donut-legend li { display:flex; align-items:center; gap:8px; }
.risk-donut-legend strong { margin-left:auto; color:var(--text); }
.risk-donut-legend .dot { width:9px; height:9px; border-radius:50%; flex:none; }
.energy-analytics { margin-bottom:16px; }
.energy-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.energy-section-head strong { display:block; color:var(--text); font-size:16px; }
.energy-section-head span { display:block; margin-top:4px; color:var(--muted); font-size:12px; line-height:1.5; }
.energy-chart-grid { display:grid; gap:14px; }
.energy-chart-card { position:relative; overflow:hidden; border:1px solid var(--border); border-radius:15px; background:#fff; box-shadow:var(--shadow); }
.energy-chart-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:15px 17px 10px; }
.energy-chart-head h3 { margin:0; color:var(--text); font-size:15px; }
.energy-chart-head p { margin:4px 0 0; color:var(--muted); font-size:11px; }
.energy-chart-total { text-align:right; }
.energy-chart-total strong { display:block; color:var(--text); font-size:21px; }
.energy-chart-total span { color:var(--muted); font-size:10px; }
.energy-chart-legend { display:flex; flex-wrap:wrap; gap:7px 14px; padding:0 17px 9px; color:#475569; font-size:10px; }
.energy-chart-legend span { display:inline-flex; align-items:center; gap:6px; }
.energy-chart-legend i { width:9px; height:9px; flex:none; border-radius:50%; background:var(--series-color); }
.energy-chart-scroll { position:relative; overflow-x:auto; padding:0 10px 8px; }
.energy-chart-stage { position:relative; min-width:720px; outline:none; }
.energy-chart-stage:focus-visible { border-radius:10px; box-shadow:inset 0 0 0 2px var(--blue); }
.energy-chart-svg { display:block; width:100%; height:auto; min-height:260px; }
.energy-chart-gridline { stroke:#dbe3ef; stroke-width:1; }
.energy-chart-axis-label { fill:#64748b; font-size:10px; }
.energy-chart-line { fill:none; stroke:var(--series-color); stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.energy-chart-point { fill:#fff; stroke:var(--series-color); stroke-width:1.8; vector-effect:non-scaling-stroke; }
.energy-chart-cursor { stroke:#64748b; stroke-width:1; stroke-dasharray:4 4; vector-effect:non-scaling-stroke; }
.energy-chart-hover-dot { fill:#fff; stroke:var(--series-color); stroke-width:2.4; vector-effect:non-scaling-stroke; }
.energy-chart-hit { fill:transparent; cursor:crosshair; }
.energy-chart-tooltip { position:absolute; z-index:5; width:min(300px,calc(100% - 20px)); max-height:220px; overflow:auto; padding:11px 12px; border:1px solid #cbd5e1; border-radius:10px; background:rgba(15,23,42,.96); color:#fff; box-shadow:0 14px 36px rgba(15,23,42,.25); pointer-events:none; transform:translate(12px,-50%); }
.energy-chart-tooltip.flip { transform:translate(calc(-100% - 12px),-50%); }
.energy-chart-tooltip strong { display:block; margin-bottom:7px; font-size:12px; }
.energy-tooltip-total { display:flex; justify-content:space-between; gap:12px; margin-bottom:6px; padding-bottom:6px; border-bottom:1px solid rgba(255,255,255,.2); color:#cbd5e1; font-size:10px; }
.energy-tooltip-row { display:grid; grid-template-columns:9px minmax(0,1fr) auto; gap:7px; align-items:center; padding:3px 0; font-size:10px; }
.energy-tooltip-row i { width:8px; height:8px; border-radius:50%; background:var(--series-color); }
.energy-tooltip-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.energy-tooltip-row b { font-size:10px; }
.energy-chart-empty { padding:40px 18px 48px; color:var(--muted); text-align:center; }
.energy-anomaly-card { margin-bottom:16px; }
.energy-anomaly-card table { min-width:900px; }
.energy-anomaly-rise { color:var(--red); font-weight:850; }
.table-card { overflow:hidden; border:1px solid var(--border); border-radius:14px; background:#fff; box-shadow:var(--shadow); }
.table-tools { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:13px 15px; border-bottom:1px solid var(--border); }
.status { color:var(--muted); font-size:13px; }
.search { width:min(320px,100%); min-height:38px; padding:8px 10px; border:1px solid #cbd5e1; border-radius:9px; }
.table-scroll { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:1050px; }
th,td { padding:11px 12px; border-bottom:1px solid #edf2f7; text-align:left; vertical-align:top; font-size:12px; }
th { position:sticky; top:0; background:#f8fafc; color:#475569; font-size:11px; text-transform:uppercase; letter-spacing:.03em; }
tbody tr:hover { background:#f8fbff; }
.device-name { font-weight:750; }
.muted { color:var(--muted); }
.badge { display:inline-flex; align-items:center; border-radius:99px; padding:4px 8px; font-size:11px; font-weight:750; white-space:nowrap; }
.badge-pending { background:var(--amber-soft); color:var(--amber); }
.badge-approved { background:var(--green-soft); color:var(--green); }
.badge-error { background:var(--red-soft); color:var(--red); }
.badge-ok { background:var(--blue-soft); color:#1d4ed8; }
.row-actions { display:flex; gap:6px; flex-wrap:wrap; }
.empty { padding:42px 20px; color:var(--muted); text-align:center; }
.drawer-backdrop { position:fixed; inset:0; z-index:30; background:rgba(15,23,42,.38); }
.drawer { position:fixed; z-index:31; top:0; right:0; width:min(680px,100%); height:100vh; display:flex; flex-direction:column; background:#f8fafc; box-shadow:-14px 0 40px rgba(15,23,42,.2); }
.drawer-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:18px 20px; border-bottom:1px solid var(--border); background:#fff; }
.drawer-head h2 { margin:0 0 5px; font-size:19px; }
.drawer-head p { margin:0; color:var(--muted); font-size:12px; }
.drawer-body { overflow:auto; padding:16px 20px 30px; }
.entry-card { margin-bottom:11px; padding:14px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.entry-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.entry-title { font-weight:750; }
.entry-meta { display:grid; gap:5px; margin-top:9px; color:#475569; font-size:12px; line-height:1.45; }
.photos { display:flex; gap:9px; overflow:auto; margin-top:11px; padding-bottom:4px; }
.photo { width:112px; height:92px; flex:none; object-fit:cover; border:1px solid var(--border); border-radius:9px; background:#e2e8f0; cursor:zoom-in; }
.photo-lightbox { position:fixed; z-index:80; inset:0; display:grid; place-items:center; padding:24px; background:rgba(2,6,23,.9); cursor:zoom-out; }
.photo-lightbox[hidden] { display:none; }
.photo-lightbox img { max-width:min(1200px,96vw); max-height:90vh; object-fit:contain; border-radius:8px; box-shadow:0 24px 70px rgba(0,0,0,.45); cursor:default; }
.photo-lightbox .lightbox-close { position:fixed; top:18px; right:18px; min-width:42px; min-height:42px; border:0; border-radius:50%; background:#fff; color:#0f172a; font-size:22px; font-weight:800; cursor:pointer; }
.photo-lightbox .lightbox-nav { position:fixed; top:50%; transform:translateY(-50%); min-width:46px; min-height:46px; border:0; border-radius:50%; background:rgba(255,255,255,.92); color:#0f172a; font-size:24px; font-weight:800; cursor:pointer; }
.photo-lightbox .lightbox-nav:hover { background:#fff; }
.photo-lightbox .lightbox-nav[hidden] { display:none; }
.photo-lightbox .lightbox-prev { left:18px; }
.photo-lightbox .lightbox-next { right:18px; }
.photo-lightbox .lightbox-counter { position:fixed; bottom:22px; left:50%; transform:translateX(-50%); color:#fff; font-size:12.5px; font-weight:700; background:rgba(255,255,255,.15); padding:5px 14px; border-radius:99px; }
.photo-thumb { cursor:zoom-in; }
.drawer-actions { display:flex; gap:8px; padding:13px 20px; border-top:1px solid var(--border); background:#fff; }
.tabs { display:flex; gap:7px; margin-bottom:14px; border-bottom:1px solid var(--border); }
.tab-button { border:0; border-bottom:3px solid transparent; padding:10px 14px; background:transparent; color:var(--muted); font-weight:750; }
.tab-button.active { border-bottom-color:var(--blue); color:var(--blue); }
.tab-panel[hidden] { display:none; }
.plan-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:13px; }
.plan-card { padding:16px; border:1px solid var(--border); border-radius:14px; background:#fff; box-shadow:0 5px 18px rgba(15,23,42,.05); }
.plan-card-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.plan-card h3 { margin:0 0 5px; font-size:15px; }
.plan-card p { min-height:36px; margin:8px 0; color:var(--muted); font-size:12px; line-height:1.5; }
.plan-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
.plan-metric { padding:9px; border-radius:9px; background:#f8fafc; }
.plan-metric span { display:block; color:var(--muted); font-size:10px; }
.plan-metric strong { display:block; margin-top:3px; font-size:16px; }
.progress { height:8px; overflow:hidden; border-radius:99px; background:#e2e8f0; }
.progress span { display:block; height:100%; background:var(--green); }
.plan-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; }
.modal-backdrop { position:fixed; inset:0; z-index:40; display:grid; place-items:center; padding:20px; background:rgba(15,23,42,.45); }
.modal { width:min(520px,100%); max-height:90vh; overflow:auto; padding:20px; border-radius:15px; background:#fff; box-shadow:0 20px 60px rgba(15,23,42,.3); }
.modal h2 { margin:0 0 6px; font-size:20px; }
.modal p { margin:0 0 16px; color:var(--muted); font-size:12px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.incident-view-backdrop { overflow:auto; padding:24px; }
.incident-view { width:min(940px,96vw); max-height:none; margin:auto; padding:0; overflow:hidden; }
.incident-view-toolbar { position:sticky; z-index:2; top:0; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 20px; border-bottom:1px solid var(--border); background:#fff; }
.incident-view-toolbar h2 { margin:0; font-size:19px; }
.incident-document { padding:28px 34px 38px; background:#fff; color:#172033; }
.incident-print-head { margin-bottom:24px; text-align:center; }
.incident-print-brand { color:#2563eb; font-size:11px; font-weight:850; letter-spacing:.14em; }
.incident-print-head h1 { margin:7px 0 5px; font-size:25px; }
.incident-print-head p { margin:0; color:var(--muted); }
.incident-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:1px; overflow:hidden; margin-bottom:18px; border:1px solid var(--border); border-radius:10px; background:var(--border); }
.incident-field { min-height:64px; padding:11px 13px; background:#fff; }
.incident-field span { display:block; margin-bottom:4px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.04em; }
.incident-field strong { font-size:12px; white-space:pre-wrap; }
.incident-section { margin-top:18px; break-inside:avoid; }
.incident-section h3 { margin:0 0 7px; padding-bottom:6px; border-bottom:2px solid #dbeafe; color:#1d4ed8; font-size:13px; }
.incident-section p { margin:0; font-size:12px; line-height:1.65; white-space:pre-wrap; }
.incident-participants { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.incident-participants > div { display:grid; padding:10px; border:1px solid var(--border); border-radius:8px; }
.incident-participants span { margin-top:3px; color:var(--muted); font-size:11px; }
.incident-photos > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.incident-photos img { width:100%; max-height:300px; object-fit:contain; border:1px solid var(--border); border-radius:8px; background:#f8fafc; }
.incident-signatures { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.incident-signature { display:grid; align-content:start; min-height:165px; padding:12px; border:1px solid var(--border); border-radius:9px; text-align:center; }
.incident-signature > strong { font-size:11px; text-transform:uppercase; }
.incident-signature > span { min-height:20px; margin:4px 0; color:var(--muted); font-size:11px; }
.incident-signature img { width:100%; height:90px; object-fit:contain; }
.signature-empty { display:grid; place-items:center; height:90px; color:#94a3b8; font-size:10px; }
@media print {
  @page { size:A4; margin:12mm; }
  body > :not(.incident-view-backdrop) { display:none !important; }
  .incident-view-backdrop { position:static; display:block !important; padding:0; background:#fff; }
  .incident-view { width:100%; max-height:none; border:0; box-shadow:none; }
  .no-print { display:none !important; }
  .incident-document { padding:0; }
  .incident-photos img { max-height:240px; }
}
.plan-editor { width:min(1080px,100%); }
.editor-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.editor-head h2 { margin:0 0 4px; }
.icon-button { width:34px; height:34px; border:0; border-radius:50%; background:#eef2f7; color:#475569; font-size:23px; line-height:1; }
.editor-grid { display:grid; grid-template-columns:2fr repeat(3,1fr); gap:12px; margin-top:17px; }
.editor-description { grid-column:1/-2; }
.check-field { display:flex; align-items:center; gap:8px; align-self:end; min-height:40px; color:#334155; font-size:12px; font-weight:700; }
.check-field input { width:17px; height:17px; }
.template-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:22px 0 9px; }
.template-section-head h3 { margin:0 0 3px; font-size:15px; }
.template-section-head p { margin:0; }
.template-table-wrap { overflow:auto; border:1px solid var(--border); border-radius:10px; }
.template-table { min-width:930px; }
.template-table td { padding:8px; vertical-align:middle; }
.template-table input,.template-table select { width:100%; min-height:36px; padding:6px 7px; border:1px solid #cbd5e1; border-radius:7px; background:#fff; }
.template-order { display:flex; align-items:center; gap:4px; }
.template-order button { width:25px; height:25px; padding:0; border:0; border-radius:6px; background:#eef2f7; color:#475569; }
.template-actions { white-space:nowrap; }
.template-actions button { border:0; background:transparent; color:var(--red); font-weight:750; }
.detail-meta-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-bottom:14px; }
.detail-meta-item { padding:10px; border:1px solid var(--border); border-radius:9px; background:#fff; }
.detail-meta-item span { display:block; color:var(--muted); font-size:10px; }
.detail-meta-item strong { display:block; margin-top:3px; font-size:12px; }
.detail-fields { grid-template-columns:1fr; margin-top:0; }
.detail-fields .editor-description { grid-column:1; }
.warning-box { margin-bottom:12px; padding:11px; border:1px solid #fecaca; border-radius:9px; background:var(--red-soft); color:#b91c1c; font-size:12px; font-weight:650; }
.evidence-section,.history-section { margin-top:20px; }
.evidence-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
.evidence-card { position:relative; overflow:hidden; border:1px solid var(--border); border-radius:10px; background:#fff; }
.evidence-card img { width:100%; height:110px; display:block; object-fit:cover; background:#e2e8f0; }
.evidence-card button { position:absolute; top:5px; right:5px; width:25px; height:25px; border:0; border-radius:50%; background:rgba(15,23,42,.78); color:#fff; }
.file-button { position:relative; overflow:hidden; display:inline-flex; align-items:center; }
.file-button input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.history-section h3 { margin:0 0 9px; font-size:15px; }
.history-list { display:grid; gap:8px; }
.history-item { padding:10px 12px; border-left:3px solid #cbd5e1; border-radius:0 8px 8px 0; background:#fff; font-size:12px; }
.history-item strong { display:block; margin-bottom:3px; }
.history-item span { color:var(--muted); }
.assets-filters { grid-template-columns:minmax(190px,1.3fr) minmax(180px,1.2fr) minmax(150px,.8fr) minmax(190px,1fr) auto; }
.energy-filters { grid-template-columns:minmax(200px,1.4fr) repeat(3,minmax(145px,1fr)) auto; }
.materials-filters { grid-template-columns:minmax(190px,1.3fr) repeat(3,minmax(135px,.8fr)) minmax(170px,1fr) auto; }
.adhoc-filters { grid-template-columns:minmax(190px,1.3fr) repeat(3,minmax(135px,.8fr)) minmax(180px,1fr) auto; }
.incident-filters { grid-template-columns:minmax(190px,1.3fr) repeat(3,minmax(135px,.8fr)) minmax(180px,1fr) auto; }
.docs-filters { grid-template-columns:minmax(220px,1.4fr) minmax(180px,.8fr) minmax(240px,1.2fr) auto; }
.asset-status { margin:0 0 10px; }
.asset-editor-grid { grid-template-columns:1fr 2fr; }
.asset-editor-grid .check-field { grid-column:2; }
.device-editor-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.status-overdue { color:var(--red); font-weight:750; }
.status-done { color:var(--green); font-weight:750; }
@media (max-width:1100px) {
  .filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .app-shell { display:block; }
  .sidebar { position:static; width:auto; height:auto; padding:12px; }
  .brand { margin:2px 8px 10px; }
  .sidebar a { display:inline-block; }
  .topbar,.content { padding:14px; }
  .filters { grid-template-columns:1fr 1fr; }
  .filters .field:first-child,.filters .field:last-child { grid-column:1/-1; }
  .summary-grid { grid-template-columns:1fr 1fr; }
  .risk-cockpit-head { display:grid; }
  .risk-level { justify-self:start; }
  .risk-cockpit-grid { grid-template-columns:1fr; }
  .incident-field-grid,.incident-participants,.incident-photos > div,.incident-signatures { grid-template-columns:1fr; }
  .incident-view-backdrop { padding:8px; }
  .incident-view-toolbar { align-items:stretch; flex-direction:column; }
  .incident-document { padding:20px 16px 28px; }
  .table-tools,.page-head { align-items:stretch; flex-direction:column; }
  .search { width:100%; }
  .editor-grid { grid-template-columns:1fr 1fr; }
  .editor-name,.editor-description { grid-column:1/-1; }
  .check-field { grid-column:1/-1; }
  .assets-filters { grid-template-columns:1fr 1fr; }
  .energy-chart-head { flex-direction:column; }
  .energy-chart-total { text-align:left; }
}
