:root {
    --bg: #08111f;
    --bg-elev: rgba(10, 20, 38, 0.84);
    --bg-card: rgba(15, 28, 49, 0.94);
    --line: rgba(130, 178, 255, 0.16);
    --text: #ecf4ff;
    --muted: #90a7c6;
    --accent: #3da1ff;
    --success: #1ec892;
    --warning: #f8bc3a;
    --danger: #ff5c80;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--text); height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.glass-panel { backdrop-filter: blur(18px); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow); }
.theme-dark { min-height: 100vh; }
.login-page { background: radial-gradient(circle at top, #13294d, #08111f 55%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.login-card { width: min(480px, 100%); border-radius: 28px; padding: 32px; }
.brand-row { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.brand-badge { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #103765, #1d79d5); font-size: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }
.login-card h1 { margin: 0; font-size: 2rem; }
.login-copy { color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.login-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.input { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: rgba(7, 15, 29, 0.95); color: var(--text); padding: 14px 16px; }
.btn-primary, .btn-inline, .btn-ghost { border: 0; border-radius: 14px; cursor: pointer; transition: .2s ease; }
.btn-primary { background: linear-gradient(135deg, #1f7ef1, #42b3ff); color: white; padding: 14px 18px; display: inline-flex; gap: 10px; align-items: center; justify-content: center; }
.btn-inline, .btn-ghost { background: rgba(61, 161, 255, 0.12); color: var(--text); padding: 10px 12px; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover, .btn-inline:hover, .btn-ghost:hover, .rail-btn:hover { transform: translateY(-1px); }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; }
.alert.danger { background: rgba(255, 92, 128, 0.12); border: 1px solid rgba(255, 92, 128, 0.25); color: #ffd8e1; }
.app-shell { position: relative; min-height: 100vh; overflow: hidden; }
.map-wrapper, #map { position: absolute; inset: 0; }
.top-filters { position: absolute; top: 18px; left: 104px; right: 24px; z-index: 30; display: flex; align-items: center; gap: 20px; padding: 14px 18px; border-radius: 22px; }
.brand-inline { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.brand-inline i { font-size: 24px; color: var(--accent); }
.brand-inline span { display: block; color: var(--muted); font-size: .86rem; }
.filters-grid { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.toggle-pill { position: relative; }
.toggle-pill input { position: absolute; opacity: 0; }
.toggle-pill span { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); padding: 10px 14px; color: var(--muted); background: rgba(255,255,255,.02); cursor: pointer; }
.toggle-pill input:checked + span { background: rgba(61, 161, 255, .16); color: var(--text); border-color: rgba(61, 161, 255, .3); }
.session-box { display: flex; align-items: center; gap: 12px; }
.left-rail { position: absolute; top: 96px; left: 24px; z-index: 30; width: 64px; border-radius: 28px; padding: 12px 10px; display: grid; gap: 12px; }
.rail-btn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.rail-btn.active { background: rgba(61, 161, 255, .16); color: white; }
.floating-panel-stack { position: absolute; top: 96px; left: 104px; bottom: 24px; width: min(420px, calc(100vw - 180px)); z-index: 20; pointer-events: none; }
.side-panel { position: absolute; inset: 0; border-radius: 26px; padding: 20px; opacity: 0; transform: translateX(-18px); transition: .24s ease; pointer-events: none; overflow: auto; }
.side-panel.visible { opacity: 1; transform: translateX(0); pointer-events: auto; }
.panel-wide { width: min(760px, calc(100vw - 170px)); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.pill { display: inline-flex; align-items: center; padding: 8px 10px; border-radius: 999px; font-size: .82rem; }
.pill.danger { background: rgba(255, 92, 128, .14); color: #ffdce5; }
.pill.info { background: rgba(61, 161, 255, .14); color: #cde6ff; }
.case-list { display: grid; gap: 14px; }
.case-card, .prediction-card { border-radius: 20px; padding: 16px; background: var(--bg-card); border: 1px solid var(--line); }
.case-card.muted { opacity: .78; }
.case-top, .case-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.case-card h3, .prediction-card h3 { margin: 12px 0 8px; }
.case-card p, .prediction-card p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.priority { border-radius: 999px; padding: 6px 10px; font-size: .78rem; }
.priority.alta, .priority.critica { background: rgba(255, 92, 128, .14); color: #ffd9e2; }
.priority.media { background: rgba(248, 188, 58, .16); color: #ffe5ac; }
.prediction-card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; }
.prediction-score { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #103765, #1d79d5); font-weight: 700; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; }
iframe { width: 100%; min-height: 70vh; border: 0; border-radius: 18px; background: #06101d; }
.settings-grid { display: grid; gap: 16px; }
@media (max-width: 1200px) {
    .top-filters { left: 24px; top: 24px; }
    .left-rail { top: auto; bottom: 24px; left: 24px; grid-auto-flow: column; width: auto; }
    .floating-panel-stack { left: 24px; top: 118px; width: min(420px, calc(100vw - 48px)); }
}
@media (max-width: 768px) {
    .top-filters { position: relative; inset: auto; margin: 16px; }
    .left-rail { bottom: 16px; left: 16px; right: 16px; justify-content: space-between; }
    .floating-panel-stack { left: 16px; right: 16px; width: auto; bottom: 88px; }
}
