:root {
    --brand: #1E5AA8;
    --brand-2: #2F80C9;
    --brand-dark: #0B2D5C;
    --gold: #C49A3A;
    --bg: #eef2f8;
    --surface: #ffffff;
    --surface-soft: #fbfcfe;
    --text: #16233a;
    --muted: #6b7788;
    --border: #e2e8f0;
    --ok: #15803d;
    --warn: #b45309;
    --danger: #b91c1c;
    --grad: linear-gradient(135deg, #0B2D5C 0%, #1E5AA8 55%, #2F80C9 100%);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px -6px rgba(16, 24, 40, .08);
    --shadow-md: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 36px -16px rgba(16, 24, 40, .22);
    --radius: 12px;
    --ring: 0 0 0 4px rgba(47, 128, 201, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 500px at 100% -10%, rgba(47, 128, 201, .08), transparent 60%),
        radial-gradient(900px 420px at -10% 12%, rgba(196, 154, 58, .06), transparent 55%),
        var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; }
code { background: #eef2f8; padding: 1px 6px; border-radius: 6px; font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.table-empty { text-align: center !important; color: var(--muted); padding: 32px !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.link { font-weight: 600; font-size: 13px; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* ---------------------------------------------------------------- Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 256px;
    background: var(--grad);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    box-shadow: 10px 0 40px -24px rgba(11, 45, 92, .8);
}
.sidebar::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(420px 200px at 8% 0%, rgba(255,255,255,.10), transparent 65%),
        radial-gradient(320px 260px at 100% 100%, rgba(196,154,58,.14), transparent 70%);
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    position: relative; z-index: 1;
}
.sidebar .brand img { height: 38px; width: 38px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.brand-name { display: block; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-sub { display: block; color: rgba(255,255,255,.6); font-size: 11px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; position: relative; z-index: 1; }
.nav-group-title {
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(255,255,255,.45); margin: 16px 22px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    margin: 2px 12px; padding: 10px 12px;
    border-radius: 10px; color: rgba(255,255,255,.78);
    font-size: 14px; font-weight: 500;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav-item.active {
    background: rgba(255,255,255,.16); color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
    position: relative;
}
.nav-item.active::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 58%; border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav-item .ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; opacity: .95; flex-shrink: 0; }
.nav-item .ico svg { width: 20px; height: 20px; display: block; }
.nav-item > svg { width: 20px; height: 20px; display: block; flex-shrink: 0; opacity: .95; }
.sidebar-footer { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.10); position: relative; z-index: 1; }
.sf-name { color: #fff; font-weight: 700; font-size: 13.5px; }
.sf-role { color: rgba(255,255,255,.6); font-size: 12px; margin: 1px 0 10px; }

.main { flex: 1; min-width: 0; margin-left: 256px; display: flex; flex-direction: column; }
.topbar {
    height: 64px; background: rgba(255,255,255,.85);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px; position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.menu-btn {
    display: none; border: 0; background: transparent; font-size: 20px; cursor: pointer;
    width: 38px; height: 38px; border-radius: 10px; color: var(--brand-dark);
}
.menu-btn:hover { background: #eef2f8; }
.project-switch select {
    padding: 7px 30px 7px 12px; border-radius: 999px; border: 1px solid var(--border);
    background: #fff; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.badge-pill {
    display: inline-block; padding: 4px 11px; border-radius: 999px;
    background: #e0e7ff; color: var(--brand-dark); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-pill.soft { background: #ecfdf5; color: #166534; }
.content { padding: 22px; flex: 1; }

/* ---------------------------------------------------------------- Cards */
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.kpi { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); opacity: .9; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi .value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .value.ok { color: var(--ok); }
.kpi .value.warn { color: var(--warn); }
.kpi .value.danger { color: var(--danger); }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 4px; }

.hero {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--grad); color: #fff; border-radius: 16px;
    padding: 20px 24px; margin-bottom: 16px;
    box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); right: -60px; top: -120px; }
.hero h1 { font-size: 22px; margin: 0; }
.hero p { margin: 4px 0 0; font-size: 13px; opacity: .85; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }

.section-title { font-size: 15px; font-weight: 800; margin: 0 0 12px; color: var(--text); }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
    background: var(--brand); color: #fff; font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(16,24,40,.5); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.ghost { background: #fff; color: var(--muted); border-color: var(--border); }
.btn.ghost:hover { background: #f8fafc; color: var(--text); }
.btn.success { background: linear-gradient(180deg, #22c55e 0%, #15803d 100%); }
.btn.success:hover { background: #166534; }
.btn.danger { background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); }
.btn.danger:hover { background: #991b1b; }
.btn.warning { background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%); color: #fff; }
.btn.warning:hover { background: #b45309; }
.btn.light { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(4px); }
.btn.light:hover { background: rgba(255,255,255,.26); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------------------------------------------------------------- Fields */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.field input, .field select, .field textarea,
.toolbar input, .toolbar select {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 14px; background: var(--surface-soft); color: var(--text); outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand-2); box-shadow: var(--ring); background: #fff; }
.field input[type="file"] { padding: 7px; background: #fff; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check.highlight { background: #eff6ff; border: 1px solid #bfdbfe; padding: 8px 12px; border-radius: 10px; font-weight: 700; color: var(--brand-dark); }

/* ---------------------------------------------------------------- Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar.card { padding: 14px 16px; }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #eef2f8; white-space: nowrap; vertical-align: middle; }
table.data th {
    background: #f7f9fc; color: var(--muted); font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; font-weight: 700; position: sticky; top: 0; z-index: 1;
    border-bottom: 1px solid var(--border);
}
table.data tbody tr { transition: background .14s ease; }
table.data tbody tr:nth-child(even) { background: #fcfdff; }
table.data tbody tr:hover { background: #eff6ff; }
table.data td.wrap { white-space: normal; min-width: 220px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mini th, table.mini td { padding: 6px 8px; border-bottom: 1px solid #eef2f8; text-align: left; }
table.mini th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; }
.thumb { width: 64px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; }

/* ---------------------------------------------------------------- Status */
.status {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.status.en_progreso { background: #fef9c3; color: #854d0e; }
.status.pendiente, .status.pendiente_admin { background: #ffedd5; color: #9a3412; }
.status.aprobado { background: #dcfce7; color: #166534; }
.status.rechazado { background: #fee2e2; color: #991b1b; }
.status.descartado { background: #e5e7eb; color: #374151; }

/* ---------------------------------------------------------------- Detail */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
.detail-grid .item .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.detail-grid .item .v { font-weight: 600; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eef2f8; color: #334155; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }

/* ---------------------------------------------------------------- Alerts */
.alert {
    background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
    padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px;
}
.alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: var(--ok); }

/* ---------------------------------------------------------------- Pagination */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 16px 0 0; }
.pagination a, .pagination span {
    display: inline-block; padding: 7px 12px; border: 1px solid var(--border);
    border-radius: 9px; background: #fff; color: var(--text); font-size: 13px;
}
.pagination a:hover { background: #f1f5f9; text-decoration: none; }
.pagination .disabled { color: #cbd5e1; }
.pagination .page-info { border: 0; background: transparent; color: var(--muted); }

/* ---------------------------------------------------------------- Timeline */
.timeline { padding-left: 4px; }
.timeline-step { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.timeline-step:not(:last-child)::before {
    content: ""; position: absolute; left: 15px; top: 46px; bottom: -8px; width: 2px; background: var(--border);
}
.timeline-step.done:not(:last-child)::before { background: #86efac; }
.timeline-dot {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; background: #cbd5e1; z-index: 1;
}
.timeline-dot.done { background: linear-gradient(180deg, #22c55e 0%, #15803d 100%); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.timeline-dot.pending { background: #cbd5e1; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-label { font-weight: 700; font-size: 14px; }
.timeline-time { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.gps { font-size: 11.5px; color: #475569; margin-top: 3px; font-variant-numeric: tabular-nums; }
.evidence {
    display: inline-flex; flex-direction: column; gap: 4px; margin-top: 8px; max-width: 260px;
    border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff;
    transition: transform .18s ease, box-shadow .18s ease;
}
.evidence:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.evidence img { width: 100%; height: 150px; object-fit: cover; display: block; }
.evidence span { font-size: 11.5px; color: var(--muted); padding: 6px 9px; }

.page-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Menus */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-md); padding: 12px; width: 260px;
}
.menu-panel.wide { width: 420px; max-width: 90vw; }
.menu-panel .stack { display: flex; flex-direction: column; gap: 7px; }
.menu-panel label.small { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.menu-panel input, .menu-panel select {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fbfcfe;
}

/* ---------------------------------------------------------------- Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(11, 45, 92, .45);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    transition: opacity .18s ease;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal {
    width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
    background: #fff; border-radius: 18px; box-shadow: 0 40px 100px -24px rgba(3,15,35,.55);
    animation: modalIn .28s cubic-bezier(.16,1,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
    border: 0; background: #eef2f8; color: #475569; width: 32px; height: 32px; border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 16px 22px 22px; }
.modal-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.modal-section:last-child { border-bottom: 0; }
.modal-section .section-title { font-size: 13px; margin-bottom: 8px; }
.modal-body .stack { display: flex; flex-direction: column; gap: 7px; }
.modal-body input, .modal-body select {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; background: #fbfcfe;
}

/* ---------------------------------------------------------------- Auth */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(47,128,201,.55), transparent 55%),
        radial-gradient(700px 500px at 90% 90%, rgba(196,154,58,.35), transparent 60%),
        linear-gradient(135deg, #081F40 0%, #0B2D5C 45%, #1E5AA8 100%);
    padding: 22px; position: relative; overflow: hidden;
}
.auth-glow { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .35; pointer-events: none; }
.auth-glow-a { width: 320px; height: 320px; background: #2F80C9; top: -80px; right: -60px; animation: floaty 12s ease-in-out infinite; }
.auth-glow-b { width: 260px; height: 260px; background: #C49A3A; bottom: -80px; left: -60px; animation: floaty 16s ease-in-out infinite reverse; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-24px); } }
.auth-card {
    width: 100%; max-width: 410px; background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.5); border-radius: 26px; padding: 34px 30px;
    box-shadow: 0 30px 80px -20px rgba(3,15,35,.65); position: relative; z-index: 1;
    animation: cardIn .5s cubic-bezier(.16,1,.3,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-card .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card .logo img { height: 46px; width: 46px; object-fit: contain; }
.auth-card h1 { font-size: 22px; margin: 0; }
.auth-card p.sub { color: var(--muted); font-size: 12.5px; margin: 3px 0 0; }
.auth-foot { text-align: center; color: #94a3b8; font-size: 11.5px; margin: 16px 0 0; }

/* ---------------------------------------------------------------- Responsive */
.sidebar-backdrop { display: none; }
@media (max-width: 1100px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); transition: transform .3s cubic-bezier(.16,1,.3,1); z-index: 120; }
    .sidebar.open { transform: translateX(0); z-index: 120; }
    .main { margin-left: 0; }
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(11,45,92,.45); z-index: 110; display: none; }
    .sidebar-backdrop.show { display: block; }
    .topbar .who .badge-pill.soft { display: none; }
    .content { padding: 16px; }
    .hero { flex-direction: column; align-items: flex-start; }
    .menu-panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 70vh; overflow-y: auto; }
}
@media (max-width: 560px) {
    .topbar { padding: 0 14px; }
    .toolbar .field { flex: 1 1 100%; }
    .toolbar-actions { width: 100%; }
    .toolbar-actions .btn { flex: 1; }
    table.data th, table.data td { padding: 9px 10px; font-size: 12px; }
    .kpi .value { font-size: 24px; }
}

/* ---------------------------------------------------------------- Accessibility */
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* -------------------------------------------------- Login con imagen de fondo */
.auth-wrap {
    background:
        linear-gradient(90deg, rgba(3, 10, 26, .08) 0%, rgba(3, 10, 26, .30) 45%, rgba(3, 10, 26, .74) 100%),
        url('../images/login-bg-pc.jpg') center center / cover no-repeat;
    justify-content: flex-end;
    padding-right: 6vw;
}
.auth-glow { display: none; }

@media (min-width: 901px) and (max-height: 720px) {
    .auth-wrap { align-items: flex-start; padding-top: 4vh; }
}

@media (max-width: 900px) {
    .auth-wrap {
        justify-content: center;
        padding: 18px 16px 26px;
        background:
            linear-gradient(180deg, rgba(3, 10, 26, .10) 0%, rgba(3, 10, 26, .42) 45%, rgba(3, 10, 26, .82) 100%),
            url('../images/login-bg-mobile.jpg') center center / cover no-repeat;
    }
    .auth-card { max-width: 430px; }
}

/* -------------------------------------------------- Capas del mapa y GPS */
/* Contiene los paneles/controles de Leaflet (z-index 400-1000) dentro del mapa
   para que nunca tapen el sidebar (60), el topbar (40) ni los modales (200). */
#liveMap {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* El aviso de GPS debe quedar por debajo del sidebar y no invadirlo. */
#gps-track-banner {
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 50 !important;
}
@media (min-width: 901px) {
    #gps-track-banner {
        left: calc(256px + 14px) !important;
    }
}
#gps-track-status {
    z-index: 49 !important;
}
