:root {
  --ink: #10233f;
  --muted: #66758a;
  --paper: #f2f6fb;
  --card: #fff;
  --line: #dce5f0;
  --green: #123f73;
  --lime: #45a8e6;
  --warm: #287bb8;
  --red: #ae4a46;
  --shadow: 0 16px 48px rgba(18, 63, 115, .09);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--green); color: #fff; padding: 28px 20px; position: sticky; top: 0; height: 100vh; }
.brand { margin-bottom: 40px; }
.brand img { display: block; width: 185px; height: auto; }
.nav a { display: block; padding: 12px 14px; margin: 5px 0; border-radius: 11px; color: #d9e6df; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.side-user { position: absolute; bottom: 24px; font-size: 13px; color: #c4d7cd; }
.main { padding: 34px; max-width: 1480px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 20px; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); letter-spacing: -1.5px; }
h2 { margin: 0 0 18px; font-size: 21px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 750; cursor: pointer; display: inline-block; }
.btn-primary { background: var(--green); color: #fff; }
.btn-light { background: #fff; border: 1px solid var(--line); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #e3b8b5; }
.btn-danger:hover { background: #fff1f0; }
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.two { grid-template-columns: 1.35fr .65fr; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 32px; margin-top: 10px; }
.stat small, .muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .7px; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; text-transform: capitalize; }
.caliente { background: #fde4df; color: #8d332f; }
.tibio { background: #fff0c7; color: #765712; }
.frio { background: #dfeee7; color: #285c47; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #47534b; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #ccd3cd; border-radius: 9px; padding: 11px 12px; background: #fff; font: inherit; color: var(--ink); }
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(185,211,107,.35); border-color: var(--green); }
.flash { padding: 13px 16px; background: #e4f1e9; color: #225d44; border-radius: 10px; margin-bottom: 18px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 20% 20%, #267cb8, var(--green) 48%, #09284d); }
.login-card { width: min(430px, 100%); background: #fff; padding: 36px; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-card .brand { margin: -36px -36px 26px; padding: 30px 36px; background: var(--green); border-radius: 20px 20px 0 0; }
.login-card .brand img { width: 230px; max-width: 100%; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.metric { padding: 14px; background: #f6f7f4; border-radius: 12px; }
.metric strong { display: block; font-size: 22px; }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 20px; }
.timeline-item { margin-bottom: 20px; position: relative; }
.timeline-item::before { content: ""; width: 10px; height: 10px; background: var(--lime); border: 3px solid #fff; border-radius: 50%; position: absolute; left: -27px; top: 4px; }
.empty { padding: 35px; text-align: center; color: var(--muted); }
.map-frame { width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 0; border-radius: 16px; box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; padding: 18px; }
  .brand { margin-bottom: 12px; }
  .brand img { width: 165px; }
  .nav { display: flex; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .side-user { display: none; }
  .main { padding: 22px 16px; }
  .stats, .two { grid-template-columns: 1fr 1fr; }
  .map-frame { height: 65vh; min-height: 440px; }
}
@media (max-width: 620px) {
  .stats, .two, .form-grid { grid-template-columns: 1fr; }
  .topbar, .detail-head { align-items: flex-start; flex-direction: column; }
  .full { grid-column: auto; }
}
@media print {
  .sidebar, .topbar .actions, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 0; }
}
