/* ============================================================
   SISTEMA DE EGRESOS — Design System (Vanilla CSS)
   ============================================================ */

/* ——— Google Font ——— */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ——— Custom Properties (Design Tokens) ——— */
:root {
    /* Primary palette */
    --primary: #0e9e87;
    --primary-dark: #0a7d6b;
    --primary-darker: #066f5e;
    --primary-light: #12c4a6;
    --primary-bg: rgba(14, 158, 135, 0.08);
    --primary-ring: rgba(14, 158, 135, 0.2);

    /* Accent & semantic */
    --accent: #6366f1;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;

    /* Neutrals */
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    --bg-input: #f8f9fb;
    --border: #e2e5ea;
    --border-light: #eef1f5;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Shadows */
    --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);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(14, 158, 135, 0.15);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --speed: 0.25s;
}

/* ——— Reset & Base ——— */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
    color: #fff;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.app-header .brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header .brand-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Navigation */
.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--speed) var(--ease);
    position: relative;
}

.app-nav a:hover,
.app-nav a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.app-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.nav-logout {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* User info badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.35;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-meta {
    text-align: right;
}

.user-meta strong {
    display: block;
    font-weight: 600;
}

.user-meta span {
    opacity: 0.8;
    font-size: 12px;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-main {
    flex: 1;
    padding: 28px 24px 40px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.app-main.narrow {
    max-width: 520px;
}

.app-main.medium {
    max-width: 750px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    animation: cardSlideIn var(--speed) var(--ease);
    border: 1px solid var(--border-light);
}

.card+.card {
    margin-top: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 20px;
}

/* Glass card variant */
.card-glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: all var(--speed) var(--ease);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L.6 3.4l.85-.85L6 7.125 10.55 2.55l.85.85z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Inline filter form */
.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-row .form-group {
    margin-bottom: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--speed) var(--ease);
    text-decoration: none;
    line-height: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 158, 135, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 14px rgba(14, 158, 135, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--text-light);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 13px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.data-table, .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table thead, .table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table th, .table th {
    background: linear-gradient(180deg, #f7f8fa 0%, #f0f2f5 100%);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td, .table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr, .table tbody tr {
    transition: background var(--speed) var(--ease);
}

.data-table tbody tr:hover, .table tbody tr:hover {
    background: var(--primary-bg);
}

.data-table tbody tr:last-child td, .table tbody tr:last-child td {
    border-bottom: none;
}

.td-right {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.td-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.no-data {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-muted);
    font-size: 14px;
}

.no-data .no-data-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ============================================================
   TOTAL BOX
   ============================================================ */
.total-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 18px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.total-box .total-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    animation: modalPop 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
}

.modal-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.modal-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.modal-box p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

@keyframes modalPop {
    from {
        transform: scale(0.85) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-admin {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

.badge-cajero {
    background: rgba(14, 158, 135, 0.1);
    color: var(--primary-dark);
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    background: linear-gradient(135deg, var(--primary-darker), #053d33);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    padding: 16px 20px;
    font-size: 12.5px;
    letter-spacing: 0.02em;
    margin-top: auto;
}

.app-footer strong {
    color: #fff;
}

/* ============================================================
   LOGIN PAGE (special layout)
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0e9e87 0%, #066f5e 40%, #053d33 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(18, 196, 166, 0.2), transparent 70%);
    border-radius: 50%;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent 70%);
    border-radius: 50%;
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 400px;
    padding: 40px 34px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(14, 158, 135, 0.1);
    animation: loginFloat 0.5s var(--ease);
}

@keyframes loginFloat {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    max-width: 180px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.login-error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-top: 14px;
    border-left: 3px solid var(--danger);
}

/* ============================================================
   LOGO CONTAINER (for forms like salida)
   ============================================================ */
.logo-container {
    text-align: center;
    margin-bottom: 18px;
}

.logo-container img {
    max-width: 180px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* ============================================================
   STAT CARDS (Dashboard-like)
   ============================================================ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--speed) var(--ease);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
}

.stat-icon.purple {
    background: rgba(99, 102, 241, 0.1);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 13px;
}

.text-xs {
    font-size: 12px;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-primary {
    color: var(--primary);
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

/* Separator */
.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 20px 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 8px;
    }

    .app-header .brand {
        font-size: 16px;
    }

    .app-header .brand-icon {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .app-nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 2px;
        justify-content: center;
    }

    .app-nav a {
        font-size: 11.5px;
        padding: 6px 8px;
    }

    .user-badge {
        font-size: 11px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .app-main {
        padding: 16px 12px 30px;
    }

    .app-main.narrow,
    .app-main.medium {
        max-width: 100%;
    }

    .card {
        padding: 18px 14px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-title {
        font-size: 16px;
    }

    .stat-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .stat-value {
        font-size: 18px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-box {
        max-width: 320px;
        padding: 22px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-subtitle {
        font-size: 13px;
    }

    /* Cuadre: stack columns on tablet */
    .cuadre-grid {
        grid-template-columns: 1fr !important;
    }

    /* Page header flex → stack */
    .page-header-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Calendar smaller */
    .calendar-grid {
        gap: 4px;
    }

    .cal-day {
        font-size: 13px;
    }

    .total-box {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .stat-row {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .td-actions {
        flex-direction: column;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11.5px;
    }

    .cal-header {
        font-size: 10px;
    }

    .cal-day {
        font-size: 12px;
    }

    .month-nav h2 {
        font-size: 18px;
        min-width: auto;
    }
}

/* ============================================================
   CUADRE GRID (responsive two-column)
   ============================================================ */
.cuadre-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ============================================================
   PAGE HEADER FLEX (responsive)
   ============================================================ */
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* ============================================================
   COPYABLE TABLE (Excel Preview)
   ============================================================ */
.preview-table-wrapper {
    overflow-x: auto;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 16px;
    position: relative;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    background: #fff;
    -webkit-user-select: all;
    user-select: all;
}

.preview-table th,
.preview-table td {
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    white-space: nowrap;
}

.preview-table th {
    background: #f3f4f6;
    font-weight: 700;
    text-align: center;
}

.preview-table .row-total {
    background: #ecfdf5;
    font-weight: 700;
}

.preview-table .row-grand-total {
    background: #d1fae5;
    font-weight: 700;
    font-size: 14px;
}

.preview-table .row-separator td {
    border: none;
    padding: 4px;
    background: #f9fafb;
}

.copy-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 500;
}

.btn-copy {
    background: var(--accent);
    color: #fff;
}

.btn-copy:hover {
    background: #4f46e5;
}

/* ============================================================
   CLOCK WIDGET
   ============================================================ */
.clock-widget {
    font-size: 11px;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   PAGE TITLES
   ============================================================ */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================================
   SCROLLBAR (custom)
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================
   SIDEBAR & LAYOUT OVERRIDES
   ============================================================ */

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0e9e87 0%, #066f5e 50%, #1e293b 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    margin-bottom: 20px;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 14px;
    text-align: center;
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }

    .login-logo img {
        max-width: 160px;
    }

    .login-title {
        font-size: 22px;
    }
}

.app-layout {
    display: flex;
    flex: 1;
    width: 100%;
}

.no-sidebar {
    justify-content: center;
}

.app-sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--primary-darker), var(--primary-dark));
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-nav {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    padding: 15px 20px 8px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

.sidebar-nav a {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--speed) var(--ease);
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left: 4px solid var(--primary-light);
    padding-left: 16px;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ============================================================
   CARD RADIOS
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.card-radio {
    cursor: pointer;
    position: relative;
    display: block;
}

.card-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-radio .card-radio-content {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 15px 12px;
    background: var(--bg-card);
    transition: all var(--speed) var(--ease);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-radio:hover .card-radio-content {
    border-color: var(--primary-light);
    background: var(--bg-input);
    transform: translateY(-2px);
}

.card-radio input[type="radio"]:checked+.card-radio-content {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 4px 12px rgba(14, 158, 135, 0.15);
}

.card-radio-content h4 {
    margin: 0 0 4px 0;
    font-size: 14.5px;
    color: var(--text);
    font-weight: 700;
}

.card-radio-content span {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
}

.card-radio-content .icon-emoji {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* ============================================================
   RESPONSIVE DESIGN (MOBILE)
   ============================================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .app-topbar {
        padding: 0 15px;
        justify-content: flex-start;
    }

    .app-topbar .user-badge {
        margin-left: auto;
    }

    .user-meta {
        display: none;
    }

    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
    }

    .app-sidebar.open {
        left: 0;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .app-main {
        padding: 15px;
    }

    .stat-row,
    .filter-row {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
        margin-bottom: 10px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .modal-box {
        width: 95%;
        margin: 10px;
        padding: 20px;
    }
}

/* Dashboard y Grillas Generales */
.grid { display: grid; gap: 20px; }
.grid-cols-2 { grid-template-columns: 1fr; }
.grid-cols-3 { grid-template-columns: 1fr; }
.grid-cols-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
    .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Grilla Votaciones */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.vote-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); display: flex; flex-direction: column; position: relative; transition: transform 0.2s; }
.vote-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.vote-status { position: absolute; top: 15px; right: 15px; font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.status-active { background: #dcfce7; color: #166534; }
.status-ended { background: #f1f5f9; color: #64748b; }
.vote-type-badge { display: inline-block; font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; background: #e0f2fe; color: #0369a1; font-weight: 600; margin-bottom: 8px; }
.vote-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.vote-dates { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; border-top: 1px solid var(--border-light); padding-top: 10px; }
.vote-actions { margin-top: 15px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Custom Voting Classes */
.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; margin-bottom: 24px; }
.candidate-card { background: var(--bg-card); border: 2px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 12px; text-align: center; cursor: pointer; transition: all var(--speed) var(--ease); box-shadow: var(--shadow-sm); }
.candidate-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.candidate-card.selected { border-color: var(--primary); background: var(--primary-bg); box-shadow: 0 4px 12px rgba(14,158,135,0.15); transform: scale(1.02); }
.candidate-avatar { width: 48px; height: 48px; background: var(--bg-body); color: var(--text-muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; margin: 0 auto 12px; transition: 0.2s; }
.candidate-card.selected .candidate-avatar { background: var(--primary); color: white; }
.candidate-name { font-size: 0.9rem; font-weight: 700; line-height: 1.2; margin-bottom: 4px; color: var(--text); }
.candidate-job { font-size: 0.75rem; color: var(--text-muted); }

.bottom-sheet-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); z-index: 100; opacity: 0; pointer-events: none; transition: 0.3s; }
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.bottom-sheet { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); padding: 32px 24px; border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 101; box-shadow: 0 -10px 40px rgba(0,0,0,0.1); }
.bottom-sheet.open { transform: translateY(0); }

/* Encuestas / Survey */
.survey-header { text-align: center; margin-bottom: 32px; }
.survey-progress { height: 8px; background: var(--border-light); border-radius: 4px; margin-top: 16px; overflow: hidden; }
.survey-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--primary)); width: 0%; transition: width 0.5s ease-out; }
.rating-group { display: flex; justify-content: space-between; margin-top: 24px; gap: 8px; flex-wrap: wrap; }
.emoji-btn { flex: 1; min-width: 50px; background: var(--bg-body); border: 2px solid transparent; border-radius: var(--radius-md); padding: 16px 8px; font-size: 2rem; cursor: pointer; transition: 0.2s; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.emoji-btn span { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.emoji-btn:hover { transform: translateY(-3px) scale(1.05); background: #fff; box-shadow: var(--shadow-sm); }
.emoji-btn.selected { border-color: var(--primary); background: var(--primary-bg); transform: scale(1.05); box-shadow: 0 4px 15px rgba(14,158,135,0.2); }