/* ===========================
   VARIABLES CSS - SISTEMA DE TEMAS
   =========================== */

/* Tema por defecto: Ocean Blue (Pastel) */
:root {
    /* Tamaño de fuente base (reducido de 16px a 13px) */
    --font-size-base: 13px;
    --font-size-xs: 8px;
    --font-size-sm: 10px;
    --font-size-md: 11px;
    --font-size-lg: 12px;
    --font-size-xl: 17px;
    --font-size-2xl: 19px;
    --font-size-3xl: 21px;

    /* Colores de Sidebar - Más grisáceo (desaturado 15%) */
    --sidebar-bg-start: #2c5470;
    --sidebar-bg-end: #3e617a;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: #a8bcd0;
    --sidebar-border: #1a3a50;
    --sidebar-heading: #85a8c2;
    --sidebar-hover: rgba(130, 180, 217, 0.22);
    --sidebar-active: #719aba;

    /* Colores del Header Principal - Más grisáceo */
    --header-bg-start: #3e617a;
    --header-bg-end: #2c5470;
    --header-text: #ffffff;

    /* Colores del Chat - Más grisáceo */
    --chat-bg: #f5f7fa;
    --message-user-bg-start: #3e617a;
    --message-user-bg-end: #2c5470;
    --message-user-text: #ffffff;
    --message-assistant-bg: #ffffff;
    --message-assistant-text: #2d3748;
    --message-assistant-border: #e2e8f0;
    --message-system-bg: #fef9e7;
    --message-system-text: #8a6b1d;
    --message-system-border: #f9e79f;
    --message-thinking-bg: #f0f3f7;
    --message-thinking-border: #d5dce5;

    /* Botones y Acciones - Más grisáceo */
    --btn-primary-bg-start: #3e617a;
    --btn-primary-bg-end: #2c5470;
    --btn-danger-bg: #b96060;
    --btn-danger-hover: #a94848;
    --btn-edit: #3e617a;
    --btn-delete: #b96060;
    --btn-view: #719aba;
    --btn-confirm: #5e9877;
    --btn-complete: #4d8d5a;
    --btn-logout-bg: #47708c;
    --btn-logout-hover: #3e617a;

    /* Status Badges - Pastel Moderado */
    --status-active-bg: #e8f5e9;
    --status-active-text: #388e3c;
    --status-inactive-bg: #fce4ec;
    --status-inactive-text: #c62828;
    --status-draft: #a8b5c0;
    --status-sent: #89b5d0;
    --status-paid: #a8d5ba;
    --status-cancelled: #e8a5a0;
    --status-pending: #f5c89a;
    --status-confirmed: #89b5d0;
    --status-completed: #a8d5ba;
    --status-no-show: #b5c0ca;

    /* Toasts y Notificaciones - Pastel Moderado */
    --toast-success: #66bb6a;
    --toast-error: #d98080;
    --toast-warning: #e0a855;
    --toast-info: #5c89a8;

    /* Modales de Confirmación - Pastel Moderado */
    --modal-warning-bg: #fef9e7;
    --modal-warning-text: #8a6d1f;
    --modal-danger-bg: #fce4ec;
    --modal-danger-text: #9a3838;
    --modal-info-bg: #e3f2fd;
    --modal-info-text: #1e5a7d;

    /* Debug Panel - Pastel Moderado */
    --debug-bg: #2d2d2d;
    --debug-text: #d4d4d4;
    --debug-bg-secondary: #3a3a3a;
    --debug-accent: #66bb6a;
    --debug-border: #4a4a4a;
    --debug-code-bg: #1a1a1a;
    --debug-hover-bg: #484848;
    --debug-tag: #5c89a8;
    --debug-tag-light: #82b4d9;
    --debug-error: #d98080;

    /* Colores del Calendario - Pastel Moderado */
    --calendar-header-bg: #f5f7fa;
    --calendar-header-accent: #5c89a8;
    --calendar-border: #e2e8f0;
    --calendar-text: #2d3748;
    --calendar-text-secondary: #4a5568;
    --calendar-text-muted: #718096;
    --calendar-event-bg: #6ca5d2;
    --calendar-event-text: #ffffff;
    --calendar-event-border: #5c89a8;
    --calendar-event-hover: #82b4d9;
    --calendar-event-readonly: #a8b8c8;
    --calendar-event-readonly-border: #8a95a0;
    --calendar-event-readonly-hover: #9aa8b8;

    /* Colores generales - Pastel Moderado */
    --bg-main: #ffffff;
    --bg-secondary: #f5f7fa;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --border-color: #e8edf2;
    --shadow-color: rgba(0, 0, 0, 0.04);
    /* Sombras más sutiles */
    --success-color: #5fa573;
    --error-color: #d98080;

    /* Espaciados minimalistas */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;

    /* Radios de borde minimalistas */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Aliases para compatibilidad con chat sidebar */
    --accent: #5c89a8;
    --accent-hover: #4a7a9e;
    --border: #e2e8f0;
    --bg-primary: #ffffff;
    --bg-hover: rgba(92, 137, 168, 0.1);
    --bg-card: #ffffff;
}

/* TEMA: Classic Dark (púrpura más grisáceo) */
body.theme-classic-dark {
    --sidebar-bg-start: #463952;
    --sidebar-bg-end: #554861;
    --sidebar-text: #ffffff;
    --sidebar-heading: #958ba8;
    --sidebar-hover: rgba(157, 143, 184, 0.22);
    --sidebar-active: #837893;

    --header-bg-start: #554861;
    --header-bg-end: #463952;
    --header-text: #ffffff;

    --message-user-bg-start: #554861;
    --message-user-bg-end: #463952;
    --message-user-text: #ffffff;

    --btn-primary-bg-start: #554861;
    --btn-primary-bg-end: #463952;
    --btn-edit: #837893;

    --calendar-header-accent: #837893;
    --btn-danger-bg: #b96060;
    --btn-danger-hover: #a94848;

    --accent: #837893;
    --accent-hover: #554861;

    --btn-logout-bg: #61536f;
    --btn-logout-hover: #554861;
}

/* TEMA: Ocean Blue (azules profesionales) */
body.theme-ocean-blue {
    /* Ya es el default en :root, pero se puede customizar aquí si se necesita */
}

/* TEMA: Forest Green (verdes más grisáceos) */
body.theme-forest-green {
    --sidebar-bg-start: #2a5642;
    --sidebar-bg-end: #3a6552;
    --sidebar-text: #ffffff;
    --sidebar-heading: #7da68e;
    --sidebar-hover: rgba(126, 184, 151, 0.22);
    --sidebar-active: #6a9c7e;

    --header-bg-start: #3a6552;
    --header-bg-end: #2a5642;
    --header-text: #ffffff;

    --message-user-bg-start: #3a6552;
    --message-user-bg-end: #2a5642;
    --message-user-text: #ffffff;

    --btn-primary-bg-start: #3a6552;
    --btn-primary-bg-end: #2a5642;

    --calendar-header-accent: #6a9c7e;
    --btn-danger-bg: #b96060;
    --btn-danger-hover: #a94848;

    --accent: #6a9c7e;
    --accent-hover: #3a6552;

    --btn-logout-bg: #42735d;
    --btn-logout-hover: #3a6552;
}

/* TEMA: Sunset Warm (tonos cálidos más grisáceos y oscuros) */
body.theme-sunset-warm {
    --sidebar-bg-start: #634e37;
    --sidebar-bg-end: #715b46;
    --sidebar-text: #ffffff;
    --sidebar-heading: #a68c68;
    --sidebar-hover: rgba(208, 168, 112, 0.22);
    --sidebar-active: #997f5a;

    --header-bg-start: #715b46;
    --header-bg-end: #634e37;
    --header-text: #ffffff;

    --message-user-bg-start: #715b46;
    --message-user-bg-end: #634e37;
    --message-user-text: #ffffff;

    --btn-primary-bg-start: #715b46;
    --btn-primary-bg-end: #634e37;

    --accent: #997f5a;
    --accent-hover: #715b46;

    --calendar-header-accent: #997f5a;
    --btn-danger-bg: #b96060;
    --btn-danger-hover: #a94848;

    --btn-logout-bg: #816950;
    --btn-logout-hover: #715b46;
}

/* ===========================
   RESET Y ESTILOS GLOBALES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    /* Tipografía sistema: SF Pro (macOS) / Segoe UI (Windows) */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-base);
    font-weight: 400;
    letter-spacing: -0.003em;
    /* Tracking ajustado (funciona en todas las plataformas) */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    height: 100%;
    background-color: var(--bg-secondary);
    overflow: hidden;
}

/* Pesos de fuente sistema (funciona en macOS y Windows) */
h1,
h2,
h3 {
    font-weight: 600;
    /* Semibold */
    letter-spacing: -0.015em;
    line-height: 1.2;
}

h4,
h5,
h6 {
    font-weight: 500;
    /* Medium */
    letter-spacing: -0.01em;
    line-height: 1.3;
}

strong,
b {
    font-weight: 600;
}

/* Optimizar legibilidad en Windows */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    body {
        font-weight: 400;
    }
}

/* Suavizar transiciones globales */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hidden {
    display: none !important;
}

/* Clase para main-content sin sidebar de chat */
.main-content-fullwidth {
    grid-template-columns: 1fr !important;
}

/* Grid de estadísticas con espaciado */
.stats-grid-spaced {
    margin-bottom: 30px;
}

/* Estilos de texto reutilizables */
.text-center {
    text-align: center;
}

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

.text-small {
    font-size: 12px;
}

/* Ancho específico para selectores */
.width-120 {
    width: 120px;
}

/* Márgenes y espaciado */
.mt-4 {
    margin-top: 4px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* Opacidad */
.opacity-80 {
    opacity: 0.8;
}

/* Color de texto */
.text-muted {
    color: #666;
}

/* Caja de resultados */
.results-box {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

/* ===========================
   LAYOUT PRINCIPAL
   =========================== */
.container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    flex: 0 0 260px;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--sidebar-border);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 2px solid var(--sidebar-border);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--sidebar-heading);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.user-display {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-display-username {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--sidebar-text);
    margin-bottom: 4px;
}

.user-display-email {
    font-size: var(--font-size-sm);
    color: var(--sidebar-text-muted);
    margin-bottom: 6px;
}

.user-display-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.user-info label {
    font-size: var(--font-size-md);
    color: var(--sidebar-text-muted);
    margin-bottom: 4px;
    display: block;
}

.location-selector {
    width: 100%;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.location-selector:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.location-selector:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.location-selector option {
    background-color: var(--sidebar-bg-start);
    color: var(--sidebar-text);
    padding: 8px;
}

.location-display {
    width: 100%;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: var(--font-size-md);
    font-weight: 500;
}

.logout-button {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--btn-logout-bg) 0%, var(--btn-logout-hover) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.logout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 44, 44, 0.4);
}

.logout-button:active {
    transform: translateY(0);
}

.role-badge {
    background-color: var(--sidebar-active);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: var(--font-size-md);
    font-weight: 600;
    text-transform: uppercase;
}

.role-selector {
    width: 100%;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.role-selector:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.role-selector:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.role-selector option {
    background-color: var(--sidebar-bg-start);
    color: var(--sidebar-text);
    padding: 8px;
}

.sidebar-section {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section h3 {
    font-size: var(--font-size-lg);
    text-transform: uppercase;
    color: var(--sidebar-text-muted);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 5px;
}

.nav-list li a,
.nav-list li button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: var(--font-size-lg);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.nav-list li a:hover,
.nav-list li button:hover {
    background-color: var(--sidebar-hover);
    transform: translateX(4px);
}

.nav-list li a.active,
.nav-list li button.active {
    background-color: var(--sidebar-active);
    color: white;
    font-weight: 600;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-icon {
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-weight: 600;
}

.agent-description {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-badge {
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.2);
}

.llm-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    padding: 3px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.6), rgba(75, 0, 130, 0.6));
    color: white;
    font-weight: 600;
    margin-left: 6px;
    margin-right: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================
   CONTENIDO PRINCIPAL
   =========================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    overflow: hidden;
}

.main-header {
    padding: 13px 30px;
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    color: var(--header-text);
    border-bottom: 3px solid var(--sidebar-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
}

.header-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.clock-time {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--header-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 13px;
    font-weight: 400;
    color: var(--header-text);
    opacity: 0.85;
    letter-spacing: 0.3px;
}

/* Wrapper para main-view + chat-sidebar */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.main-view {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-main);
    position: relative;
}

/* Contenedor para paneles dinámicos (calendario, admin panels) */
.panel-container {
    width: 100%;
}

.panel-container.hidden {
    display: none;
}

.main-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 5px;
}

.main-header p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
}

/* ===========================
   DATA VIEW (SUPERPUESTA EN MAIN-VIEW)
   =========================== */
.data-view {
    padding: 20px;
    background-color: var(--bg-main);
    border-radius: 8px;
    margin-top: 20px;
}

.data-view.hidden {
    display: none;
}

.data-view .view-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.data-view .view-header h2 {
    margin: 0;
    color: var(--calendar-header-accent);
    font-size: var(--font-size-2xl);
}

/* ===========================
   CHAT CONTAINER (DERECHA)
   =========================== */
/* Chat container dentro del sidebar */
.chat-sidebar .messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--chat-bg);
}

.message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 87%;
    word-wrap: break-word;
    line-height: 1.5;
    box-shadow: 0 1px 2px var(--shadow-color);
}

/* Estilos para negritas en el chat - SIN display block */
.message strong {
    font-weight: 600;
    /* NO display: block - eso rompe el formato inline */
    /* NO color - hereda del contenedor para funcionar con fondos claros y oscuros */
}

/* Nuevo: Estilos específicos para títulos en el chat */
.message h2 {
    font-size: 1.2em;
    font-weight: 600;
    color: #2563eb;
    margin: 1em 0 0.5em 0;
    padding-top: 0.5em;
    border-top: 1px solid #e5e7eb;
}

.message h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e293b;
    margin: 0.8em 0 0.4em 0;
}

/* Mejorar separación de párrafos */
.message p {
    line-height: 1.6;
    margin: 0.8em 0;
}

/* Formato especial para métricas/KPIs */
.message .metric {
    display: inline-block;
    background: #f0f9ff;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    margin: 0.2em;
    font-weight: 600;
    color: #0369a1;
}

/* Formato para acciones recomendadas */
.message .action {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 0.5em 0.8em;
    margin: 0.8em 0;
    border-radius: 0 4px 4px 0;
}

.message ul,
.message ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message ul {
    list-style-type: disc;
}

.message ol {
    list-style-type: decimal;
}

.message li {
    margin: 4px 0;
}

.message p {
    margin: 8px 0;
}

.message p:first-child {
    margin-top: 0;
}

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

.message.user {
    background: linear-gradient(135deg, var(--message-user-bg-start) 0%, var(--message-user-bg-end) 100%);
    color: var(--message-user-text);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background-color: var(--message-assistant-bg);
    color: var(--message-assistant-text);
    align-self: flex-start;
    border: 1px solid var(--message-assistant-border);
    border-bottom-left-radius: 4px;
}

.message.system {
    background-color: var(--message-system-bg);
    color: var(--message-system-text);
    align-self: center;
    font-style: italic;
    font-size: 0.9em;
    border: 1px solid var(--message-system-border);
}

.message.thinking {
    background-color: var(--message-thinking-bg);
    border: 1px solid var(--message-thinking-border);
    align-self: flex-start;
    padding: 16px 20px;
}

.thinking-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--sidebar-active);
    animation: thinking-bounce 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes thinking-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.message-form {
    display: flex;
    padding: 20px;
    background-color: var(--bg-main);
    border-top: 2px solid var(--border-color);
    gap: 12px;
}

.message-input {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: var(--font-size-lg);
    transition: all 0.2s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-button {
    background: linear-gradient(135deg, var(--btn-primary-bg-start) 0%, var(--btn-primary-bg-end) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 24px;
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* ===========================
   VISTAS (CALENDARIO/MÉTRICAS)
   =========================== */
.view-panel {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.view-panel h2 {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* ===========================
   DATA VIEW (PARA ALEX)
   NOTA: Ya NO define estilos de tabla aquí.
   Usar .data-table en el HTML para tablas consistentes.
   =========================== */

/* ===========================
   PANEL DE DEBUG
   =========================== */
.debug-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 40vw;
    min-width: 400px;
    max-width: 800px;
    background: var(--debug-bg);
    color: var(--debug-text);
    border-left: 3px solid var(--sidebar-active);
    font-family: 'Courier New', Courier, monospace;
    font-size: var(--font-size-md);
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.debug-header {
    position: sticky;
    top: 0;
    background: var(--debug-bg-secondary);
    padding: 15px;
    border-bottom: 2px solid var(--debug-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.debug-header h3 {
    color: var(--debug-accent);
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    color: var(--debug-text);
    font-size: var(--font-size-3xl);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: var(--debug-error);
    color: white;
}

.debug-content {
    padding: 15px;
}

.debug-entry {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--debug-bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--sidebar-active);
}

.debug-entry h4 {
    color: var(--debug-tag);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.debug-entry h5 {
    color: var(--debug-tag-light);
    margin: 10px 0 5px 0;
}

.debug-entry p {
    margin: 8px 0;
    line-height: 1.6;
}

.debug-entry details {
    margin-top: 10px;
    border: 1px solid var(--debug-border);
    border-radius: 4px;
    background-color: var(--debug-bg);
}

.debug-entry summary {
    cursor: pointer;
    font-weight: bold;
    padding: 10px;
    background-color: var(--debug-bg-secondary);
    border-radius: 4px 4px 0 0;
}

.debug-entry summary:hover {
    background-color: var(--debug-hover-bg);
}

.debug-entry pre {
    background-color: var(--debug-code-bg);
    padding: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    border-top: 1px solid var(--debug-border);
    overflow-x: auto;
}

.debug-entry code {
    background-color: var(--debug-hover-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: var(--font-size-md);
}

/* ===========================
   LOADING OVERLAY
   =========================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--sidebar-active);
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: var(--font-size-base);
}

/* ===========================
   CALENDARIO - Estilo Google Calendar
   =========================== */
.calendar-location-header {
    padding: 20px 24px 12px 24px;
    background-color: var(--calendar-header-bg);
    border-bottom: 2px solid var(--calendar-header-accent);
}

.calendar-location-header h2 {
    margin: 0;
    font-size: var(--font-size-3xl);
    font-weight: 600;
    color: var(--calendar-header-accent);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--calendar-border);
    margin-bottom: 0;
}

.calendar-title {
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--calendar-text);
    margin: 0;
}

.calendar-nav-btn {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--calendar-border);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-size-lg);
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background-color: var(--chat-bg);
    border-color: #d2d3d4;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.calendar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background-color: var(--calendar-header-bg);
    border-bottom: 1px solid var(--calendar-border);
}

.calendar-filters label {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.resource-filter-select {
    padding: 6px 12px;
    border: 1px solid var(--calendar-border);
    border-radius: 4px;
    background-color: var(--bg-main);
    color: var(--calendar-text);
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.resource-filter-select:hover {
    border-color: var(--text-secondary);
}

.resource-filter-select:focus {
    outline: none;
    border-color: var(--calendar-header-accent);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.filter-label {
    font-size: var(--font-size-base);
    color: var(--calendar-text);
}

/* ===========================
   LEYENDA DE COLORES
   =========================== */
.color-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--calendar-border);
}

.legend-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
    box-shadow: 0 1px 2px var(--shadow-color);
}

.legend-name {
    font-size: var(--font-size-md);
    color: var(--calendar-text);
    font-weight: 400;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-main);
    table-layout: fixed;
}

.calendar-grid th {
    background-color: var(--bg-main);
    color: var(--calendar-text-muted);
    padding: 8px 4px;
    text-align: center;
    font-weight: 500;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    border-right: 1px solid var(--calendar-border);
    border-bottom: 1px solid var(--calendar-border);
    letter-spacing: 0.5px;
}

.calendar-grid th.hour-col {
    width: 70px;
    background-color: var(--bg-main);
    border-right: 1px solid var(--calendar-border);
}

.calendar-grid th.day-col {
    width: calc((100% - 70px) / 7);
}

.date-label {
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--calendar-event-text);
    text-transform: none;
    display: block;
    margin-top: 2px;
}

.calendar-grid td {
    border-right: 1px solid var(--calendar-border);
    border-bottom: 1px solid var(--calendar-border);
    padding: 4px;
    vertical-align: top;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    position: relative;
    background-color: var(--bg-main);
    overflow: hidden;
}

.hour-cell {
    background-color: var(--bg-main);
    text-align: right;
    font-weight: 400;
    font-size: var(--font-size-xs);
    color: var(--calendar-text-muted);
    padding-right: 8px;
    padding-top: 4px;
    border-right: 1px solid var(--calendar-border);
}

.calendar-cell {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.calendar-cell:hover {
    background-color: var(--chat-bg);
}

.calendar-cell.has-event {
    background-color: var(--bg-main);
}

.calendar-cell.has-event:hover {
    background-color: var(--chat-bg);
}

/* 🆕 Celdas pasadas - solo deshabilitar creación */
.calendar-cell.past-cell {
    cursor: not-allowed;
}

/* 🆕 Celda de la hora actual - destacada */
.calendar-cell.current-hour {
    background-color: rgba(66, 133, 244, 0.15) !important;
    border: 2px solid rgba(66, 133, 244, 0.3);
}

.calendar-cell.current-hour:hover {
    background-color: rgba(66, 133, 244, 0.25) !important;
}

.calendar-event {
    background-color: var(--calendar-event-bg);
    color: var(--calendar-event-text);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    border-left: 3px solid var(--calendar-event-border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.calendar-event:hover {
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    background-color: var(--calendar-event-hover);
}

.calendar-event strong {
    display: block;
    font-weight: 500;
    margin-bottom: 2px;
}

.calendar-event small {
    font-size: var(--font-size-xs);
    opacity: 0.9;
}

.calendar-event.read-only {
    background-color: var(--calendar-event-readonly);
    border-left-color: var(--calendar-event-readonly-border);
}

.calendar-event.read-only:hover {
    background-color: var(--calendar-event-readonly-hover);
}

/* ===========================
   MODALES
   =========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

/* Modal - Nueva estructura (Estructura B) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* REGLA ELIMINADA - Conflictiva con nuevo sistema de modales */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--calendar-border);
    background-color: var(--bg-main);
    color: var(--calendar-text);
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-3xl);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--chat-bg);
}

.modal-body {
    padding: 24px;
}

.appointment-preview {
    background-color: #e8f0fe;
    border-left: 4px solid #4285f4;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.appointment-preview p {
    margin: 4px 0;
    color: #1967d2;
    font-size: var(--font-size-lg);
}

.event-details {
    background-color: var(--chat-bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.event-details p {
    margin: 8px 0;
    color: #3c4043;
    font-size: var(--font-size-lg);
}

/* NOTA: .status-badge consolidado en sección BLOQUE: STATUS BADGES más adelante */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #3c4043;
    font-size: var(--font-size-md);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--calendar-border);
    border-radius: 4px;
    font-size: var(--font-size-lg);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #b0b3b8;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    font-style: italic;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--calendar-border);
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-warning {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: var(--font-size-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--btn-primary-bg-start), var(--btn-primary-bg-end)) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    opacity: 1 !important;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.btn-secondary {
    background-color: var(--bg-main);
    color: var(--calendar-header-accent);
    border: 1px solid var(--calendar-border);
}

.btn-secondary:hover {
    background-color: var(--chat-bg);
    border-color: #b0b3b8;
}

.btn-success {
    background-color: #28a745;
    color: white;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-success:hover {
    background-color: #218838;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.btn-danger {
    background-color: var(--btn-danger-bg);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-danger:hover {
    background-color: var(--btn-danger-hover);
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-warning:hover {
    background-color: #e0a800;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

/* ===========================
   BLOQUE: TOAST NOTIFICATIONS
   NOTA: Definición completa en líneas 1841-1939
   =========================== */

/* ===========================
   MODAL DE CONFIRMACIÓN
   =========================== */
.confirm-modal-content {
    max-width: 450px;
}

.confirm-modal-header-warning {
    background-color: var(--modal-warning-bg);
    color: var(--modal-warning-text);
    border-bottom: 2px solid #ffc107;
}

.confirm-modal-header-danger {
    background-color: var(--modal-danger-bg);
    color: var(--modal-danger-text);
    border-bottom: 2px solid #f44336;
}

.confirm-modal-header-info {
    background-color: var(--modal-info-bg);
    color: var(--modal-info-text);
    border-bottom: 2px solid #2196f3;
}

.confirm-message {
    font-size: var(--font-size-lg);
    color: #3c4043;
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

.confirm-message strong {
    color: var(--calendar-text);
    font-weight: 600;
}

/* ===========================
   SELECTOR DE TEMA (ADMIN)
   =========================== */
.theme-selector {
    width: 100%;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.theme-selector:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.theme-selector:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.theme-selector option {
    background-color: var(--sidebar-bg-start);
    color: var(--sidebar-text);
    padding: 8px;
}

/* Selector de LLM (superadmin) */
.llm-selector {
    width: 100%;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.llm-selector:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.llm-selector:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.llm-selector option {
    background-color: var(--sidebar-bg-start);
    color: var(--sidebar-text);
    padding: 8px;
}

.llm-status {
    font-size: 0.75rem;
    margin-top: 8px;
    color: var(--sidebar-text);
    opacity: 0.8;
}

/* ===========================
   CONTADOR DE TOKENS (SUPERADMIN)
   =========================== */
.token-counter {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: var(--font-size-md);
    text-align: center;
    margin-top: 4px;
}

.token-counter #token-count {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--accent);
}

.theme-preview {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    padding: 6px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.theme-preview-color {
    width: 30px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===========================
   PANELES DE GESTIÓN
   =========================== */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background-color: var(--bg-main);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-lg);
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.table-container {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-md);
}

.data-table thead {
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    color: white;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-md);
}

/* Columnas ordenables */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.data-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.data-table th.sortable.sorted {
    background-color: rgba(255, 255, 255, 0.15);
}

.data-table th .sort-icon {
    margin-left: 5px;
    opacity: 0.6;
    font-size: 0.9em;
}

.data-table th.sorted .sort-icon {
    opacity: 1;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-md);
}

.data-table tbody tr:hover {
    background-color: var(--chat-bg);
}

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

.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
    font-style: italic;
}

/* NOTA: Status badges consolidados en líneas 2414-2479 */

.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* Alineado a la izquierda */
}

/* ===========================
   TPV FEATURES - Multi-Checkout & Refunds
   =========================== */

/* Checkbox column styling */
.checkbox-col {
    width: 40px !important;
    text-align: center;
    padding: 8px !important;
}

.checkbox-cell {
    text-align: center;
    padding: 8px !important;
}

.appointment-checkbox,
#select-all-appointments {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Fila deshabilitada en tabla TPV - ÚNICO estilo custom necesario */
.row-disabled-tpv {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(60%);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.row-disabled-tpv td {
    color: var(--text-secondary, #999);
}

/* Invoice states */
.invoice-rectificative {
    background-color: rgba(220, 38, 38, 0.08) !important;
    border-left: 3px solid #dc2626;
}

.invoice-rectificative:hover {
    background-color: rgba(220, 38, 38, 0.12) !important;
}

/* Appointment billed indicator */
.appointment-billed {
    background-color: rgba(34, 197, 94, 0.05);
}

.billed-badge {
    margin-left: 6px;
    font-size: 14px;
}

/* Refund button styling */
.btn-refund {
    color: #dc2626;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-refund:hover {
    background-color: rgba(220, 38, 38, 0.1);
    transform: scale(1.1);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-xl);
    padding: 4px 8px;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.btn-edit {
    color: var(--btn-edit);
}

.btn-delete {
    color: var(--btn-delete);
}

/* Botones de acción con texto (para users y services) */
.btn-action {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-action:hover {
    background: transparent;
    transform: scale(1.1);
    color: var(--text);
}

.btn-action.btn-view:hover {
    border-color: var(--btn-view);
    color: var(--btn-view);
}

.btn-action.btn-edit:hover {
    border-color: var(--btn-edit);
    color: var(--btn-edit);
}

.btn-action.btn-delete:hover,
.btn-action.btn-no-show:hover {
    border-color: var(--btn-delete);
    color: var(--btn-delete);
}

.btn-action.btn-confirm:hover {
    border-color: var(--btn-confirm);
    color: var(--btn-confirm);
}

.btn-action.btn-complete:hover {
    border-color: var(--btn-complete);
    color: var(--btn-complete);
}

/* Botones con iconos pequeños y discretos (para appointments) */
.btn-icon-small {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.btn-icon-small:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Botones de acción (para facturas y transacciones) - mismo estilo que btn-icon-small */
.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.action-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Colores por defecto para cada tipo de botón */
.btn-icon-small.btn-view,
.action-btn.btn-view {
    color: var(--btn-view);
}

.btn-icon-small.btn-edit,
.action-btn.btn-edit {
    color: var(--btn-edit);
}

.btn-icon-small.btn-delete,
.btn-icon-small.btn-no-show,
.action-btn.btn-delete {
    color: var(--btn-delete);
}

.btn-icon-small.btn-confirm,
.action-btn.btn-confirm {
    color: var(--btn-confirm);
}

.btn-icon-small.btn-complete,
.action-btn.btn-complete {
    color: var(--btn-complete);
}

.action-btn.btn-pdf {
    color: var(--btn-view);
}

/* NOTA: Botones ya definidos en líneas 1339-1382
   .btn-primary, .btn-secondary, .btn-danger
   NO DUPLICAR */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--calendar-border);
    border-radius: 4px;
    font-size: var(--font-size-lg);
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-group select[multiple] {
    padding: 8px;
}

.form-group label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .sidebar {
        flex: 0 0 200px;
    }

    .debug-panel {
        width: 100vw;
        min-width: unset;
    }

    .message {
        max-width: 90%;
    }

    .calendar-header {
        flex-direction: column;
        gap: 10px;
    }

    .calendar-nav-btn {
        width: 100%;
    }

    .calendar-grid th.hour-col,
    .hour-cell {
        font-size: var(--font-size-sm);
        padding: 4px;
    }

    .calendar-event {
        font-size: var(--font-size-xs);
        padding: 4px;
    }

    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
        bottom: 10px;
    }
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    border-left: 4px solid;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: var(--font-size-md);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tipos de toast */
.toast-success {
    border-left-color: var(--toast-success);
}

.toast-success .toast-icon {
    color: var(--toast-success);
}

.toast-error {
    border-left-color: var(--toast-error);
}

.toast-error .toast-icon {
    color: var(--toast-error);
}

.toast-warning {
    border-left-color: var(--toast-warning);
}

.toast-warning .toast-icon {
    color: var(--toast-warning);
}

.toast-info {
    border-left-color: var(--toast-info);
}

.toast-info .toast-icon {
    color: var(--toast-info);
}

/* ===========================
   MÓDULO DE CITAS - ESTILOS ESPECÍFICOS
   =========================== */

/* Filtros en toolbar */
.filters-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    min-width: 150px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Información de resultados */
.results-info {
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    border-left: 3px solid var(--sidebar-active);
}

/* NOTA: Estados de citas consolidados en bloque STATUS BADGES (líneas 2461-2479) */

/* Detalles de cita en modal */
.appointment-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.detail-row span {
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

/* NOTA: Botones ya definidos globalmente
   .btn-danger → líneas 1373-1382
   .btn-view → usar .btn-icon-small.btn-view (líneas 1712-1714)
*/

/* Responsive para filtros */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-input {
        width: 100%;
        min-width: auto;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .detail-row label {
        font-weight: 700;
    }
}

/* ===========================
   CHAT SIDEBAR COLAPSABLE Y REDIMENSIONABLE
   =========================== */

.chat-sidebar {
    position: relative;
    display: flex;
    flex-direction: row;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    transition: all 0.3s ease;
    /* Ancho por defecto, se sobrescribe con inline style desde JS */
    --chat-width: 400px;
}

.chat-sidebar:not(.collapsed) {
    width: var(--chat-width, 400px);
    min-width: 300px;
    max-width: 800px;
}

.chat-sidebar.collapsed {
    width: 40px;
    min-width: 40px;
}

/* Barra de toggle/resize */
.chat-toggle-bar {
    width: 40px;
    min-width: 40px;
    background: var(--accent);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 8px;
    padding: 1rem 0;
    position: relative;
    user-select: none;
}

/* Cursor de resize cuando está sobre la barra */
.chat-toggle-bar.chat-resizer {
    cursor: ew-resize;
}

.chat-toggle-bar:hover {
    background: var(--accent-hover);
}

/* Indicador visual de resize */
.chat-toggle-bar .resize-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    letter-spacing: -2px;
    pointer-events: none;
}

.chat-toggle-bar:hover .resize-hint {
    opacity: 0.5;
}

/* Cuando está en modo resize (dragging) */
.chat-sidebar.resizing {
    transition: none !important;
    user-select: none;
}

.chat-sidebar.resizing .chat-toggle-bar {
    background: var(--accent-hover);
}

.chat-sidebar.resizing .chat-toggle-bar .resize-hint {
    opacity: 0.8;
}

.chat-toggle-bar .toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.chat-sidebar:not(.collapsed) .chat-toggle-bar .toggle-icon {
    transform: rotate(180deg);
}

.chat-toggle-bar .toggle-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-sidebar:not(.collapsed) .chat-sidebar-content {
    opacity: 1;
}

.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.collapse-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-message-form {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.sidebar-message-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.sidebar-message-input:focus {
    outline: none;
    border-color: var(--accent);
}

.sidebar-send-button {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.sidebar-send-button:hover {
    background: var(--accent-hover);
}

/* Main view con sidebar expandido */
.main-view.with-sidebar {
    width: 70%;
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .chat-sidebar:not(.collapsed) {
        position: fixed;
        right: 0;
        top: 0;
        width: 100%;
        height: 100vh;
        z-index: 1000;
        min-width: 100%;
    }

    .chat-toggle-bar {
        width: 100%;
        height: 50px;
        flex-direction: row;
        min-width: auto;
        padding: 0 1rem;
    }

    .chat-toggle-bar .toggle-label {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        margin-left: 0.5rem;
    }

    .chat-sidebar-content {
        height: calc(100vh - 50px);
    }

    .main-view.with-sidebar {
        width: 100%;
    }
}

/* ============================================
   APPOINTMENT DETAIL MODAL
   ============================================ */

.modal-appointment-detail {
    max-width: 600px;
}

.appointment-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.appointment-detail-table tr {
    border-bottom: 1px solid var(--calendar-border, #444);
}

.appointment-detail-table tr:last-child {
    border-bottom: none;
}

.appointment-detail-table .detail-label {
    padding: 12px 8px;
    font-weight: bold;
    width: 35%;
    color: var(--text-secondary, #aaa);
}

.appointment-detail-table .detail-value {
    padding: 12px 8px;
    color: var(--text-primary, #fff);
}

/* ============================================
   AGENT STATUS DISPLAY (Tiempo Real)
   ============================================ */

.header-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.agent-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--sidebar-bg);
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.agent-status.hidden {
    display: none;
}

.agent-status .status-icon {
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.agent-status .status-text {
    color: var(--text-secondary);
    font-weight: 500;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animación de typing dots */
.typing-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDots 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animaciones */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes typingDots {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-6px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .agent-status .status-text {
        max-width: 250px;
    }
}

/* ===========================
   BILLING - Vista de Facturas
   =========================== */

/* Barra de filtros */
.filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #444);
    border-radius: 4px;
    background: var(--bg-secondary, #2a2a2a);
    color: var(--text-primary, #e0e0e0);
    font-size: 14px;
}

.filter-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 150px;
}

/* BLOQUE: TABLAS - Ya definido en líneas 1559-1604
   NO DUPLICAR - Usar .data-table + clases específicas
   Ejemplo: <table class="data-table invoices-table">
*/

/* Paginación */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 20px;
}

/* Footer de vista */
.view-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-secondary, #2a2a2a);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-secondary, #b0b0b0);
}

/* ===========================
   BLOQUE: STATUS BADGES
   Base: .status-badge
   Variantes: .status-[tipo]
   =========================== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Estados generales */
.status-active {
    background-color: var(--status-active-bg);
    color: var(--status-active-text);
}

.status-inactive {
    background-color: var(--status-inactive-bg);
    color: var(--status-inactive-text);
}

/* Estados de facturas */
.status-draft {
    background: var(--status-draft);
    color: #4a5560;
}

.status-sent {
    background: var(--status-sent);
    color: #2d5a72;
}

.status-paid {
    background: var(--status-paid);
    color: #2d6842;
}

.status-cancelled {
    background: var(--status-cancelled);
    color: #8b3a32;
}

/* Estados de citas (appointments) */
.status-pending {
    background: var(--status-pending);
    color: #8b5e2b;
}

.status-confirmed {
    background: var(--status-confirmed);
    color: #2d5a72;
}

.status-completed {
    background: var(--status-completed);
    color: #2d6842;
}

.status-no-show {
    background: var(--status-no-show);
    color: #4a5560;
}

/* BLOQUE: ACTION BUTTONS - Usar estilos globales
   .btn-icon-small.btn-view (azul)
   .btn-icon-small.btn-edit (naranja)
   .btn-icon-small.btn-delete (rojo)

   O para botones con texto usar:
   .btn-action.btn-view / .btn-edit / .btn-delete
   (Definidos en líneas 1594-1635)
*/

/* Responsive */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
    }

    .filter-input {
        width: 100%;
    }

    .table-container {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* ===========================
   MODAL COMPONENT - Reutilizable
   =========================== */

/* Overlay de fondo */
.nexus-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.nexus-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

/* Dialog container - SIEMPRE CENTRADO */
.modal-dialog {
    position: relative;
    z-index: 10000;
    width: 600px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contenido del modal */
.modal-content {
    background: var(--bg-secondary, #2a2a2a);
    border: 1px solid var(--border-color, #444);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    width: 90%;
    max-width: 600px;
}

/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #444);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-secondary, #b0b0b0);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--bg-hover, #3a3a3a);
    color: var(--text-primary, #e0e0e0);
}

/* Body */
.modal-body {
    padding: 24px;
    color: var(--text-primary, #e0e0e0);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #444);
}

/* Prevenir scroll del body cuando modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-dialog {
        width: 90vw;
        max-width: 90vw;
    }

    .nexus-modal .modal-dialog {
        width: 90vw;
        max-width: 90vw;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
}

/* Estilos para detalles de factura en modal */
.invoice-details {
    font-size: 14px;
}

.invoice-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.invoice-detail-row .label {
    color: var(--text-secondary, #b0b0b0);
    font-weight: 500;
}

.invoice-detail-row .value {
    color: var(--text-primary, #e0e0e0);
    text-align: right;
}

/* ===================================
   TRANSACCIONES - VISTA
   =================================== */

/* Grid de estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Cards de estadísticas */
.stat-card {
    background: var(--bg-main, #ffffff);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color, #e1e8ed);
    box-shadow: 0 2px 4px var(--shadow-color, rgba(0, 0, 0, 0.1));
}

.stat-card.income-card {
    border-left: 4px solid #10b981;
}

.stat-card.expense-card {
    border-left: 4px solid #ef4444;
}

.stat-card.balance-card {
    border-left: 4px solid #3b82f6;
}

.stat-card.balance-card.positive {
    border-left-color: var(--success-color);
}

.stat-card.balance-card.negative {
    border-left-color: var(--error-color);
}

.stat-icon {
    font-size: 32px;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary, #a0a0a0);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

/* Badges de tipo de transacción */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.badge-income {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-expense {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Montos en tabla */
.amount-positive {
    color: var(--success-color);
    font-weight: 600;
}

.amount-negative {
    color: var(--error-color);
    font-weight: 600;
}

/* Detalles de transacción en modal */
.transaction-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-details .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-secondary, #f0f2f5);
    border-radius: 6px;
}

.transaction-details .detail-row strong {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.transaction-details .detail-row span {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

/* ================================== */
/* Sofia Dashboard Styles */
/* ================================== */

/* Sofia severity badges */
.badge-critical {
    background-color: #e8a5a0 !important;
    color: #8b3a32 !important;
}

.badge-high {
    background-color: #f5c89a !important;
    color: #8b5e2b !important;
}

.badge-medium {
    background-color: #f7e5a3 !important;
    color: #8b7a2b !important;
}

.badge-low {
    background-color: #a8d5ba !important;
    color: #2d6842 !important;
}

.badge-success {
    background-color: #a8d5ba !important;
    color: #2d6842 !important;
}

.badge-warning {
    background-color: #f5c89a !important;
    color: #8b5e2b !important;
}

/* Sofia table */
.sofia-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Progress bar for run detectors */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
    width: 0;
}

/* Action buttons in Sofia table */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
    /* Alineado a la izquierda */
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Sofia stats grid override */
.view-container .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.view-container .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-container .stat-icon {
    font-size: 32px;
}

.view-container .stat-content {
    flex: 1;
}

.view-container .stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-container .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* Sofia modal sizes */
.modal-medium {
    max-width: 600px;
}

/* =====================================================
   SISTEMA DE ICONOS UNIFICADO - TONOS PASTEL
   ===================================================== */

/* Base para todos los iconos */
.nexus-icon {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    transition: all 0.2s ease;
}

/* Tamaños de iconos */
.nexus-icon-sm {
    font-size: 16px;
}

.nexus-icon-md {
    font-size: 20px;
}

.nexus-icon-lg {
    font-size: 28px;
}

.nexus-icon-xl {
    font-size: 36px;
}

/* Variante DEFAULT - Sin filtro (para casos especiales) */
.nexus-icon-default {
    filter: none;
}

/* Variante PASTEL - Tonos suaves (PRINCIPAL) */
.nexus-icon-pastel {
    filter: saturate(0.25) brightness(1.3) opacity(0.7);
}

/* Variante MUTED - Aún más suave */
.nexus-icon-muted {
    filter: saturate(0.2) brightness(1.2) opacity(0.7);
}

/* ==========================================
   ICONOS EN CONTEXTOS ESPECÍFICOS
   ========================================== */

/* Iconos en navegación (sidebar) */
.sidebar .nav-list a .nexus-icon {
    margin-right: 8px;
    filter: saturate(0.25) brightness(1.3) opacity(0.7);
}

.sidebar .nav-list a:hover .nexus-icon {
    filter: saturate(0.5) brightness(1.1) opacity(0.95);
    transform: scale(1.05);
}

.sidebar .nav-list a.active .nexus-icon {
    filter: saturate(0.6) brightness(1.05) opacity(1);
}

/* Iconos en botones */
.btn .nexus-icon,
.btn-primary .nexus-icon,
.btn-secondary .nexus-icon,
button .nexus-icon {
    margin-right: 6px;
    filter: saturate(0.3) brightness(1.2) opacity(0.85);
}

.btn:hover .nexus-icon,
.btn-primary:hover .nexus-icon,
.btn-secondary:hover .nexus-icon {
    filter: saturate(0.45) brightness(1.15) opacity(0.95);
}

/* Iconos en títulos */
h1 .nexus-icon,
h2 .nexus-icon,
h3 .nexus-icon,
h4 .nexus-icon {
    margin-right: 10px;
    filter: saturate(0.4) brightness(1.1) opacity(0.8);
}

/* Stat cards - tonos pastel suaves */
.stat-icon {
    font-size: 32px;
    /* ACTUALIZADO: Filtro pastel en vez de solo opacity */
    filter: saturate(0.35) brightness(1.15) hue-rotate(-5deg) opacity(0.75);
}

.stat-icon .nexus-icon {
    /* Si hay un nexus-icon dentro de stat-icon, no aplicar filtro doble */
    filter: none;
}

/* Iconos de acción en tablas */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px 8px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.btn-icon .nexus-icon {
    filter: saturate(0.3) brightness(1.1) opacity(0.7);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.btn-icon:hover .nexus-icon {
    filter: saturate(0.5) brightness(1.05) opacity(0.9);
    transform: scale(1.15);
}

/* Iconos en modales */
.modal-header .nexus-icon,
.modal-title .nexus-icon {
    margin-right: 8px;
    filter: saturate(0.25) brightness(1.3) opacity(0.7);
}

/* Iconos en badges */
.badge .nexus-icon {
    margin-right: 4px;
    font-size: 0.9em;
    filter: saturate(0.3) brightness(1.2) opacity(0.85);
}

/* ==========================================
   ADAPTACIÓN POR TEMA
   ========================================== */

/* Ocean Blue - Ligeramente más azulado */
[data-theme="theme-ocean-blue"] .nexus-icon-pastel,
[data-theme="theme-ocean-blue"] .sidebar .nav-list a .nexus-icon,
[data-theme="theme-ocean-blue"] .btn .nexus-icon {
    filter: saturate(0.35) brightness(1.15) hue-rotate(5deg) opacity(0.8);
}

/* Forest Green - Ligeramente más verdoso */
[data-theme="theme-forest-green"] .nexus-icon-pastel,
[data-theme="theme-forest-green"] .sidebar .nav-list a .nexus-icon,
[data-theme="theme-forest-green"] .btn .nexus-icon {
    filter: saturate(0.3) brightness(1.1) hue-rotate(10deg) opacity(0.8);
}

/* Sunset Warm - Ligeramente más cálido */
[data-theme="theme-sunset-warm"] .nexus-icon-pastel,
[data-theme="theme-sunset-warm"] .sidebar .nav-list a .nexus-icon,
[data-theme="theme-sunset-warm"] .btn .nexus-icon {
    filter: saturate(0.4) brightness(1.1) hue-rotate(-10deg) opacity(0.85);
}

/* Classic Dark - Más desaturado y brillante */
[data-theme="theme-classic-dark"] .nexus-icon-pastel,
[data-theme="theme-classic-dark"] .sidebar .nav-list a .nexus-icon,
[data-theme="theme-classic-dark"] .btn .nexus-icon {
    filter: saturate(0.25) brightness(1.25) opacity(0.7);
}

/* ==========================================
   ANIMACIONES ESPECIALES
   ========================================== */

/* Animación de loading para iconos específicos */
.nexus-icon.icon-loading {
    animation: iconSpin 1.5s linear infinite;
}

@keyframes iconSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Pulse para notificaciones */
.nexus-icon.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .nexus-icon-xl {
        font-size: 28px;
    }

    .nexus-icon-lg {
        font-size: 24px;
    }

    .nexus-icon-md {
        font-size: 18px;
    }

    .nexus-icon-sm {
        font-size: 14px;
    }

    .stat-icon {
        font-size: 28px;
    }
}

/* ==========================================
   FIN SISTEMA DE ICONOS
   ========================================== */

/* ==========================================
   SUPERADMIN DASHBOARD
   ========================================== */

.superadmin-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dashboard-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Secciones del Dashboard */
.system-status-section,
.quick-tools-section,
.metrics-section,
.alerts-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.superadmin-dashboard h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Grid de Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.service-card {
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

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

.service-card.checking {
    border-color: #ffa726;
}

.service-card.online {
    border-color: #4caf50;
}

.service-card.offline {
    border-color: #f44336;
}

.service-indicator {
    font-size: 20px;
    line-height: 1;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.service-port {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.service-desc {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-status {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-legend {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-legend .indicator {
    font-size: 16px;
    margin-right: 4px;
}

.status-legend .indicator.green {
    color: #4caf50;
}

.status-legend .indicator.red {
    color: #f44336;
}

.status-legend .indicator.yellow {
    color: #ffa726;
}

/* Herramientas Rápidas */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.tool-btn {
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.tool-btn:hover:not(:disabled) {
    background: var(--card-bg);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tool-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-icon {
    font-size: 32px;
}

.tool-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.tool-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric-card {
    background: linear-gradient(135deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--header-text);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Alertas */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-alerts {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.alert-success,
.alert-error,
.alert-info {
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 13px;
}

.alert-success {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #1b5e20;
}

.alert-error {
    background: #ffebee;
    border-color: #f44336;
    color: #b71c1c;
}

.alert-info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #0d47a1;
}

.alert-success pre,
.alert-error pre,
.alert-info pre {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow-x: auto;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {

    .services-grid,
    .tools-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   FIN SUPERADMIN DASHBOARD
   ========================================== */

/* ==========================================
   TOGGLE SWITCH (para IVA incluido)
   ========================================== */

.toggle-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}

input:checked+.slider {
    background-color: var(--primary-color, #2196F3);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color, #2196F3);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.help-text span {
    color: #ffffff;
}

#tax-mode-container {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* ==========================================
   FIN TOGGLE SWITCH
   ========================================== */

/* ========================================
   ESTILOS GLOBALES PARA CHECKBOXES
   ======================================== */
.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0.25rem 0 !important;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    height: 16px !important;
}

/* Asegurar que los form-groups con checkboxes no se descuadren */
.form-group .checkbox-label {
    width: 100% !important;
}

/* ===========================
   ESTILOS DIFERENCIADOS POR AGENTE
   =========================== */

/* Alex - Estratega de Crecimiento (Azul/Morado analítico) */
.message.assistant[data-agent="alex"] {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #5c6bc0;
    box-shadow: 0 2px 8px rgba(92, 107, 192, 0.15);
}

.message.assistant[data-agent="alex"]::before {
    content: "📊 ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Badges de insights de Alex */
.insight-badge {
    display: inline-block;
    background: linear-gradient(135deg, #5c6bc0 0%, #7e57c2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 4px 4px 4px 0;
    box-shadow: 0 2px 4px rgba(92, 107, 192, 0.3);
}

/* Sofia - IA Predictiva (Rosa/Morado futurista) */
.message.assistant[data-agent="sofia"] {
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
    border-left: 4px solid #ab47bc;
    box-shadow: 0 2px 8px rgba(171, 71, 188, 0.15);
}

.message.assistant[data-agent="sofia"]::before {
    content: "🔮 ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Badges de predicción de Sofia */
.prediction-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ab47bc 0%, #ec407a 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 4px 4px 4px 0;
    box-shadow: 0 2px 4px rgba(171, 71, 188, 0.3);
}

.prediction-badge.high-priority {
    background: linear-gradient(135deg, #e53935 0%, #d32f2f 100%);
    animation: pulse-alert 2s ease-in-out infinite;
}

.prediction-badge.medium-priority {
    background: linear-gradient(135deg, #fb8c00 0%, #f57c00 100%);
}

.prediction-badge.low-priority {
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

@keyframes pulse-alert {

    0%,
    100% {
        box-shadow: 0 2px 4px rgba(229, 57, 53, 0.3);
    }

    50% {
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.6);
        transform: scale(1.02);
    }
}

/* Emma - Gestora de Citas (Verde operativo) */
.message.assistant[data-agent="emma"] {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 4px solid #66bb6a;
    box-shadow: 0 2px 8px rgba(102, 187, 106, 0.15);
}

.message.assistant[data-agent="emma"]::before {
    content: "🗓️ ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Carlos - CFO Financiero (Dorado/Naranja) */
.message.assistant[data-agent="carlos"] {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
    border-left: 4px solid #ffa726;
    box-shadow: 0 2px 8px rgba(255, 167, 38, 0.15);
}

.message.assistant[data-agent="carlos"]::before {
    content: "💰 ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Diana - Coordinadora (Azul coordinación) */
.message.assistant[data-agent="diana"] {
    background: linear-gradient(135deg, #e1f5fe 0%, #e0f2f1 100%);
    border-left: 4px solid #26c6da;
    box-shadow: 0 2px 8px rgba(38, 198, 218, 0.15);
}

.message.assistant[data-agent="diana"]::before {
    content: "🎯 ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Daniel - Asistente General (Gris neutral) */
.message.assistant[data-agent="daniel"] {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-left: 4px solid #78909c;
    box-shadow: 0 2px 8px rgba(120, 144, 156, 0.15);
}

.message.assistant[data-agent="daniel"]::before {
    content: "🤖 ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Ana - Especialista Reservas Externas (Turquesa) */
.message.assistant[data-agent="ana"] {
    background: linear-gradient(135deg, #e0f7fa 0%, #e0f2f1 100%);
    border-left: 4px solid #26a69a;
    box-shadow: 0 2px 8px rgba(38, 166, 154, 0.15);
}

.message.assistant[data-agent="ana"]::before {
    content: "📱 ";
    font-size: 1.2em;
    margin-right: 4px;
}

/* Selector de agente - Destacar agente activo */
#agent-selector option[value="alex"] {
    background-color: #e3f2fd;
}

#agent-selector option[value="sofia"] {
    background-color: #fce4ec;
}

#agent-selector option[value="emma"] {
    background-color: #e8f5e9;
}

#agent-selector option[value="carlos"] {
    background-color: #fff8e1;
}

#agent-selector option[value="diana"] {
    background-color: #e1f5fe;
}

/* Animación suave para cambios de agente */
.message.assistant {
    transition: all 0.3s ease;
}

/* ===========================
   BUSINESS HOURS VIEW
   =========================== */

.business-hours-view {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.business-hours-view .view-header {
    margin-bottom: 2rem;
}

.business-hours-view .view-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.business-hours-view .view-description {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
}

.business-hours-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--btn-primary-bg-start);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-state .error-message {
    color: var(--btn-danger-bg);
    margin-bottom: 1rem;
}

/* Hours Grid */
.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.day-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.day-row.day-closed {
    background-color: #f8f9fa;
    opacity: 0.6;
}

.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.day-name {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    flex: 1;
}

.day-status {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-left: 1rem;
}

/* Switch Toggle (reuso del existente en index.html) */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}

input:checked+.slider {
    background-color: var(--btn-primary-bg-start);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Time Inputs */
.day-hours {
    display: flex;
    gap: 1rem;
}

.time-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-input-group label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.time-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: var(--font-size-md);
    transition: all 0.3s ease;
}

.time-input:focus {
    outline: none;
    border-color: var(--btn-primary-bg-start);
    box-shadow: 0 0 0 3px rgba(62, 97, 122, 0.1);
}

.time-input:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.form-actions .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, var(--btn-primary-bg-start), var(--btn-primary-bg-end));
    color: white;
}

.form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-actions .btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
}

.form-actions .btn-secondary:hover {
    background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .business-hours-view {
        padding: 1rem;
    }

    .business-hours-content {
        padding: 1rem;
    }

    .day-hours {
        flex-direction: column;
    }

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

    .form-actions .btn {
        width: 100%;
    }
}

/* ===========================
   ESTILOS PARA GRÁFICOS (ApexCharts)
   =========================== */

.message-chart-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 300px;
    max-width: 100%;
    overflow: hidden;
}

/* Contenedor de gráfico dentro de mensaje del asistente */
.message.assistant .message-chart-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--message-assistant-border);
}

/* Contenedor de gráfico en modo oscuro */
@media (prefers-color-scheme: dark) {
    .message-chart-container {
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Asegurar que los gráficos sean responsive */
.message-chart-container .apexcharts-canvas {
    max-width: 100%;
}

/* Estilos para el título del gráfico dentro de ApexCharts */
.message-chart-container .apexcharts-title-text {
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Estilos para las leyendas */
.message-chart-container .apexcharts-legend {
    padding: 10px 0 !important;
}

/* Loading state mientras se renderiza */
.message-chart-container:empty::before {
    content: "Cargando gráfico...";
    display: block;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* Error state */
.message-chart-container.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}