/* ==========================================================================
   LOTA Admin — Holo Theme
   Paleta azul espacial inspirada en el HUD del juego.
   Sobreescribe los colores Tailwind usados en las paginas existentes para
   que todo el panel quede armonico sin tocar cada PHP.
   ========================================================================== */

:root {
    --holo-bg: #050b18;
    --holo-bg-2: #081428;
    --holo-surface: #0e1d33;
    --holo-surface-2: #122541;
    --holo-surface-3: #16304f;
    --holo-border: rgba(94, 161, 230, 0.18);
    --holo-border-strong: rgba(94, 161, 230, 0.35);
    --holo-cyan: #38bdf8;
    --holo-cyan-2: #06b6d4;
    --holo-blue: #3b82f6;
    --holo-blue-2: #2563eb;
    --holo-accent: #4cc9ff;
    --holo-accent-glow: rgba(76, 201, 255, 0.35);
    --holo-text: #e2ecff;
    --holo-text-dim: #94a8c4;
    --holo-text-mute: #6b7f9e;
    --holo-success: #10b981;
    --holo-warning: #f59e0b;
    --holo-danger: #ef4444;
    --holo-purple: #6366f1;
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 64px;
    --topbar-h: 52px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--holo-bg) !important;
    color: var(--holo-text) !important;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'tnum' 1;
    min-height: 100vh;
}

body {
    background:
        radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.10), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(56, 189, 248, 0.08), transparent 55%),
        var(--holo-bg) !important;
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(94, 161, 230, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 161, 230, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   LAYOUT: Sidebar + Topbar + Main full-width
   ========================================================================== */

.lota-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.lota-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--holo-bg-2) 0%, var(--holo-bg) 100%);
    border-right: 1px solid var(--holo-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
    z-index: 30;
}
.lota-sidebar::-webkit-scrollbar { width: 6px; }
.lota-sidebar::-webkit-scrollbar-thumb { background: var(--holo-border-strong); border-radius: 3px; }

.lota-sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.lota-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--holo-border);
    text-decoration: none;
    color: var(--holo-text);
}
.lota-sidebar-brand .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--holo-blue), var(--holo-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 20px var(--holo-accent-glow);
    flex-shrink: 0;
}
.lota-sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    overflow: hidden;
}
.lota-sidebar-brand .brand-text strong {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.lota-sidebar-brand .brand-text span {
    font-size: 10px;
    color: var(--holo-text-mute);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.lota-sidebar.collapsed .brand-text { display: none; }

.lota-nav-group { padding: 14px 12px 6px; }
.lota-nav-group-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--holo-text-mute);
    padding: 0 8px 6px;
    font-weight: 600;
}
.lota-sidebar.collapsed .lota-nav-group-label {
    font-size: 0;
    padding: 0;
    border-top: 1px solid var(--holo-border);
    margin: 8px 4px;
    height: 1px;
}

.lota-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 2px;
    color: var(--holo-text-dim);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.lota-nav-link i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.lota-nav-link:hover { background: var(--holo-surface); color: var(--holo-text); }
.lota-nav-link.is-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), transparent);
    color: var(--holo-accent);
    border-left-color: var(--holo-accent);
}
.lota-sidebar.collapsed .lota-nav-link { justify-content: center; padding: 10px 0; }
.lota-sidebar.collapsed .lota-nav-link span { display: none; }

.lota-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.lota-topbar {
    height: var(--topbar-h);
    background: rgba(8, 20, 40, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--holo-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.lota-topbar-left { display: flex; align-items: center; gap: 14px; }
.lota-topbar-toggle {
    background: transparent;
    border: 1px solid var(--holo-border);
    color: var(--holo-text-dim);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.lota-topbar-toggle:hover { color: var(--holo-accent); border-color: var(--holo-accent); }
.lota-breadcrumb { font-size: 13px; color: var(--holo-text-dim); }
.lota-breadcrumb strong { color: var(--holo-text); font-weight: 600; }
.lota-topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }

.lota-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--holo-surface);
    border: 1px solid var(--holo-border);
    border-radius: 999px;
    color: var(--holo-text);
    font-size: 12px;
}
.lota-user-chip i { color: var(--holo-accent); }

.lota-logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5 !important;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.lota-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff !important;
}

.lota-main { flex: 1; padding: 24px 28px 40px; width: 100%; max-width: none; }

.lota-footer {
    border-top: 1px solid var(--holo-border);
    padding: 14px 28px;
    color: var(--holo-text-mute);
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 11, 24, 0.6);
}

/* ==========================================================================
   REMAP de clases Tailwind usadas en las paginas existentes
   ========================================================================== */

.bg-gray-900 { background-color: transparent !important; }
.bg-gray-800 { background-color: var(--holo-surface) !important; border: 1px solid var(--holo-border); }
.bg-gray-700 { background-color: var(--holo-surface-2) !important; }
.bg-gray-600 { background-color: var(--holo-surface-3) !important; }
.bg-space-dark { background-color: var(--holo-bg-2) !important; }
.bg-space-blue { background-color: var(--holo-blue-2) !important; }
.bg-space-purple { background-color: var(--holo-blue) !important; }
.bg-space-cyan { background-color: var(--holo-cyan) !important; }

.border-gray-700, .border-gray-600 { border-color: var(--holo-border) !important; }
.border-gray-700\/50 { border-color: var(--holo-border) !important; }

.text-gray-100, .text-white, .text-gray-200 { color: var(--holo-text) !important; }
.text-gray-300, .text-gray-400 { color: var(--holo-text-dim) !important; }
.text-gray-500 { color: var(--holo-text-mute) !important; }
.text-space-cyan { color: var(--holo-accent) !important; }
.text-space-purple { color: var(--holo-blue) !important; }

[class*="bg-gradient-"] {
    background: var(--holo-surface) !important;
    border: 1px solid var(--holo-border) !important;
    position: relative;
    overflow: hidden;
}
[class*="bg-gradient-"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(76, 201, 255, 0.06), transparent 60%);
    pointer-events: none;
}

.bg-gradient-to-br.from-blue-600 { border-top: 2px solid var(--holo-blue) !important; }
.bg-gradient-to-br.from-purple-600 { border-top: 2px solid var(--holo-purple) !important; }
.bg-gradient-to-br.from-green-600 { border-top: 2px solid var(--holo-success) !important; }
.bg-gradient-to-br.from-orange-600 { border-top: 2px solid var(--holo-warning) !important; }
.bg-gradient-to-br.from-red-600 { border-top: 2px solid var(--holo-danger) !important; }
.bg-gradient-to-br.from-space-purple { border-top: 2px solid var(--holo-cyan) !important; }

.bg-gradient-to-r.from-blue-600,
.bg-gradient-to-r.from-purple-600,
.bg-gradient-to-r.from-green-600,
.bg-gradient-to-r.from-orange-600,
.bg-gradient-to-r.from-space-purple,
.bg-gradient-to-r.from-space-dark {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(56, 189, 248, 0.05)) !important;
    border-bottom: 1px solid var(--holo-border-strong);
}

.text-blue-200, .text-purple-200, .text-green-200, .text-orange-200 {
    color: var(--holo-text-dim) !important;
}
.text-blue-300, .text-purple-300, .text-green-300, .text-orange-300 {
    color: var(--holo-text-mute) !important;
}

.bg-blue-500, .bg-purple-500, .bg-green-500, .bg-orange-500,
.bg-opacity-30 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

.bg-blue-600, .bg-blue-700, .bg-purple-600, .bg-purple-700 {
    background-color: var(--holo-blue) !important;
}
.bg-blue-600:hover, .bg-blue-700:hover, .hover\:bg-blue-700:hover {
    background-color: var(--holo-blue-2) !important;
}
.bg-green-600, .bg-green-700 { background-color: var(--holo-success) !important; }
.bg-red-600, .bg-red-700 { background-color: var(--holo-danger) !important; }
.hover\:bg-gray-700:hover { background-color: var(--holo-surface-2) !important; }

.border-space-cyan { border-color: var(--holo-accent) !important; }
.border-l-4 { border-left-width: 3px !important; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
    background-color: var(--holo-bg-2) !important;
    border: 1px solid var(--holo-border) !important;
    color: var(--holo-text) !important;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: var(--holo-accent) !important;
    box-shadow: 0 0 0 3px rgba(76, 201, 255, 0.15) !important;
}

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--holo-text-mute);
    font-weight: 600;
    padding: 10px 12px;
    background: var(--holo-bg-2);
    border-bottom: 1px solid var(--holo-border-strong);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--holo-border); font-size: 13px; }
tr:hover td { background: rgba(76, 201, 255, 0.04); }

button, .btn { font-family: inherit; }

.bg-red-900 { background-color: rgba(239, 68, 68, 0.12) !important; }
.bg-green-900 { background-color: rgba(16, 185, 129, 0.12) !important; }
.border-red-500 { border-color: rgba(239, 68, 68, 0.4) !important; }
.border-green-500 { border-color: rgba(16, 185, 129, 0.4) !important; }
.text-red-200 { color: #fca5a5 !important; }
.text-green-200 { color: #6ee7b7 !important; }

.transform.hover\:scale-105:hover, .hover\:scale-105:hover { transform: none !important; }
.hover\:-translate-y-0\.5:hover { transform: none !important; }

h1, h2, h3, h4 { color: var(--holo-text); font-weight: 600; letter-spacing: -0.01em; }
.text-4xl, .text-3xl { font-weight: 700; letter-spacing: -0.02em; }

/* ==========================================================================
   COMPONENTES NUEVOS (paginas Lota: Financial, etc.)
   ========================================================================== */

.lota-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--holo-border);
    flex-wrap: wrap;
    gap: 16px;
}
.lota-page-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: var(--holo-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.lota-page-title i { color: var(--holo-accent); }
.lota-page-subtitle { color: var(--holo-text-mute); font-size: 13px; margin: 4px 0 0; }

.lota-card {
    background: var(--holo-surface);
    border: 1px solid var(--holo-border);
    border-radius: 8px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
.lota-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--holo-border);
}
.lota-card-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--holo-text-dim);
    font-weight: 600;
    margin: 0;
}

.lota-kpi { display: flex; flex-direction: column; gap: 6px; }
.lota-kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--holo-text-mute);
    font-weight: 600;
}
.lota-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--holo-text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.lota-kpi-delta { font-size: 12px; font-weight: 500; }
.lota-kpi-delta.up { color: var(--holo-success); }
.lota-kpi-delta.down { color: var(--holo-danger); }
.lota-kpi-delta.flat { color: var(--holo-text-mute); }

.lota-grid { display: grid; gap: 16px; }
.lota-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.lota-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.lota-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.lota-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
    .lota-grid.cols-4, .lota-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
    .lota-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .lota-grid.cols-2, .lota-grid.cols-3, .lota-grid.cols-4, .lota-grid.cols-5 {
        grid-template-columns: 1fr;
    }
}

.lota-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--holo-border);
    margin-bottom: 20px;
    overflow-x: auto;
}
.lota-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--holo-text-dim);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.lota-tab:hover { color: var(--holo-text); background: var(--holo-surface); }
.lota-tab.is-active {
    color: var(--holo-accent);
    border-bottom-color: var(--holo-accent);
    background: rgba(76, 201, 255, 0.05);
}

.lota-period-selector {
    display: inline-flex;
    border: 1px solid var(--holo-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--holo-bg-2);
}
.lota-period-selector a {
    padding: 6px 14px;
    font-size: 12px;
    color: var(--holo-text-dim);
    text-decoration: none;
    border-right: 1px solid var(--holo-border);
    transition: all 0.15s;
}
.lota-period-selector a:last-child { border-right: none; }
.lota-period-selector a:hover { color: var(--holo-text); background: var(--holo-surface); }
.lota-period-selector a.is-active { background: var(--holo-blue); color: #fff; }

.lota-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--holo-blue);
    color: #fff !important;
    border: 1px solid var(--holo-blue);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.lota-btn:hover { background: var(--holo-blue-2); box-shadow: 0 0 16px rgba(59, 130, 246, 0.4); }
.lota-btn.ghost { background: transparent; color: var(--holo-text-dim) !important; border-color: var(--holo-border-strong); }
.lota-btn.ghost:hover { color: var(--holo-text) !important; border-color: var(--holo-accent); box-shadow: none; }
.lota-btn.danger { background: var(--holo-danger); border-color: var(--holo-danger); }

.lota-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 160px;
    padding: 8px 0 28px;
    position: relative;
}
.lota-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--holo-cyan), var(--holo-blue));
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    position: relative;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.lota-bar:hover { opacity: 1; box-shadow: 0 0 12px var(--holo-accent-glow); }
.lota-bar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--holo-text-mute);
    white-space: nowrap;
}
.lota-bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--holo-text-dim);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
}
.lota-bar:hover .lota-bar-value { opacity: 1; }

.lota-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}
.lota-pill.cyan { color: var(--holo-cyan); border-color: var(--holo-cyan); background: rgba(56, 189, 248, 0.08); }
.lota-pill.green { color: var(--holo-success); border-color: var(--holo-success); background: rgba(16, 185, 129, 0.08); }
.lota-pill.amber { color: var(--holo-warning); border-color: var(--holo-warning); background: rgba(245, 158, 11, 0.08); }
.lota-pill.red { color: var(--holo-danger); border-color: var(--holo-danger); background: rgba(239, 68, 68, 0.08); }
.lota-pill.dim { color: var(--holo-text-mute); border-color: var(--holo-border-strong); }

.lota-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 14, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lota-modal {
    background: var(--holo-surface);
    border: 1px solid var(--holo-border-strong);
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px var(--holo-accent-glow);
}
.lota-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--holo-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lota-modal-body { padding: 20px; }
.lota-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--holo-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.lota-form-row { margin-bottom: 14px; }
.lota-form-row label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--holo-text-dim);
    font-weight: 600;
    margin-bottom: 6px;
}
.lota-form-row input,
.lota-form-row select,
.lota-form-row textarea { width: 100%; }

.lota-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--holo-text-mute);
    font-size: 13px;
}
.lota-empty i {
    font-size: 32px;
    opacity: 0.4;
    margin-bottom: 12px;
    display: block;
}

.lota-stack { display: flex; flex-direction: column; gap: 12px; }
.lota-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lota-mono { font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', 'Consolas', monospace; }

.lota-source-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--holo-bg-2);
    margin-top: 10px;
}
.lota-source-bar > div { height: 100%; transition: width 0.3s; }

.lota-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11px; }
.lota-legend-item { display: flex; align-items: center; gap: 6px; color: var(--holo-text-dim); }
.lota-legend-dot { width: 10px; height: 10px; border-radius: 2px; }
