/* ============================================================
   ESTILOS CORPORATIVOS - SISTEMA AMADEUS (SOPORTE MULTI-TEMA)
   ============================================================ */
:root, [data-theme="amadeus-classic"] {
    --primary-900: #0a1628;
    --primary-800: #0f2040;
    --primary-700: #1a2d5a;
    --primary-600: #1e3d7a;
    --primary-500: #2a5099;
    --primary-400: #3a6ab8;
    --primary-300: #5a8ad4;
    --primary-100: #b8d5f2;
    --primary-50:  #e8f0fa;

    --gold-500: #d4a84a;
    --gold-400: #e0bc6a;
    --gold-300: #ecd48a;

    /* Color Adaptativo para Texto en Botones Destacados */
    --btn-accent-color: #0a1628;
    --btn-primary-color: #ffffff;

    --gray-50:  #f7f9fc;
    --gray-100: #eef2f7;
    --gray-200: #dce3ec;
    --gray-300: #c0cbd8;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --success: #2a8a5a;
    --warning: #d4a44a;
    --danger:  #c4604a;
    --info:    #3a7a9a;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow:    0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 8px 16px -4px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 16px 32px -8px rgb(0 0 0 / 0.12);
    --shadow-xl: 0 24px 48px -12px rgb(0 0 0 / 0.16);

    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tema 2: Emerald Slate (Verde Esmeralda & Texto Blanco Nítido) */
[data-theme="emerald-slate"] {
    --primary-900: #064e3b;
    --primary-800: #065f46;
    --primary-700: #047857;
    --primary-600: #059669;
    --primary-500: #10b981;
    --primary-400: #34d399;
    --primary-300: #6ee7b7;
    --primary-100: #d1fae5;
    --primary-50:  #ecfdf5;

    --gold-500: #059669;
    --gold-400: #10b981;
    --gold-300: #34d399;

    --btn-accent-color: #ffffff;
    --btn-primary-color: #ffffff;
}

/* Tema 3: Midnight Purple (Violeta & Cian) */
[data-theme="midnight-purple"] {
    --primary-900: #2e1065;
    --primary-800: #3b0764;
    --primary-700: #581c87;
    --primary-600: #6b21a8;
    --primary-500: #7e22ce;
    --primary-400: #a855f7;
    --primary-300: #c084fc;
    --primary-100: #f3e8ff;
    --primary-50:  #faf5ff;

    --gold-500: #06b6d4;
    --gold-400: #22d3ee;
    --gold-300: #67e8f9;

    --btn-accent-color: #0f172a;
    --btn-primary-color: #ffffff;
}

/* Tema 4: Light Corporate (Blanco Minimalista & Texto Blanco Nítido en Botón Azul) */
[data-theme="light-corporate"] {
    --primary-900: #1e293b;
    --primary-800: #334155;
    --primary-700: #475569;
    --primary-600: #2563eb;
    --primary-500: #3b82f6;
    --primary-400: #60a5fa;
    --primary-300: #93c5fd;
    --primary-100: #dbeafe;
    --primary-50:  #eff6ff;

    --gold-500: #2563eb;
    --gold-400: #3b82f6;
    --gold-300: #60a5fa;

    --btn-accent-color: #ffffff;
    --btn-primary-color: #ffffff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    transition: var(--transition);
}

#app {
    width: 100%;
    max-width: 1440px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 92vh;
    position: relative;
}

/* ============================================================
   GRID CALENDARIO DE EVENTOS Y RESERVAS (ESTILOS PASTEL Y FINES DE SEMANA)
   ============================================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 14px;
}

/* Títulos de los días (Lun-Vie pastel azul lavanda) */
.calendar-day-header {
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: #3730a3 !important;
    padding: 10px 0 !important;
    background: #e0e7ff !important;
    border: 1.5px solid #c7d2fe !important;
    border-radius: var(--radius) !important;
}

/* Títulos de los Fines de Semana (Sáb-Dom pastel rosa melocotón) */
.calendar-day-header.weekend {
    background: #ffe4e6 !important;
    color: #9f1239 !important;
    border: 1.5px solid #fecdd3 !important;
}

.calendar-day-cell {
    min-height: 100px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}
.calendar-day-cell:hover {
    border-color: var(--gold-400);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Celdas de Fines de Semana (Fondo suave pastel salmón/durazno) */
.calendar-day-cell.weekend {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
}
.calendar-day-cell.weekend .calendar-day-num {
    color: #9a3412 !important;
}

.calendar-day-cell.other-month { background: var(--gray-50); opacity: 0.5; cursor: default; }
.calendar-day-cell.other-month.weekend { background: #fef2f2 !important; opacity: 0.55; }
.calendar-day-cell.today { border: 2.5px solid var(--gold-500) !important; background: #e0f2fe !important; }

.calendar-day-num { font-weight: 700; font-size: 13px; color: var(--gray-800); display: flex; justify-content: space-between; align-items: center; }
.calendar-day-num .add-btn-hint { font-size: 10px; color: var(--gold-600); opacity: 0; transition: var(--transition); }
.calendar-day-cell:hover .add-btn-hint { opacity: 1; }

/* Pastillas de Eventos Multicolores para Diferenciar Reuniones */
.event-pill {
    font-size: 10px; padding: 3px 6px; border-radius: 4px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Colores Dinámicos Pastel para Múltiples Reuniones */
.event-pill.meeting-color-1 { background: #dbeafe; color: #1e40af; border-left: 3px solid #2563eb; } /* Azul */
.event-pill.meeting-color-2 { background: #e0e7ff; color: #3730a3; border-left: 3px solid #4f46e5; } /* Índigo */
.event-pill.meeting-color-3 { background: #d1fae5; color: #065f46; border-left: 3px solid #059669; } /* Esmeralda */
.event-pill.meeting-color-4 { background: #fef3c7; color: #92400e; border-left: 3px solid #d97706; } /* Ámbar */
.event-pill.meeting-color-5 { background: #fae8ff; color: #86198f; border-left: 3px solid #c026d3; } /* Púrpura */

.event-pill.birthday { background: #fce7f3; color: #9d174d; border-left: 3px solid #ec4899; }

.badge-meeting { background: var(--primary-100); color: var(--primary-800); }
.badge-birthday { background: #fce7f3; color: #9d174d; }

/* Selector tipo de evento en modal */
.event-type-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid var(--gray-200); padding-bottom: 8px; }
.event-type-btn { padding: 8px 16px; border-radius: var(--radius); border: none; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--gray-100); color: var(--gray-600); transition: var(--transition); }
.event-type-btn.active { background: var(--primary-500); color: white; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92vh;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 40%, var(--primary-500) 100%);
    position: relative;
    overflow: hidden;
}

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

.login-brand {
    text-align: center;
    margin-bottom: 32px;
    color: white;
}

.login-brand .logo-icon {
    font-size: 40px;
    background: rgba(255, 255, 255, 0.08);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold-400);
    color: var(--gold-400);
}

.login-brand h1 {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.login-brand h1 span { color: var(--gold-400); }

.login-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.login-card .field { margin-bottom: 18px; }
.login-card label { display: block; color: rgba(255, 255, 255, 0.7); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.login-card input {
    width: 100%; padding: 14px 18px; border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius); background: rgba(255, 255, 255, 0.06);
    color: white; font-size: 15px; transition: var(--transition); outline: none;
}
.login-card input:focus { border-color: var(--gold-400); background: rgba(255, 255, 255, 0.12); }

.btn-login {
    width: 100%; padding: 14px; border: none; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--btn-accent-color); font-size: 16px; font-weight: 700; cursor: pointer;
    transition: var(--transition); margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }

.login-error { color: #fca5a5; font-size: 14px; text-align: center; margin-top: 14px; min-height: 24px; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.panel { display: none; animation: fadeSlideIn 0.4s ease; }
.panel.active { display: block; }

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

.admin-layout { display: flex; flex-direction: column; min-height: 92vh; }
.admin-header {
    background: var(--primary-900); color: white; padding: 14px 28px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
    border-bottom: 2px solid var(--gold-500);
}
.admin-header .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; }
.admin-header .brand i { color: var(--gold-400); font-size: 26px; }
.admin-header .brand .name span { color: var(--gold-400); }

.widget-clock-cal {
    display: flex; align-items: center; gap: 16px; background: rgba(255, 255, 255, 0.07);
    padding: 6px 16px; border-radius: 40px; border: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px;
}
.widget-clock-cal i { color: var(--gold-400); }

.admin-body { display: flex; flex: 1; background: var(--gray-50); }
.admin-sidebar { width: 240px; background: white; border-right: 1px solid var(--gray-200); padding: 20px 0; flex-shrink: 0; }
.admin-sidebar .menu-item {
    padding: 12px 22px; display: flex; align-items: center; gap: 14px; color: var(--gray-600);
    cursor: pointer; transition: var(--transition); border-left: 3px solid transparent;
    font-weight: 500; font-size: 14px; margin: 3px 10px; border-radius: var(--radius);
}
.admin-sidebar .menu-item:hover { background: var(--gray-100); color: var(--gray-800); }
.admin-sidebar .menu-item.active { background: var(--primary-50); color: var(--primary-600); border-left-color: var(--gold-500); }
.admin-sidebar .menu-item.active i { color: var(--gold-500); }

.admin-content { flex: 1; padding: 28px 32px; overflow-y: auto; max-height: calc(92vh - 72px); }
.admin-content .seccion { display: none; animation: fadeSlideIn 0.3s ease; }
.admin-content .seccion.active { display: block; }

/* Selector de Temas Visuales */
.theme-card {
    border: 2px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px; cursor: pointer;
    transition: var(--transition); text-align: center; background: white;
}
.theme-card:hover { border-color: var(--gold-400); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-card.active { border-color: var(--gold-500); background: var(--primary-50); }
.theme-preview-colors { display: flex; height: 28px; border-radius: 8px; overflow: hidden; margin-top: 10px; border: 1px solid rgba(0,0,0,0.1); }
.theme-preview-colors div { flex: 1; }

/* Componentes UI */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.page-header h2 i { color: var(--gold-500); margin-right: 10px; }

.card {
    background: white; border-radius: var(--radius-lg); padding: 24px 28px;
    box-shadow: var(--shadow); border: 1px solid var(--gray-200); margin-bottom: 24px; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.card-header .card-title { font-weight: 600; font-size: 16px; color: var(--gray-800); display: flex; align-items: center; gap: 10px; }
.card-header .card-title i { color: var(--gold-500); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* Botones con Contraste y Tipografía Adaptativa */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
    border: none; border-radius: var(--radius); font-weight: 500; font-size: 14px;
    cursor: pointer; transition: var(--transition); text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--primary-500); color: var(--btn-primary-color); }
.btn-primary:hover { background: var(--primary-600); transform: translateY(-1px); }

.btn-accent { background: var(--gold-500); color: var(--btn-accent-color); font-weight: 700; }
.btn-accent:hover { background: var(--gold-400); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.btn-outline { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-900); }
.btn-success { background: var(--success); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 8px; }

/* Formularios y Tablas */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }
.form-control {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    font-size: 14px; transition: var(--transition); background: white; outline: none; color: var(--gray-800);
}
.form-control:focus { border-color: var(--gold-400); box-shadow: 0 0 0 4px rgba(212, 168, 74, 0.08); }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--gray-200); color: var(--gray-600); font-weight: 600; font-size: 11px; text-transform: uppercase; }
td { padding: 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:hover td { background: var(--gray-50); }

.badge { display: inline-block; padding: 3px 12px; border-radius: 40px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e4a7a; }
.badge-danger  { background: #fde8e8; color: #991b1b; }

.stat-card {
    background: white; border-radius: var(--radius-lg); padding: 18px 22px;
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card .stat-label { font-size: 12px; color: var(--gray-500); font-weight: 500; text-transform: uppercase; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); margin-top: 2px; }
.stat-card .stat-icon { position: absolute; right: 18px; top: 18px; font-size: 28px; color: var(--gold-300); opacity: 0.5; }

/* ============================================================
   VISTA MENSAJERO (MOBILE-FIRST)
   ============================================================ */
.messenger-layout { background: var(--gray-50); min-height: 92vh; max-width: 480px; margin: 0 auto; padding: 16px 14px; }
.messenger-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
    background: white; padding: 12px 16px; border-radius: var(--radius-xl); box-shadow: var(--shadow); border: 1px solid var(--gray-200);
}
.messenger-header .user-info { display: flex; align-items: center; gap: 10px; }
.messenger-header .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-500); color: var(--btn-accent-color); display: flex; align-items: center; justify-content: center; font-weight: 700; }

.diligencia-card-mobile {
    background: white; border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px;
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
}
.diligencia-card-mobile .dil-asunto { font-weight: 600; font-size: 15px; color: var(--gray-800); }
.diligencia-card-mobile .actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--gray-100); }

.firma-canvas { border: 2px dashed var(--gray-300); border-radius: var(--radius); width: 100%; height: 130px; background: white; touch-action: none; cursor: crosshair; }

/* Modal UI */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); z-index: 9990; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeSlideIn 0.3s ease; }
.modal-card { background: white; border-radius: var(--radius-xl); width: 100%; max-width: 520px; padding: 24px; box-shadow: var(--shadow-xl); position: relative; }

/* Toast Container */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 380px; width: 100%; }
.toast { background: var(--gray-900); color: white; padding: 14px 20px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 14px; display: flex; align-items: center; gap: 12px; border-left: 4px solid var(--gold-400); }
.toast.success { background: #064e3b; border-left-color: var(--success); }
.toast.error   { background: #7f1d1d; border-left-color: var(--danger); }

@media (max-width: 840px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--gray-200); display: flex; overflow-x: auto; padding: 10px; }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .admin-content { max-height: none; padding: 16px; }
}

/* Insignia de Recordatorios en Header */
.badge-reminder-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-900);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Tarjetas y Badges del Planner */
.badge-gold { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-date { background: #e0f2fe; color: #0369a1; }

.planner-card.completed {
    opacity: 0.65;
    background: var(--gray-50) !important;
}

