/* Cumbre — Design System 2025 — fully responsive */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

:root{
  --bg:#080b10; --bg-2:#0e131c; --panel:#111820; --panel-2:#16202e; --panel-3:#1a2740;
  --line:#1e2a3a; --line-2:#25344a; --line-3:#2f4360;
  --text:#eaf0f7; --muted:#8fa0b8; --muted-2:#a6b5cc;
  --accent:#ff5c1e; --accent-2:#ff7a3d; --accent-3:#ffede3; --accent-glow:rgba(255,92,30,.35);
  --ok:#29c07f; --ok-glow:rgba(41,192,127,.35); --bad:#ff5a43; --warn:#ffb020;
  --radius:18px; --radius-sm:12px; --radius-xs:10px;
  --shadow:0 8px 32px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.04) inset;
  --shadow-card:0 4px 24px rgba(0,0,0,.32), 0 1px 0 rgba(255,255,255,.04) inset;
  --blur:18px;
  --sidebar-w:260px;
  --header-h:56px;
  --content-max:1320px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth; scrollbar-gutter:stable}
body{
  margin:0; background:
    radial-gradient(1100px 700px at 72% -8%, rgba(255,92,30,.12), transparent 65%),
    radial-gradient(900px 600px at 10% 0%, rgba(64,148,255,.09), transparent 65%),
    linear-gradient(180deg, #070a12 0%, #080b10 100%);
  color:var(--text); font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size:15px; line-height:1.6; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  min-width:320px;
}
img, video, canvas, svg{max-width:100%}
h1,h2,h3{font-weight:800; letter-spacing:-.02em; margin:0}
h1{font-size:clamp(22px, 4vw, 28px)}
h2{font-size:16px}
p{margin:0}
a{color:var(--accent-2); text-decoration:none}
a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--accent-2); outline-offset:2px; border-radius:8px}
.mono, code{font-family:"JetBrains Mono", ui-monospace, monospace}

/* Scrollbar */
::-webkit-scrollbar{width:10px; height:10px}
::-webkit-scrollbar-thumb{background:#1e2d45; border-radius:999px; border:2px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:#25405f}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 16px; border-radius:999px; border:1px solid var(--line-2);
  background:rgba(255,255,255,.04); color:var(--text); font-weight:600; font-size:13px;
  letter-spacing:.01em; cursor:pointer; transition: all .18s ease; backdrop-filter: blur(6px);
  min-height:40px; white-space:nowrap;
}
.btn:hover{background:rgba(255,255,255,.08); border-color:var(--line-3); transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn:disabled{opacity:.5; cursor:not-allowed; transform:none}
.btn.primary{
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color:rgba(255,92,30,.9); color:#fff; box-shadow:0 6px 18px var(--accent-glow), 0 1px 0 rgba(255,255,255,.3) inset;
}
.btn.primary:hover{filter:brightness(1.06); transform:translateY(-1px)}
.btn.danger{background:transparent; color:var(--bad); border-color:rgba(255,90,67,.45)}
.btn.danger:hover{background:rgba(255,90,67,.1)}
.btn.ghost{background:transparent; border-color:transparent}
.btn.ghost:hover{background:rgba(255,255,255,.06)}
.btn.small{padding:7px 12px; font-size:12.5px; min-height:34px}
.btn.block{width:100%; padding:12px 16px; border-radius:14px}
.btn .ico{width:16px; height:16px}
.icon-btn{
  width:40px; height:40px; border-radius:12px; border:1px solid var(--line-2);
  background:rgba(255,255,255,.04); color:var(--text); display:inline-grid; place-items:center;
  cursor:pointer; transition:all .16s;
}
.icon-btn:hover{background:rgba(255,255,255,.08); border-color:var(--line-3)}
.burger{display:grid; gap:4px}
.burger i{display:block; width:16px; height:2px; background:currentColor; border-radius:999px}

/* Inputs */
label{display:grid; gap:7px; font-size:12.5px; color:var(--muted); font-weight:600; letter-spacing:.02em; text-transform:uppercase}
input[type=text], input[type=password], input:not([type]), textarea, select{
  padding:11px 14px; border-radius:12px; border:1px solid var(--line-2);
  background:rgba(8,11,16,.9); color:var(--text); width:100%; font-size:16px; font-weight:500;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus{border-color:var(--accent-2); box-shadow:0 0 0 3px rgba(255,92,30,.18); outline:none; background:rgba(14,19,28,.9)}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-card);
  backdrop-filter: blur(var(--blur));
}
.error{color:var(--bad); font-size:13px; min-height:1.2em; font-weight:600}
.hint, .muted{color:var(--muted); font-size:13px; line-height:1.55}
.muted-strong{color:var(--muted-2)}
.logo{
  width:32px; height:32px; border-radius:10px; flex:none;
  background:
    radial-gradient(120% 120% at 30% 20%, #ff8a5a 0%, #ff5c1e 55%, #c43d08 100%);
  box-shadow:0 4px 12px rgba(255,92,30,.45);
  position:relative;
}
.logo::after{
  content:""; position:absolute; inset:6px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M5 24l8-13 4 6 3-4 7 11z' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}
.brand{display:flex; align-items:center; gap:11px; font-weight:800; font-size:17px; letter-spacing:-.015em}
.brand small{font-weight:600; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); background:rgba(255,255,255,.06); border:1px solid var(--line); padding:2px 7px; border-radius:999px}

/* Auth — responsive */
.auth{min-height:100vh; display:grid; grid-template-columns:1.05fr .95fr; background:var(--bg)}
.auth-hero{
  padding:48px 56px; display:flex; flex-direction:column; justify-content:center; gap:24px; position:relative; overflow:hidden;
  background:
    radial-gradient(900px 600px at 12% 18%, rgba(255,92,30,.22), transparent 60%),
    radial-gradient(800px 500px at 85% 88%, rgba(64,148,255,.13), transparent 60%),
    linear-gradient(165deg, #0c111c 0%, #090d14 100%);
  border-right:1px solid var(--line);
}
.auth-hero::before{
  content:""; position:absolute; inset:auto -120px -120px auto; width:520px; height:520px; opacity:.07;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M20 160 L70 60 L95 105 L110 80 L180 160 Z' fill='none' stroke='white' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.auth-hero h1{font-size:clamp(30px, 4vw, 52px); line-height:.95; letter-spacing:-.03em; max-width:15ch; margin-top:10px}
.auth-hero p{color:var(--muted-2); font-size:16.5px; max-width:48ch; line-height:1.6}
.auth-panel{display:grid; place-items:center; padding:32px; background: radial-gradient(600px 400px at 50% 0%, rgba(255,255,255,.03), transparent 70%)}
.auth-card{width:min(420px, 100%); padding:28px; display:grid; gap:16px; background:rgba(17,24,32,.9); border:1px solid var(--line); box-shadow:var(--shadow)}
.tabs{display:grid; grid-template-columns:1fr 1fr; background:rgba(255,255,255,.06); border:1px solid var(--line); border-radius:999px; padding:4px}
.tabs button{border:0; background:transparent; padding:9px; border-radius:999px; cursor:pointer; color:var(--muted); font-weight:700; font-size:13px; transition:all .18s; min-height:40px}
.tabs button[aria-selected=true]{background:#fff; color:#0a0f18; box-shadow:0 2px 10px rgba(0,0,0,.25)}

/* App layout — desktop */
.app{display:grid; grid-template-columns:var(--sidebar-w) 1fr; min-height:100vh; min-width:0}
.sidebar{
  background: linear-gradient(180deg, rgba(17,24,32,.92), rgba(14,19,28,.98));
  border-right:1px solid var(--line); padding:18px 14px; display:flex; flex-direction:column; gap:20px; position:sticky; top:0; height:100vh; backdrop-filter: blur(14px);
  z-index:30; min-width:0;
}
.sidebar-head{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 4px}
.sidebar-head .close{display:none}
.sidebar .brand{padding:0 4px}
nav{display:grid; gap:6px}
nav button{
  display:flex; align-items:center; gap:12px; padding:11px 12px; border:0; background:transparent;
  border-radius:12px; cursor:pointer; color:var(--muted); font-weight:600; font-size:13px; text-align:left; transition:all .16s;
  width:100%; min-height:44px;
}
nav button:hover{background:rgba(255,255,255,.06); color:var(--text)}
nav button[aria-current=page]{background:linear-gradient(180deg, rgba(255,92,30,.18), rgba(255,92,30,.08)); color:var(--accent-2); border:1px solid rgba(255,92,30,.25); box-shadow:0 4px 14px rgba(255,92,30,.15)}
nav button .ico{opacity:.9; flex:none}
.ico{width:18px; height:18px; background:currentColor; flex:none; -webkit-mask:var(--i) center/contain no-repeat; mask:var(--i) center/contain no-repeat}
.ico-home{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l9 8h-3v9h-6v-6h-4v6H2v-9H-1z' fill='currentColor'/%3E%3C/svg%3E")}
.ico-routes{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 20l7-12 4 6 3-4 6 10z' fill='currentColor'/%3E%3C/svg%3E")}
.ico-upload{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 16V7.8L8.4 10.4 7 9l5-5 5 5-1.4 1.4L13 7.8V16zM5 20v-5h2v3h10v-3h2v5z' fill='currentColor'/%3E%3C/svg%3E")}
.ico-key{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 14a2 2 0 110-4 2 2 0 010 4zm5.6-4a6 6 0 100 4H16v3h3v-3h3v-4z' fill='currentColor'/%3E%3C/svg%3E")}
.ico-user{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-4 0-8 2-8 5v1h16v-1c0-3-4-5-8-5z' fill='currentColor'/%3E%3C/svg%3E")}
.sidebar-foot{margin-top:auto; display:flex; align-items:center; gap:12px; padding:12px 8px 2px; border-top:1px solid var(--line); justify-content:space-between; flex-wrap:wrap}
.who{display:flex; align-items:center; gap:10px; min-width:0; flex:1}
.who strong{display:block; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:14ch}
.who small{color:var(--muted); font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase}
.avatar{
  width:36px; height:36px; border-radius:12px; background:linear-gradient(180deg, #1f2a3d, #16202e);
  border:1px solid var(--line-2); display:grid; place-items:center; font-weight:800; flex:none; text-transform:uppercase; color:var(--accent-2)
}
.mobile-header{
  display:none; align-items:center; gap:12px; padding:10px 14px; min-height:var(--header-h);
  background:rgba(14,19,28,.9); border-bottom:1px solid var(--line); backdrop-filter:blur(14px);
  position:sticky; top:0; z-index:25;
}
.mobile-header .brand{font-size:16px}
.mobile-spacer{flex:1}
.sidebar-overlay{
  position:fixed; inset:0; background:rgba(4,7,11,.56); backdrop-filter:blur(2px); z-index:29;
}

main{padding:30px 32px 64px; max-width:var(--content-max); width:100%; outline:none; min-width:0}
.page-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap}
.page-head h1{font-size:clamp(20px, 5vw, 26px)}
.page-head p{color:var(--muted); margin-top:6px; font-size:14px; max-width:60ch}
.section-title{font-size:11px; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); margin:28px 0 12px; font-weight:700; display:flex; align-items:center; gap:10px}
.section-title::after{content:""; flex:1; height:1px; background:linear-gradient(90deg, var(--line), transparent)}
.live-dot{width:8px; height:8px; border-radius:50%; background:var(--ok); box-shadow:0 0 0 6px rgba(41,192,127,.15); animation:pulse 1.8s infinite; flex:none}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(41,192,127,.35)} 70%{box-shadow:0 0 0 8px rgba(41,192,127,0)} 100%{box-shadow:0 0 0 0 rgba(41,192,127,0)}}

/* Stats — responsive */
.stats, .stats-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:14px}
.stat{padding:18px 18px; position:relative; overflow:hidden; min-width:0}
.stat::before{content:""; position:absolute; inset:0; background:radial-gradient(400px 200px at 100% 0%, rgba(255,92,30,.08), transparent 70%); pointer-events:none}
.stat small{color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase}
.stat strong{display:block; font-size:clamp(20px, 5vw, 26px); letter-spacing:-.02em; margin-top:6px; font-variant-numeric:tabular-nums; font-weight:800}
.stat strong span{font-size:13px; color:var(--muted); font-weight:600; margin-left:6px}
.stat .trend{position:absolute; top:14px; right:14px; font-size:11px; font-weight:700; color:var(--ok); background:rgba(41,192,127,.12); border:1px solid rgba(41,192,127,.2); padding:3px 7px; border-radius:999px}

/* Jobs */
.jobs{display:grid; gap:10px}
.job{
  padding:14px 16px; display:grid; grid-template-columns:1fr auto; gap:8px 16px; align-items:center; position:relative; overflow:hidden;
  transition:border-color .2s, transform .2s; border:1px solid var(--line); min-width:0;
}
.job:hover{border-color:var(--line-3); transform:translateY(-1px)}
.job h3{font-size:14px; overflow-wrap:anywhere; font-weight:700}
.job .state{color:var(--muted); font-size:12.5px; display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.job .pct{font-variant-numeric:tabular-nums; font-weight:800; font-size:12px; color:var(--accent-2); background:rgba(255,92,30,.12); border:1px solid rgba(255,92,30,.22); padding:4px 8px; border-radius:999px; flex:none}
.bar{grid-column:1 / -1; height:8px; border-radius:999px; background:rgba(255,255,255,.07); overflow:hidden; position:relative; border:1px solid rgba(255,255,255,.06)}
.bar i{display:block; height:100%; width:0; background:linear-gradient(90deg, var(--accent), #ff8e4a); border-radius:999px; transition:width .5s ease; position:relative; overflow:hidden}
.bar i::after{content:""; position:absolute; inset:0; background:linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent); animation:shimmer 1.2s infinite}
@keyframes shimmer{0%{transform:translateX(-100%)} 100%{transform:translateX(100%)}}
.job.failed{border-color:rgba(255,90,67,.45); background:linear-gradient(180deg, rgba(255,90,67,.06), rgba(255,255,255,.02))}
.job.failed .state{color:var(--bad)}
.job .job-meta{font-size:11px; color:var(--muted); display:flex; gap:10px; flex-wrap:wrap}

/* Grid videos — fully responsive */
.grid{display:grid; gap:18px; grid-template-columns:repeat(auto-fill, minmax(300px,1fr))}
.route{overflow:hidden; display:flex; flex-direction:column; transition:transform .18s, border-color .18s, box-shadow .18s; min-width:0}
.route:hover{transform:translateY(-3px); border-color:var(--line-3); box-shadow:0 12px 32px rgba(0,0,0,.45)}
.route video{width:100%; aspect-ratio:16/9; background:#000; display:block; object-fit:cover}
.route.vertical video{aspect-ratio:9/16; max-height:520px; object-fit:contain; background:radial-gradient(600px 400px at 50% 0%, #111a28, #000)}
.route-media{position:relative; overflow:hidden}
.route-body{padding:16px 16px 14px; display:grid; gap:11px; flex:1; min-width:0}
.route h3{font-size:15px; font-weight:800; overflow-wrap:anywhere; line-height:1.35}
.route time{color:var(--muted); font-size:12px; font-weight:500}
.metrics{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:11px 8px; border-block:1px solid var(--line); background:rgba(255,255,255,.01); border-radius:10px}
.metrics div{display:grid; gap:2px; text-align:center; min-width:0}
.metrics small{color:var(--muted); font-size:9.5px; text-transform:uppercase; letter-spacing:.07em; font-weight:700}
.metrics b{font-size:13px; font-variant-numeric:tabular-nums; font-weight:800}
.route-actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.route-actions .spacer{flex:1; color:var(--muted); font-size:11px; font-weight:500; min-width:120px}
.empty{padding:48px 24px; text-align:center; display:grid; gap:14px; justify-items:center; border-style:dashed; background:rgba(255,255,255,.02)}
.empty .art{width:64px; height:64px; border-radius:16px; background:rgba(255,92,30,.12); border:1px solid rgba(255,92,30,.2); display:grid; place-items:center; font-size:28px}

/* Form nuevo video */
.form{display:grid; gap:20px; max-width:760px}
.drop{
  border:2px dashed var(--line-2); border-radius:16px; padding:36px 22px; text-align:center; cursor:pointer;
  display:grid; gap:8px; justify-items:center; background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  transition:border-color .16s, background .16s, transform .16s; min-width:0;
}
.drop:hover, .drop.over{border-color:var(--accent); background:rgba(255,92,30,.06); transform:translateY(-1px)}
.drop .ico{width:36px; height:36px; color:var(--accent-2)}
.drop strong{font-size:clamp(14px, 3.5vw, 15px); font-weight:800; overflow-wrap:anywhere}
.drop.has-file{border-style:solid; border-color:var(--ok); background:rgba(41,192,127,.06)}
fieldset{border:0; padding:0; margin:0; display:grid; gap:10px; min-width:0}
legend{font-size:11px; color:var(--muted); font-weight:700; letter-spacing:.07em; text-transform:uppercase; padding:0; margin-bottom:2px}
.options{display:grid; gap:10px; grid-template-columns:repeat(auto-fit, minmax(170px,1fr))}
.option{position:relative; min-width:0}
.option input{position:absolute; opacity:0; inset:0; cursor:pointer}
.option span{
  display:grid; gap:2px; padding:13px 14px; border:1px solid var(--line-2); border-radius:14px;
  background:rgba(255,255,255,.03); transition:all .16s; min-height:64px; align-content:center;
}
.option:hover span{border-color:var(--line-3); background:rgba(255,255,255,.05)}
.option small{color:var(--muted); font-size:12px; font-weight:500; overflow-wrap:anywhere}
.option b{font-weight:700; color:var(--text); font-size:13.5px}
.option input:checked + span{border-color:var(--accent); background:linear-gradient(180deg, rgba(255,92,30,.16), rgba(255,92,30,.07)); box-shadow:0 4px 16px rgba(255,92,30,.16)}
.range-row{display:flex; align-items:center; gap:14px; background:rgba(255,255,255,.03); border:1px solid var(--line); padding:10px 12px; border-radius:999px; flex-wrap:wrap}
input[type=range]{flex:1; accent-color:var(--accent); height:6px; min-width:120px}
.range-row output{min-width:5ch; font-weight:800; font-variant-numeric:tabular-nums; color:var(--accent-2); background:rgba(255,92,30,.12); border:1px solid rgba(255,92,30,.2); padding:4px 8px; border-radius:999px; font-size:12px; text-align:center}

/* Panels, tables */
.panel{padding:20px 22px; display:grid; gap:14px; max-width:860px; margin-bottom:16px; min-width:0}
.panel h2{font-size:15px; display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.panel h2::before{content:""; width:3px; height:16px; border-radius:999px; background:var(--accent); flex:none}
.inline-form{display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap}
.inline-form label{flex:1; min-width:220px}
.reveal{border:1px solid rgba(41,192,127,.35); background:linear-gradient(180deg, rgba(41,192,127,.14), rgba(41,192,127,.06)); border-radius:14px; padding:14px 16px; display:grid; gap:10px}
.reveal .row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.reveal code{flex:1; overflow-wrap:anywhere; background:rgba(0,0,0,.35); padding:9px 12px; border-radius:10px; border:1px solid var(--line); font-weight:600; min-width:0}
table{width:100%; border-collapse:separate; border-spacing:0; font-size:13px; overflow:hidden; border-radius:12px; border:1px solid var(--line)}
th{text-align:left; color:var(--muted); font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.06em; padding:10px 12px; background:rgba(255,255,255,.04); border-bottom:1px solid var(--line)}
td{padding:12px 12px; border-bottom:1px solid rgba(255,255,255,.05); vertical-align:middle}
tr:last-child td{border-bottom:0}
tr:hover td{background:rgba(255,255,255,.02)}
td:last-child{text-align:right}
pre{margin:0; background:rgba(0,0,0,.35); border:1px solid var(--line); border-radius:12px; padding:14px 16px; overflow-x:auto; max-width:100%}
.badge{display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border-radius:999px; font-size:11px; font-weight:700; letter-spacing:.03em; background:rgba(255,92,30,.14); color:var(--accent-2); border:1px solid rgba(255,92,30,.25); max-width:100%; overflow-wrap:anywhere}
.badge.plain{background:rgba(255,255,255,.06); color:var(--muted); border-color:var(--line-2)}
.badge.success{background:rgba(41,192,127,.14); color:var(--ok); border-color:rgba(41,192,127,.25)}
.badge.danger{background:rgba(255,90,67,.12); color:var(--bad); border-color:rgba(255,90,67,.25)}
.stack{display:grid; gap:14px; max-width:420px}

/* Mapa — responsive */
.map{position:relative; height:440px; border-radius:16px; overflow:hidden; border:1px solid var(--line-2); background:#080c12; touch-action:none; user-select:none; box-shadow:var(--shadow); min-width:0}
.map-tiles{position:absolute; inset:0}
.map-tiles img{position:absolute; left:0; top:0; width:256px; height:256px; pointer-events:none}
.map-canvas{position:absolute; inset:0; width:100%; height:100%; cursor:crosshair}
.map-controls{position:absolute; top:12px; right:12px; display:grid; gap:6px}
.map-controls button{width:36px; height:36px; border-radius:10px; border:1px solid var(--line-2); background:rgba(17,24,32,.88); backdrop-filter:blur(10px); cursor:pointer; font-size:16px; transition:all .15s}
.map-controls button:hover{background:var(--panel-2); transform:translateY(-1px)}
.map-credit{position:absolute; right:8px; bottom:6px; font-size:10px; color:rgba(255,255,255,.85); text-shadow:0 1px 4px #000; pointer-events:none; background:rgba(0,0,0,.35); padding:2px 6px; border-radius:999px; border:1px solid rgba(255,255,255,.12); max-width:70%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.moment-form{padding:16px 18px; display:grid; gap:12px; border-color:var(--accent)}
.moment-list{display:grid; gap:8px}
.moment{display:grid; grid-template-columns:auto 56px 1fr auto; gap:12px; align-items:center; padding:10px 12px; background:rgba(255,255,255,.04); border:1px solid var(--line); border-radius:12px; min-width:0}
.moment img, .moment-clip{width:56px; height:42px; object-fit:cover; border-radius:8px; background:var(--panel-2); display:grid; place-items:center; font-size:11px; color:var(--muted); font-weight:700}
.moment-n{width:26px; height:26px; border-radius:50%; background:#fff; color:#0d1117; border:2px solid var(--accent); display:grid; place-items:center; font-size:11px; font-weight:800; flex:none}
.moment > div{min-width:0; overflow-wrap:anywhere}
.panel.wide{max-width:1100px}
.table-wrap{overflow-x:auto; border-radius:12px; -webkit-overflow-scrolling:touch}
.row-actions{display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap}
label.check{display:flex; align-items:center; gap:8px; flex:none; min-width:0; padding-bottom:10px; color:var(--text); text-transform:none; letter-spacing:0; font-size:14px}
label.check input{width:16px; height:16px; accent-color:var(--accent)}
.ico-users{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a4 4 0 100-8 4 4 0 000 8zm8 0a3 3 0 100-6 3 3 0 000 6zM9 13c-3.3 0-7 1.7-7 4.5V20h14v-2.5C16 14.700 12.300 13 9 13zm8 .5c-.6 0-1.200.1-1.800.2A5 5 0 0118 17.500V20h4v-2.300c0-2.500-2.800-4.200-5-4.200z' fill='currentColor'/%3E%3C/svg%3E")}
.ico-polar{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 00-7 7c0 5 7 11 7 11s7-6 7-11a7 7 0 00-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z' fill='currentColor'/%3E%3C/svg%3E")}
.dialog-input{margin-top:14px; padding:10px 12px; border-radius:12px; border:1px solid var(--line-2); background:var(--bg); width:100%; font-size:16px}
.dialog{border:1px solid var(--line-2); border-radius:16px; background:rgba(17,24,32,.98); color:var(--text); padding:24px; width:min(440px, 92vw); box-shadow:var(--shadow)}
.dialog::backdrop{background:rgba(4,7,11,.72); backdrop-filter:blur(6px)}
.dialog-actions{display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-top:18px}
.toasts{position:fixed; right:18px; bottom:18px; display:grid; gap:10px; z-index:60; max-width:min(380px, calc(100vw - 24px))}
.toast{
  background:rgba(17,24,32,.96); border:1px solid var(--line-2); border-left:3px solid var(--ok);
  padding:12px 14px; border-radius:12px; box-shadow:var(--shadow); font-size:13px; font-weight:600;
  animation:slideIn .25s ease; overflow-wrap:anywhere;
}
.toast.bad{border-left-color:var(--bad)}
@keyframes slideIn{from{transform:translateX(8px); opacity:0} to{transform:translateX(0); opacity:1}}

/* Skeletons */
.skeleton{background:linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.06) 75%); background-size:200% 100%; animation:skeleton 1.2s infinite; border-radius:10px; min-height:16px}
@keyframes skeleton{0%{background-position:200% 0} 100%{background-position:-200% 0}}
.fade-in{animation:fadeIn .3s ease}
@keyframes fadeIn{from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:translateY(0)}}

/* ── Responsive ──  640 / 768 / 1024 / 1280 */
@media (max-width: 1280px){
  .grid{grid-template-columns:repeat(auto-fill, minmax(280px,1fr))}
}
@media (max-width: 1024px){
  .mobile-header{display:flex}
  .sidebar{
    position:fixed; inset:0 auto 0 0; width:min(86vw, 320px); height:100dvh; height:100vh;
    transform:translateX(-100%); transition:transform .24s cubic-bezier(.32,.72,0,1);
    box-shadow:0 0 0 rgba(0,0,0,0); overflow:auto; overscroll-behavior:contain;
  }
  .sidebar.open{transform:translateX(0); box-shadow:0 12px 40px rgba(0,0,0,.55)}
  .sidebar-head .close{display:inline-grid}
  .app{grid-template-columns:1fr}
  main{padding:20px 18px 48px}
  .auth{grid-template-columns:1fr}
  .auth-hero{padding:28px 22px; border-right:0; border-bottom:1px solid var(--line)}
  .map{height:380px}
}
@media (max-width: 768px){
  body{font-size:14px}
  main{padding:16px 14px 64px}
  .page-head{flex-direction:column; align-items:stretch}
  .page-head .btn{width:100%}
  .stats, .stats-grid{grid-template-columns:repeat(2,1fr); gap:10px}
  .stat{padding:14px 14px}
  .grid{grid-template-columns:1fr; gap:14px}
  .metrics{gap:6px; padding:10px 6px}
  .metrics small{font-size:9px}
  .route-actions .spacer{display:none}
  .panel{padding:16px 14px; border-radius:14px}
  .options{grid-template-columns:1fr}
  .drop{padding:28px 16px}
  .map{height:320px; border-radius:14px}
  .moment{grid-template-columns:36px 48px 1fr; gap:8px}
  .moment .btn{grid-column:1 / -1; justify-self:start}
  .inline-form{flex-direction:column; align-items:stretch}
  .inline-form label{min-width:0}
  table{font-size:12.5px}
  th, td{padding:9px 8px}
  .dialog{padding:18px 16px; width:min(96vw, 440px)}
  .toasts{right:12px; bottom:12px; left:12px; max-width:none}
}
@media (max-width: 480px){
  .stats, .stats-grid{grid-template-columns:1fr; gap:10px}
  .auth-panel{padding:20px 14px}
  .auth-card{padding:20px 16px}
  .page-head h1{font-size:22px}
  .map{height:280px}
  .range-row{border-radius:14px}
  .moment-list{gap:6px}
}
@media (max-width: 360px){
  main{padding:12px 10px 48px}
  .grid{gap:12px}
  .btn{padding:9px 12px}
}
/* Táctil: botones más grandes */
@media (pointer: coarse){
  nav button{padding:13px 14px}
  .btn{min-height:44px}
  .btn.small{min-height:38px}
}
/* Safe area iOS */
@supports (padding: max(0px)){
  .mobile-header{padding-left:max(14px, env(safe-area-inset-left)); padding-right:max(14px, env(safe-area-inset-right))}
  main{padding-left:max(14px, env(safe-area-inset-left)); padding-right:max(14px, env(safe-area-inset-right))}
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce){*{animation:none!important; transition:none!important}}
