/* GODIM Contigo · portal · identidad: azul marino, azul institucional, dorado */
:root {
  --navy: #062B56; --blue: #004B87; --gold: #D4A137; --amber: #8A5F10;
  --bg: #F3F6FA; --surface: #FFFFFF; --surface2: #F8FAFC; --text: #0F1E33; --muted: #566579; --border: #DCE3EC;
  --primary: #004B87; --primary-h: #003B6B; --on-primary: #FFFFFF; --link: #004B87;
  --gold-bg: #FBF1DA; --gold-ink: #8A5F10; --blue-bg: #E3EEF9; --blue-ink: #0B4B80;
  --green-bg: #DDF3E6; --green-ink: #0B6B3A; --red-bg: #FCE4E2; --red-ink: #A5251B; --gray-bg: #E7ECF2; --gray-ink: #44546A;
  --danger: #B42318; --shadow: 0 1px 2px rgba(6,43,86,.06), 0 4px 14px rgba(6,43,86,.06);
  --radius: 14px; --sb-w: 264px; --sb-w-compact: 76px;
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-h: 'Montserrat', 'Open Sans', system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A1524; --surface: #11233C; --surface2: #162B49; --text: #EAF0F8; --muted: #A2B2C7; --border: #263A58;
  --primary: #2B78C2; --primary-h: #3A88D3; --on-primary: #FFFFFF; --link: #8CC1F5;
  --gold-bg: #3A2D0F; --gold-ink: #F0C468; --blue-bg: #14355B; --blue-ink: #9CCBF7;
  --green-bg: #12352A; --green-ink: #7FD9A6; --red-bg: #43191A; --red-ink: #FFA39B; --gray-bg: #22344D; --gray-ink: #B8C6D9;
  --danger: #E5584B; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.25); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #0A1524; --surface: #11233C; --surface2: #162B49; --text: #EAF0F8; --muted: #A2B2C7; --border: #263A58;
    --primary: #2B78C2; --primary-h: #3A88D3; --on-primary: #FFFFFF; --link: #8CC1F5;
    --gold-bg: #3A2D0F; --gold-ink: #F0C468; --blue-bg: #14355B; --blue-ink: #9CCBF7;
    --green-bg: #12352A; --green-ink: #7FD9A6; --red-bg: #43191A; --red-ink: #FFA39B; --gray-bg: #22344D; --gray-ink: #B8C6D9;
    --danger: #E5584B; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.25); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--font-h); line-height: 1.2; margin: 0 0 .5rem; color: var(--text); }
h1 { font-size: 1.55rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-size: .85em; background: var(--gray-bg); padding: .1em .35em; border-radius: 5px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .inline { display: inline; margin: 0; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* logos según tema */
.lg-dark { display: none; }
[data-theme="dark"] .lg-light { display: none; } [data-theme="dark"] .lg-dark { display: inline-block; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .lg-light { display: none; } [data-theme="auto"] .lg-dark { display: inline-block; } }
.lg { height: 40px; width: auto; }
.ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: none; } [data-theme="dark"] .ic-sun { display: inline-flex; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .ic-moon { display: none; } [data-theme="auto"] .ic-sun { display: inline-flex; } }

/* ---------- botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; background: var(--surface2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); } .btn-primary:hover { background: var(--primary-h); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); } .btn-danger:hover { background: var(--red-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; } .btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field input, .field select, .field textarea, .filters input, .filters select, .composer textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.field textarea, .composer textarea { resize: vertical; }
.field input:disabled { background: var(--surface2); color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field small { display: block; margin-top: .25rem; }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .92rem; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.code-input { font: 600 1.6rem var(--font-h) !important; letter-spacing: .3em; text-align: center; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; } legend { font-weight: 600; padding: 0 .4rem; }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 1rem; align-items: end; }
.row-fields .btn { margin-bottom: 1rem; justify-self: start; }
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; } .filters input { flex: 1 1 200px; } .filters select { width: auto; flex: 0 1 190px; }
input[type=file] { font-size: .85rem; max-width: 100%; }

.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; word-break: break-word; }
.alert-ok { background: var(--green-bg); color: var(--green-ink); border-color: transparent; }
.alert-err { background: var(--red-bg); color: var(--red-ink); border-color: transparent; }
.offline-banner { background: var(--gold-bg); color: var(--gold-ink); padding: .5rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }

/* ---------- componentes ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); color: var(--text); }
a.card:hover { text-decoration: none; border-color: var(--gold); }
.empty { color: var(--muted); text-align: center; padding: 1rem 0; margin: 0; } .empty-card { text-align: center; }
.chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.chip-gold { background: var(--gold-bg); color: var(--gold-ink); } .chip-blue { background: var(--blue-bg); color: var(--blue-ink); }
.chip-green { background: var(--green-bg); color: var(--green-ink); } .chip-red { background: var(--red-bg); color: var(--red-ink); } .chip-gray { background: var(--gray-bg); color: var(--gray-ink); }
.folio { font: 700 .8rem var(--font-h); color: var(--muted); letter-spacing: .04em; margin-right: .4rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--navy); font: 700 .85rem var(--font-h); flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: .75rem; background: var(--blue-bg); color: var(--blue-ink); } .avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0 .75rem; } .sec-head:first-child { margin-top: 0; } .sec-head h1, .sec-head h2 { margin: 0; }
.stack { display: grid; gap: 0; } .li { display: flex; flex-direction: column; padding: .5rem 0; border-bottom: 1px solid var(--border); } .li:last-child { border-bottom: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.25rem; align-items: start; }
.hello { margin-bottom: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.25rem; } .kpis.k4 { grid-template-columns: repeat(4, 1fr); }
.kpi { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; color: var(--text); box-shadow: var(--shadow); }
.kpi:hover { text-decoration: none; border-color: var(--gold); } .kpi b { font: 700 1.7rem var(--font-h); line-height: 1.1; } .kpi span { color: var(--muted); font-size: .82rem; } .kpi.warn b { color: var(--gold-ink); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; } .svc { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.case-card h3 { margin: .35rem 0 .1rem; } .cc-top { display: flex; justify-content: space-between; align-items: center; }
.case-head { margin-bottom: 1rem; } .case-head h1 { margin: .35rem 0 .1rem; }
.row-card { display: flex; flex-direction: column; } .legal-card { background: var(--surface2); box-shadow: none; }
.emergency { display: flex; gap: 1rem; align-items: center; border-color: var(--red-ink); color: var(--text); } .emergency svg { color: var(--danger); flex: none; } .emergency p { margin: 0; }
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.hint { color: var(--muted); font-size: .88rem; display: flex; gap: .4rem; align-items: center; }
.note-red { display: block; color: var(--red-ink); } .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

.stagebar { list-style: none; display: flex; gap: .35rem; padding: 0; margin: .75rem 0 0; }
.stagebar li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; font-size: .68rem; color: var(--muted); position: relative; }
.stagebar li::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; } .stagebar li:first-child::before { display: none; }
.stagebar i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font: 700 .7rem var(--font-h); font-style: normal; color: var(--muted); }
.stagebar li.done i { background: var(--primary); border-color: var(--primary); color: var(--on-primary); } .stagebar li.done::before, .stagebar li.now::before { background: var(--primary); }
.stagebar li.now i { border-color: var(--gold); background: var(--gold); color: var(--navy); } .stagebar li.now { color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .65rem 1rem; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; display: inline-flex; gap: .4rem; align-items: center; } .tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--gold); }
.dot, .badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--navy); font: 700 .7rem var(--font); font-style: normal; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); } .timeline li { position: relative; padding: 0 0 1rem 1rem; } .timeline li::before { content: ''; position: absolute; left: -1.4rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.doc-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .75rem 0; border-bottom: 1px solid var(--border); } .doc-row:last-child { border-bottom: 0; }
.doc-main { flex: 1 1 220px; display: flex; flex-direction: column; min-width: 0; word-break: break-word; } .link-row { color: var(--text); } .link-row:hover { text-decoration: none; background: var(--surface2); }
.doc-actions { flex-basis: 100%; display: flex; gap: .5rem; flex-wrap: wrap; } .doc-actions form { display: flex; gap: .4rem; flex: 0 1 auto; } .reject-form input { min-height: 36px; padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; min-width: 200px; }
.upload-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; flex-basis: 100%; }
.list-card { padding: .25rem 1rem; } .thread-row { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); color: var(--text); } .thread-row:last-child { border-bottom: 0; } .thread-row:hover { text-decoration: none; }
.thread-row.unread { font-weight: 600; } .tr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; } .tr-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; } .bubble { max-width: 80%; padding: .6rem .9rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.bubble.mine { align-self: flex-end; background: var(--blue-bg); border-color: transparent; } .b-meta { font-size: .78rem; margin-bottom: .2rem; } .b-body { word-break: break-word; }
.composer { display: flex; gap: .5rem; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding: .5rem 0; } .composer textarea { flex: 1; min-height: 48px; }
.note p { margin: .25rem 0 0; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 32px; gap: .75rem; align-items: center; padding: .3rem 0; font-size: .88rem; } .bar { height: 10px; border-radius: 6px; background: var(--gray-bg); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--gold); }
.assign-card { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; } .ac-info { display: flex; flex-direction: column; color: var(--text); flex: 1 1 260px; } .ac-info:hover { text-decoration: none; }
.assign-form { display: flex; gap: .5rem; flex-wrap: wrap; } .assign-form select { min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 .5rem; font: inherit; }
.table-card { padding: 0; overflow: hidden; } .table { width: 100%; border-collapse: collapse; font-size: .92rem; } .table th { text-align: left; padding: .75rem 1rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); background: var(--surface2); }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); } .table tbody tr { cursor: pointer; } .table tbody tr:hover { background: var(--surface2); } .pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.seg { display: flex; gap: .5rem; flex-wrap: wrap; } .seg button { flex: 1 1 110px; display: inline-flex; gap: .5rem; align-items: center; justify-content: center; min-height: 48px; border: 2px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; font: 600 .92rem var(--font); cursor: pointer; } .seg button.on { border-color: var(--gold); background: var(--gold-bg); color: var(--gold-ink); }
.settings { display: grid; gap: 0; max-width: 640px; } .set-row { display: flex; align-items: center; gap: 1rem; } .set-row:hover { text-decoration: none; } .sr-main { flex: 1; display: flex; flex-direction: column; } .settings h3 { margin-bottom: .75rem; }
.flagbtn { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; } .flagbtn:hover { border-color: var(--gold); } .flagbtn svg { border-radius: 50%; } .flagbtn.sm { width: 34px; height: 34px; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; } .iconbtn:hover { background: var(--surface2); text-decoration: none; }
.iconbtn .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: .65rem; }
.steps { padding-left: 1.2rem; } .steps li { margin-bottom: .75rem; } .keybox { font: 700 1.15rem/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; background: var(--surface2); border: 1px dashed var(--border); border-radius: 10px; padding: .75rem; margin: .5rem 0; word-break: break-all; text-align: center; user-select: all; }
.checks { list-style: none; padding: 0; } .checks .ok { color: var(--green-ink); } .checks .bad { color: var(--red-ink); font-weight: 600; }

/* ---------- autenticación ---------- */
body.bare { min-height: 100vh; background: linear-gradient(160deg, var(--bg), var(--surface2)); }
.auth-top { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 16px; z-index: 5; }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 4.5rem 1rem 2rem; } .auth-wrap .auth-card.wide { max-width: none; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.5rem; } .auth-brand .lg { height: 56px; }
.auth-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.errcode { font: 700 3.5rem var(--font-h); color: var(--gold); line-height: 1; margin-bottom: .5rem; } .legal { color: var(--muted); font-size: .78rem; text-align: center; margin-top: 1rem; }

/* ---------- estructura (escritorio) ---------- */
.shell { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; width: var(--sb-w); background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 1rem .75rem; gap: 1rem; transition: width .18s ease; overflow: hidden; z-index: 20; }
.brand { display: flex; align-items: center; padding: .25rem .5rem; min-height: 44px; } .brand img { display: block; width: auto; } .brand-iso { display: none !important; }
.rolebox { background: rgba(255,255,255,.08); border-radius: 12px; padding: .6rem .8rem; display: flex; flex-direction: column; } .rolebox small { color: #AFC2DA; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; } .rolebox b { font: 600 .92rem var(--font-h); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sb-nav a, .sb-profile, .sb-exit, .sb-theme { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 10px; color: #D6E2F1; font: 600 .92rem var(--font); border: 0; background: transparent; cursor: pointer; min-height: 44px; text-align: left; white-space: nowrap; }
.sb-nav a:hover, .sb-profile:hover, .sb-exit:hover, .sb-theme:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.sb-nav a.on, .sb-profile.on { background: rgba(212,161,55,.18); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sb-nav svg, .sb-exit svg, .sb-theme svg { flex: none; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: .75rem; display: flex; flex-direction: column; gap: .35rem; }
.sb-profile .sb-txt { display: flex; flex-direction: column; min-width: 0; overflow: hidden; } .sb-profile b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; } .sb-profile small { color: #AFC2DA; font-weight: 400; }
.sb-actions { display: flex; gap: .35rem; } .sb-actions form:first-child { flex: 1; } .sb-exit { width: 100%; } .sb-theme { padding: .65rem; justify-content: center; }
.sb-theme .ic-moon, .sb-theme .ic-sun { display: inline-flex; } .sb-theme .ic-sun { display: none; }
[data-theme="dark"] .sb-theme .ic-moon { display: none; } [data-theme="dark"] .sb-theme .ic-sun { display: inline-flex; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .sb-theme .ic-moon { display: none; } [data-theme="auto"] .sb-theme .ic-sun { display: inline-flex; } }

/* menú compacto: solo íconos + isotipo */
.sb-compact .sidebar { width: var(--sb-w-compact); padding-left: .6rem; padding-right: .6rem; }
.sb-compact .sb-txt, .sb-compact .rolebox, .sb-compact .brand-full { display: none !important; }
.sb-compact .brand-iso { display: block !important; margin: 0 auto; } .sb-compact .brand { justify-content: center; padding: .25rem 0; }
.sb-compact .sb-nav a, .sb-compact .sb-profile, .sb-compact .sb-exit, .sb-compact .sb-theme { justify-content: center; padding: .65rem 0; }
.sb-compact .sb-actions { flex-direction: column; } .sb-compact .sb-actions form { flex: none !important; } .sb-compact .sb-nav a.on, .sb-compact .sb-profile.on { box-shadow: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.tb-title { font: 700 1.05rem var(--font-h); } .tb-right { display: flex; align-items: center; gap: .5rem; }
.content { padding: 1.5rem; max-width: 1180px; width: 100%; margin: 0 auto; }
.mbar, .subbar, .tabbar { display: none; }

/* ---------- móvil / PWA ---------- */
@media (max-width: 860px) {
  .sidebar, .topbar { display: none; }
  .shell { display: block; }
  .mbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .area-staff .mbar { background: var(--navy); color: #fff; border-color: transparent; } .area-staff .mbar .iconbtn:hover { background: rgba(255,255,255,.1); }
  .mb-right { display: flex; align-items: center; gap: .35rem; } .mb-logo { display: flex; align-items: center; } .mb-logo .lg, .mb-logo img { height: 30px; width: auto; }
  .avatar-btn { width: 36px; height: 36px; font-size: .75rem; } .avatar-btn:hover { text-decoration: none; }
  .subbar { position: sticky; top: calc(53px + env(safe-area-inset-top)); z-index: 14; display: flex; align-items: center; gap: .5rem; padding: .5rem 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .subbar a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--text); border-radius: 10px; } .subbar b { font: 700 1rem var(--font-h); }
  .content { padding: 1rem 14px calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .4rem; color: var(--muted); font: 600 .68rem var(--font); min-height: 56px; } .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--primary); box-shadow: inset 0 3px 0 var(--gold); } [data-theme="dark"] .tabbar a.on { color: var(--link); }
  @media (prefers-color-scheme: dark) { [data-theme="auto"] .tabbar a.on { color: var(--link); } }
  .cols { grid-template-columns: 1fr; } .kpis.k4 { grid-template-columns: repeat(2, 1fr); } h1 { font-size: 1.3rem; }
  .bar-row { grid-template-columns: 100px 1fr 28px; } .bubble { max-width: 92%; }
  .table thead { display: none; } .table, .table tbody, .table tr, .table td { display: block; width: 100%; } .table tr { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
  .table td { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border: 0; text-align: right; } .table td::before { content: attr(data-l); color: var(--muted); font-size: .78rem; text-align: left; }
  .stagebar li span { display: none; } .stagebar li.now span { display: block; position: absolute; top: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap; } .stagebar li.now:last-child span { left: auto; right: -2px; transform: none; } .stagebar li.now:first-child span { left: -2px; transform: none; } .stagebar { margin-bottom: 1rem; }
  .auth-wrap { padding-top: 5rem; }
}
@media (max-width: 480px) { .kpis { gap: .5rem; } .kpi { padding: .7rem; } .kpi b { font-size: 1.4rem; } .kpi span { font-size: .72rem; } .upload-inline, .doc-actions { width: 100%; } }
@media print { .sidebar, .topbar, .mbar, .tabbar, .subbar { display: none; } .content { padding: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
