/* Fiber Link OS 2.0 */
:root {
    --navy: #0B1B3A;
    --navy-2: #12264D;
    --primary: #0A66E8;
    --primary-600: #0853BF;
    --primary-50: #EAF2FF;
    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --border: #E3E8F0;
    --border-strong: #CBD3E1;
    --text: #0F172A;
    --text-2: #475569;
    --muted: #7A8599;
    --green: #0F9D58; --green-50: #E7F6EE;
    --red: #D93025;   --red-50: #FDECEA;
    --orange: #E8710A; --orange-50: #FDF0E4;
    --amber: #B7791F; --amber-50: #FEF6E0;
    --cyan: #0891B2;  --cyan-50: #E3F6FA;
    --indigo: #5B5BD6; --indigo-50: #EEEEFC;
    --blue: #0A66E8;  --blue-50: #EAF2FF;
    --gray: #64748B;  --gray-50: #F1F4F8;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
    --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    color: #C9D3E6;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    padding: 18px 14px;
    transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; color: #fff; }
.brand:hover { color: #fff; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.brand-logo img { max-width: 34px; max-height: 34px; object-fit: contain; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #8FA0C0; font-size: 12px; }
.sidebar-cta { margin: 4px 0 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: #B7C3DA; font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(10,102,232,.22); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.nav-count { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; background: var(--primary); color: #fff; padding: 1px 8px; border-radius: 99px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 10px; }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-info strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { color: #8FA0C0; font-size: 12px; }
.sidebar .icon-btn { color: #8FA0C0; }
.sidebar .icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px; padding: 0 28px;
    position: sticky; top: 0; z-index: 20;
}
.topbar-menu { display: none; }
.topbar-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.topbar-search input { border: 0; background: transparent; outline: 0; height: 38px; flex: 1; font: inherit; color: var(--text); min-width: 0; }
.topbar-search:focus-within { border-color: var(--primary); background: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.topbar-date { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.content { padding: 28px; flex: 1; width: 100%; max-width: 1400px; }
.footer { display: flex; justify-content: space-between; padding: 16px 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--gray-50); color: var(--text); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; margin-bottom: 8px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3 .icon { color: var(--primary); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: #FAFBFD; border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .card-body { padding: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

/* ---------- KPIs ---------- */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start; color: inherit; }
a.kpi:hover { border-color: var(--border-strong); color: inherit; }
.kpi-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-orange { background: var(--orange-50); color: var(--orange); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-indigo { background: var(--indigo-50); color: var(--indigo); }
.tone-cyan { background: var(--cyan-50); color: var(--cyan); }
.tone-amber { background: var(--amber-50); color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    text-decoration: none;
}
.btn:focus-visible { outline: 3px solid rgba(10,102,232,.3); outline-offset: 1px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0B8048; color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #B3261E; color: #fff; }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--gray-50); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-50); color: var(--text); }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1EB257; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.link-danger { color: var(--red); background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; } .col-9 { grid-column: span 9; } .col-1 { grid-column: span 1; }
@media (max-width: 1100px) { .col-1 { grid-column: span 2; } .form-grid .col-3 + .col-1 { grid-column: span 2; } }
.field label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field .req { color: var(--red); }
.input, .select, .textarea {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
    font: inherit; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748B' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,102,232,.15); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 160px; }
.filters .grow { flex: 1; min-width: 220px; }
.show-mobile { display: none; }
@media (max-width: 640px) { .show-mobile { display: inline-flex; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #FAFBFD; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.row-link { cursor: pointer; }
.os-code { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.cell-sub { font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { color: var(--border-strong); margin-bottom: 8px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-blue, .badge-soft-blue { background: var(--blue-50); color: var(--blue); }
.badge-green, .badge-soft-green { background: var(--green-50); color: var(--green); }
.badge-red, .badge-soft-red { background: var(--red-50); color: var(--red); }
.badge-orange, .badge-soft-orange { background: var(--orange-50); color: var(--orange); }
.badge-amber, .badge-soft-amber { background: var(--amber-50); color: var(--amber); }
.badge-cyan, .badge-soft-cyan { background: var(--cyan-50); color: var(--cyan); }
.badge-indigo, .badge-soft-indigo { background: var(--indigo-50); color: var(--indigo); }
.badge-gray, .badge-soft-gray { background: var(--gray-50); color: var(--gray); }
[class*="badge-soft-"] { border-radius: 6px; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-weight: 500; transition: opacity .4s; }
.alert-success { background: var(--green-50); border-color: #B7E4CB; color: #0B6B3D; }
.alert-error { background: var(--red-50); border-color: #F5C2BE; color: #A1231B; }
.alert-warning { background: var(--amber-50); border-color: #F3DDA2; color: #7A5210; }
.alert-info { background: var(--blue-50); border-color: #BCD5FB; color: #0B4AA6; }

/* ---------- Detail lists ---------- */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.text-block { white-space: pre-wrap; background: var(--gray-50); border-radius: 8px; padding: 12px 14px; margin: 0; font: inherit; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .justify-between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ---------- OS header ---------- */
.os-hero { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.os-hero h1 { font-size: 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.os-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-2); margin-top: 8px; font-size: 13px; }
.os-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Stepper de status */
.stepper { display: flex; gap: 0; margin: 0 0 20px; overflow-x: auto; }
.step { flex: 1; min-width: 110px; text-align: center; position: relative; padding-top: 22px; font-size: 12px; color: var(--muted); font-weight: 500; }
.step::before { content: ''; position: absolute; top: 7px; left: 0; right: 0; height: 3px; background: var(--border); }
.step:first-child::before { left: 50%; } .step:last-child::before { right: 50%; }
.step i { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 17px; height: 17px; border-radius: 50%; background: #fff; border: 3px solid var(--border-strong); z-index: 1; }
.step.done { color: var(--text); } .step.done::before { background: var(--primary); }
.step.done i { background: var(--primary); border-color: var(--primary); }
.step.current { color: var(--primary); font-weight: 700; }
.step.current i { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(10,102,232,.18); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.timeline strong { display: block; font-size: 13.5px; }
.timeline p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; white-space: pre-wrap; }
.timeline small { color: var(--muted); font-size: 12px; }

/* Fotos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--gray-50); border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo form { position: absolute; top: 6px; right: 6px; }
.photo .icon-btn { background: rgba(255,255,255,.92); width: 28px; height: 28px; color: var(--red); }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 11px; padding: 14px 8px 6px; }

/* Assinatura */
.sign-pad { border: 2px dashed var(--border-strong); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 200px; display: block; cursor: crosshair; }
.sign-img { max-width: 100%; max-height: 160px; border-bottom: 1px solid var(--text); display: block; margin: 0 auto; }

/* Gráfico de barras simples */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar span { width: 100%; max-width: 32px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bar span:hover { background: var(--primary-600); }
.bar small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar b { font-size: 11px; color: var(--text-2); font-weight: 600; }
.hbar { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.hbar-track { height: 8px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }

/* Listas compactas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.pagination div { display: flex; align-items: center; gap: 6px; }
.pagination-info { color: var(--text-2); font-size: 13px; padding: 0 6px; }

/* Tabs de status (chips) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 500; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip em { font-style: normal; opacity: .7; margin-left: 4px; }

/* Modal (dialog nativo) */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(11, 27, 58, .5); }
dialog .card-head, dialog .card-body { border-radius: 0; }

/* ---------- Auth / instalador ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-side { background: radial-gradient(1200px 600px at 10% 10%, #1C4EA8 0%, transparent 60%), linear-gradient(160deg, #0B1B3A 0%, #0E2A5C 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; inset: auto -120px -120px auto; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); }
.auth-side h1 { font-size: 36px; letter-spacing: -.02em; margin: 28px 0 12px; }
.auth-side p { color: #B7C6E4; font-size: 16px; max-width: 440px; margin: 0; }
.auth-logo { background: #fff; border-radius: 14px; padding: 10px 14px; display: inline-flex; }
.auth-logo img { max-height: 56px; }
.auth-feats { display: grid; gap: 18px; position: relative; z-index: 1; }
.auth-feat { display: flex; gap: 14px; align-items: flex-start; }
.auth-feat .kpi-icon { background: rgba(255,255,255,.1); color: #fff; }
.auth-feat strong { display: block; }
.auth-feat span { color: #9FB2D6; font-size: 13px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 26px; letter-spacing: -.01em; }
.auth-box > p { color: var(--text-2); margin: 6px 0 28px; }
.auth-box .field { margin-bottom: 16px; }
.auth-box .input { height: 46px; }
.auth-box .btn { height: 46px; font-size: 15px; }
.auth-foot { margin-top: 32px; color: var(--muted); font-size: 12px; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(11,27,58,.45); z-index: 30; }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .topbar-menu { display: inline-grid; }
    .topbar-date { display: none; }
    .content { padding: 20px 16px; }
    .footer { padding: 14px 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}
@media (max-width: 640px) {
    .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi { padding: 14px; flex-direction: column; gap: 8px; }
    .kpi-value { font-size: 22px; }
    .form-grid > [class*="col-"] { grid-column: span 12; }
    .dl { grid-template-columns: 1fr; gap: 2px 0; }
    .dl dd { margin-bottom: 8px; }
    .page-head h1 { font-size: 20px; }
    .os-hero h1 { font-size: 21px; }
    .table-cards thead { display: none; }
    .table-cards tr { display: block; border-bottom: 1px solid var(--border); padding: 10px 4px; }
    .table-cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; text-align: right; }
    .table-cards td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; text-align: left; }
    .table-cards td.actions { justify-content: flex-end; }
    .table-cards td.actions::before { content: none; }
    .hbar { grid-template-columns: 100px 1fr 36px; }
    .filters .input, .filters .select { width: 100%; }
    .step { min-width: 0; font-size: 10px; letter-spacing: -.01em; }
    .filters .adv { display: none; }
    .filters.open .adv { display: block; }
}
@media print {
    .sidebar, .topbar, .footer, .page-actions, .no-print { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}
