/* =====================================================
   ESTILOS GLOBALES - SISTEMA DE PAGOS MUNICIPAL
   Variables y estilos base compartidos
   ===================================================== */

:root {
    /* --- LIGHT THEME (Default) --- */
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #7dd3fc;
    --secondary: #0369a1;
    --secondary-dark: #075985;
    
    /* Colores de Estado */
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    
    /* Colores de Texto */
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --text-white: #ffffff;
    
    /* Fondos */
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --bg-section: #f3f4f6;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;
    
    /* Bordes */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    
    /* Espaciados */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Bordes Redondeados */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transiciones */
    --transition: 0.3s ease;
    --transition-fast: 0.15s ease;
}

[data-theme='dark'] {
    /* --- DARK THEME --- */
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --primary-light: #7dd3fc;
    
    /* Colores de Texto */
    --text: #e5e7eb;
    --text-light: #9ca3af;
    --text-lighter: #6b7280;
    
    /* Fondos */
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-section: #020617;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    /* Bordes */
    --border: #334155;
    --border-light: #1e293b;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    
    /* Ajustes de Estado para Dark */
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
    --info-light: rgba(14, 165, 233, 0.1);
}


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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-section);
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
}

/* Imágenes */
img {
    max-width: 100%;
    height: auto;
}

/* Botones base */
button {
    font-family: inherit;
    cursor: pointer;
}

/* Inputs base */
input, textarea, select {
    font-family: inherit;
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Scroll personalizado - Fin */

/* =====================================================
   SISTEMA DE TABLAS MODERNO (UNIFICADO)
   ===================================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--bg-card);
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern th {
    background: var(--bg-alt);
    padding: 1rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table-modern td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
    color: var(--text);
    transition: var(--transition-fast);
}

.table-modern tr:last-child td {
    border-bottom: none;
}

.table-modern tr:hover td {
    background: var(--bg-hover);
}

/* Identificadores (IDs, Números de Recibo) */
.table-id {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 800;
    color: var(--primary);
    font-size: .9rem;
    background: var(--info-light, #eff6ff);
    padding: .15rem .45rem;
    border-radius: 5px;
    letter-spacing: .02em;
}

/* Texto Principal (Nombres) */
.table-main-text {
    display: block;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}

/* Subtexto (DNI, Email, etc) */
.table-subtext {
    display: block;
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 2px;
}

.table-subtext i {
    width: 14px;
    opacity: 0.6;
    margin-right: 2px;
}

/* Badges de Estado */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #e0f2fe; color: #0369a1; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Indicadores de Servicio (Icono) */
.service-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--bg-alt);
    color: var(--text-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.service-icon-only[title] {
    cursor: help;
}

.service-icon-only i {
    transition: transform 0.2s;
}

.service-icon-only:hover i {
    transform: scale(1.1);
}

/* Colores Dinámicos para Fechas de Vencimiento */
.date-future {
    color: #10b981 !important; /* Verde Esmeralda */
    font-weight: 700 !important;
}

.date-past {
    color: #ef4444 !important; /* Rojo */
    font-weight: 700 !important;
}

.service-indicator i {
    font-size: 0.8rem;
}

/* Botones de Acción Mini */
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-light);
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-action.primary { color: var(--primary); background: #eff6ff; border-color: #dbeafe; }
.btn-action.success { color: var(--success); background: #ecfdf5; border-color: #d1fae5; }
.btn-action.danger  { color: var(--danger);  background: #fef2f2; border-color: #fee2e2; }
.btn-action.warning { color: var(--warning); background: #fffbeb; border-color: #fef3c7; }

/* Alineaciones especializadas */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

