/* ============================================
   IoT Control Center — Prototipo Frontend
   Tema oscuro telemetría (basado en iot-theme.css)
   ============================================ */

:root {
    --bg: #08131a;
    --bg-2: #0c1c26;
    --panel: #102531;
    --panel-2: #0b1c24;
    --line: rgba(125, 211, 252, 0.14);
    --text: #e8f4f8;
    --muted: #9dbcc9;
    --teal: #2ee6c5;
    --teal-dim: rgba(46, 230, 197, 0.16);
    --cyan: #5ec8ff;
    --amber: #f5b942;
    --ok: #3ddc97;
    --rose: #ff6b7a;
    --violet: #a78bfa;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(46, 230, 197, 0.12), transparent 50%),
        radial-gradient(900px 500px at 100% 0%, rgba(94, 200, 255, 0.1), transparent 45%),
        var(--bg);
    color: var(--text);
}

a { color: var(--cyan); text-decoration: none; }
h1, h2, h3, h4, h5 { color: var(--text); margin: 0; }
h1, h2 { font-weight: 700; }
p { color: var(--muted); }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- Layout ---------- */

.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.app-sidebar {
    background: linear-gradient(180deg, #0b1a22, #08141b);
    border-right: 1px solid var(--line);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    color: var(--text);
}

.app-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal), var(--cyan));
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #062018;
    box-shadow: 0 0 24px rgba(46, 230, 197, 0.35);
    flex-shrink: 0;
}

.app-brand h1 { font-size: 15px; }
.app-brand p { margin: 2px 0 0; font-size: 11px; }

.nav-section {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px 6px;
}

.app-nav { display: flex; flex-direction: column; gap: 4px; }

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
}

.app-nav .nav-link .ico { width: 18px; text-align: center; }

.app-nav .nav-link.active,
.app-nav .nav-link:hover {
    background: var(--teal-dim);
    color: var(--teal);
    border-color: rgba(46, 230, 197, 0.25);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
}

.app-main { padding: 28px 32px 48px; min-width: 0; }
.app-main-inner { max-width: 1240px; margin: 0 auto; }

/* ---------- Tipografía de página ---------- */

.page-eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin: 0 0 6px;
}

.page-title { font-size: 28px; font-weight: 700; }
.page-sub { margin: 6px 0 0; color: var(--muted); }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

/* ---------- Cards ---------- */

.card {
    background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    padding: 20px;
    transition: border-color .2s ease;
}

.card:hover { border-color: rgba(46, 230, 197, 0.3); }

.card-pad-sm { padding: 14px 16px; }
.card-title { font-size: 16px; font-weight: 600; }

.kicker {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--cyan);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- KPIs ---------- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-card .kpi-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--teal);
    line-height: 1.1;
}

.kpi-card .kpi-value.amber { color: var(--amber); }
.kpi-card .kpi-value.rose { color: var(--rose); }
.kpi-card .kpi-value.cyan { color: var(--cyan); }

.kpi-card .kpi-foot { color: var(--muted); font-size: 13px; }
.kpi-card .kpi-trend { font-size: 12px; }
.kpi-trend.up { color: var(--ok); }
.kpi-trend.down { color: var(--rose); }

/* ---------- Grids ---------- */

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }

/* ---------- Pills / badges ---------- */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 10px var(--ok);
    flex-shrink: 0;
}

.status-dot.amber { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.status-dot.rose { background: var(--rose); box-shadow: 0 0 10px var(--rose); }
.status-dot.muted { background: var(--muted); box-shadow: none; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge.ok { background: rgba(61, 220, 151, 0.14); color: var(--ok); }
.badge.warn { background: rgba(245, 185, 66, 0.14); color: var(--amber); }
.badge.crit { background: rgba(255, 107, 122, 0.16); color: var(--rose); }
.badge.info { background: var(--teal-dim); color: var(--teal); }
.badge.muted { background: rgba(138, 168, 181, 0.14); color: var(--muted); }
.badge.violet { background: rgba(167, 139, 250, 0.16); color: var(--violet); }

.pay-banner {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 18px; margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 185, 66, 0.4);
    background: rgba(245, 185, 66, 0.08);
}
.pay-banner.crit {
    border-color: rgba(255, 107, 122, 0.45);
    background: rgba(255, 107, 122, 0.08);
}
.pay-banner .pb-text { flex: 1; min-width: 220px; }
.pay-banner .pb-text b { color: var(--amber); }
.pay-banner.crit .pb-text b { color: var(--rose); }
.pay-banner .pb-x {
    background: none; border: none; color: var(--muted);
    cursor: pointer; font-size: 15px; padding: 4px 8px;
}
.pay-banner .pb-x:hover { color: var(--text); }

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    transition: filter .15s ease, border-color .15s ease;
}

.btn:hover { filter: brightness(1.12); }

.btn-primary { background: var(--teal); color: #062018; }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-warn { background: rgba(245, 185, 66, 0.16); color: var(--amber); }
.btn-danger { background: rgba(255, 107, 122, 0.18); color: var(--rose); }
.btn-cyan { background: rgba(94, 200, 255, 0.16); color: var(--cyan); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */

label.f-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.input, .select {
    width: 100%;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.input:focus, .select:focus {
    box-shadow: 0 0 0 3px var(--teal-dim);
    border-color: var(--teal);
}

.f-group { margin-bottom: 14px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Tablas ---------- */

.table-wrap { overflow-x: auto; }

table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.tbl thead th {
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan);
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 28, 36, 0.6);
    font-family: "JetBrains Mono", ui-monospace, monospace;
}

table.tbl tbody td {
    padding: 12px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.07);
    color: var(--text);
    vertical-align: middle;
}

table.tbl tbody tr:hover { background: rgba(46, 230, 197, 0.05); }
table.tbl tbody tr:last-child td { border-bottom: none; }

/* ---------- Alertas ---------- */

.alert-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 10px;
}

.alert-item .a-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}

.alert-item.warn .a-ico { background: rgba(245, 185, 66, 0.15); }
.alert-item.crit .a-ico { background: rgba(255, 107, 122, 0.15); }
.alert-item.info .a-ico { background: var(--teal-dim); }

.alert-item .a-body { flex: 1; min-width: 0; }
.alert-item .a-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.alert-item .a-meta { font-size: 12px; color: var(--muted); }
.alert-item.warn { border-color: rgba(245, 185, 66, 0.3); }
.alert-item.crit { border-color: rgba(255, 107, 122, 0.35); }

/* ---------- Sensores ---------- */

.sensor-card { display: flex; flex-direction: column; gap: 10px; }

.sensor-card .s-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.sensor-card h3 { font-size: 18px; }
.sensor-card .s-loc { font-size: 13px; color: var(--muted); }

.sensor-card .s-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.s-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
}

.s-stat .v { font-size: 16px; font-weight: 700; }
.s-stat .l { font-size: 11px; color: var(--muted); }

.sensor-card .s-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ok);
    background: rgba(61, 220, 151, 0.1);
    border-radius: 999px;
    padding: 5px 10px;
}

.live-pill.off { color: var(--muted); background: rgba(138, 168, 181, 0.1); }
.live-pill.warn { color: var(--amber); background: rgba(245, 185, 66, 0.1); }

/* ---------- Auth ---------- */

.auth-wrap { max-width: 440px; margin: 40px auto; padding: 32px; }

/* ---------- Hero / landing ---------- */

.hero { text-align: center; padding: 56px 16px 32px; }

.hero h1 {
    font-size: 44px;
    background: linear-gradient(90deg, var(--teal), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p { font-size: 17px; max-width: 620px; margin: 14px auto 0; }
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-actions .btn { min-width: 180px; padding: 12px 20px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 40px;
    text-align: left;
}

.feature-card { padding: 20px; }
.feature-card .f-ico {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--teal-dim);
    display: grid; place-items: center;
    font-size: 20px; margin-bottom: 12px;
}
.feature-card h4 { font-size: 15px; margin-bottom: 6px; }
.feature-card p { font-size: 13px; margin: 0; }

/* ---------- Perfil ---------- */

.perfil-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.profile-card { padding: 28px 24px; text-align: center; }

.avatar-ring {
    width: 96px; height: 96px; border-radius: 50%;
    margin: 0 auto 14px;
    background: conic-gradient(from 180deg, var(--teal), var(--cyan), #1b4, var(--teal));
    padding: 3px;
}

.avatar-initials {
    width: 100%; height: 100%; border-radius: 50%;
    background: #12303a;
    display: grid; place-items: center;
    font-size: 28px; font-weight: 700;
}

.profile-name { font-size: 22px; font-weight: 700; margin: 0; }
.profile-role { color: var(--teal); font-size: 13px; margin: 4px 0 16px; }

.meta-row {
    display: flex; gap: 10px; align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--muted);
    text-align: left;
    margin-bottom: 8px;
}

/* ---------- Admin ---------- */

.admin-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.admin-btn {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-btn small { color: var(--muted); font-weight: 400; font-size: 12px; }
.admin-btn:hover { border-color: var(--teal); color: var(--teal); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }

.tab-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn.active { background: var(--teal-dim); color: var(--teal); border-color: rgba(46,230,197,0.3); }

/* ---------- Varios ---------- */

.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100%; display: block; }

.progress {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}

.progress > div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal), var(--cyan));
}

.gauge-wrap { display: flex; align-items: center; gap: 18px; }
.gauge-wrap canvas { flex-shrink: 0; }

.empty-note {
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--panel);
    border: 1px solid rgba(46,230,197,0.35);
    color: var(--text);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 14px;
    box-shadow: var(--shadow);
    z-index: 50;
    animation: toastIn .25s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.severity-bar { display: flex; gap: 4px; }
.severity-bar span { flex: 1; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.08); }
.severity-bar span.on-ok { background: var(--ok); }
.severity-bar span.on-warn { background: var(--amber); }
.severity-bar span.on-crit { background: var(--rose); }

.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; } .mb-3 { margin-bottom: 20px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap { gap: 10px; } .wrap { flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.teal { color: var(--teal); } .amber { color: var(--amber); } .rose { color: var(--rose); } .cyan { color: var(--cyan); }

/* ---------- Topbar / centro de notificaciones ---------- */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 4px 10px;
    margin: -8px -4px 10px;
    background: linear-gradient(var(--bg) 75%, transparent);
}

.notif-wrap { position: relative; }

.notif-btn {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color .15s, border-color .15s;
}

.notif-btn:hover { color: var(--teal); border-color: rgba(46,230,197,0.35); }

.notif-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
    box-shadow: 0 0 10px rgba(255,107,122,.5);
}

.notif-panel {
    position: absolute;
    right: 0; top: 48px;
    width: 330px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.notif-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 8px 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}

.notif-item {
    display: block;
    padding: 10px 10px;
    border-radius: 10px;
    border-left: 3px solid var(--muted);
    margin-bottom: 6px;
    background: rgba(255,255,255,.02);
    color: var(--text);
}

.notif-item:hover { background: rgba(46,230,197,.06); }
.notif-item.crit { border-left-color: var(--rose); }
.notif-item.warn { border-left-color: var(--amber); }
.notif-item.info { border-left-color: var(--teal); }
.notif-item.unread { background: rgba(46,230,197,.07); }
.notif-item .n-msg { font-size: 13px; line-height: 1.35; }
.notif-item .n-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-item .n-nuevo {
    display: inline-block; margin-left: 6px; padding: 1px 7px;
    border-radius: 999px; font-size: 10px; font-weight: 600;
    background: var(--teal-dim); color: var(--teal);
}

/* ---------- Mockup de producto (landing) ---------- */

.mock-wrap { max-width: 720px; margin: 40px auto 0; text-align: left; }
.mock-dash { transform: perspective(1200px) rotateX(4deg); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.mock-kpi { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mock-kpi .v { font-size: 19px; font-weight: 700; color: var(--teal); }
.mock-kpi .v.cyan { color: var(--cyan); }
.mock-kpi .v.rose { color: var(--rose); }
.mock-kpi .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.mock-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.mock-list { display: flex; flex-direction: column; gap: 8px; }
.mock-item { display: flex; justify-content: space-between; align-items: center; font-size: 12px;
    background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.mock-tag { position: absolute; top: -12px; left: 18px; }
.mock-wrap { position: relative; }

/* ---------- Pricing ---------- */

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.price-card { display: flex; flex-direction: column; padding: 24px 20px; position: relative; }
.price-card.featured { border-color: rgba(46,230,197,.5); box-shadow: 0 0 0 1px rgba(46,230,197,.25), var(--shadow); }
.price-name { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); }
.price-num { font-size: 30px; font-weight: 700; margin: 8px 0 2px; }
.price-num small { font-size: 14px; color: var(--muted); font-weight: 400; }
.price-list { list-style: none; padding: 0; margin: 16px 0 20px; flex: 1; }
.price-list li { font-size: 13px; color: var(--muted); padding: 5px 0 5px 22px; position: relative; }
.price-list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.price-list li.no { opacity: .45; }
.price-list li.no::before { content: "—"; color: var(--muted); }
.price-ribbon {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(90deg, var(--teal), var(--cyan));
    color: #062018; font-size: 11px; font-weight: 700;
    padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Contador de métricas (landing) ---------- */

.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin: 34px auto 0; max-width: 760px; }
.stat-big { text-align: center; padding: 16px 10px; }
.stat-big .v { font-size: 30px; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.stat-big .l { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Contacto (landing) ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; text-align: left; }
.contact-grid textarea.input { min-height: 104px; resize: vertical; font-family: inherit; }

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .app-nav { flex-direction: row; flex-wrap: wrap; }
    .nav-section { width: 100%; padding-bottom: 0; }
    .grid-2, .grid-2-even, .grid-3, .perfil-grid,
    .price-grid, .contact-grid, .mock-row { grid-template-columns: 1fr; }
    .app-main { padding: 20px; }
}

/* ============================================================
   SPRINT 3 · USABILIDAD
   ============================================================ */

/* ---- Skeletons de carga ---- */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton {
    position: relative; overflow: hidden;
    background: var(--bg-2); border-radius: 10px;
}
.skeleton::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
    animation: shimmer 1.4s infinite;
}
.sk-line { height: 14px; margin-bottom: 10px; }
.sk-head { height: 30px; width: 260px; border-radius: 8px; }
.sk-kpi { height: 96px; }
.sk-card { height: 220px; }
.sk-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-top: 18px; }

/* ---- Breadcrumbs ---- */
.crumbs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; font-size: .78rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.crumbs .sep { color: var(--muted); opacity: .5; }
.crumbs .here { color: var(--text); font-weight: 600; }

/* ---- Chips de filtro de rango ---- */
.range-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.range-chips .tab-btn { padding: 5px 12px; font-size: .75rem; }
.range-chips input[type="date"] {
    background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
    border-radius: 8px; padding: 5px 8px; font-size: .75rem; font-family: inherit;
}
.range-chips input[type="date"]:focus { outline: 1px solid var(--teal); }

/* ---- Tema claro ---- */
[data-theme="light"] {
    --bg: #eef3f6;
    --bg-2: #e2ebf0;
    --panel: #ffffff;
    --panel-2: #f4f8fa;
    --line: rgba(13, 60, 80, .13);
    --text: #10303d;
    --muted: #52707e;
    --teal: #0bb39a;
    --teal-dim: rgba(11, 179, 154, .13);
    --cyan: #0e9dbf;
    --amber: #b57f12;
    --ok: #1a9e6b;
    --rose: #c2374f;
    --violet: #6d52cf;
    --shadow: 0 16px 40px rgba(20, 60, 80, .10);
}
[data-theme="light"] body {
    background:
        radial-gradient(1000px 520px at 75% -10%, rgba(11,179,154,.10), transparent 60%),
        radial-gradient(800px 420px at 8% 10%, rgba(14,157,191,.08), transparent 55%),
        var(--bg);
}
[data-theme="light"] .app-sidebar { background: var(--panel); }
[data-theme="light"] .auth-shell { background: var(--bg); }
[data-theme="light"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(20,60,80,.07), transparent); }
[data-theme="light"] .status-pill,
[data-theme="light"] .badge { text-shadow: none; }

/* ---- Navegación inferior móvil ---- */
.mobile-nav { display: none; }

@media (max-width: 1020px) {
    .app-nav, .sidebar-footer .api-status, .sidebar-footer .session-info { display: none; }
    .sidebar-foot-nav { display: flex !important; gap: 4px; }
    .sidebar-foot-nav .btn { flex: 1; font-size: .72rem; padding: 6px 2px; }

    .mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 800;
        background: var(--panel); border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 24px rgba(0,0,0,.18);
    }
    .mobile-nav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 7px 2px; border-radius: 10px;
        color: var(--muted); text-decoration: none; font-size: .62rem; font-weight: 600;
    }
    .mobile-nav a svg { width: 19px; height: 19px; }
    .mobile-nav a.on { color: var(--teal); background: rgba(46,230,197,.08); }
    .app-content { padding-bottom: 92px; }
}

/* Cinta fija cuando la app corre con datos de muestra (?demo=1) */
.demo-ribbon {
    position: fixed; bottom: 14px; right: 14px; z-index: 1000;
    background: var(--amber); color: #14100a;
    font: 700 11px/1 "JetBrains Mono", monospace; letter-spacing: .08em;
    padding: 8px 14px; border-radius: 999px; text-decoration: none;
    box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
.demo-ribbon:hover { filter: brightness(1.1); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Marca: logo SVG en sidebar */
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }

/* Caso real / confianza */
.case-card { padding: 26px 28px; border-left: 3px solid var(--teal); }
.case-badge {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--teal); font: 700 12px/1 "JetBrains Mono", monospace;
    letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px;
}
.case-text { color: var(--text); font-size: 15px; line-height: 1.65; margin: 0 0 16px; }
.case-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.case-stat {
    background: rgba(46,230,197,.05); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px;
}
.case-stat b { display: block; font-size: 17px; color: var(--teal); font-family: "JetBrains Mono", monospace; }
.case-stat span { font-size: 11.5px; color: var(--muted); }

/* FAQ acordeón nativo */
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.faq-item {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; padding: 0; overflow: hidden;
}
.faq-item summary {
    cursor: pointer; list-style: none; padding: 16px 20px;
    font-weight: 600; font-size: 14.5px; color: var(--text);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+"; font-family: "JetBrains Mono", monospace; font-size: 18px;
    color: var(--teal); transition: transform .18s ease; flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 16px; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

/* Footer de la landing */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 34px 4px 20px; }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 26px;
    margin-bottom: 24px;
}
.footer-brand { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.footer-title {
    font: 700 11px/1 "JetBrains Mono", monospace; letter-spacing: .08em;
    text-transform: uppercase; color: var(--teal); margin-bottom: 10px;
}
.footer-link {
    display: block; color: var(--muted); font-size: 13px;
    text-decoration: none; padding: 3px 0;
}
.footer-link:hover { color: var(--teal); }
.footer-bottom {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding-top: 16px; border-top: 1px solid var(--line);
    font-size: 12px; color: var(--muted);
}
@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Misión y visión */
.mision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mision-card { padding: 24px 26px; }
.mision-card .case-badge { color: var(--cyan); }
@media (max-width: 720px) { .mision-grid { grid-template-columns: 1fr; } }

/* Lista de misión (bullets) */
.mision-list { margin: 0; padding: 0; list-style: none; }
.mision-list li {
    position: relative; padding: 5px 0 5px 22px;
    color: var(--text); font-size: 14px; line-height: 1.55;
}
.mision-list li::before {
    content: "▸"; position: absolute; left: 2px;
    color: var(--teal); font-weight: 700;
}

/* Valores corporativos */
.valores-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.valor-card { padding: 20px; }
.valor-card h5 { margin: 10px 0 8px; font-size: 14.5px; }
.valor-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ============================================================
   MODO PÚBLICO — landing full-width sin sidebar
   ============================================================ */
.app-shell.publico { display: block; }
.app-shell.publico .app-sidebar,
.app-shell.publico .mobile-nav,
.app-shell.publico .app-topbar { display: none; }
.app-shell.publico .app-main { padding: 0; }
.app-shell.publico .app-main-inner {
    max-width: 1180px; margin: 0 auto; padding: 92px 24px 40px;
}

/* Navbar pública fija */
.pub-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 10px 28px;
    background: color-mix(in srgb, var(--bg-2) 84%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.pub-nav[hidden] { display: none; }
.pub-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.pub-brand b { color: var(--teal); }
.pub-brand .brand-mark { width: 30px; height: 30px; }
.pub-links { display: flex; gap: 22px; }
.pub-links a {
    color: var(--muted); text-decoration: none;
    font-size: 13.5px; font-weight: 600; padding: 4px 2px;
}
.pub-links a:hover { color: var(--teal); }
.pub-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 860px) { .pub-links { display: none; } }

/* Los anchors no quedan tapados por la navbar fija */
[id] { scroll-margin-top: 80px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Skip-link: invisible hasta que recibe foco por teclado */
.skip-link {
    position: fixed; top: -60px; left: 16px; z-index: 1200;
    background: var(--teal); color: #082018; font-weight: 700; font-size: 13px;
    padding: 10px 18px; border-radius: 0 0 12px 12px; text-decoration: none;
    transition: top .18s ease;
}
.skip-link:focus { top: 0; }

/* Indicador de foco para navegación por teclado */
a:focus-visible, button:focus-visible, summary:focus-visible,
.input:focus-visible, .select:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px;
}

/* Screenshot real con frame de navegador */
.shot-wrap { margin-top: 34px; position: relative; }
.shot-wrap .mock-tag { position: absolute; top: -12px; left: 20px; z-index: 2; }
.shot-frame {
    border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
    background: var(--bg-2); box-shadow: var(--shadow);
}
.shot-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px; border-bottom: 1px solid var(--line);
    background: var(--panel-2);
}
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; }
.shot-bar i:nth-child(1) { background: var(--rose); }
.shot-bar i:nth-child(2) { background: var(--amber); }
.shot-bar i:nth-child(3) { background: var(--ok); }
.shot-url {
    margin-left: 12px; font: 12px "JetBrains Mono", monospace;
    color: var(--muted);
}
.shot-frame img { display: block; width: 100%; height: auto; }
