/* ============================================================
   MUSA — Sistema de diseño (v2, 2026-08-14)
   Identidad Seguridad y Accesos: gris / negro / azul marino,
   con naranja quemado reservado como acento puntual — nunca
   como color dominante. Sin glassmorphism, sin gradientes
   morado/azul genéricos: superficies planas, bordes definidos,
   tipografía con carácter para títulos.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Marca */
    --navy-950: #101d42;
    --navy-900: #16255a;
    --navy-800: #1a2b5c;
    --navy-700: #2a3d78;
    --ink: #0b0d10;

    /* Escala de grises */
    --gray-900: #1f2430;
    --gray-700: #4a5060;
    --gray-500: #7b8190;
    --gray-300: #d7dae0;
    --gray-200: #e6e8ec;
    --gray-100: #f1f2f5;
    --gray-50: #f7f8fa;

    /* Acento — usar con moderación */
    --accent: #c14f08;
    --accent-dark: #9c3f06;
    --accent-soft: #fdecdf;

    /* Estados funcionales (mantener legibles, poco saturados) */
    --success: #1f8a5f;
    --success-soft: #e3f3ec;
    --danger: #b93a2f;
    --danger-soft: #fbeae8;
    --warning: #a5690f;
    --warning-soft: #faf0dd;
    --info: var(--navy-800);
    --info-soft: var(--gray-100);

    /* Roles semánticos usados en el resto del CSS */
    --primary: var(--navy-800);
    --primary-dark: var(--navy-900);
    --secondary: var(--gray-700);
    --light: var(--gray-50);
    --dark: var(--ink);
    --white: #ffffff;
    --foreground: var(--ink);
    --border: var(--gray-200);

    /* Superficies planas (reemplazan el glassmorphism anterior) */
    --surface: #ffffff;
    --surface-border: var(--gray-200);
    --surface-shadow: 0 1px 2px rgba(10, 17, 32, 0.04), 0 1px 12px rgba(10, 17, 32, 0.04);
    --glass-bg: var(--surface);
    --glass-border: var(--surface-border);
    --glass-shadow: var(--surface-shadow);
    --glass-blur: none;

    --font-display: 'Oswald', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --sidebar-width: 264px;

    /* --- Escala de espaciado (design pass) --- */
    --space-1: 0.25rem;   /* 4  */
    --space-2: 0.5rem;    /* 8  */
    --space-3: 0.75rem;   /* 12 */
    --space-4: 1rem;      /* 16 */
    --space-5: 1.5rem;    /* 24 */
    --space-6: 2rem;      /* 32 */
    --space-7: 3rem;      /* 48 */

    /* --- Radios de borde estándar --- */
    --radius-sm: 8px;     /* inputs, badges, botones */
    --radius-md: 12px;    /* tarjetas */
    --radius-lg: 18px;    /* modales */
    --radius-pill: 999px; /* pastillas */

    /* --- Elevación / sombras (3 niveles) --- */
    --elev-1: 0 1px 2px rgba(16,29,66,0.05), 0 1px 3px rgba(16,29,66,0.06);
    --elev-2: 0 1px 3px rgba(16,29,66,0.06), 0 8px 24px rgba(16,29,66,0.07);
    --elev-3: 0 10px 30px rgba(16,29,66,0.12), 0 24px 60px rgba(16,29,66,0.14);

    /* --- Transición estándar --- */
    --transition: 0.15s ease;
}

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

body {
    font-family: var(--font-body);
    background:
        radial-gradient(1200px 600px at 12% -5%, rgba(26,43,92,0.06) 0%, rgba(26,43,92,0) 60%),
        radial-gradient(1000px 500px at 105% 110%, rgba(193,79,8,0.05) 0%, rgba(193,79,8,0) 55%),
        linear-gradient(155deg, #ffffff 0%, #eef1f6 50%, #dfe4ee 100%);
    background-attachment: fixed;
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, .logo-text h2, .page-header h1, .card-title, .stat-content h3 {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — panel sólido azul marino, sin efecto vidrio ni tarjeta flotante */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    color: var(--gray-700);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 1000;
    transition: transform 0.3s ease;
    border-right: 1px solid var(--gray-200);
}

.sidebar-header {
    padding: 1.75rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    width: 100px;
    height: 100px;
    margin-bottom: 0.25rem;
    object-fit: contain;
    max-height: 100px;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    text-align: center;
}

.logo-text h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--navy-800);
    margin-bottom: 0;
    text-transform: uppercase;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 0.4rem;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    margin-bottom: 0.15rem;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--navy-800);
}

.nav-item.active {
    background: var(--accent-soft);
    border-left-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

.nav-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: 0.85;
    flex-shrink: 0;
}
.nav-item:hover .nav-icon-img,
.nav-item.active .nav-icon-img { opacity: 1; }

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-action-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.6rem;
    background: var(--gray-50);
    border-radius: 0.4rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s;
    border: 1px solid var(--gray-200);
}

.user-action-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--navy-800);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 0.4rem;
    background: var(--navy-700);
    border: 1px solid var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
    font-family: var(--font-display);
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy-800);
}

.user-role {
    font-size: 0.72rem;
    color: var(--gray-500);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: transparent;
    border-radius: 0.4rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.15s;
    border: 1px solid var(--gray-300);
}

.logout-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 2.25rem 2.5rem;
    min-height: 100vh;
    background: transparent;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.page-header h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.page-header p {
    color: var(--gray-700);
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Cards — superficie plana, sin blur, borde definido */
.card {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--elev-2);
    margin-bottom: var(--space-5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--gray-100);
}

.card-title {
    border-left: 3px solid var(--accent);
    padding-left: 0.6rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--elev-2);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(16,29,66,0.08), 0 14px 32px rgba(16,29,66,0.10);
}

/* alternar el acento: tarjetas pares en azul marino, para variedad visual de marca */
.stats-grid .stat-card:nth-child(even) {
    border-left-color: var(--navy-800);
}

.stat-card-wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .stat-card-wide {
        grid-column: span 1;
    }
}

.stat-icon {
    font-size: 2rem;
    filter: grayscale(0.5);
    opacity: 0.85;
}

.stat-icon-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.9;
}

.stat-content h3 {
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.15rem;
}

.stat-content p {
    color: var(--gray-700);
    font-size: 0.8125rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    gap: var(--space-2);
}

.btn:hover {
    filter: brightness(1.08);
}

.btn:active {
    filter: brightness(0.96);
}

.btn:disabled,
.btn.btn-loading {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn-primary {
    background: var(--navy-800);
    color: white;
}

.btn-primary:hover {
    background: var(--navy-900);
}

.btn-secondary {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-100);
    color: var(--ink);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #176e4b;
}

.btn-danger,
.btn-error {
    background: var(--danger);
    color: white;
}

.btn-danger:hover,
.btn-error:hover {
    background: #96271d;
}

.btn-info {
    background: var(--navy-700);
    color: white;
}

.btn-info:hover {
    background: var(--navy-800);
}

/* Único lugar pensado para el naranja de marca como color dominante:
   la acción principal de una pantalla (ej. "Guardar" en un formulario
   crítico). Usar con moderación — no reemplaza a btn-primary. */
.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-control,
.input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--foreground);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control::placeholder,
.input::placeholder {
    color: var(--gray-500);
}

.form-control option {
    background: #ffffff;
    color: var(--ink);
}

.form-control:focus,
.input:focus {
    outline: none;
    border-color: var(--navy-800);
    box-shadow: 0 0 0 3px rgba(22, 35, 63, 0.12);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--gray-700);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--gray-100);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Badges — texto sólido y oscuro sobre fondo suave, legible en fondo claro */
.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.badge-primary {
    background: var(--gray-100);
    color: var(--navy-900);
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-danger,
.badge-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-info {
    background: var(--gray-100);
    color: var(--navy-800);
}

/* Alerts — planas, con barra de color a la izquierda en vez de vidrio */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.35rem;
    margin-bottom: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--gray-400);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-success {
    background: var(--success-soft);
    color: #145c40;
    border-color: var(--success-soft);
    border-left-color: var(--success);
}

.alert-error {
    background: var(--danger-soft);
    color: #7c281f;
    border-color: var(--danger-soft);
    border-left-color: var(--danger);
}

.alert-warning {
    background: var(--warning-soft);
    color: #7a4e0b;
    border-color: var(--warning-soft);
    border-left-color: var(--warning);
}

.alert-info {
    background: var(--gray-100);
    color: var(--navy-900);
    border-color: var(--gray-100);
    border-left-color: var(--navy-800);
}

.alert-floating {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    min-width: 300px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
}

.alert-floating.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active,
.modal.show {
    display: flex;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: var(--foreground);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.glass {
    background: rgba(255, 255, 255, 0.05); /* Extra translucency if needed */
}

.modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
}

/* Vertical layout in modals — sin !important */
.modal-content .form-row {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.modal-content .form-row .form-group {
    width: 100%;
}

.modal-content form {
    display: flex;
    flex-direction: column;
}

.modal-content form>* {
    width: 100%;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.filters .form-control {
    flex: 1;
}

/* Premium Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../images/login_bg.png') center/cover no-repeat;
    position: relative;
    padding: 1rem;
}

/* Dark overlay for contrast */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
    z-index: 1;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 1.5rem;
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    color: #1e293b;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header .logo img {
    max-width: 110px;
    height: auto;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.login-header .logo img:hover {
    transform: scale(1.05);
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-header p {
    color: #475569;
    font-size: 0.95rem;
}

.login-form {
    margin-bottom: 2rem;
}

.login-form .form-group label {
    color: #475569;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Premium Inputs */
.login-form .form-control {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(26, 43, 92, 0.25);
    color: #0f172a;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form .form-control::placeholder {
    color: rgba(30, 41, 59, 0.4);
}

.login-form .form-control:focus {
    background: #ffffff;
    border-color: rgba(26, 43, 92, 0.8);
    box-shadow: 0 0 0 4px rgba(26, 43, 92, 0.2);
    outline: none;
}

/* Premium Select Custom Styling */
.login-form select.form-control option {
    background: #ffffff;
    color: #0f172a;
}

/* Custom Alert inside login card */
.login-card .alert-error {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
}

/* Nota: el botón real de login.php usa .btn-premium (definido inline en
   login.php), no .btn-primary — este bloque quedó huérfano del diseño
   anterior a la identidad navy/gris/naranja (v2, 2026-08-14) y se retiró
   el 2026-08-15 porque contradecía la paleta documentada arriba. */

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.login-footer strong {
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-100% - 2rem));
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .mobile-header {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .page-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

/* ─── Overlay sidebar (móvil) ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    cursor: pointer;
}

.sidebar-overlay.active {
    display: block;
}

/* ─── Estado de carga en botones ─── */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.55s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Tabs (reutilizables en todo el sistema) ─── */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ─── Amenity Cards ─── */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.amenity-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--glass-shadow);
}

.amenity-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.amenity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(26, 43, 92, 0.2) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.amenity-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff !important;
    letter-spacing: -0.01em;
}

.amenity-header .badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
}

.amenity-body {
    padding: 1.5rem;
    flex: 1;
}

.amenity-body p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.amenity-body p strong {
    color: #ffffff;
    font-weight: 600;
    min-width: 90px;
}

.amenity-body p:last-child {
    margin-bottom: 0;
}

.amenity-actions {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.amenity-actions .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 15px rgba(26, 43, 92, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.amenity-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2a3d78 0%, #2a3d78 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 43, 92, 0.4);
}

/* ─── Privadas Grid ─── */
.privadas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.privada-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.privada-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.privada-card-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.privada-card-body {
    padding: 1.25rem;
}

.privada-card-body p {
    font-size: 0.875rem;
    color: var(--secondary);
    margin-bottom: 0.35rem;
}

.privada-card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--secondary);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* ─── Dashboard widgets grid ─── */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ─── Notification item (dashboard) ─── */
.notif-item {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary);
    margin-bottom: 0.75rem;
}

.notif-item:last-child {
    margin-bottom: 0;
}

.notif-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.notif-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
}

.notif-item-time {
    font-size: 0.75rem;
    color: var(--secondary);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.notif-item-body {
    font-size: 0.8125rem;
    color: #4b5563;
    margin: 0;
}

/* ─── Report item (dashboard) ─── */
.report-item {
    padding: 0.75rem;
    background: #fef3c7;
    border-radius: 0.5rem;
    border-left: 3px solid var(--warning);
    margin-bottom: 0.75rem;
}

.report-item:last-child {
    margin-bottom: 0;
}

/* ─── Responsive adicional ─── */
@media (max-width: 768px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }

    .amenities-grid {
        grid-template-columns: 1fr;
    }

    .privadas-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}
/* ─── Amenities Specific Styles (Adapted to Glassmorphism) ─── */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--glass-border);
}

.tab-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(26, 43, 92, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Day Pills */
.day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.day-pill:hover {
    border-color: var(--primary);
    background: rgba(26, 43, 92, 0.1);
}

.day-pill input[type="checkbox"] {
    display: none;
}

.day-pill:has(input[type="checkbox"]:checked) {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(26, 43, 92, 0.3);
}

.day-pill:has(input[type="checkbox"]:checked) span {
    color: white !important;
}

/* ─── Calendar Glassmorphism ─── */
#calendar-container, .admin-global-calendar {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 1.25rem;
    padding: 1.75rem;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.calendar-header h4, .admin-global-calendar h3 {
    margin: 0;
    color: white !important;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.btn-calendar-nav {
    background: rgba(26, 43, 92, 0.2);
    color: white;
    border: 1px solid rgba(26, 43, 92, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(26, 43, 92, 0.3);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-calendar-nav:hover {
    background: rgba(26, 43, 92, 0.5);
    border-color: rgba(26, 43, 92, 0.8);
    transform: scale(1.12);
    box-shadow: 0 8px 28px rgba(26, 43, 92, 0.5);
}

.btn-calendar-nav:active {
    transform: scale(0.95);
}

/* Scroll wrapper layout */
.calendar-admin-scroll-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.calendar-day.empty {
    cursor: default;
    background: transparent;
}

.calendar-day.available {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.15);
}

.calendar-day.available:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px) scale(1.05);
}

.calendar-day.occupied {
    background: rgba(244, 63, 94, 0.08); /* Ruby Pink */
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.15);
    cursor: not-allowed;
}

.calendar-day.occupied:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: #f43f5e;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
}

.calendar-day.unavailable {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.calendar-day.selected, .calendar-day.range-start, .calendar-day.range-end {
    background: linear-gradient(135deg, var(--primary) 0%, var(--navy-700) 100%) !important; /* Neon Purple to Electric Blue */
    color: white !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 25px rgba(26, 43, 92, 0.5);
    transform: scale(1.08);
    z-index: 2;
}

.calendar-day.in-range {
    background: rgba(26, 43, 92, 0.2) !important;
    color: white !important;
    position: relative;
}

.calendar-day.in-range::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.calendar-day.today {
    border: 2px solid #fbbf24 !important; /* Amber/Gold */
    color: #fbbf24 !important;
    animation: gold-pulse 2s infinite;
}

@keyframes gold-pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

.calendar-day.past {
    background: transparent;
    color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

.calendar-day.today {
    border: 2px solid #fbbf24 !important;
}

/* Tooltip & Modals (Amenities) */
.calendar-tooltip {
    display: none;
    position: absolute;
    z-index: 3000;
    pointer-events: none;
    padding: 1rem;
    border-radius: 1rem;
    width: 250px;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: white !important;
}

.calendar-tooltip.show {
    display: block;
}

.reservations-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.reservations-detail-modal.show {
    display: flex;
}

.reservations-detail-content {
    width: 90%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: white !important;
    border-radius: 1.5rem;
    padding: 2rem;
}

.tooltip-header, .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--primary) !important;
}

.detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.btn-close-detail {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.btn-close-detail:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.reservation-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border-left: 4px solid var(--primary) !important;
    color: white !important;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

.reservation-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reservation-info span {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.875rem;
}

/* Scrollbar Hiding */
#adminMonthsContainer::-webkit-scrollbar {
    display: none;
}

/* Support classes for Amenities cleanup */
.coto-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
}

.calendar-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-admin-header h3 {
    margin: 0;
    color: white;
}

.months-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.btn-calendar-nav.right {
    right: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.legend-color.occupied {
    width: 15px;
    height: 15px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    border-radius: 3px;
    display: inline-block;
}

/* Interactive Table Rows */
.clickable-row {
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.clickable-row:hover {
    background: rgba(26, 43, 92, 0.15) !important;
    transform: scale(1.002);
    box-shadow: inset 4px 0 0 var(--primary);
}

/* ─── Mensualidades & Confirmation Modals (Glassmorphism) ─── */
.confirm-details-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
}

.confirm-details-box .label {
    margin: 0.5rem 0 0.25rem 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.confirm-details-box .value {
    margin: 0;
    font-weight: 600;
    color: white;
    font-size: 1rem;
}

.confirm-details-box .value.highlight {
    color: var(--primary);
}

.confirm-summary-box {
    background: rgba(26, 43, 92, 0.05);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(26, 43, 92, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.label-large { font-size: 1rem; font-weight: 500; color: rgba(255, 255, 255, 0.7); }
.value-large { font-size: 1.25rem; font-weight: 700; color: white; }
.label-xl { font-size: 1.125rem; font-weight: 600; color: white; }
.value-xl { font-size: 1.75rem; font-weight: 800; color: var(--primary); text-shadow: 0 0 20px rgba(26, 43, 92, 0.3); }

/* Summary Grid for Modals */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
}

.summary-item .label {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.summary-item .value {
    margin: 0.5rem 0 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.summary-item .sub-value {
    margin: 0.25rem 0 0 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
}

.summary-item.success { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.05); }
.summary-item.success .value { color: #10b981; }
.summary-item.warning { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.05); }
.summary-item.warning .value { color: #f59e0b; }
.summary-item.info { border-color: rgba(26, 43, 92, 0.3); background: rgba(26, 43, 92, 0.05); }
.summary-item.info .value { color: #2a3d78; }

/* Utility Classes for Glassmorphism */
.text-success { color: #34d399 !important; }
.text-warning-light { color: #fbbf24 !important; }
.text-center { text-align: center !important; }
.empty-cell { padding: 2.5rem !important; color: rgba(255, 255, 255, 0.4) !important; font-style: italic; }

/* Readonly Inputs in Glassmorphism */
.form-control[readonly] {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Modal Inner Utilities */
.accent-text-bold {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
}

.highlight-bg {
    background: rgba(26, 43, 92, 0.05) !important;
    border-color: rgba(26, 43, 92, 0.2) !important;
}

.text-muted-light {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.75rem !important;
    display: block !important;
    margin-top: 5px !important;
}

/* Modal Form Adjustments */
.modal-content .form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-content .form-control:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 43, 92, 0.1);
}

.modal-content select.form-control option {
    background: #1a1a1a; /* Needed for readability in some browsers */
    color: white;
}

/* ─── Notification Cards (Glassmorphism) ─── */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.notification-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-left: 6px solid var(--primary);
}

.notification-card.unread {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(26, 43, 92, 0.1);
}

.notification-card.read {
    opacity: 0.8;
    border-left-color: rgba(255, 255, 255, 0.2);
}

.notification-card:hover {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.07);
    border-left-width: 8px;
}

.notification-icon {
    font-size: 1.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-info .notification-icon { background: rgba(26, 43, 92, 0.1); border-color: rgba(26, 43, 92, 0.2); }
.notification-success .notification-icon { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
.notification-warning .notification-icon { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
.notification-error .notification-icon { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }

.notification-content {
    flex: 1;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.notification-header h3 {
    margin: 0;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.notification-date {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
    font-weight: 500;
}

.notification-message {
    color: rgba(255, 255, 255, 0.8);
    margin: 0.5rem 0 1rem 0;
    line-height: 1.7;
    font-size: 1rem;
}

.notification-recipient {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

/* Approval badge inside notifications */
.approval-badge {
    color: #34d399;
    font-weight: 700;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
}
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
/* ============================================================
   Módulo Telefonía (Grandstream) y Cámaras — alineado al sistema
   de diseño v2 (gris/negro/azul marino, naranja como acento
   puntual). Superficie plana, sin blur ni gradientes de color.
   ============================================================ */
.tel-hero {
    background: var(--primary);
    border: 1px solid var(--primary-dark);
    border-radius: 0.75rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.tel-hero h1 { display: flex; align-items: center; gap: 0.6rem; color: #fff; }
.tel-hero p { color: var(--gray-300); }

.tel-badge-privada {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.tel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.tel-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--surface-shadow);
    color: var(--ink);
}

.tel-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--ink);
    font-size: 1.05rem;
}

.tel-card .tel-desc {
    color: var(--gray-700);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.tel-card label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
    margin-top: 0.85rem;
}

.tel-card input,
.tel-card select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-300);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.875rem;
}

.tel-card input:focus,
.tel-card select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 35, 63, 0.12);
}

.tel-row { display: flex; gap: 0.75rem; }
.tel-row > div { flex: 1; }

.tel-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    font-size: 0.8125rem;
    color: var(--gray-700);
}
.tel-checkbox input { width: auto; }

/* Botón con halo/glow al hacer click — efecto conservado, recoloreado a la paleta */
.tel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
}

.tel-btn:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
}

/* Micro-interacción de presionado (independiente del color del halo) */
.tel-btn:active,
.btn:active {
    transform: translateY(1px);
    transition: transform 0.1s ease;
}

/* ============================================================
   Halo azul de interacción (2026-08-15)
   Sustituye al halo naranja/rojo instantáneo anterior (solo
   :active, sin animación real). Ahora es un único halo azul,
   animado, disparado tanto por click/tap como por teclado
   (Enter/Espacio) vía JS delegado en includes/footer.php, más un
   anillo de foco persistente para navegación por Tab. El color de
   fondo de cada botón (.btn-danger, .btn-success, etc.) sigue
   marcando qué tan crítica es la acción — este halo es solo
   feedback de "se registró tu interacción", no un semáforo de
   severidad.
   ============================================================ */
:root {
    --halo-blue: 26, 43, 92; /* rgb, para reusar en rgba() con distintas alfas */
}

.click-halo {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%) scale(0.3);
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(var(--halo-blue), 0.6) 0%,
        rgba(var(--halo-blue), 0.28) 45%,
        rgba(var(--halo-blue), 0) 72%);
    pointer-events: none;
    z-index: 9999;
    animation: musaHaloPulse 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes musaHaloPulse {
    0%   { opacity: 0.95; transform: translate(-50%, -50%) scale(0.25); }
    55%  { opacity: 0.6; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .click-halo { animation-duration: 0.01s; }
}

/* Anillo de foco azul persistente al navegar con teclado (Tab) */
.btn:focus-visible,
.tel-btn:focus-visible,
.nav-item:focus-visible,
.btn-calendar-nav:focus-visible,
.menu-toggle:focus-visible,
.logout-btn:focus-visible,
.btn-premium:focus-visible,
a.user-action-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--halo-blue), 0.4), 0 0 14px 2px rgba(var(--halo-blue), 0.35);
}

.tel-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.tel-btn.tel-btn-danger {
    background: var(--danger);
}

.tel-btn.tel-btn-danger:hover {
    background: var(--danger-dark, #922f26);
}

.tel-btn.tel-btn-outline {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--gray-300);
    box-shadow: none;
}

.tel-result {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    font-size: 0.8125rem;
    font-family: 'SF Mono', Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.tel-result.show { display: block; }
.tel-result.ok { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #065f46; }
.tel-result.err { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #991b1b; }

input[type=number] {
  -moz-appearance: textfield;
}

/* Sobrescribir estilos en línea violetas (#9333ea, #7c3aed, #7e22ce) en el DOM */
[style*="color: #9333ea"], [style*="color:#9333ea"],
[style*="color: #7c3aed"], [style*="color:#7c3aed"],
[style*="color: #7e22ce"], [style*="color:#7e22ce"] {
    color: var(--primary) !important;
}

[style*="background: #9333ea"], [style*="background:#9333ea"],
[style*="background: #7c3aed"], [style*="background:#7c3aed"],
[style*="background: #7e22ce"], [style*="background:#7e22ce"],
[style*="background-color: #9333ea"], [style*="background-color:#9333ea"],
[style*="background-color: #7c3aed"], [style*="background-color:#7c3aed"],
[style*="background: linear-gradient(135deg, #9333ea"],
[style*="background: linear-gradient(135deg,  #9333ea"] {
    background: var(--primary) !important;
}

[style*="border-color: #9333ea"], [style*="border-color:#9333ea"],
[style*="border-color: #7c3aed"], [style*="border-color:#7c3aed"],
[style*="border-left: 3px solid #9333ea"], [style*="border-left:3px solid #9333ea"],
[style*="border-left: 4px solid #9333ea"], [style*="border-left:4px solid #9333ea"],
[style*="border-bottom: 3px solid #9333ea"], [style*="border-bottom:3px solid #9333ea"],
[style*="border-bottom: 2px solid #9333ea"], [style*="border-bottom:2px solid #9333ea"],
[style*="border-bottom-color: #9333ea"], [style*="border-bottom-color:#9333ea"] {
    border-color: var(--primary) !important;
}

[style*="accent-color:#9333ea"], [style*="accent-color: #9333ea"] {
    accent-color: var(--primary) !important;
}


/* Icono de imagen junto al título de una tarjeta (reemplaza los emojis).
   Uso: <h2 class="card-title"><img src="assets/images/iconos-menu/X.png" class="card-title-ico"> Texto</h2> */
.card-title-ico {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: .45rem;
    margin-top: -2px;
}

/* Graficas de 12 meses del dashboard: Chart.js con maintainAspectRatio:false necesita un contenedor con altura. */
.grafica-12m-caja { padding: 1rem 1.25rem 1.25rem; }
.grafica-12m { position: relative; height: 280px; }
@media (max-width: 768px) {
    .grafica-12m-caja { padding: 0.5rem 0.25rem 0.75rem; }
    .grafica-12m { height: 240px; }
}
/* Encabezado de tarjeta: si el boton no cabe junto al titulo (celular), baja a otro renglon en vez de encimarse. */
.card-header { flex-wrap: wrap; gap: 0.5rem; }
/* Tablas anchas dentro de tarjetas: se deslizan de lado en el celular en vez de ensanchar toda la pagina. */
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
