/**
 * Estilos personalizados – Sistema de Votos
 */

:root {
    --primary-color: #dc3545;
    --primary-dark: #76131d;
    --primary-light: #f8d7da;
    --secondary-color: #6c757d;
    --light-gray: #f8f9fa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --dark-gray: #343a40;
    --white: #ffffff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 0.5rem;
    --radius-lg: 1rem;
    --transition: 250ms ease-in-out;
}

input.form-control,
textarea.form-control,
select.form-select,
.table td,
.table th,
.data-card-value {
    text-transform: uppercase;
}

.login-body input.form-control,
#modalUsuario input.form-control {
    text-transform: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: #f5f7fa;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-gray);
}

/* Login */
.login-body {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 50%, #8b2331 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.login-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 85px;
}

.sidebar-header {
    padding: 1.5rem;
    color: var(--white);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.381);
}

.sidebar-header img {
    max-width: 56px;
    max-height: 56px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px 0 rgba(31, 30, 30, 0.637);
    background-color: var(--white);
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

.sidebar.collapsed .sidebar-header h4 {
    display: none;
}

.sidebar-menu {
    padding: 1rem 0.75rem;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.sidebar-menu .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: var(--white);
    color: var(--white);
    font-weight: 600;
}

.sidebar-menu .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-menu .nav-link span {
    display: none;
}

.sidebar.collapsed .sidebar-menu .nav-link i {
    margin-right: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

/* Main */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background-color: #f5f7fa;
    transition: margin-left var(--transition);
}

.main-content.expanded {
    margin-left: 85px;
}

.topbar {
    background: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px 0 rgba(31, 30, 30, 0.637);
    background-color: var(--white);
}

.content-area {
    padding: 1.5rem;
}

/* Cards */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: 10%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.stat-card h6 {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem !important;
}

.stat-card h3 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card.primary {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #fd7e14 0%, #e06600 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.stat-card.purple {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.stat-card.dark-blue {
    background: linear-gradient(135deg, #2c5faa 0%, #1e3f73 100%);
}

.stat-card.orange-pending {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    float: right;
    color: #fff !important;
}

.stat-card .stat-icon-lg {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    opacity: 0.2;
    color: #fff !important;
}

/* Dashboard welcome section */
.dashboard-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.dashboard-welcome h5 {
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
}

.dashboard-welcome p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
}

/* Dashboard quick access */
.dashboard-quick-access {
    background: linear-gradient(135deg, #1e2a3a 0%, #2d3748 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.dashboard-quick-access h5 {
    color: #fff;
    font-weight: 700;
}

.dashboard-quick-access .btn-dash {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.dashboard-quick-access .btn-dash:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
    color: #fff;
}

.dashboard-quick-access .btn-dash i {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.dashboard-quick-access .btn-dash .icon-red {
    background: rgba(220, 53, 69, 0.25);
    color: #ff6b7a;
}

.dashboard-quick-access .btn-dash .icon-orange {
    background: rgba(253, 126, 20, 0.25);
    color: #ffa94d;
}

.dashboard-quick-access .btn-dash .icon-cyan {
    background: rgba(23, 162, 184, 0.25);
    color: #63e6f5;
}

.dashboard-quick-access .btn-dash .icon-green {
    background: rgba(40, 167, 69, 0.25);
    color: #69db7c;
}

/* Padrón vs Votantes chart */
.padron-chart-container {
    background: #2d3748;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.padron-chart-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.padron-chart-header h5 {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.padron-chart-header i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.padron-chart-body {
    padding: 1.5rem 2rem;
}

.chart-wrapper {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    min-height: 140px;
}

.padron-info-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.padron-info-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.padron-info-card.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.padron-info-card.red {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
}

.padron-info-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.padron-info-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0.25rem 0 0.5rem;
    line-height: 1;
}

.padron-info-detail {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.5rem;
}

.padron-info-detail i {
    margin-right: 0.25rem;
}

.padron-info-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.padron-info-badge.blue {
    background: rgba(255, 255, 255, 0.2);
}

.padron-info-badge.red {
    background: rgba(255, 255, 255, 0.2);
}

.padron-info-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .padron-chart-body {
        padding: 1rem;
    }
    .padron-info-value {
        font-size: 1.5rem;
    }
}

/* Dashboard report section */
.dashboard-report-container {
    background: #2d3748;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dashboard-report-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-report-header h5 {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.dashboard-report-header i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.dashboard-report-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 3px;
}

.report-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.report-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.report-tab.active {
    color: #fff;
    background: var(--primary-color);
}

.dashboard-report-body {
    padding: 1.25rem 1.5rem;
}

.report-tab-content {
    display: none;
}

.report-tab-content.active {
    display: block;
}

.dashboard-report-body .table {
    color: #e2e8f0;
    margin-bottom: 0;
}

.dashboard-report-body .table thead th {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.75rem;
}

.dashboard-report-body .table tbody td {
    border-color: rgba(255, 255, 255, 0.06);
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    vertical-align: middle;
}

.dashboard-report-body .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-report-body .badge-pct {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 48px;
    text-align: center;
}

.badge-pct.high { background: rgba(40, 167, 69, 0.2); color: #69db7c; }
.badge-pct.mid { background: rgba(253, 126, 20, 0.2); color: #ffa94d; }
.badge-pct.low { background: rgba(220, 53, 69, 0.2); color: #ff6b7a; }

.chart-wrapper-dark {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    min-height: 200px;
}

.rango-resultado {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    text-align: center;
}

.rango-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    display: block;
}

.rango-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: #63b3ed;
}

@media (max-width: 768px) {
    .dashboard-report-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-report-tabs {
        width: 100%;
    }
    .report-tab {
        flex: 1;
        text-align: center;
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    .dashboard-report-body {
        padding: 1rem;
    }
}

/* Reportes – encabezado en blanco */
.reportes-header {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.reportes-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.reportes-header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.reportes-logo {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.reportes-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-gray);
}

.reportes-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.reportes-table-container {
    border: 1px solid var(--gray-200);
}

.reportes-table-title {
    color: var(--dark-gray);
    font-weight: 600;
}

/* Badges de estado en reportes */
#tbodyReporte .badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
    font-weight: 600;
}

#tbodyReporte .badge.bg-success { background-color: var(--success) !important; }
#tbodyReporte .badge.bg-warning { color: #212529 !important; }

/* Tables */
.data-table-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.table thead th {
    font-weight: 600;
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: rgba(220, 53, 69, 0.05);
}

/* Modern table styles */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern tbody tr {
    transition: box-shadow 0.15s;
}

.table-modern tbody tr:hover {
    background-color: #f0f4ff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.thead-dark-blue th {
    background: #2c3e6b;
    color: #fff;
    border: none;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.thead-light-gray th {
    background: #f1f3f7;
    color: #5a6a85;
    border: none;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.icon-yellow { background: #fff3cd; color: #d4a017; }
.icon-blue { background: #d6e4ff; color: #3b6fc4; }
.icon-green { background: #d4edda; color: #28a745; }

.badge-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-blue { background: #e3eeff; color: #2c5faa; }
.badge-green { background: #d4f5dc; color: #1e7a38; }
.badge-orange { background: #fff0d6; color: #b87a1a; }

.badge-coord {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f0fe;
    color: #3367d6;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.btn-outline-primary.rounded-circle,
.btn-outline-danger.rounded-circle {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tr-details td {
    border-top: none !important;
}

/* Detail page cards */
.detail-card-dark {
    background: #1e2a3a;
    color: #e0e6ed;
}

.detail-card-dark .text-muted { color: #8a9bb5 !important; }
.detail-card-dark hr { border-color: rgba(255,255,255,0.1); }

.detail-header-blue {
    background: #2c5faa;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-header-cyan {
    background: #17a2b8;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-header-green {
    background: #28a745;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-header-gold {
    background: #e0a800;
    color: #212529;
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #3b7ddd;
    color: #fff;
    font-size: 2rem;
}

.detail-info-box {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 0.85rem;
    border: 1px solid #e9ecef;
}

.mobile-row-toggle-btn {
    transition: transform 0.2s;
}

.mobile-row-toggle-btn.open {
    transform: rotate(180deg);
}

/* Modals */
.modal-header {
    background: var(--primary-color);
    color: var(--white);
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--dark-gray);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Vista móvil (cards): oculta por defecto */
.table-mobile-view {
    display: none;
}

.table-mobile-view .text-center.p-3 {
    padding: 1.5rem !important;
    color: var(--secondary-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Scrollbar */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content-area {
        padding: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    /* Tabla → Cards en móvil */
    .data-table-container:has(.table-mobile-view) .table-mobile-view {
        display: block;
    }

    .data-table-container:has(.table-mobile-view) .table-responsive {
        display: none !important;
    }
}

/* Cards móvil – estilo reducido */
.mobile-row-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.mobile-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    gap: 0.75rem;
    transition: background-color 0.2s;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-row-header:hover {
    background-color: var(--gray-100);
}

.mobile-row-info {
    flex: 1;
    min-width: 0;
}

.mobile-row-info .row-cedula {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.15rem;
}

.mobile-row-info .row-nombre,
.mobile-row-info .row-apellido {
    font-weight: 600;
    color: var(--dark-gray);
}

.mobile-row-info .row-nombre {
    font-size: 1rem;
}

.mobile-row-info .row-apellido {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.mobile-row-toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.25s, background-color 0.2s;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-row-toggle:hover {
    background: var(--gray-100);
}

.mobile-row-toggle i {
    font-size: 1.1rem;
    color: var(--dark-gray);
    transition: transform 0.25s;
}

.mobile-row-header.active .mobile-row-toggle i {
    transform: rotate(180deg);
}

.mobile-row-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-row-details.active {
    max-height: 1200px;
}

.mobile-row-details > .mobile-row-detail-item:first-child {
    border-top: 1px solid var(--gray-200);
}

.mobile-row-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
}

.mobile-row-detail-item:last-of-type {
    border-bottom: none;
}

.mobile-row-detail-label {
    flex-shrink: 0;
    font-weight: 500;
    color: var(--secondary-color);
    min-width: 110px;
}

.mobile-row-detail-value {
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.mobile-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
    position: relative;
    z-index: 1;
}

.mobile-row-actions .btn {
    flex: 1;
    min-width: 120px;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Dark mode: cards móvil (tonos grises originales) */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .mobile-row-card {
        background: #2d3748;
        border-color: #4a5568;
    }

    .mobile-row-header {
        color: #e2e8f0;
    }

    .mobile-row-header:hover {
        background-color: rgba(74, 85, 104, 0.4);
    }

    .mobile-row-info .row-cedula {
        color: #a0aec0;
    }

    .mobile-row-info .row-nombre,
    .mobile-row-info .row-apellido {
        color: #e2e8f0;
    }

    .mobile-row-toggle {
        background: #374151;
        border-color: #4a5568;
    }

    .mobile-row-toggle:hover {
        background: #4a5568;
    }

    .mobile-row-toggle i {
        color: #e2e8f0;
    }

    .mobile-row-detail-item {
        border-color: #4a5568;
    }

    .mobile-row-details > .mobile-row-detail-item:first-child {
        border-top-color: #4a5568;
    }

    .mobile-row-detail-label {
        color: #a0aec0;
    }

    .mobile-row-detail-value {
        color: #e2e8f0;
    }

    .mobile-row-actions {
        border-top-color: #4a5568;
        background: rgba(74, 85, 104, 0.3);
    }
}

/* Modo claro: cabecera y lateral rojos con texto blanco */
@media (prefers-color-scheme: light) {
    .topbar {
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        color: #fff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    .topbar h3 {
        color: #fff;
    }
    .topbar .sidebar-toggle {
        color: #fff !important;
    }
    .topbar .user-avatar {
        border-color: rgba(255, 255, 255, 0.8);
    }
    .topbar .user-menu span {
        color: #fff;
    }
    .topbar .user-menu .text-white-50,
    .topbar .user-menu .small {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    .topbar .btn-outline-light {
        border-color: rgba(255, 255, 255, 0.9);
        color: #fff;
    }
    .topbar .user-menu .btn-outline-light {
        border-color: rgba(255, 255, 255, 0.9);
        color: #fff;
    }
    .topbar .user-menu .btn-outline-light:hover {
        background: #fff;
        color: var(--primary-color);
        border-color: #fff;
    }
    .topbar .btn-outline-light:hover {
        background: #fff;
        color: var(--primary-color);
        border-color: #fff;
    }
    .topbar .btn-outline-danger {
        border-color: rgba(255, 255, 255, 0.9);
        color: #fff;
    }
    .topbar .btn-outline-danger:hover {
        background: #fff;
        color: var(--primary-color);
        border-color: #fff;
    }
    .sidebar {
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    }
    .sidebar-header {
        color: #fff;
    }
    .sidebar-header h4 {
        color: #fff;
    }
    .sidebar-menu .nav-link {
        color: rgba(255, 255, 255, 0.9);
    }
    .sidebar-menu .nav-link:hover,
    .sidebar-menu .nav-link.active {
        color: #fff;
    }
}

/* Dark mode – tonos grises originales */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #e2e8f0;
    }

    .card,
    .data-table-container {
        background-color: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }

    .stat-card {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .dashboard-welcome {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .dashboard-quick-access {
        background: linear-gradient(135deg, #1a1f2e 0%, #252d3d 100%);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .table {
        color: #e2e8f0;
    }

    .table th {
        background-color: #4a5568;
        color: #e2e8f0;
        border-color: #4a5568;
    }

    .table td {
        border-color: #4a5568;
    }

    .table tbody tr:hover {
        background-color: rgba(74, 85, 104, 0.5);
    }

    .sidebar {
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .sidebar-menu .nav-link {
        color: rgba(255, 255, 255, 0.9);
    }

    .sidebar-menu .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .sidebar-menu .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .main-content {
        background-color: #343f55;
    }

    .topbar {
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .topbar h3 {
        color: #fff;
    }

    .content-area {
        background-color: #343f55;
    }

    .form-control,
    .form-select {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .form-control::placeholder {
        color: #a0aec0;
    }

    .form-label,
    .text-muted {
        color: #a0aec0 !important;
    }

    .modal-content {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .modal-header {
        background: var(--primary-color) !important;
        color: #fff !important;
        border-color: rgba(255, 255, 255, 0.15);
    }

    .empty-state {
        color: #a0aec0;
    }

    .content-area::-webkit-scrollbar-track {
        background: #2d3748;
    }

    .content-area::-webkit-scrollbar-thumb {
        background: #4a5568;
    }

    .content-area::-webkit-scrollbar-thumb:hover {
        background: #718096;
    }
}
