@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════
   MEGA ELEVADORES — Brand Color System
   Primary Navy:  #1a3a6e
   Accent Orange: #e87722
   ═══════════════════════════════════════════════════ */
:root {
    /* Brand Palette */
    --brand-navy:        #1a3a6e;
    --brand-navy-light:  #1e4590;
    --brand-navy-dark:   #0f2248;
    --brand-orange:      #e87722;
    --brand-orange-hover:#d4661a;
    --brand-orange-glow: rgba(232, 119, 34, 0.35);

    /* App Backgrounds */
    --bg-main:       #0c1829;
    --bg-sidebar:    #0f2040;
    --bg-card:       rgba(26, 58, 110, 0.25);
    --bg-card-solid: #122044;
    --bg-card-hover: rgba(26, 58, 110, 0.45);
    --border-color:  rgba(232, 119, 34, 0.18);
    --border-subtle: rgba(255, 255, 255, 0.07);

    /* Primary = Orange accent, secondary = navy */
    --primary:       #e87722;
    --primary-hover: #d4661a;
    --accent:        #1e90ff;

    /* Text */
    --text-main:     #f0f4ff;
    --text-muted:    #8ba3c7;
    --text-dim:      #4a6fa5;

    /* Semantic */
    --success:  #10b981;
    --warning:  #f59e0b;
    --danger:   #ef4444;
    --info:     #3b82f6;

    /* Layout */
    --sidebar-width: 280px;
    --glass-blur:    blur(14px);
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
}

/* ── Reset ─────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body & Background ─────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 0% 0%,   rgba(26, 58, 110, 0.55) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 80%, rgba(232, 119, 34, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 100%, rgba(26, 58, 110, 0.3) 0%, transparent 60%);
}

/* ── Glassmorphism ─────────────────────────────── */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Typography ────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; }
a { color: var(--brand-orange); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--brand-orange-hover); }

/* ── Buttons ───────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    gap: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-hover) 100%);
    color: white;
    box-shadow: 0 4px 14px var(--brand-orange-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--brand-orange-glow);
    filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(26, 58, 110, 0.5);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(26, 58, 110, 0.8);
    border-color: var(--brand-orange);
}

/* ── Inputs ────────────────────────────────────── */
.form-group  { margin-bottom: 1.5rem; }
.form-label  { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(12, 24, 41, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}
.form-control:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.18);
    background: rgba(12, 24, 41, 0.9);
}

.form-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(12, 24, 41, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%238ba3c7' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem auto;
}
.form-select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.18);
}
.form-select option { background: #0f2040; color: var(--text-main); }

/* ── Layout ────────────────────────────────────── */
.app-container { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0d1f3e 0%, #0a1729 100%);
    border-right: 1px solid rgba(232, 119, 34, 0.12);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

/* Logo area in sidebar */
.sidebar-logo {
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(232, 119, 34, 0.25);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.sidebar-logo img {
    width: 150px;
    height: auto;
    display: block;
}
.sidebar-logo .platform-tag,
.platform-tag {
    font-size: 0.6rem;
    color: var(--brand-orange);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
    margin-top: 6px;
    text-align: center;
    width: 100%;
}

/* ── Nav Menu ──────────────────────────────────── */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-link:hover {
    background: rgba(232, 119, 34, 0.08);
    color: var(--text-main);
    border-left-color: rgba(232, 119, 34, 0.4);
}
.nav-link.active {
    background: linear-gradient(90deg, rgba(232, 119, 34, 0.15) 0%, transparent 100%);
    color: white;
    border-left: 3px solid var(--brand-orange);
    font-weight: 600;
}
.nav-link.active i { color: var(--brand-orange); }
.nav-link:hover i  { color: var(--brand-orange); }
.nav-link i        { font-size: 1rem; width: 18px; text-align: center; transition: color 0.2s; }

/* ── Main Content ──────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
}

/* ── Topbar ────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.topbar-title {
    font-size: 1.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 30%, var(--brand-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile { display: flex; align-items: center; gap: 1rem; cursor: pointer; }
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px var(--brand-orange-glow);
}

/* ── Cards ─────────────────────────────────────── */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(26,58,110,0.35) 0%, rgba(12,24,41,0.6) 100%);
    border: 1px solid rgba(232, 119, 34, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(232, 119, 34, 0.15);
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 90px; height: 90px;
    background: linear-gradient(135deg, var(--brand-orange) 0%, transparent 100%);
    opacity: 0.08;
    border-radius: 0 var(--radius-lg) 0 100%;
}
.stat-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--brand-orange), transparent);
    opacity: 0.5;
}
.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
    color: white;
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.stat-change {
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 0.25rem;
}

/* ── Tables ────────────────────────────────────── */
.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle); }
th {
    color: var(--brand-orange);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    background: rgba(232, 119, 34, 0.05);
}
tr:hover td { background: rgba(232, 119, 34, 0.04); }

/* ── Badges ────────────────────────────────────── */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.badge-success  { background: rgba(16,185,129,0.15);  color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-warning  { background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-primary  { background: rgba(232,119,34,0.15);  color: #f59e0b; border: 1px solid rgba(232,119,34,0.3); }
.badge-danger   { background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-info     { background: rgba(59,130,246,0.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* ── Loader ────────────────────────────────────── */
#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-main);
    z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    border-top-color: var(--brand-orange);
    animation: spin 0.8s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────────────── */
#toast-container {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 10000;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    background: var(--bg-card-solid);
    border: 1px solid rgba(232, 119, 34, 0.3);
    border-left: 4px solid var(--brand-orange);
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex; align-items: center; gap: 10px;
    animation: slideIn 0.3s ease;
    max-width: 340px;
}
.toast.error  { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.error i  { color: var(--danger); }
.toast.success i { color: var(--success); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Modals ────────────────────────────────────── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8, 16, 32, 0.8);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
    background: linear-gradient(145deg, #122044, #0c1829);
    border: 1px solid rgba(232, 119, 34, 0.25);
    border-radius: var(--radius-md);
    width: 100%; max-width: 520px; max-height: 90vh;
    overflow-y: auto; padding: 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(232,119,34,0.2);
}
.modal-header h2, .modal-header h3 { color: var(--text-main); }
.modal-close {
    background: none; border: none;
    color: var(--text-muted); font-size: 1.25rem;
    cursor: pointer; transition: color 0.2s;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.modal-close:hover { color: white; background: rgba(255,255,255,0.08); }

/* ── Utils ─────────────────────────────────────── */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-orange { color: var(--brand-orange); }
.text-navy   { color: var(--brand-navy-light); }

/* ── Section Headers ───────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}
.section-header h2, .section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}
.section-header h2 span, .section-header h3 span { color: var(--brand-orange); }

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232,119,34,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,119,34,0.45); }
