/* GeoThermX — UI tokens measured from the 1440×1080 design screens. Single light theme by design. */
:root {
  --teal-700: #0f766e; --teal-600: #0d9488; --teal-500: #14b8a6; --teal-100: #ccfbf1; --teal-50: #f0fdfa;
  --ink: #0f172a; --ink-2: #1e293b; --ink-3: #334155; --muted: #64748b; --muted-2: #94a3b8;
  --line: #e2e8f0; --line-2: #f1f5f9; --bg: #f8fafc; --card: #ffffff; --chip: #efefef;
  --green: #10b981; --green-50: #ecfdf5; --amber: #f59e0b; --amber-50: #fffbeb; --red: #ef4444; --red-50: #fef2f2; --blue: #3b82f6; --gold: #d4a72c;
  --navy: #0f172a; --navy-2: #1b2335; --navy-3: #272e3f;
  --r-card: 10px; --r-btn: 8px; --r-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .02);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, .25);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sidebar: 260px; --header: 64px; --pad: 25px; --gap: 20px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.pad { padding: 20px; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num, .tab-nums { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100%; }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; z-index: 30; }
.brand { height: 72px; display: flex; align-items: center; padding: 0 28px; font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--teal-600); text-decoration: none; flex: none; }
.nav { padding: 16px 0 24px; }
.nav-sec { margin-top: 14px; }
.nav-sec:first-child { margin-top: 0; }
.nav-label { padding: 0 28px; height: 20px; line-height: 20px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-bottom: 7px; }
.nav a { display: flex; align-items: center; height: 36px; padding: 0 28px; font-size: 14px; color: var(--ink); text-decoration: none; position: relative; transition: color .15s, background .15s; }
.nav a:hover { color: var(--teal-600); background: linear-gradient(90deg, var(--teal-50), transparent 85%); }
.nav a.active { color: var(--teal-600); }
.nav a.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal-600); animation: grow-y .25s ease; }
@keyframes grow-y { from { transform: scaleY(0); } }
.nav a .badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { margin-top: auto; padding: 16px 28px 22px; font-size: 11px; color: var(--muted-2); line-height: 1.5; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; position: relative; }
.topbar { height: var(--header); flex: none; background: #fff; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 32px; gap: 16px; position: relative; z-index: 20; }
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-title { font-size: 17px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.tb-ref { color: var(--muted); font-size: 14px; padding-left: 14px; border-left: 1px solid var(--muted-2); white-space: nowrap; }
.proj-btn { display: inline-flex; align-items: center; gap: 12px; background: none; border: 0; padding: 6px 8px 6px 0; border-radius: 8px; font-size: 17px; font-weight: 500; }
.proj-btn .caret { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--muted-2); transition: transform .2s; }
.proj-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.tb-center { display: flex; justify-content: center; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.step-pill { display: inline-flex; align-items: center; height: 30px; padding: 0 20px; border-radius: 999px; background: var(--teal-50); border: 1px solid var(--teal-100); color: var(--teal-500); font-size: 13px; font-weight: 500; white-space: nowrap; }
.step-pill.dark { color: var(--teal-600); }
.status-online { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-500); font-weight: 500; font-size: 13px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.user { display: flex; align-items: center; gap: 10px; text-align: right; background: none; border: 0; padding: 4px; border-radius: 10px; }
.user b { display: block; font-size: 12px; font-weight: 600; }
.user span { display: block; font-size: 11.5px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; box-shadow: 0 0 0 1px var(--line); }
.tb-sep { width: 1px; height: 30px; background: var(--line); }
.menu-btn { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; align-items: center; justify-content: center; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--pad); position: relative; }
.view.has-foot { padding-bottom: 24px; }
.view-inner { animation: view-in .35s cubic-bezier(.2, .7, .2, 1); min-height: 100%; display: flex; flex-direction: column; }
#vroot { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#vroot > * { min-width: 0; }
@keyframes view-in { from { opacity: .001; transform: translateY(8px); } }
.footbar { flex: none; height: 64px; background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 32px; }
.footbar .spacer { flex: 1; }
.footbar .note { color: var(--muted); font-size: 13px; }

/* ---------- Primitives ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); min-width: 0; position: relative; }
.card.pad { padding: 20px; }
.card-title { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0; }
.card-title.dark { color: var(--ink); font-weight: 700; }
.card-title.ink3 { color: var(--ink-3); }
.dark-card { background: var(--navy); border: 0; color: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); position: relative; }
.dark-card .card-title { color: #cbd5e1; }
.grid { display: grid; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); } .teal { color: var(--teal-500); } .teal6 { color: var(--teal-600); } .gold { color: var(--gold); }
.b { font-weight: 600; } .bb { font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 18px; border-radius: var(--r-btn); border: 1px solid transparent; font-size: 14px; font-weight: 600; white-space: nowrap; transition: transform .08s ease, background .15s, box-shadow .15s, border-color .15s, color .15s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-chip { background: var(--chip); color: #000; height: 33px; font-size: 13px; padding: 0 16px; border-radius: 7px; }
.btn-chip:hover { background: #e4e4e4; }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); box-shadow: 0 4px 14px -4px rgba(13, 148, 136, .55); }
.btn-accent { background: var(--teal-500); color: #fff; }
.btn-accent:hover { background: var(--teal-600); box-shadow: 0 4px 14px -4px rgba(20, 184, 166, .55); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: #1e293b; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #cbd5e1; background: var(--bg); }
.btn-outline { background: #fff; color: var(--teal-600); border-color: var(--teal-500); }
.btn-outline:hover { background: var(--teal-50); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: flex; background: var(--line-2); border-radius: 8px; padding: 4px; gap: 2px; }
.seg button { flex: 1; height: 34px; border: 0; background: transparent; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--ink); transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: #fff; color: var(--teal-600); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.tabs { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 4px; gap: 2px; }
.tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; font-size: 13.5px; font-weight: 500; color: var(--ink); transition: background .2s, box-shadow .2s; }
.tabs button.on { background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.tabs-dark { display: inline-flex; gap: 10px; }
.tabs-dark button { height: 34px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink); transition: all .2s; }
.tabs-dark button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs-outline { display: flex; gap: 16px; flex-wrap: wrap; }
.tabs-outline button { height: 52px; padding: 0 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 500; color: var(--ink-3); transition: all .2s; }
.tabs-outline button.on { border-color: var(--teal-500); background: var(--teal-50); color: var(--teal-500); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink); }
.input, .select { height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); padding: 0 16px; font-size: 14px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; outline: none; }
.input:hover, .select:hover { border-color: #cbd5e1; }
.input:focus, .select:focus { border-color: var(--teal-500); background: #fff; box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; cursor: pointer; }
.input:disabled, .select:disabled { color: var(--muted); cursor: not-allowed; }
.kv-field > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kv-field { gap: 8px; display: flex; align-items: center; justify-content: space-between; height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 0 14px 0 16px; font-size: 13px; color: var(--ink-3); transition: border-color .15s, box-shadow .15s; }
.kv-field:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.kv-field input { width: 58px; border: 0; outline: 0; text-align: right; font-weight: 600; color: var(--ink); background: transparent; font-size: 13px; }
.kv-field .unit { font-weight: 600; color: var(--ink); margin-left: 1px; }
.kv-field .step { display: flex; flex-direction: column; margin-left: 6px; opacity: .3; transition: opacity .15s; }
.kv-field:hover .step, .kv-field:focus-within .step { opacity: 1; }
.kv-field .step button { border: 0; background: none; height: 12px; width: 14px; padding: 0; color: var(--muted); font-size: 9px; line-height: 12px; }
.kv-field .step button:hover { color: var(--teal-600); }

.toggle { position: relative; width: 40px; height: 22px; border-radius: 11px; background: #cbd5e1; border: 0; padding: 0; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s cubic-bezier(.3, .7, .3, 1.2); }
.toggle.on { background: var(--teal-500); }
.toggle.on::after { transform: translateX(18px); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--line) 0 0); outline: none; margin: 10px 0 4px; cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--teal-500); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--teal-500), 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.range::-webkit-slider-thumb:hover { transform: scale(1.25); }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--teal-500); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--teal-500); }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.pill.red { background: var(--red-50); color: var(--red); }
.pill.amber { background: var(--amber-50); color: #d97706; }
.pill.green { background: var(--green-50); color: var(--green); }
.pill.gray { background: var(--line-2); color: var(--ink); }
.pill.teal { background: var(--teal-50); color: var(--teal-600); }
.pill.blue { background: #eff6ff; color: #2563eb; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.insight { background: var(--teal-50); border-radius: 8px; padding: 12px 16px; font-size: 13px; line-height: 1.45; color: var(--ink); border: 1px solid #d5f5ef; }
.insight.bar { border: 0; border-left: 3px solid var(--teal-600); border-radius: 4px 8px 8px 4px; }

/* number animation flash */
.flash { animation: flash .6s ease; }
@keyframes flash { 0% { background: rgba(20, 184, 166, .18); } 100% { background: transparent; } }
.stagger > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; } .stagger > *:nth-child(3) { animation-delay: .08s; } .stagger > *:nth-child(4) { animation-delay: .12s; }
.stagger > *:nth-child(5) { animation-delay: .16s; } .stagger > *:nth-child(6) { animation-delay: .2s; } .stagger > *:nth-child(7) { animation-delay: .24s; } .stagger > *:nth-child(n+8) { animation-delay: .28s; }
@keyframes rise { from { opacity: .001; transform: translateY(10px); } }
.hover-lift { transition: transform .2s, box-shadow .2s, border-color .2s; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .35); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.kpi { padding: 24px 20px 18px 20px; min-height: 128px; display: flex; flex-direction: column; }
.kpi .lbl { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-size: 28px; font-weight: 700; margin-top: 10px; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.kpi .val small { font-size: 14px; font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.kpi .sub { font-size: 12px; margin-top: auto; line-height: 1.25; }
.kpi4 .kpi { height: 80px; padding: 16px 16px; }

.kpi-sm { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; height: 80px; }
.kpi-sm .lbl { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.kpi-sm .val { font-size: 21px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; white-space: nowrap; }
.kpi-sm .val small { font-size: 11px; font-weight: 600; margin-left: 4px; }
.kpi-sm .sub { font-size: 11px; font-weight: 600; margin-top: 2px; }

/* ---------- Charts ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 10.5px; fill: var(--muted); }
.bar-anim { transform-box: fill-box; transform-origin: bottom; animation: bar-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bar-grow { from { transform: scaleY(0); } }
.line-anim { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s cubic-bezier(.4, .1, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tip { position: fixed; z-index: 200; pointer-events: none; background: var(--navy); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, -100%) translateY(-8px); transition: opacity .12s; white-space: nowrap; }
.tip.show { opacity: 1; }
.tip b { color: var(--teal-500); font-weight: 600; }

/* ---------- Toast / modal / menus ---------- */
.toasts { pointer-events: none; position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast { min-width: 260px; max-width: 380px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 16px 12px 14px; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.4; animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2); }
.toast.out { animation: toast-out .25s ease forwards; }
.toast .ti { width: 20px; height: 20px; border-radius: 50%; background: var(--teal-500); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; margin-top: 1px; }
.toast.warn .ti { background: var(--amber); } .toast.err .ti { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); z-index: 250; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .28s cubic-bezier(.2, .9, .3, 1.15); }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal-h { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--line-2); font-size: 18px; line-height: 1; }
.modal-b { padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.code-box { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 300px; overflow: auto; white-space: pre; }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop .2s ease; }
.dropdown button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 13.5px; }
.dropdown button:hover { background: var(--bg); }
.dropdown button.on { color: var(--teal-600); font-weight: 600; }
.dropdown .dd-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- Generic layout helpers ---------- */
.kv { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); gap: 12px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); }
.kv .v { font-weight: 600; text-align: right; }
.list-rows .kv { padding: 11px 0; }
.mini-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff; }
.mini-box .l { font-size: 12px; color: var(--muted); }
.mini-box .v { font-size: 19px; font-weight: 700; margin-top: 2px; }
.progress { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--teal-500); transition: width .8s cubic-bezier(.2, .8, .2, 1); }

.readonly-banner { display: none; }
body.readonly .readonly-banner { display: flex; align-items: center; gap: 10px; background: var(--amber-50); border: 1px solid #fde68a; color: #92400e; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
body.readonly [data-edit] { pointer-events: none; opacity: .55; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); padding-top: env(safe-area-inset-top, 0px); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .topbar { grid-template-columns: 1fr auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .tb-center { display: none; }
  .view { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
  .footbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); height: auto; min-height: 64px; flex-wrap: wrap; padding-block: 12px; }
  .r-stack { grid-template-columns: 1fr !important; }
  .r-span-all { grid-column: 1 / -1 !important; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user .u-text, .tb-ref, .hide-sm { display: none; }
  .tb-right .btn-chip, #start-project { display: none; }
  .footbar .btn { height: 34px; font-size: 13px; padding: 0 12px; }
  .r-2 { grid-template-columns: 1fr !important; }
  .footbar .btn { flex: 1 1 auto; }
  .footbar .note { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  .sidebar, .topbar, .footbar, .toasts { display: none !important; }
  .app { display: block; } .view { overflow: visible; }
}
