/* ==========================================================================
   Variables de Color: Modo Claro y Modo Oscuro (Estilo Dashboard Moderno)
   ========================================================================== */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --table-header: #f1f5f9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --transition-smooth: all 0.25s ease-in-out;
}

[data-theme="dark"] {
    --bg-main: #090d16;
    --bg-card: #111827;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #f9fafb;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #1f2937;
    --table-header: #1f2937;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Estructura Global y Contenedores con Estética de Tarjeta Flotante
   ========================================================================== */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 25px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: auto;
    background: var(--bg-card);
    padding: 35px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

/* Tipografía de Títulos */
h1, h2, h3 {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* ==========================================================================
   Tablas Estilizadas y Contenedores Modernos
   ========================================================================== */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9em;
}

th {
    background-color: var(--table-header);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

tr:hover td {
    background-color: rgba(59, 130, 246, 0.02);
}

/* ==========================================================================
   Formularios, Campos e Inputs Estilo "Clean Panel"
   ========================================================================== */
input, select, textarea {
    width: 100%;
    padding: 11px 14px;
    margin-top: 6px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-sizing: border-box;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.95em;
    transition: var(--transition-smooth);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Botones con transiciones suaves */
button, .btn-apply, .btn-export {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

button:hover, .btn-apply:hover, .btn-export:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Badges de Estado tipo "Pastilla" (Pill) */
.badge-status, .status {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   Sistema de Notificaciones Toast Flotantes
   ========================================================================== */
#toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast-success { border-left: 5px solid var(--success); }
.toast-error { border-left: 5px solid var(--danger); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}