:root {
    /* Brand Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #ede9fe;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --secondary-color: #ec4899;
    --secondary-light: #fce7f3;

    /* Light Theme Backgrounds */
    --bg-page: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.95);

    /* Text */
    --text-main: #1e293b;
    --text-sub: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* Borders & Shadows */
    --border-color: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);

    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.06), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.05), transparent 30%);
    background-attachment: fixed;
}

/* ─── Loader ─────────────────────────────────────────────── */
.loader-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-page);
    z-index: 9999;
    transition: opacity 0.5s ease;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ─── Login View ─────────────────────────────────────────── */
.log-in-container {
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

.log-in-container::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: var(--primary-color);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.08;
    z-index: -1;
    top: 50%;
    transform: translateY(-50%) translateX(-20%);
}
.log-in-container::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: var(--secondary-color);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.06;
    z-index: -1;
    bottom: 0%;
    right: 10%;
}

.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.6s ease-out forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes fadeUp {
    to { transform: translateY(0); opacity: 1; }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}
.login-header h2 span { color: var(--primary-color); }
.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}
.login-footer a {
    color: var(--primary-color);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}
.login-footer a:hover { text-decoration: underline; }

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}
.card-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-main);
}
.card-header h2 span { color: var(--primary-color); }
.card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ─── Inputs ─────────────────────────────────────────────── */
.input-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.01em;
}
.input-group input,
.input-group textarea,
.input-group select {
    background: #f8fafc;
    border: 1.5px solid var(--border-strong);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}
.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #ffffff;
}
.input-group input::placeholder { color: var(--text-faint); }
.input-group textarea {
    resize: vertical;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-primary.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.btn-primary.success:hover { box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35); }

.btn-secondary {
    background: #f8fafc;
    border: 1.5px solid var(--border-strong);
    color: var(--text-sub);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}
.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-logout {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    color: var(--text-muted);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}
.btn-logout:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}
.btn-close:hover { color: #ef4444; transform: scale(1.1); }

/* ─── Error messages ─────────────────────────────────────── */
.error-msg {
    color: #ef4444;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    text-align: center;
    min-height: 20px;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
}
.error-msg:empty { background: transparent; padding: 0; }

/* ─── Dashboard SaaS Layout ──────────────────────────────── */
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* TOPBAR */
.topbar {
    height: 64px;
    background: var(--bg-topbar);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; min-width: 200px; }
.brand-logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}
.brand-logo span { color: var(--primary-color); }

.topbar-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.context-selector {
    background: #f8fafc;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    min-width: 250px;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2264748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem top 50%;
    background-size: 0.6rem auto;
}
.context-selector:hover, .context-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: #ffffff;
}
.context-selector option { background: white; color: var(--text-main); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 200px;
    justify-content: flex-end;
}

.notification-bell {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}
.notification-bell:hover { transform: scale(1.1); }
.notification-bell .badge {
    position: absolute;
    top: -5px; right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-quick-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex; justify-content: center; align-items: center;
    font-weight: 700; font-size: 1rem; color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.user-role { font-size: 0.65rem; color: var(--primary-color); font-weight: 500; }

/* APP CONTAINER */
.app-container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0.75rem;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.nav-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.nav-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.details { display: flex; flex-direction: column; }
.details span { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }

.badge {
    font-size: 0.7rem;
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 2px;
    display: inline-block;
    width: fit-content;
}
.badge-blue { color: #0284c7; }

/* MAIN CONTENT */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    padding: 2rem 2.5rem;
    background: var(--bg-page);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* Generic Components */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}
.stat-card.accent-1 .value { color: #16a34a; }
.stat-card.accent-2 .value { color: var(--primary-color); }
.stat-card.accent-3 .value { color: var(--secondary-color); }

.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.modern-table {
    width: 100%;
    border-collapse: collapse;
}
.modern-table th {
    background: #f8fafc;
    text-align: left;
    padding: 0.9rem 1.4rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.modern-table td {
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}
.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover { background: #f8fafc; }

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-color);
    display: inline-block;
}
.status-badge.success { background: #dcfce7; color: #16a34a; }
.status-badge.warning { background: #fef9c3; color: #ca8a04; }

/* glass-card para forms internos */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding: 1rem; flex-direction: row; justify-content: space-between; align-items: center; }
    .nav-menu { display: none; }
    .sidebar-footer { padding-top: 0; border: none; flex-direction: row; }
    .main-content { padding: 1rem; }
}

/* ─── Modal (Event Creation) ─────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.glass-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown { to { transform: translateY(0); } }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
.modal-header h2 { font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
.modal-header span { color: var(--primary-color); }

.modal-body { display: flex; flex-direction: column; gap: 0.75rem; }

.input-row.duplo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

/* ─── Wizard ─────────────────────────────────────────────── */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    position: relative;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}
.step-indicator {
    color: var(--text-faint);
    font-size: 0.82rem;
    font-weight: 500;
    position: relative;
    padding-bottom: 12px;
    flex: 1;
    text-align: center;
}
.step-indicator.active {
    color: var(--primary-color);
    font-weight: 700;
}
.step-indicator.active::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0; width: 100%; height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-glow);
}

.wizard-controls {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
}
.right-controls { display: flex; gap: 10px; }

.module-block {
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.module-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 0.5rem;
}
.module-header strong { color: var(--text-main); font-size: 0.9rem; }
.step-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }

.review-panel {
    background: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}
.review-panel h3 { color: var(--primary-dark); font-size: 1rem; margin-bottom: 0.5rem; }
.review-panel p, .review-panel li { color: var(--text-sub); font-size: 0.88rem; }
.review-panel ul { margin-top: 0.5rem; padding-left: 1.2rem; }
.review-panel li { margin-bottom: 0.3rem; }

/* TOGGLE SWITCH */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
.toggle-switch input:checked + .slider { background-color: var(--primary-color); }
.toggle-switch input:checked + .slider:before { transform: translateX(20px); }

.file-input {
    background: #f8fafc;
    padding: 0.5rem;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    width: 100%;
    cursor: pointer;
    font-size: 0.85rem;
}
.file-input:hover { border-color: var(--primary-color); }

/* ─── Sala de Comando ────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--kpi-accent, var(--primary-color));
}
.kpi-card[data-accent="green"]  { --kpi-accent: #22c55e; }
.kpi-card[data-accent="amber"]  { --kpi-accent: #f59e0b; }
.kpi-card[data-accent="pink"]   { --kpi-accent: #ec4899; }
.kpi-card[data-accent="blue"]   { --kpi-accent: #3b82f6; }
.kpi-card[data-accent="purple"] { --kpi-accent: #8b5cf6; }

.kpi-card .kpi-icon { font-size: 1.4rem; margin-bottom: 0.5rem; }
.kpi-card .kpi-value { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 0.3rem; color: var(--kpi-accent, var(--primary-color)); }
.kpi-card .kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.kpi-card .kpi-sub { font-size: 0.68rem; color: var(--text-faint); margin-top: 0.4rem; }

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.chart-card h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}
.chart-card canvas { max-height: 220px; }

/* ─── Offcanvas Panel ────────────────────────────────────── */
.event-detail-panel {
    position: fixed;
    top: 0; right: 0;
    width: 400px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,0.1);
    animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from { transform: translateX(120%); }
    to   { transform: translateX(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    background: #f8fafc;
}
.panel-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-main); line-height: 1.4; }

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.3) transparent;
}

.panel-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}
.panel-kpi-item {
    background: var(--primary-light);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    text-align: center;
}
.panel-kpi-item .val { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.panel-kpi-item .lbl { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; margin-top: 2px; font-weight: 600; }

.panel-section { margin-bottom: 1.5rem; }
.panel-section h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 0.8rem; font-weight: 700; }

/* Timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
    content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(to bottom, var(--primary-color), transparent);
}
.timeline-item { position: relative; margin-bottom: 1.1rem; }
.timeline-dot {
    position: absolute; left: -1.5rem; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg-page); border: 2px solid var(--border-strong);
    transition: var(--transition);
}
.timeline-item.done .timeline-dot { border-color: #22c55e; background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.timeline-item.active .timeline-dot { border-color: var(--primary-color); background: var(--primary-color); box-shadow: 0 0 8px var(--primary-glow); animation: pulseGlow 2s infinite; }
@keyframes pulseGlow { 0%,100%{ box-shadow: 0 0 6px var(--primary-glow); } 50%{ box-shadow: 0 0 14px var(--primary-glow); } }

.timeline-label { font-size: 0.83rem; font-weight: 500; color: var(--text-main); }
.timeline-date  { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Status Controls */
.status-controls { display: flex; flex-direction: column; gap: 0.45rem; }
.status-btn {
    background: #f8fafc;
    border: 1.5px solid var(--border-strong);
    color: var(--text-sub);
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.status-btn:hover { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); }
.status-btn.active-status { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-dark); font-weight: 700; }

/* Event card actions */
.stat-card .card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-command {
    background: var(--primary-light);
    border: 1px solid rgba(99,102,241,0.25);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}
.btn-command:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* Recent Submissions */
.recent-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    margin-top: 1.2rem;
    box-shadow: var(--shadow-sm);
}
.recent-section h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 1rem; font-weight: 700; }
.submission-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    gap: 10px;
}
.submission-row:last-child { border-bottom: none; }
.submission-row .sub-title { font-weight: 500; flex: 1; color: var(--text-main); }
.submission-row .sub-score { color: var(--primary-color); font-weight: 700; min-width: 50px; text-align: right; }

/* Event Progress Bar */
.event-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}
.event-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* Btn Loader */
.btn-loader {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* KPI animations */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.kpi-card { animation: fadeSlideUp 0.4s ease both; }
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }

