/* public/styles.css - Versión optimizada responsive */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Variables para modo claro (default) */
:root {
    --color-primary: #7380ec;
    --color-danger: #ff7782;
    --color-success: #41f1b6;
    --color-warning: #ffbb55;
    --color-white: #fff;
    --color-info-dark: #7d8da1;
    --color-info-light: #dce1eb;
    --color-dark: #363949;
    --color-light: rgba(132, 139, 200, 0.18);
    --color-primary-variant: #111e88;
    --color-dark-variant: #677483;
    --color-background: #f6f6f9;
    --card-border-radius: 2rem;
    --border-radius-1: 0.4rem;
    --border-radius-2: 0.8rem;
    --border-radius-3: 1.2rem;
    --card-padding: 1.8rem;
    --padding-1: 1.2rem;
    --box-shadow: 0 2rem 3rem var(--color-light);
}

/* Variables para modo oscuro (inspirado en OmniChat) */
body[data-theme="dark"] {
    --color-primary: #25d366;
    --color-danger: #ea4335;
    --color-success: #25d366;
    --color-warning: #fbbc04;
    --color-white: #e9edef;
    --color-info-dark: #8696a0;
    --color-info-light: #2a3942;
    --color-dark: #e9edef;
    --color-light: rgba(42, 57, 66, 0.3);
    --color-primary-variant: #20ba5a;
    --color-dark-variant: #8696a0;
    --color-background: #111b21;
    --box-shadow: 0 2rem 3rem rgba(0, 0, 0, 0.3);
}

/* Colores específicos de tarjetas/cards en modo oscuro */
body[data-theme="dark"] .card {
    background: #202c33;
    border: 1px solid #2a3942;
}

body[data-theme="dark"] .main-header {
    background: #202c33;
    border-bottom: 1px solid #2a3942;
}

body[data-theme="dark"] .sidebar {
    background: #0b141a;
    border-right: 1px solid #2a3942;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
    background: #2a3942;
    color: #e9edef;
    border-color: #2a3942;
}

body[data-theme="dark"] table {
    background: #202c33;
}

body[data-theme="dark"] table th {
    background: #111b21;
    color: #e9edef;
}

body[data-theme="dark"] table td {
    border-bottom: 1px solid #2a3942;
    color: #e9edef;
}

body[data-theme="dark"] table tbody tr:hover {
    background: #2a3942;
}

body[data-theme="dark"] .modal-content {
    background: #202c33;
    border: 1px solid #2a3942;
}

body[data-theme="dark"] .modal-header {
    border-bottom: 1px solid #2a3942;
}

body[data-theme="dark"] .sidebar-nav a {
    color: #8696a0;
}

body[data-theme="dark"] .sidebar-nav a:hover,
body[data-theme="dark"] .sidebar-nav li.active a {
    background: #2a3942;
    color: #25d366;
}

/* ===== CALENDARIO - MODO OSCURO ===== */
body[data-theme="dark"] .fc .fc-toolbar-title {
    color: #e9edef;
    font-weight: 700;
}

body[data-theme="dark"] .fc .fc-col-header-cell {
    background: #111b21;
    color: #e9edef;
    font-weight: 700;
}

body[data-theme="dark"] .fc .fc-daygrid-day-number {
    color: #e9edef;
    font-weight: 600;
}

body[data-theme="dark"] .fc-theme-bootstrap5 {
    --fc-border-color: #2a3942;
    --fc-button-bg-color: #25d366;
    --fc-button-border-color: #25d366;
    --fc-button-hover-bg-color: #20ba5a;
    --fc-button-hover-border-color: #20ba5a;
    --fc-button-active-bg-color: #1a9d4a;
    --fc-today-bg-color: rgba(37, 211, 102, 0.15);
}

body[data-theme="dark"] .fc .fc-button-primary {
    background: #25d366;
    color: #111b21;
    font-weight: 600;
}

body[data-theme="dark"] .fc .fc-button-primary:hover {
    background: #20ba5a;
}

body[data-theme="dark"] .fc-daygrid-day {
    background: #202c33;
}

body[data-theme="dark"] .fc-day-today {
    background-color: rgba(37, 211, 102, 0.15) !important;
}

body[data-theme="dark"] .fc-daygrid-day:hover {
    background-color: #2a3942;
}

body[data-theme="dark"] .fc-more-link {
    color: #25d366;
}

/* Tabs del calendario en modo oscuro */
body[data-theme="dark"] .calendar-tabs {
    background-color: #111b21;
    border: 1px solid #2a3942;
}

body[data-theme="dark"] .calendar-tab-btn {
    background: transparent;
    color: #8696a0;
    font-weight: 600;
}

body[data-theme="dark"] .calendar-tab-btn:hover {
    background: #2a3942;
    color: #e9edef;
}

body[data-theme="dark"] .calendar-tab-btn.active {
    background: #25d366;
    color: #111b21;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

/* ===== BOTONES MODE-BTN - MODO OSCURO (SIN DEGRADADOS) ===== */
body[data-theme="dark"] .mode-btn {
    background: #202c33 !important;
    border: 2px solid #2a3942 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

body[data-theme="dark"] .mode-btn:hover {
    background: #2a3942 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="dark"] .mode-btn.active {
    background: #2a3942 !important;
    border-color: #25d366 !important;
}

body[data-theme="dark"] .mode-btn span {
    color: #e9edef;
    font-weight: 700;
}

body[data-theme="dark"] .mode-btn small {
    color: #e9edef;
    font-weight: 500;
}

/* Colores específicos para cada modo en dark theme */
body[data-theme="dark"] .mode-btn.complete.active {
    border-color: #25d366 !important;
    background: #2a3942 !important;
}

body[data-theme="dark"] .mode-btn.gateway.active {
    border-color: #25d366 !important;
    background: #2a3942 !important;
}

body[data-theme="dark"] .mode-btn.emergency.active {
    border-color: #fbbc04 !important;
    background: #2a3942 !important;
}

body[data-theme="dark"] .mode-btn.stopped.active {
    border-color: #ea4335 !important;
    background: #2a3942 !important;
}

body[data-theme="dark"] .mode-btn.custom-danger:hover {
    border-color: #ea4335;
    background: #2a3942 !important;
}

body[data-theme="dark"] .mode-btn.custom-success:hover {
    border-color: #25d366;
    background: #2a3942 !important;
}

/* ===== BOTONES ACTION-BTN - MODO OSCURO (SIN DEGRADADOS) ===== */
body[data-theme="dark"] .action-btn,
body[data-theme="dark"] .action-btn-small {
    background: #202c33 !important;
    color: #e9edef !important;
    border: 1px solid #2a3942 !important;
}

body[data-theme="dark"] .action-btn:hover,
body[data-theme="dark"] .action-btn-small:hover {
    background: #2a3942 !important;
}

body[data-theme="dark"] .action-btn.connect,
body[data-theme="dark"] .action-btn-small.connect {
    background: #25d366 !important;
    color: #111b21 !important;
    font-weight: 600;
}

body[data-theme="dark"] .action-btn.connect:hover,
body[data-theme="dark"] .action-btn-small.connect:hover {
    background: #20ba5a !important;
}

body[data-theme="dark"] .action-btn.disconnect,
body[data-theme="dark"] .action-btn-small.disconnect {
    background: #ea4335 !important;
    color: #e9edef !important;
}

body[data-theme="dark"] .action-btn.disconnect:hover,
body[data-theme="dark"] .action-btn-small.disconnect:hover {
    background: #d33828 !important;
}

body[data-theme="dark"] .action-btn.warning,
body[data-theme="dark"] .action-btn-small.warning {
    background: #fbbc04 !important;
    color: #111b21 !important;
}

/* ===== FORMULARIOS Y CAMPOS - MODO OSCURO (SIN DEGRADADOS) ===== */
body[data-theme="dark"] label {
    color: #e9edef;
    font-weight: 600;
}

body[data-theme="dark"] .form-group small {
    color: #8696a0;
}

body[data-theme="dark"] button[type="submit"] {
    background: #25d366 !important;
    color: #111b21 !important;
    font-weight: 600;
}

body[data-theme="dark"] button[type="submit"]:hover {
    background: #20ba5a !important;
}

/* ===== INPUTS Y CAMPOS DE TEXTO - MODO OSCURO (FONDO OSCURO, TEXTO BLANCO) ===== */
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] input[type="tel"],
body[data-theme="dark"] input[type="url"],
body[data-theme="dark"] input[type="date"],
body[data-theme="dark"] input[type="time"],
body[data-theme="dark"] input[type="datetime-local"],
body[data-theme="dark"] textarea,
body[data-theme="dark"] .main-section input[type="text"],
body[data-theme="dark"] .main-section input[type="email"],
body[data-theme="dark"] .main-section input[type="password"],
body[data-theme="dark"] .main-section input[type="number"],
body[data-theme="dark"] .main-section input[type="tel"],
body[data-theme="dark"] .main-section input[type="url"],
body[data-theme="dark"] .main-section textarea,
body[data-theme="dark"] section input,
body[data-theme="dark"] section textarea {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
    -webkit-text-fill-color: #ffffff !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: #6b7c8e !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] textarea:focus {
    border-color: #25d366 !important;
    outline: none !important;
    background: #1a252f !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2) !important;
}

/* Asegurar que el valor escrito sea visible con máximo contraste */
body[data-theme="dark"] input:not(:placeholder-shown),
body[data-theme="dark"] textarea:not(:placeholder-shown) {
    color: #ffffff !important;
    font-weight: 700 !important;
    background: #1a252f !important;
    background-color: #1a252f !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Regla súper específica para TODOS los inputs en modo oscuro */
body[data-theme="dark"] input,
body[data-theme="dark"] .main-content input,
body[data-theme="dark"] .card input,
body[data-theme="dark"] form input,
body[data-theme="dark"] #settings input,
body[data-theme="dark"] .main-section input,
body[data-theme="dark"] section input,
body[data-theme="dark"] div input {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

body[data-theme="dark"] textarea,
body[data-theme="dark"] .main-content textarea,
body[data-theme="dark"] .card textarea,
body[data-theme="dark"] form textarea,
body[data-theme="dark"] #settings textarea,
body[data-theme="dark"] .main-section textarea,
body[data-theme="dark"] section textarea,
body[data-theme="dark"] div textarea {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

/* FORZAR para menús y settings específicamente */
body[data-theme="dark"] .menu-editor input,
body[data-theme="dark"] .menu-item input,
body[data-theme="dark"] [class*="menu"] input,
body[data-theme="dark"] [class*="editor"] input,
body[data-theme="dark"] [class*="settings"] input,
body[data-theme="dark"] [id*="settings"] input {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

/* ===== SELECT DROPDOWNS - MODO OSCURO ===== */
body[data-theme="dark"] select {
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

body[data-theme="dark"] select option {
    background: #1a252f !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] select:focus {
    border-color: #25d366 !important;
    outline: none !important;
    background: #1a252f !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2) !important;
}

/* ===== DATE Y TIME PICKERS - MODO OSCURO ===== */
/* Asegurar visibilidad del calendario de fechas */
body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

body[data-theme="dark"] input[type="date"]::-webkit-datetime-edit,
body[data-theme="dark"] input[type="time"]::-webkit-datetime-edit,
body[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit {
    color: #ffffff !important;
}

body[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-fields-wrapper,
body[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    color: #ffffff !important;
}

body[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-text,
body[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-text {
    color: #ffffff !important;
}

body[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field,
body[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field,
body[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field,
body[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-hour-field,
body[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-minute-field,
body[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-ampm-field {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* ===== BOTONES - ELIMINAR DEGRADADOS Y ESTANDARIZAR ===== */
body[data-theme="dark"] button,
body[data-theme="dark"] .btn {
    background: #202c33 !important;
    color: #e9edef !important;
    border: 1px solid #2a3942 !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] button:hover,
body[data-theme="dark"] .btn:hover {
    background: #2a3942 !important;
}

body[data-theme="dark"] button.primary,
body[data-theme="dark"] .btn-primary {
    background: #25d366 !important;
    color: #111b21 !important;
}

body[data-theme="dark"] button.primary:hover,
body[data-theme="dark"] .btn-primary:hover {
    background: #20ba5a !important;
}

body[data-theme="dark"] button.danger,
body[data-theme="dark"] .btn-danger {
    background: #ea4335 !important;
    color: #e9edef !important;
}

body[data-theme="dark"] button.danger:hover,
body[data-theme="dark"] .btn-danger:hover {
    background: #d33828 !important;
}

/* ===== MODALES - MODO OSCURO ===== */
body[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}

body[data-theme="dark"] .modal {
    background: #202c33 !important;
}

body[data-theme="dark"] .modal-header {
    border-bottom-color: #2a3942 !important;
}

body[data-theme="dark"] .modal-header h3,
body[data-theme="dark"] .modal-header h4 {
    color: #e9edef !important;
}

body[data-theme="dark"] .close-modal-btn {
    color: #e9edef !important;
}

body[data-theme="dark"] .modal-body {
    background: #202c33 !important;
}

body[data-theme="dark"] .modal-footer {
    background: #111b21 !important;
    border-top: 1px solid #2a3942 !important;
}

/* ===== TARJETAS Y SECCIONES - MODO OSCURO ===== */
body[data-theme="dark"] .settings-section,
body[data-theme="dark"] .config-section {
    background: #202c33 !important;
    border: 2px solid #4a5c6a !important;
}

/* Asegurar que todos los contornos y bordes sean visibles */
body[data-theme="dark"] .section,
body[data-theme="dark"] section,
body[data-theme="dark"] .container {
    border-color: #4a5c6a !important;
}

body[data-theme="dark"] .section h2,
body[data-theme="dark"] .section h3,
body[data-theme="dark"] .section h4,
body[data-theme="dark"] .section p,
body[data-theme="dark"] section h2,
body[data-theme="dark"] section h3,
body[data-theme="dark"] section h4,
body[data-theme="dark"] section p {
    color: #e9edef !important;
}

body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5 {
    color: #e9edef !important;
}

body[data-theme="dark"] p {
    color: #e9edef !important;
}

/* ===== LISTAS Y ITEMS - MODO OSCURO ===== */
body[data-theme="dark"] ul li,
body[data-theme="dark"] ol li {
    color: #e9edef !important;
}

/* ===== CAMPOS DISABLED - MODO OSCURO ===== */
body[data-theme="dark"] input:disabled,
body[data-theme="dark"] select:disabled,
body[data-theme="dark"] textarea:disabled {
    background: #0f1820 !important;
    color: #4a5c6a !important;
    opacity: 0.7 !important;
    border-color: #1a252f !important;
}

/* ===== ICONOS Y BADGES - MODO OSCURO ===== */
body[data-theme="dark"] .badge {
    background: #2a3942 !important;
    color: #e9edef !important;
}

body[data-theme="dark"] .badge.success {
    background: #25d366 !important;
    color: #111b21 !important;
}

body[data-theme="dark"] .badge.danger {
    background: #ea4335 !important;
    color: #e9edef !important;
}

/* ===== SETTINGS-CARD HOVER - MODO OSCURO ===== */
body[data-theme="dark"] .settings-card {
    background: #202c33 !important;
    border: 1px solid #2a3942 !important;
}

body[data-theme="dark"] .settings-card:hover {
    background: #2a3942 !important;
    transform: translateY(-5px);
}

body[data-theme="dark"] .settings-card span {
    color: #e9edef !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .settings-icon {
    color: #25d366 !important;
}

/* ===== MODERN-FORM - MODO OSCURO ===== */
body[data-theme="dark"] .modern-form label {
    color: #e9edef !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .modern-form input,
body[data-theme="dark"] .modern-form textarea,
body[data-theme="dark"] .modern-form select {
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

body[data-theme="dark"] .modern-form input:focus,
body[data-theme="dark"] .modern-form textarea:focus,
body[data-theme="dark"] .modern-form select:focus {
    border-color: #25d366 !important;
    background: #1a252f !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2) !important;
}

body[data-theme="dark"] .modern-form small {
    color: #a0aec0 !important;
}

/* ===== FORM-GROUP GENERAL - MODO OSCURO ===== */
body[data-theme="dark"] .form-group label {
    color: #e9edef !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .form-group input,
body[data-theme="dark"] .form-group textarea,
body[data-theme="dark"] .form-group select {
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

body[data-theme="dark"] .form-group small {
    color: #a0aec0 !important;
}

/* ===== TIME SLOTS - MODO OSCURO ===== */
body[data-theme="dark"] .time-slot input[type="time"] {
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

/* ===== ISP OPTIONS - MODO OSCURO ===== */
body[data-theme="dark"] .isp-option,
body[data-theme="dark"] .isp-card,
body[data-theme="dark"] .platform-item {
    background: #202c33 !important;
    border: 2px solid #2a3942 !important;
}

body[data-theme="dark"] .isp-option:hover,
body[data-theme="dark"] .isp-card:hover,
body[data-theme="dark"] .platform-item:hover {
    background: #2a3942 !important;
    border-color: #25d366 !important;
}

body[data-theme="dark"] .isp-option.selected,
body[data-theme="dark"] .isp-card.selected,
body[data-theme="dark"] .platform-item.selected {
    background: #2a3942 !important;
    border-color: #25d366 !important;
}

body[data-theme="dark"] .isp-option h4,
body[data-theme="dark"] .isp-option p,
body[data-theme="dark"] .isp-card h4,
body[data-theme="dark"] .isp-card p,
body[data-theme="dark"] .platform-item h4,
body[data-theme="dark"] .platform-item p {
    color: #e9edef !important;
}

/* ===== GROUP CARDS - MODO OSCURO ===== */
body[data-theme="dark"] .group-card,
body[data-theme="dark"] .group-status-card {
    background: #202c33 !important;
    border: 1px solid #2a3942 !important;
}

body[data-theme="dark"] .group-card h4,
body[data-theme="dark"] .group-card h5,
body[data-theme="dark"] .group-status-card h4,
body[data-theme="dark"] .group-status-card h5 {
    color: #e9edef !important;
}

body[data-theme="dark"] .group-card p,
body[data-theme="dark"] .group-status-card p {
    color: #e9edef !important;
}

body[data-theme="dark"] .group-status-card.configured {
    background: #2a3942 !important;
    border-color: #25d366 !important;
}

/* ===== MODALES EMERGENTES - MODO OSCURO ===== */
body[data-theme="dark"] .modal-content {
    background: #202c33 !important;
    border: 1px solid #2a3942 !important;
    color: #e9edef !important;
}

body[data-theme="dark"] .modal-header {
    background: #111b21 !important;
    border-bottom: 1px solid #2a3942 !important;
    color: #e9edef !important;
}

body[data-theme="dark"] .modal-header h2,
body[data-theme="dark"] .modal-header h3,
body[data-theme="dark"] .modal-header h4 {
    color: #e9edef !important;
}

body[data-theme="dark"] .modal-body label {
    color: #e9edef !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .modal-body input,
body[data-theme="dark"] .modal-body textarea,
body[data-theme="dark"] .modal-body select {
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

body[data-theme="dark"] .modal-body input::placeholder,
body[data-theme="dark"] .modal-body textarea::placeholder {
    color: #6b7c8e !important;
    font-weight: 400 !important;
}

/* Inputs disabled dentro de modales - más específico que .modal-body input */
body[data-theme="dark"] .modal input:disabled,
body[data-theme="dark"] .modal-body input:disabled,
body[data-theme="dark"] .modal input[disabled],
body[data-theme="dark"] .modal-body input[disabled],
body[data-theme="dark"] .modal textarea:disabled,
body[data-theme="dark"] .modal select:disabled {
    background: #2a3942 !important;
    color: #8696a0 !important;
    opacity: 0.8 !important;
    border-color: #364954 !important;
    cursor: not-allowed !important;
}

/* Forzar estilos en autofill/autocomplete del navegador para modales */
body[data-theme="dark"] .modal input:-webkit-autofill,
body[data-theme="dark"] .modal input:-webkit-autofill:hover,
body[data-theme="dark"] .modal input:-webkit-autofill:focus,
body[data-theme="dark"] .modal-body input:-webkit-autofill,
body[data-theme="dark"] .modal-body input:-webkit-autofill:hover,
body[data-theme="dark"] .modal-body input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1a252f inset !important;
    box-shadow: 0 0 0px 1000px #1a252f inset !important;
    background-color: #1a252f !important;
    background: #1a252f !important;
    border: 2px solid #2d3e50 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Autofill para inputs disabled en modales */
body[data-theme="dark"] .modal input:disabled:-webkit-autofill,
body[data-theme="dark"] .modal-body input:disabled:-webkit-autofill,
body[data-theme="dark"] .modal input[disabled]:-webkit-autofill {
    -webkit-text-fill-color: #8696a0 !important;
    -webkit-box-shadow: 0 0 0px 1000px #2a3942 inset !important;
    box-shadow: 0 0 0px 1000px #2a3942 inset !important;
    background-color: #2a3942 !important;
    background: #2a3942 !important;
}

/* ===== APPOINTMENT MODAL - MODO OSCURO ===== */
body[data-theme="dark"] .appointment-modal .form-group label {
    color: #e9edef !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .appointment-modal .form-group input,
body[data-theme="dark"] .appointment-modal .form-group textarea,
body[data-theme="dark"] .appointment-modal .form-group select {
    background: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

/* ===== TOGGLE GROUP - MODO OSCURO ===== */
body[data-theme="dark"] .form-group.toggle-group small {
    color: #a0aec0 !important;
}

/* ===== CARD GENERAL - MODO OSCURO (sin cambiar a blanco en hover) ===== */
body[data-theme="dark"] .card:hover {
    background: #202c33 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="dark"] .card h2,
body[data-theme="dark"] .card h3,
body[data-theme="dark"] .card h4 {
    color: #e9edef !important;
}

/* ULTRA FORZADO - Capturar CUALQUIER input sin importar su clase */
body[data-theme="dark"] *[type="text"],
body[data-theme="dark"] *[type="email"],
body[data-theme="dark"] *[type="password"],
body[data-theme="dark"] *[type="number"],
body[data-theme="dark"] *[type="tel"],
body[data-theme="dark"] *[type="url"] {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

/* Asegurar que NINGÚN input tenga fondo claro */
body[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

body[data-theme="dark"] textarea {
    background-color: #1a252f !important;
    background: #1a252f !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    font-weight: 700 !important;
}

/* Eliminar todos los degradados en modo oscuro */
body[data-theme="dark"] * {
    background-image: none !important;
}

* {
    margin: 0;
    padding: 0;
    outline: 0;
    appearance: none;
    border: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
}
/* Restaurar apariencia de checkboxes en tablas */
.tickets-table input[type="checkbox"],
.row-checkbox,
#select-all-tickets,
#select-all-receipts {
    appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    margin: 0 auto !important;
    display: block !important;
}
html {
    font-size: 14px;
}

body {
    width: 100vw;
    height: 100vh;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    background: var(--color-background);
    user-select: none;
    overflow-x: hidden;
    color: var(--color-dark);
}

.dashboard-container {
    display: grid;
    width: 96%;
    margin: 0 auto;
    gap: 1.8rem;
    grid-template-columns: 14rem auto;
}

a {
    color: var(--color-dark);
}

img {
    display: block;
    width: 100%;
}

h1 {
    font-weight: 800;
    font-size: 1.8rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 0.87rem;
}

h4 {
    font-size: 0.8rem;
}

h5 {
    font-size: 0.77rem;
}

small {
    font-size: 0.75rem;
}

.profile-photo {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    overflow: hidden;
}

.text-muted {
    color: var(--color-info-dark);
}

p {
    color: var(--color-dark-variant);
}

b {
    color: var(--color-dark);
}

.primary {
    color: var(--color-primary);
}
.danger {
    color: var(--color-danger);
}
.success {
    color: var(--color-success);
}
.warning {
    color: var(--color-warning);
}

/* --- Sidebar --- */
.sidebar {
    height: 100vh;
    background: var(--color-white);
    padding: var(--card-padding);
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
    position: relative;
}

.sidebar:hover {
    box-shadow: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
}

.logo-text {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.sidebar-nav h3 {
    font-weight: 500;
    color: var(--color-info-dark);
    margin: 1.5rem 0 0.8rem;
}

.sidebar-nav ul li a {
    display: flex;
    color: var(--color-info-dark);
    margin-left: 2rem;
    gap: 1rem;
    align-items: center;
    position: relative;
    height: 3.7rem;
    transition: all 300ms ease;
}

.sidebar-nav ul li a span {
    font-size: 1rem;
}

.sidebar-nav ul li a:hover {
    color: var(--color-primary);
}

.sidebar-nav ul li.active a {
    background: var(--color-light);
    color: var(--color-primary);
    margin-left: 0;
}

.sidebar-nav ul li.active a:before {
    content: "";
    width: 6px;
    height: 100%;
    background: var(--color-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid var(--color-info-light);
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-info-dark);
    height: 3.7rem;
    transition: all 300ms ease;
    width: 100%;
    padding: 0 1rem;
}

.logout-button:hover {
    color: var(--color-danger);
    background: var(--color-light);
    border-radius: var(--border-radius-1);
}

.version-display {
    text-align: center;
    padding: 0.8rem;
    font-size: 0.75rem;
    color: var(--color-info-dark);
    font-weight: 500;
    letter-spacing: 0.5px;
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    margin-top: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.version-display:hover {
    opacity: 1;
}

/* --- Main Content --- */
.main-wrapper {
    margin-top: 1.4rem;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
}

.search-bar {
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    padding: var(--padding-1) 1.6rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 300px;
}

.search-bar input {
    background: transparent;
    width: 100%;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-icon {
    font-size: 1.2rem;
    position: relative;
}

.notification-dot {
    background: var(--color-danger);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: absolute;
    top: -2px;
    right: -2px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: right;
}

.profile-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--color-white);
    font-size: 1.2rem;
}

/* --- Cards and Layout --- */
.card {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    margin-top: 1rem;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

.card:hover {
    box-shadow: none;
}

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

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.search-box i.fa-search {
    position: absolute;
    left: 12px;
    color: var(--color-text-secondary);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-2);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius-1);
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background-color: var(--color-background-tertiary);
    color: var(--color-danger);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.6rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--border-radius-3);
    color: var(--color-white);
}

.kpi-card.bg-blue { background: var(--color-primary); }
.kpi-card.bg-green { background: var(--color-success); }
.kpi-card.bg-orange { background: var(--color-warning); }
.kpi-card.bg-red { background: var(--color-danger); }

.kpi-icon {
    font-size: 2.5rem;
}

.kpi-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
}

.main-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
}

.chart-container {
    height: 250px;
    position: relative;
}

.log-viewer-iframe {
    width: 100%;
    height: 300px;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-2);
}

/* --- Contenedores de tablas responsive --- */
.card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card-body:has(.tickets-table) {
    max-height: 70vh;
    overflow-y: auto;
}
.tickets-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Tables --- */
.tickets-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.tickets-table th {
    padding: 0.8rem 1.2rem;
    color: var(--color-info-dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tickets-table td {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--color-light);
}

.tickets-table tbody tr:hover {
    background: var(--color-light);
}

/* TICKETS - Pendiente = NARANJA */
.status-pendiente { 
    background: var(--color-warning) !important;
    color: var(--color-white) !important;
}

/* TICKETS - En Progreso = AZUL */
.status-en-progreso { 
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
}

/* TICKETS - Cerrado = VERDE */
.status-cerrado { 
    background: var(--color-success) !important;
    color: var(--color-white) !important;
}

/* TICKETS - Cerrado Forzado = GRIS OSCURO con borde */
.status-cerrado-\(forzado\),
.status-cerrado-forzado {
    background: #495057 !important;
    color: var(--color-white) !important;
    border: 2px solid #6c757d !important;
}

/* TICKETS - Pendiente Transferido = NARANJA con borde */
.status-pendiente-\(transferido\),
.status-pendiente-transferido {
    background: var(--color-warning) !important;
    color: var(--color-white) !important;
    border: 2px solid #e69500 !important;
}
.status-aprobado { 
    background: var(--color-success) !important;
    color: var(--color-white) !important;
}
.status-auto-aprobado { 
    background: #28a745 !important;
    color: var(--color-white) !important;
    border: 2px solid var(--color-success) !important;
}
.status-rechazado { background: var(--color-danger); }
.status-pendiente-\(no-identificado\),
.status-pendiente-no-identificado {
    background: #f1c40f !important;
    color: var(--color-dark) !important;
}
.status-error-de-auto-imputación,
.status-error-de-auto-imputacion {
    background: #e74c3c !important;
    color: var(--color-white) !important;
}
/* === ESTILOS ADICIONALES PARA ESTADOS DE SESIONES === */

/* En progreso - Chat directo = AZUL con borde */
.status-en-progreso-\(chat-directo\),
.status-en-progreso-chat-directo {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border: 2px solid #5a67d8 !important;
}

/* En progreso - Ventas = AZUL CLARO con borde */
.status-en-progreso-\(ventas\),
.status-en-progreso-ventas {
    background: #5a9fd4 !important;
    color: var(--color-white) !important;
    border: 2px solid var(--color-primary) !important;
}

/* Pendiente - Menos No Conocida */
.status-pendiente-\(menos-no-conocida\),
.status-pendiente-menos-no-conocida {
    background: var(--color-warning) !important;
    color: var(--color-white) !important;
    border: 2px solid #e69500 !important;
}

/* === ESTILOS ADICIONALES PARA ESTADOS DE COMPROBANTES === */

/* Promesa registrada (auto) */
.status-promesa-registrada-\(auto\),
.status-promesa-registrada-auto {
    background: #2ecc71 !important;
    color: var(--color-white) !important;
    border: 2px solid #27ae60 !important;
}

/* Error de Auto-imputación */
.status-error-de-auto-imputación,
.status-error-de-auto-imputacion {
    background: var(--color-danger) !important;
    color: var(--color-white) !important;
}

/* Mejora visual para badges con paréntesis */
.status-badge[class*="("] {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.7rem !important;
    border-radius: 4px !important;
}

/* Efecto hover para todos los badges especiales */
.status-en-progreso-chat-directo:hover,
.status-en-progreso-ventas:hover,
.status-pendiente-transferido:hover,
.status-promesa-registrada-auto:hover,
.status-error-de-auto-imputacion:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}
.sentiment-icon,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.6rem !important;
    border-radius: 4px !important;
    color: var(--color-white);
    font-size: 0.7rem !important;
    font-weight: 500;
}
.sentiment-enojado { background: var(--color-danger); }
.sentiment-frustrado { background: var(--color-warning); }
.sentiment-neutro { background: var(--color-dark-variant); }
.sentiment-contento { background: var(--color-success); }

/* --- SISTEMA UNIFICADO DE BOTONES --- */

/* Botones Primarios - Inspirados en el dashboard */
.action-btn, .action-btn-small {
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 300ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.action-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
}

.action-btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Botones Primarios - Azul fijo como la tarjeta CONECTADO */
.action-btn.connect, .action-btn-small.connect,
.action-btn:not(.disconnect):not(.danger):not(.warning), 
.action-btn-small:not(.disconnect):not(.danger):not(.warning):not(.edit-btn):not(.delete-btn) {
    background: #7380ec;
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn.connect:hover, .action-btn-small.connect:hover,
.action-btn:not(.disconnect):not(.danger):not(.warning):hover,
.action-btn-small:not(.disconnect):not(.danger):not(.warning):not(.edit-btn):not(.delete-btn):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Botones Secundarios - Verde fijo como Tickets Abiertos con tamaño unificado */
.create-group-btn, .add-agent-btn, .add-plan-btn, .add-promo-btn, 
.add-zona-btn, .add-faq-btn, .add-support-faq-btn, .add-user-btn,
.add-agent-to-group-btn, .add-root-item-btn, .add-context-btn {
    background: #41f1b6 !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 12px rgba(65, 241, 182, 0.3) !important;
    font-size: 0.85rem !important;
    height: auto !important;
    min-height: 44px !important;
}

.create-group-btn:hover, .add-agent-btn:hover, .add-plan-btn:hover, .add-promo-btn:hover, 
.add-zona-btn:hover, .add-faq-btn:hover, .add-support-faq-btn:hover, .add-user-btn:hover,
.add-agent-to-group-btn:hover, .add-root-item-btn:hover, .add-context-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.4) !important;
}

/* Botones de Acción Rápida - Iconos únicamente */
.edit-btn, .delete-btn, .edit-user-btn, .delete-user-btn, .view-ticket-btn, 
.view-receipt-btn, .trash-item-btn, .restore-item-btn, .delete-permanently-btn,
.edit-agent-btn, .delete-agent-btn, .edit-zona-btn, .delete-zona-btn,
.add-child-btn, .edit-item-btn, .delete-item-btn, .edit-context-btn, .delete-context-btn,
.edit-group-agent-btn, .delete-group-agent-btn {
    background: #f1f5f9 !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--color-dark-variant) !important;
    font-size: 0.9rem !important;
}

.edit-btn:hover, .edit-user-btn:hover, .view-ticket-btn:hover, 
.view-receipt-btn:hover, .edit-agent-btn:hover, .edit-zona-btn:hover,
.add-child-btn:hover, .edit-item-btn:hover, .edit-context-btn:hover,
.edit-group-agent-btn:hover {
    background: #e2e8f0 !important;
    transform: translateY(-1px) !important;
}

.delete-btn:hover, .delete-user-btn:hover, .trash-item-btn:hover, 
.delete-permanently-btn:hover, .delete-agent-btn:hover, .delete-zona-btn:hover,
.delete-item-btn:hover, .delete-context-btn:hover, .delete-group-agent-btn:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    transform: translateY(-1px) !important;
}

/* Efecto hover verde específico para botón ver */
.view-ticket-btn:hover,
.view-receipt-btn:hover {
    background: #d1fae5 !important;
    color: #059669 !important;
    transform: translateY(-1px) !important;
}
/* Efecto hover verde específico para botón ver */
.view-ticket-btn:hover,
.view-receipt-btn:hover {
    background: #d1fae5 !important;
    color: #059669 !important;
    transform: translateY(-1px) !important;
}

/* Botones de Estado Peligroso - Rojo fijo como Alertas del Sistema */
.action-btn.disconnect, .action-btn-small.disconnect, 
.delete-group-btn, .kill-session-btn {
    background: #ff7782 !important;
    color: var(--color-white) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.action-btn.disconnect:hover, .action-btn-small.disconnect:hover,
.delete-group-btn:hover, .kill-session-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
}

/* Botones de Estado - Para mostrar estados y categorías */
.status-badge {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    transition: all 300ms ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Filtros y Controles */
.filter-btn, .kpi-filter-btn {
    background: #f1f5f9 !important;
    color: var(--color-dark-variant) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    transition: all 300ms ease !important;
}

.filter-btn:hover, .kpi-filter-btn:hover {
    background: #e2e8f0 !important;
    transform: translateY(-1px) !important;
}

.filter-btn.active, .kpi-filter-btn.active {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border-color: var(--color-primary) !important;
}

/* Botones de Paginación */
.pagination-btn {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 0.8rem !important;
    transition: all 300ms ease !important;
    padding: 8px 16px !important;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border-color: var(--color-primary) !important;
}

.pagination-btn:disabled {
    background: #e2e8f0 !important;
    color: var(--color-dark-variant) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Botones de Formulario - Azul fijo como CONECTADO */
.modern-form button[type="submit"] {
    background: #7380ec !important;
    color: var(--color-white) !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    margin-top: 1rem !important;
    transition: all 300ms ease !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.modern-form button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

/* Botones de Login - Azul fijo como CONECTADO */
.login-card button[type="submit"] {
    background: #7380ec !important;
    color: var(--color-white) !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 300ms ease !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.login-card button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

/* Botones de Modo de Operación */
.mode-btn {
    background: var(--color-white) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    border: 2px solid transparent !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    padding: 1.5rem 1rem !important;
    text-align: center !important;
}

.mode-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}

.mode-btn.active {
    border-color: var(--color-primary) !important;
    background: linear-gradient(135deg, #fff 0%, rgba(115, 128, 236, 0.1) 100%) !important;
}

/* Botones de regresar - Naranja como Visitas Agendadas con tamaño unificado */
.back-to-settings {
    background: #ffbb55 !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: all 300ms ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 12px rgba(255, 187, 85, 0.3) !important;
}

.back-to-settings:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 187, 85, 0.4) !important;
}

.back-to-settings:hover {
    background: #e2e8f0 !important;
    transform: translateY(-1px) !important;
}

/* Responsivo para botones pequeños */
@media screen and (max-width: 768px) {
    .action-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .action-btn-small {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    
    .create-group-btn, .add-agent-btn, .add-plan-btn, .add-promo-btn, 
    .add-zona-btn, .add-faq-btn, .add-support-faq-btn, .add-user-btn,
    .add-agent-to-group-btn, .add-root-item-btn, .add-context-btn {
        padding: 10px 16px !important;
        font-size: 0.8rem !important;
    }
    
    .edit-btn, .delete-btn, .edit-user-btn, .delete-user-btn, .view-ticket-btn, 
    .view-receipt-btn, .trash-item-btn, .restore-item-btn, .delete-permanently-btn,
    .edit-agent-btn, .delete-agent-btn, .edit-zona-btn, .delete-zona-btn,
    .add-child-btn, .edit-item-btn, .delete-item-btn, .edit-context-btn, .delete-context-btn,
    .edit-group-agent-btn, .delete-group-agent-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
}
/* --- FORMULARIOS MEJORADOS --- */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.modern-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .modern-form .form-row {
        grid-template-columns: 1fr;
    }
}

.modern-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modern-form label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1.4;
}

body:not([data-theme="dark"]) .modern-form input,
body:not([data-theme="dark"]) .modern-form textarea,
body:not([data-theme="dark"]) .modern-form select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--color-white);
    border: 2px solid #e2e8f0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--color-dark);
    transition: all 300ms ease;
    line-height: 1.5;
}

body:not([data-theme="dark"]) .modern-form input:focus,
body:not([data-theme="dark"]) .modern-form textarea:focus,
body:not([data-theme="dark"]) .modern-form select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
    box-shadow: 0 0 0 3px rgba(115, 128, 236, 0.1);
}

/* Modo oscuro para modern-form */
body[data-theme="dark"] .modern-form input,
body[data-theme="dark"] .modern-form textarea,
body[data-theme="dark"] .modern-form select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: all 300ms ease;
    background: #1a252f !important;
    background-color: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    -webkit-text-fill-color: #ffffff !important;
}

body[data-theme="dark"] .modern-form input:focus,
body[data-theme="dark"] .modern-form textarea:focus,
body[data-theme="dark"] .modern-form select:focus {
    background: #1a252f !important;
    border-color: #25d366 !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2) !important;
}

.modern-form textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Poppins', sans-serif;
}

.modern-form small {
    color: var(--color-info-dark);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: 0.3rem;
}

/* Campos específicos */
body:not([data-theme="dark"]) .time-slot input[type="time"] {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: var(--color-white) !important;
    color: var(--color-dark) !important;
}

/* Modo oscuro para time-slot */
body[data-theme="dark"] .time-slot input[type="time"] {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    background: #1a252f !important;
    background-color: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    -webkit-text-fill-color: #ffffff !important;
}

body:not([data-theme="dark"]) input[type="date"] {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: var(--color-white) !important;
    color: var(--color-dark) !important;
}

/* Modo oscuro para input[type="date"] */
body[data-theme="dark"] input[type="date"] {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    background: #1a252f !important;
    background-color: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Corregir inputs específicos - SOLO en modo claro */
body:not([data-theme="dark"]) #company-config-form input,
body:not([data-theme="dark"]) #company-config-form textarea,
body:not([data-theme="dark"]) .isp-credential-form input,
body:not([data-theme="dark"]) .isp-credential-form textarea,
body:not([data-theme="dark"]) .isp-credential-form select,
body:not([data-theme="dark"]) .integration-card-body input,
body:not([data-theme="dark"]) .integration-card-body textarea,
body:not([data-theme="dark"]) .integration-card-body select,
body:not([data-theme="dark"]) .office-hours-section input,
body:not([data-theme="dark"]) .office-hours-section textarea,
body:not([data-theme="dark"]) .modal input,
body:not([data-theme="dark"]) .modal textarea,
body:not([data-theme="dark"]) .modal select {
    font-size: 0.95rem !important;
    padding: 12px 16px !important;
    color: var(--color-dark) !important;
    background: var(--color-white) !important;
    border: 2px solid #e2e8f0 !important;
    line-height: 1.5 !important;
}

/* Modo oscuro para estas clases específicas - debe ir DESPUÉS para tener prioridad */
body[data-theme="dark"] #company-config-form input,
body[data-theme="dark"] #company-config-form textarea,
body[data-theme="dark"] .isp-credential-form input,
body[data-theme="dark"] .isp-credential-form textarea,
body[data-theme="dark"] .isp-credential-form select,
body[data-theme="dark"] .integration-card-body input,
body[data-theme="dark"] .integration-card-body textarea,
body[data-theme="dark"] .integration-card-body select,
body[data-theme="dark"] .office-hours-section input,
body[data-theme="dark"] .office-hours-section textarea,
body[data-theme="dark"] .modal input,
body[data-theme="dark"] .modal textarea,
body[data-theme="dark"] .modal select {
    font-size: 0.95rem !important;
    padding: 12px 16px !important;
    line-height: 1.5 !important;
    background: #1a252f !important;
    background-color: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Toggle switches - mantener funcionalidad */
.toggle-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Grids de formularios */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-with-button {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
}

.input-with-button input {
    flex-grow: 1;
}
/* --- Sections --- */
.main-section {
    display: none;
}
.main-section.active {
    display: block;
}

/* --- Settings Page --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.settings-card {
    background: var(--color-light);
    padding: 2rem;
    border-radius: var(--border-radius-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 300ms ease;
}
.settings-card:hover {
    background: var(--color-white);
    box-shadow: var(--box-shadow);
    transform: translateY(-5px);
}
.settings-icon {
    font-size: 2rem;
    color: var(--color-primary);
}
.settings-card span {
    font-weight: 500;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 300ms ease;
}
.modal-overlay.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}
.modal {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius-3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all 300ms ease;
}
.modal-overlay.show .modal {
    transform: scale(1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-light);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.close-modal-btn {
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-footer .action-btn {
    min-width: 120px !important;
    padding: 12px 24px !important;
    flex: 0 0 auto;
}

.modal-footer .action-btn.disconnect,
.modal-footer .action-btn.connect {
    min-width: 120px !important;
    padding: 12px 24px !important;
}

.modal.modal-lg {
    max-width: 900px;
}
.receipt-modal-body {
    display: flex;
    gap: 2rem;
    max-height: 60vh;
}
.receipt-image-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-2);
}
.receipt-image-container img {
    width: 100%;
    height: auto;
}
.receipt-details-container {
    flex: 1;
}
.receipt-details-container h4 {
    margin-bottom: 1rem;
}
.receipt-detail {
    margin-bottom: 0.8rem;
}

/* Button pool para zonas en modales */
.button-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-light);
    border-radius: var(--border-radius-1);
}

.zone-btn {
    padding: 0.5rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    cursor: pointer;
    transition: all 300ms ease;
    color: var(--color-dark);
}

body[data-theme="dark"] .zone-btn {
    background: #2a3942;
    border-color: #364954;
    color: #e9edef;
}

.zone-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

body[data-theme="dark"] .zone-btn:hover {
    background: #7380ec;
}

.zone-btn.active {
    background: var(--color-success) !important;
    color: var(--color-white) !important;
    border-color: var(--color-success) !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .zone-btn.active {
    background: var(--color-success) !important;
    color: #111b21 !important;
    border-color: var(--color-success) !important;
    font-weight: 600 !important;
}

/* Toggle switch */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-light);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-2);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.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: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color-success);
}

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

/* Switch rojo para acciones peligrosas */
.switch-danger input:checked + .slider {
    background-color: #e53e3e;
}

/* --- Spinner y Tags --- */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--color-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1.5rem auto;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: var(--color-light);
    padding: 1rem;
    border-radius: var(--border-radius-1);
    min-height: 50px;
}

.group-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-1);
    font-size: 0.8rem;
}

.delete-tag-btn {
    background: none;
    color: var(--color-white);
    margin-left: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

.empty-pool-message {
    color: var(--color-info-dark);
    font-style: italic;
}

/* --- Menu Editor --- */
.menu-tree-container {
    padding-left: 20px;
}
.menu-tree-level {
    position: relative;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--color-light);
}

body[data-theme="dark"] .menu-tree-level {
    border-left-color: #2a3942;
}
.menu-tree-level li {
    position: relative;
    margin: 1rem 0;
}
.menu-tree-level li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 18px;
    width: 20px;
    height: 1px;
    background-color: var(--color-light);
}

body[data-theme="dark"] .menu-tree-level li::before {
    background-color: #2a3942;
}
.menu-tree-level li:last-child > .menu-item-node::after {
    content: '';
    position: absolute;
    left: -15px;
    top: 19px;
    bottom: 0;
    width: 1px;
    background-color: var(--color-background);
}
.menu-item-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-white);
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius-2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 300ms ease;
}

body[data-theme="dark"] .menu-item-node {
    background-color: #202c33;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.menu-item-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

body[data-theme="dark"] .menu-item-node:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.menu-item-title {
    font-weight: 500;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

body[data-theme="dark"] .menu-item-title {
    color: #e9edef;
}

.menu-item-title i {
    color: var(--color-primary);
}

body[data-theme="dark"] .menu-item-title i {
    color: #25d366;
}

.menu-item-actions {
    display: flex;
    gap: 0.5rem;
}

.kpi-filters {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
}
.kpi-filter-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-1);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 300ms ease;
    border: 1px solid rgba(255,255,255,0.3);
}
.kpi-filter-btn:hover {
    background: rgba(255,255,255,0.4);
}
.kpi-filter-btn.active {
    background: var(--color-white);
    color: var(--color-warning);
    font-weight: 700;
    border-color: var(--color-white);
}

/* --- Estilos para Toggle Switch --- */
.form-group.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-light);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-2);
}
.form-group.toggle-group small {
    display: block;
    margin-top: 0.2rem;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* --- Estilos para Tarjetas de Integración --- */
.integration-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-2);
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--color-light);
}

/* Modo oscuro para integration-card */
body[data-theme="dark"] .integration-card {
    background: #202c33;
    border: 1px solid #2a3942;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.integration-card-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    gap: 1rem;
}

body[data-theme="dark"] .integration-card-header {
    color: #e9edef;
}

.integration-card-header .active-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-info-light);
    transition: background-color 300ms ease;
}
.integration-card-header.active .active-indicator {
    background-color: var(--color-success);
}
.integration-card-header .isp-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

/* Fondo blanco para el logo de ISPBrain (PNG transparente) */
.integration-card[data-isp="ispbrain"] .isp-logo {
    background-color: white;
    padding: 4px 8px;
    border-radius: 4px;
}
.integration-card-header h5 {
    font-weight: 600;
    font-size: 1rem;
    flex-grow: 1;
}

body[data-theme="dark"] .integration-card-header h5 {
    color: #e9edef;
}
.integration-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 400ms ease-out, padding 400ms ease-out;
    padding: 0 1.5rem;
}
.integration-card-body.open {
    max-height: 600px;
    overflow-y: auto;
    padding: 1.5rem;
    border-top: 1px solid var(--color-light);
}

body[data-theme="dark"] .integration-card-body {
    background: #202c33;
}

body[data-theme="dark"] .integration-card-body.open {
    border-top: 1px solid #2a3942;
}

body[data-theme="dark"] .integration-card-body label,
body[data-theme="dark"] .integration-card label {
    color: #e9edef !important;
}

body[data-theme="dark"] .integration-card-body .text-muted,
body[data-theme="dark"] .integration-card-body small,
body[data-theme="dark"] .integration-card small {
    color: #8696a0 !important;
}

.integration-card-body .modern-form {
    margin-top: 1rem;
}

/* Estilos para la caja de configuración de webhook */
.webhook-config-box {
    background: #f8f9fa;
}

body[data-theme="dark"] .webhook-config-box {
    background: #2a3942;
}

body[data-theme="dark"] .webhook-config-box label {
    color: #e9edef !important;
}

body[data-theme="dark"] .webhook-config-box input {
    background: #202c33 !important;
    color: #e9edef !important;
    border-color: #3b4a54 !important;
}

/* --- Estilos para Login --- */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--color-background);
}

.login-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header img {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.login-card {
    background: var(--color-white);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--color-info-dark);
    margin-bottom: 2rem;
}

.login-card .form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.login-card .form-group .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-info-dark);
}

.login-card .form-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.5rem;
    border-radius: var(--border-radius-1);
    background: var(--color-light);
    font-family: 'Poppins', sans-serif;
}

.login-card button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 300ms ease;
}

.login-card button[type="submit"]:hover {
    background: var(--color-primary-variant);
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--color-info-dark);
}

.qr-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

#qr-image {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-btn {
    background-color: var(--color-light);
    color: var(--color-dark-variant);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 300ms ease;
}

.filter-btn:hover {
    background-color: var(--color-info-light);
    color: var(--color-dark);
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* --- Estilos para Chat History --- */
.ticket-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chat-box {
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    background-color: #f9f9f9;
}
.chat-message {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    word-wrap: break-word;
}
.chat-message span {
    display: block;
    margin-top: 4px;
}
.client-message {
    background-color: #e1ffc7;
}
.agent-message {
    background-color: #c7e1ff;
}
.bot-message {
    background-color: #f0f0f0;
    font-style: italic;
}

/* === CHAT BOX - MODO OSCURO === */
body[data-theme="dark"] .chat-box {
    background-color: #202c33;
    border-color: #2a3942;
}

body[data-theme="dark"] .chat-message {
    color: #e9edef;
}

body[data-theme="dark"] .chat-message strong {
    color: #25d366;
    font-weight: 700;
}

body[data-theme="dark"] .client-message {
    background-color: #1c4a2c;
    color: #e9edef;
}

body[data-theme="dark"] .agent-message {
    background-color: #1c3a4a;
    color: #e9edef;
}

body[data-theme="dark"] .bot-message {
    background-color: #2a3942;
    color: #8696a0;
    font-style: italic;
}

/* --- Estilos para Horarios de Atención --- */
.office-hours-section {
    border-top: 2px solid var(--color-light);
    margin-top: 2rem;
    padding-top: 2rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.day-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius-2);
    padding: var(--padding-1);
    border: 1px solid var(--color-info-light);
}

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

.day-card-header h5 {
    font-weight: 600;
    font-size: 1rem;
}

.time-slots-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.time-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-slot input[type="time"] {
    flex-grow: 1;
    padding: 0.5rem;
}

.time-slot .remove-time-slot-btn {
    background-color: #ff7782 !important;
    color: var(--color-white) !important;
    border: none !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

.time-slot .remove-time-slot-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 119, 130, 0.3) !important;
    background-color: #e63946 !important;
}
/* Forzar estilo circular para botón X */
button.remove-time-slot-btn {
    background-color: #ff7782 !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
}
.holiday-manager h4 {
    margin-bottom: 1rem;
}

.holiday-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    background-color: var(--color-light);
    padding: 1rem;
    border-radius: var(--border-radius-1);
    min-height: 50px;
}

.holiday-item {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-1);
    font-size: 0.8rem;
}

.remove-holiday-btn {
    background: #ff7782 !important;
    color: var(--color-white) !important;
    border: none !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    margin-left: 0.8rem !important;
}

/* --- Feedback Toast --- */
.feedback-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-2);
    color: var(--color-white);
    font-weight: 500;
    z-index: 9999;
    transform: translateX(400px);
    opacity: 0;
    transition: all 300ms ease;
    max-width: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

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

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

.feedback-toast.error {
    background-color: var(--color-danger);
}

.feedback-toast.info {
    background-color: var(--color-primary);
}

.feedback-toast.warning {
    background-color: var(--color-warning);
}
/* --- Estilos para Pestañas de Calendario --- */
.fc {
    font-family: inherit;
}

.fc-theme-bootstrap5 {
    --fc-border-color: #e3e6f0;
    --fc-button-bg-color: #7380ec;
    --fc-button-border-color: #7380ec;
    --fc-button-hover-bg-color: #5a67d8;
    --fc-button-hover-border-color: #5a67d8;
    --fc-button-active-bg-color: #4c51bf;
    --fc-today-bg-color: rgba(115, 128, 236, 0.1);
}

.fc .fc-toolbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #363949;
}

.fc .fc-button-primary {
    background: #7380ec;
    border: none;
    border-radius: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.fc .fc-button-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.fc .fc-button-primary:disabled {
    background: #dce1eb;
    opacity: 0.5;
}

.fc-event {
    border: none;
    border-radius: 0.3rem;
    padding: 2px 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.fc-event:hover {
    transform: scale(1.02);
}

.fc-daygrid-day {
    transition: background-color 0.2s ease;
}

.fc-daygrid-day:hover {
    background-color: rgba(115, 128, 236, 0.05);
}

.fc-day-today {
    background-color: rgba(115, 128, 236, 0.1) !important;
}

.fc .fc-col-header-cell {
    background: #f6f6f9;
    color: #677483;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    padding: 1rem;
}

.fc .fc-daygrid-day-number {
    color: #363949;
    font-weight: 500;
}

.fc-h-event .fc-event-title {
    font-weight: 500;
}

.fc-more-link {
    color: #7380ec;
    font-weight: 600;
}
.calendar-tabs {
    display: flex;
    gap: 0.5rem;
    background-color: var(--color-light);
    padding: 0.5rem;
    border-radius: var(--border-radius-2);
}
.calendar-tab-btn {
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 300ms ease;
    background: transparent;
    color: var(--color-dark-variant);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.calendar-tab-btn:hover {
    background: var(--color-white);
    color: var(--color-dark);
}
.calendar-tab-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 4px 10px rgba(115, 128, 236, 0.3);
}
.calendar-content {
    display: none;
}
.calendar-content.active {
    display: block;
}
/* --- Estilos para Progreso de Agentes --- */
.progress-modal {
    max-width: 500px;
    padding: 30px;
}

.progress-steps {
    margin: 20px 0;
}

.progress-steps .step {
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.step i {
    margin-right: 10px;
    width: 20px;
    color: #6c757d;
}

.step.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.step.active i {
    color: #2196f3;
}

.step.completed {
    background: #e8f5e8;
    border-left-color: #4caf50;
}

.step.completed i {
    color: #4caf50;
}

.estimated-time {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
    padding: 12px;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
}

.progress-actions {
    text-align: center;
    margin-top: 20px;
}

/* --- Estilos para Control de Estados del Bot --- */
.bot-status-display {
    background: var(--color-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-2);
    margin-bottom: 1.5rem;
    text-align: center;
}

.bot-status-display h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.mode-description {
    color: var(--color-info-dark);
    font-size: 0.9rem;
}

.mode-controls {
    margin-bottom: 1.5rem;
}

.mode-controls h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-dark);
    border-bottom: 1px solid var(--color-light);
    padding-bottom: 0.5rem;
}

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

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius-2);
    cursor: pointer;
    transition: all 300ms ease;
    text-align: center;
    border: 2px solid transparent;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.mode-btn.active {
    border-color: var(--color-primary);
    background: var(--color-light);
}

.mode-btn i {
    font-size: 2rem;
}

.mode-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.mode-btn small {
    font-size: 0.75rem;
    color: var(--color-info-dark);
    line-height: 1.3;
}

/* Colores específicos para cada modo */
.mode-btn.complete i { color: var(--color-success); }
.mode-btn.complete.active { border-color: var(--color-success); background: rgba(65, 241, 182, 0.1); }

.mode-btn.gateway i { color: var(--color-primary); }
.mode-btn.gateway.active { border-color: var(--color-primary); background: rgba(115, 128, 236, 0.1); }

.mode-btn.emergency i { color: var(--color-warning); }
.mode-btn.emergency.active { border-color: var(--color-warning); background: rgba(255, 187, 85, 0.1); }

.mode-btn.stopped i { color: var(--color-danger); }
.mode-btn.stopped.active { border-color: var(--color-danger); background: rgba(255, 119, 130, 0.1); }
/* Colores personalizados para botones de acción del sistema */
.mode-btn.custom-danger i,
.mode-btn.custom-danger span {
    color: var(--color-danger);
}

.mode-btn.custom-danger:hover {
    border-color: var(--color-danger);
    background: rgba(255, 119, 130, 0.1);
}

.mode-btn.custom-success i,
.mode-btn.custom-success span {
    color: var(--color-success);
}

.mode-btn.custom-success:hover {
    border-color: var(--color-success);
    background: rgba(65, 241, 182, 0.1);
}

/* Ajuste para que los botones de acción sean 2 por fila */
.mode-buttons.system-action-buttons {
    grid-template-columns: repeat(2, 1fr);
}

@media screen and (max-width: 480px) {
    .mode-buttons.system-action-buttons {
        grid-template-columns: 1fr;
    }
}
.actions-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
/* --- Estilos para Acciones del Sistema --- */
.system-actions {
    margin-bottom: 1.5rem;
}

.system-actions h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-dark);
    border-bottom: 1px solid var(--color-light);
    padding-bottom: 0.5rem;
}

.system-actions .action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-light);
    gap: 1rem;
}

.system-actions .action-item:last-child {
    border-bottom: none;
}

.system-actions .action-info {
    flex-grow: 1;
}

.system-actions .action-info strong {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-dark);
    display: block;
    margin-bottom: 0.2rem;
}

.system-actions .action-info p {
    font-size: 0.8rem;
    color: var(--color-info-dark);
    line-height: 1.4;
    margin: 0;
}

.system-actions .action-btn-small {
    flex-shrink: 0;
}

/* Botones de Estado de Advertencia - Naranja fijo */
.action-btn.warning, .action-btn-small.warning {
    background: var(--color-warning) !important;
    color: var(--color-white) !important;
    box-shadow: 0 4px 12px rgba(255, 187, 85, 0.3) !important;
}

.action-btn.warning:hover, .action-btn-small.warning:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 187, 85, 0.4) !important;
}

/* Responsive para Acciones del Sistema */
@media screen and (max-width: 768px) {
    .system-actions .action-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.8rem;
    }
}

/* --- RESPONSIVE DESIGN --- */
/* Desktop large */
@media screen and (max-width: 1200px) {
    .dashboard-container {
        width: 94%;
        grid-template-columns: 7rem auto;
    }
    .sidebar-nav h3 {
        display: none;
    }
    .sidebar-nav ul li a span {
        display: none;
    }
}

/* Tablets */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .dashboard-container {
        width: 96%;
        grid-template-columns: 200px 1fr;
        gap: 1.2rem;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar-nav ul li a span {
        font-size: 0.9rem;
    }
    
    .tickets-table {
        font-size: 0.8rem;
    }
    
    .settings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Móviles */
@media screen and (max-width: 768px) {
    html {
        font-size: 12px;
    }
    
    .dashboard-container {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 0;
        padding: 0 0.5rem;
    }
    
    .sidebar {
    height: 100vh;
    background: var(--color-white);
    padding: var(--card-padding);
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
    position: relative;
    display: flex;              /* ← AGREGAR ESTA LÍNEA */
    flex-direction: column;     /* ← AGREGAR ESTA LÍNEA */
}
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-nav h3 {
        display: inline;
    }
    
    .sidebar-nav ul li a span {
        display: inline;
    }
    
    .menu-toggle {
        display: inline-block;
        background: var(--color-primary);
        color: var(--color-white);
        padding: 0.8rem;
        border-radius: var(--border-radius-1);
        font-size: 1.2rem;
    }
    
    .main-header {
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }
    
    .user-profile {
        gap: 0.5rem;
    }
    
    .user-info {
        display: none;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .kpi-card {
        padding: 1rem;
        gap: 1rem;
    }
    
    .kpi-icon {
        font-size: 2rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .kpi-title {
        font-size: 0.8rem;
    }
    
    .main-chart-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .tickets-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 70vh;
    overflow-y: auto;
}
    
    .tickets-table {
        min-width: 600px;
        font-size: 0.7rem;
    }
    
    .tickets-table th,
    .tickets-table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    .action-btn-small {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        margin: 0.1rem;
    }
    
    .status-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .sentiment-icon {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .filter-controls {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .filter-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
    
    
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .settings-card {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .modal {
        width: 95%;
        max-width: none;
        padding: 1rem;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        width: 100%;
        padding: 1rem;
    }
    
    .receipt-modal-body {
        flex-direction: column;
        gap: 1rem;
        max-height: none;
    }
    
    .receipt-image-container {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .log-viewer-iframe {
        height: 200px;
    }
    
    .integration-card-body {
        padding: 1rem;
    }
    
    .input-with-button {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .input-with-button input {
        margin-bottom: 0.5rem;
    }
    
    .mode-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .mode-btn {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .mode-btn i {
        font-size: 1.5rem;
    }
    
    .mode-btn span {
        font-size: 0.75rem;
    }
    
    .mode-btn small {
        font-size: 0.65rem;
    }
    
    .kpi-filters {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .kpi-filter-btn {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Móviles muy pequeños */
@media screen and (max-width: 480px) {
    html {
        font-size: 11px;
    }
    
    .sidebar {
        width: 250px;
    }
    
    .kpi-card {
        padding: 0.8rem;
        text-align: center;
    }
    
    .kpi-info {
        text-align: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .tickets-table {
        min-width: 500px;
        font-size: 0.65rem;
    }
    
    .action-btn-small {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
    }
    
    .card-header {
        text-align: center;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
    
    .modal {
        width: 98%;
        padding: 0.8rem;
    }
    
    .form-group.toggle-group {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        text-align: center;
    }
    
    .toggle-switch {
        align-self: center;
    }
}

/* Mejorar la experiencia táctil */
@media (hover: none) and (pointer: coarse) {
    .action-btn, 
    .action-btn-small,
    .filter-btn,
    .kpi-filter-btn,
    .settings-card {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    .tickets-table td {
        min-height: 44px;
    }
    
    .close-modal-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* Estilos para ordenamiento de tablas */
.sort-icon {
    margin-left: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

th[data-sortable]:hover .sort-icon {
    opacity: 1;
}

th[data-sortable] {
    transition: background-color 0.2s ease;
}

th[data-sortable]:hover {
    background-color: var(--color-light);
}

th[data-sort-direction="asc"] .sort-icon,
th[data-sort-direction="desc"] .sort-icon {
    opacity: 1;
    color: var(--color-primary);
}
/* === ESTILOS PARA PAGINACIÓN === */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: var(--color-light);
    border-bottom: 1px solid var(--color-info-light);
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 70px; /* Altura mínima para consistencia visual */
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-size-selector {
    padding: 0.5rem 0.8rem;
    border-radius: var(--border-radius-1);
    background: var(--color-white);
    border: 1px solid var(--color-info-light);
    font-size: 0.8rem;
    cursor: pointer;
}

.records-info {
    font-size: 0.8rem;
    color: var(--color-info-dark);
    font-weight: 500;
}
.bulk-actions-container {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.pagination-right-group {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.8rem 1.2rem; /* <-- Espaciado interno */
    background: rgba(255, 187, 85, 0.1); /* <-- Mismo fondo */
    border: 1px solid var(--color-warning); /* <-- Mismo borde */
    border-radius: var(--border-radius-1); /* <-- Mismo redondeo */
}

.pagination-right-group .pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 300ms ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-size: 0.8rem;
    color: var(--color-dark);
    font-weight: 500;
    padding: 0 0.5rem;
}

/* Responsive para paginación */
@media screen and (max-width: 992px) { /* Ajustado para mejor respuesta */
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .bulk-actions-container {
        justify-content: center;
        order: 2; /* Acciones masivas abajo */
    }

    .pagination-right-group {
        justify-content: center;
        order: 1; /* Paginación arriba */
        gap: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .pagination-buttons {
        gap: 0.3rem;
    }
    
    .pagination-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
    }
}

/* Responsive para iconos de ordenamiento */
@media screen and (max-width: 768px) {
    .sort-icon {
        font-size: 0.7rem;
    }
    
    th[data-sortable] {
        padding: 0.5rem 0.2rem;
    }
}
/* === ESTILOS PARA ESTADO DE GRUPOS === */
.groups-configuration-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Grid de 2 columnas para grupos principales en pantallas grandes */
.groups-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1200px) {
    .groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.groups-configuration-container h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 1rem 0 0.8rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

.group-status-card {
    background: var(--color-white);
    border-radius: var(--border-radius-2);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.group-status-card.configured {
    border-color: var(--color-success);
    background: linear-gradient(135deg, #fff 0%, rgba(65, 241, 182, 0.05) 100%);
}

.group-status-card.not-configured {
    border-color: var(--color-danger);
    background: linear-gradient(135deg, #fff 0%, rgba(255, 119, 130, 0.05) 100%);
}

.group-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-info-light);
}

.group-status-header h5 {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0;
}

.group-status-card.configured .group-status-header h5 i {
    color: var(--color-success);
}

.group-status-card.not-configured .group-status-header h5 i {
    color: var(--color-danger);
}

.group-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.not-configured-status {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 119, 130, 0.1);
    border-radius: var(--border-radius-1);
    margin-bottom: 1rem;
}

.status-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-danger);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.info-label {
    font-weight: 600;
    min-width: 80px;
    color: var(--color-dark);
}

.info-value {
    color: var(--color-info-dark);
    font-family: 'Courier New', monospace;
    background: var(--color-light);
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius-1);
    font-size: 0.9rem;
}

.group-description {
    color: var(--color-info-dark);
    font-style: italic;
    margin: 0;
    padding: 0.5rem;
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    font-size: 0.9rem;
}

.group-admins-display {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-info-light);
}

.group-admins-display h6 {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-display {
    padding: 0.5rem 0;
    color: var(--color-info-dark);
    border-left: 3px solid var(--color-success);
    padding-left: 1rem;
    margin-bottom: 0.3rem;
}

.create-group-form {
    background: var(--color-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-1);
    border: 1px solid var(--color-info-light);
}

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

.create-group-form label {
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.group-name-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-1);
    background: var(--color-white);
    border: 1px solid var(--color-info-light);
    font-family: 'Poppins', sans-serif;
}

.group-agent-actions {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--color-info-light);
    text-align: center;
}

.section-divider {
    border: none;
    height: 2px;
    background: var(--color-info-light);
    margin: 1.5rem 0;
}

.description {
    color: var(--color-info-dark);
    margin-bottom: 1rem;
    font-style: italic;
}

.actions-header {
    margin-bottom: 1.5rem;
}

/* Responsive para estado de grupos */
@media screen and (max-width: 768px) {
    .group-status-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        text-align: center;
    }
    
    .info-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }
    
    .info-label {
        min-width: auto;
    }
}

/* === ESTILOS PARA MODAL DE AGREGAR AGENTE A GRUPO === */
.add-agent-to-group-btn {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 300ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.add-agent-to-group-btn:hover {
    background: var(--color-primary-variant);
    transform: translateY(-1px);
}

/* === ESTILOS PARA CARTAS DE AGENTES === */
.agent-card {
    background: var(--color-white);
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-2);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 300ms ease;
}

body[data-theme="dark"] .agent-card {
    background: #202c33;
    border-color: #2a3942;
}

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

body[data-theme="dark"] .agent-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

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

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.agent-name {
    font-weight: 600;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-number {
    font-size: 0.8rem;
    color: var(--color-info-dark);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.agent-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* Estilos para horarios de atención - botones personalizados */
.add-time-slot-btn {
    background: #41f1b6 !important;
    color: var(--color-white) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    box-shadow: 0 4px 12px rgba(65, 241, 182, 0.3) !important;
}

.add-time-slot-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(65, 241, 182, 0.4) !important;
}

.remove-time-slot-btn {
    background: #ff7782 !important;
    color: var(--color-white) !important;
    border: none !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
}

.remove-time-slot-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 119, 130, 0.3) !important;
}

#add-holiday-btn {
    background: #41f1b6 !important;
    color: var(--color-white) !important;
    box-shadow: 0 4px 12px rgba(65, 241, 182, 0.3) !important;
}

#add-holiday-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(65, 241, 182, 0.4) !important;
}

.remove-holiday-btn {
    background: #ff7782 !important;
    color: var(--color-white) !important;
    border: none !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    margin-left: 0.8rem !important;
}

.remove-holiday-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 119, 130, 0.3) !important;
}
/* Responsive para agentes */
@media screen and (max-width: 768px) {
    .agent-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .agent-actions {
        justify-content: center;
    }
}
/* === CORRECCIÓN PARA GRUPOS PRINCIPALES === */
.groups-configuration-container .group-status-card {
    background: var(--color-white) !important;
    border-radius: var(--border-radius-2) !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border: 2px solid !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.groups-configuration-container .group-status-card.configured {
    border-color: var(--color-success) !important;
    background: linear-gradient(135deg, #fff 0%, rgba(65, 241, 182, 0.05) 100%) !important;
}

.groups-configuration-container .group-status-card.not-configured {
    border-color: var(--color-danger) !important;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 119, 130, 0.05) 100%) !important;
}

.groups-configuration-container .group-status-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 0.8rem !important;
    border-bottom: 1px solid var(--color-info-light) !important;
}

.groups-configuration-container .create-group-btn,
.groups-configuration-container .delete-group-btn {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: var(--border-radius-1) !important;
    cursor: pointer !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    transition: all 300ms ease !important;
}

.groups-configuration-container .delete-group-btn {
    background: var(--color-danger) !important;
}

.groups-configuration-container .create-group-btn:hover {
    background: var(--color-primary-variant) !important;
}

.groups-configuration-container .delete-group-btn:hover {
    background: #e63946 !important;
}
.group-agents-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.group-agents-section h6 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.group-agent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid var(--color-primary);
}

body[data-theme="dark"] .group-agent-item {
    background: #202c33;
    border-left-color: #25d366;
}

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.agent-phone {
    font-size: 12px;
    color: #666;
}

.agent-added {
    font-size: 11px;
    color: #999;
}

.agent-actions {
    display: flex;
    gap: 5px;
}

.no-agents {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 5px 0;
}

.group-agents-list {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar personalizado para la lista de agentes */
.group-agents-list::-webkit-scrollbar {
    width: 6px;
}

.group-agents-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.group-agents-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.group-agents-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* === ESTILOS PARA PLATAFORMAS DE PAGO === */
.payment-platforms-container {
    max-width: 800px;
    margin: 0 auto;
}

.platform-section {
    background: var(--color-white);
    border-radius: var(--border-radius-2);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--color-info-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body[data-theme="dark"] .platform-section {
    background: #202c33;
    border: 1px solid #2a3942;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.platform-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-info-light);
}

body[data-theme="dark"] .platform-header {
    border-bottom-color: #2a3942;
}

.platform-header h4 {
    margin-bottom: 0.5rem;
    color: var(--color-dark);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

body[data-theme="dark"] .platform-header h4 {
    color: #e9edef;
}

.platform-header h4 i {
    color: var(--color-primary);
}

body[data-theme="dark"] .platform-header h4 i {
    color: #25d366;
}

.platform-description {
    color: var(--color-info-dark);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

body[data-theme="dark"] .platform-description {
    color: #8696a0;
}

.platform-form {
    background: var(--color-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-1);
    border: 1px solid var(--color-info-light);
}

body[data-theme="dark"] .platform-form {
    background: #2a3942;
    border: 1px solid #364954;
}

body[data-theme="dark"] .platform-form label {
    color: #e9edef !important;
}

body[data-theme="dark"] .platform-form input,
body[data-theme="dark"] .platform-form textarea,
body[data-theme="dark"] .platform-form select,
body[data-theme="dark"] #paypertic-form input,
body[data-theme="dark"] #paypertic-form textarea,
body[data-theme="dark"] #paypertic-form select,
body[data-theme="dark"] #payment-platforms-form input,
body[data-theme="dark"] #payment-platforms-form textarea,
body[data-theme="dark"] #payment-platforms-form select {
    background: #1a252f !important;
    background-color: #1a252f !important;
    color: #ffffff !important;
    border: 2px solid #2d3e50 !important;
    -webkit-text-fill-color: #ffffff !important;
}

body[data-theme="dark"] .platform-form input::placeholder,
body[data-theme="dark"] .platform-form textarea::placeholder,
body[data-theme="dark"] #paypertic-form input::placeholder,
body[data-theme="dark"] #paypertic-form textarea::placeholder {
    color: #6b7c8e !important;
}

/* Forzar estilos en autofill/autocomplete del navegador */
body[data-theme="dark"] .platform-form input:-webkit-autofill,
body[data-theme="dark"] .platform-form input:-webkit-autofill:hover,
body[data-theme="dark"] .platform-form input:-webkit-autofill:focus,
body[data-theme="dark"] #paypertic-form input:-webkit-autofill,
body[data-theme="dark"] #paypertic-form input:-webkit-autofill:hover,
body[data-theme="dark"] #paypertic-form input:-webkit-autofill:focus,
body[data-theme="dark"] #payment-platforms-form input:-webkit-autofill,
body[data-theme="dark"] #payment-platforms-form input:-webkit-autofill:hover,
body[data-theme="dark"] #payment-platforms-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1a252f inset !important;
    box-shadow: 0 0 0px 1000px #1a252f inset !important;
    background-color: #1a252f !important;
    background: #1a252f !important;
    border: 2px solid #2d3e50 !important;
    transition: background-color 5000s ease-in-out 0s;
}

body[data-theme="dark"] .platform-form small {
    color: #8696a0 !important;
}

.readonly-field {
    background-color: #f1f3f4 !important;
    color: var(--color-info-dark) !important;
    cursor: not-allowed !important;
    border-color: var(--color-info-light) !important;
}

body[data-theme="dark"] .readonly-field {
    background-color: #2a3942 !important;
    color: #8696a0 !important;
    border-color: #364954 !important;
}

.readonly-field:focus {
    box-shadow: none !important;
    border-color: var(--color-info-light) !important;
}

body[data-theme="dark"] .readonly-field:focus {
    border-color: #364954 !important;
}

/* ===== LOGO UPLOAD CONTAINER ===== */
.logo-upload-container {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f6f6f9;
    padding: 15px;
    border-radius: 0.8rem;
}

body[data-theme="dark"] .logo-upload-container {
    background-color: #2a3942;
}

.logo-upload-container img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 0.4rem;
    background-color: white;
    padding: 5px;
}

body[data-theme="dark"] .logo-upload-container img {
    background-color: #1a252f;
}

.coming-soon-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.coming-soon-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--color-light);
    border-radius: var(--border-radius-2);
    border: 2px dashed var(--color-info-light);
    max-width: 400px;
    width: 100%;
}

.coming-soon-card i {
    font-size: 2.5rem;
    color: var(--color-info-dark);
    margin-bottom: 1rem;
}

.coming-soon-card h5 {
    color: var(--color-dark);
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.coming-soon-card p {
    color: var(--color-info-dark);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-info-light), transparent);
    margin: 2rem 0;
}

/* Responsive para plataformas de pago */
@media screen and (max-width: 768px) {
    .payment-platforms-container {
        max-width: 100%;
    }
    
    .platform-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .platform-header h4 {
        font-size: 1.1rem;
    }
    
    .platform-form {
        padding: 1rem;
    }
    
    .coming-soon-card {
        padding: 2rem 1.5rem;
    }
    
    .coming-soon-card i {
        font-size: 2rem;
    }
}

@media screen and (max-width: 480px) {
    .platform-section {
        padding: 0.8rem;
    }
    
    .platform-header h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 1rem;
    }
    
    .coming-soon-card {
        padding: 1.5rem 1rem;
    }
}
/* Estilos para enlaces en formularios */
.modern-form small a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.modern-form small a:hover {
    text-decoration: underline;
    color: var(--color-primary-variant);
}
/* Estilos para el campo de webhook URL */
.webhook-url-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.webhook-url-input {
    flex: 1;
    font-family: 'Courier New', monospace !important;
    font-size: 0.85rem !important;
}

.copy-webhook-btn {
    background: var(--color-success) !important;
    color: var(--color-white) !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
}

.copy-webhook-btn:hover {
    background: #36d399 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(65, 241, 182, 0.3) !important;
}

.copy-webhook-btn:active {
    transform: translateY(0) !important;
}
/* =============================================
   ESTILOS PARA EDITOR DE MENÚS DE VENTAS
   ============================================= */

/* Contenedor principal del editor de ventas */
.sales-menu-editor-container {
    background: var(--color-white);
    border-radius: var(--border-radius-2);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-info-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Header del editor de ventas */
.sales-menu-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-info-light);
}

.sales-menu-editor-header h4 {
    color: var(--color-dark);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0;
}

.sales-menu-editor-header h4 i {
    color: var(--color-primary);
}

/* Botones específicos del editor de ventas */
.add-sales-root-item-btn {
    background: #41f1b6 !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 12px rgba(65, 241, 182, 0.3) !important;
    font-size: 0.85rem !important;
}

.add-sales-root-item-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.4) !important;
}

.add-sales-child-btn {
    background: #f1f5f9 !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--color-dark-variant) !important;
    font-size: 0.9rem !important;
}

.add-sales-child-btn:hover {
    background: #d1fae5 !important;
    color: #059669 !important;
    transform: translateY(-1px) !important;
}

.edit-sales-item-btn {
    background: #f1f5f9 !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--color-dark-variant) !important;
    font-size: 0.9rem !important;
}

.edit-sales-item-btn:hover {
    background: #e2e8f0 !important;
    transform: translateY(-1px) !important;
}

.delete-sales-item-btn {
    background: #f1f5f9 !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--color-dark-variant) !important;
    font-size: 0.9rem !important;
}

.delete-sales-item-btn:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    transform: translateY(-1px) !important;
}

/* Contenedor del árbol de menús de ventas */
.sales-menu-tree-container {
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    padding: 1.5rem;
    min-height: 200px;
}

body[data-theme="dark"] .sales-menu-tree-container {
    background: #2a3942;
}

.sales-menu-tree-level {
    position: relative;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 2px solid var(--color-info-light);
}

body[data-theme="dark"] .sales-menu-tree-level {
    border-left-color: #364954;
}

.sales-menu-tree-level:first-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

.sales-menu-tree-level li {
    position: relative;
    margin: 1rem 0;
    list-style: none;
}

.sales-menu-tree-level li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 18px;
    width: 20px;
    height: 2px;
    background-color: var(--color-info-light);
}

body[data-theme="dark"] .sales-menu-tree-level li::before {
    background-color: #364954;
}

.sales-menu-tree-level li:last-child > .sales-menu-item-node::after {
    content: '';
    position: absolute;
    left: -15px;
    top: 19px;
    bottom: -1rem;
    width: 2px;
    background-color: var(--color-background);
}

/* Nodos de items del menú de ventas */
.sales-menu-item-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-white);
    padding: 1rem 1.2rem;
    border-radius: var(--border-radius-2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 300ms ease;
    border-left: 4px solid var(--color-primary);
}

body[data-theme="dark"] .sales-menu-item-node {
    background-color: #202c33;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border-left-color: #25d366;
}

.sales-menu-item-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body[data-theme="dark"] .sales-menu-item-node:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.sales-menu-item-title {
    font-weight: 600;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
}

body[data-theme="dark"] .sales-menu-item-title {
    color: #e9edef;
}

.sales-menu-item-title i {
    color: var(--color-primary);
    font-size: 1.1rem;
}

body[data-theme="dark"] .sales-menu-item-title i {
    color: #25d366;
}

.sales-menu-item-description {
    font-size: 0.85rem;
    color: var(--color-info-dark);
    margin-top: 0.3rem;
    font-style: italic;
}

body[data-theme="dark"] .sales-menu-item-description {
    color: #8696a0;
}

.sales-menu-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Badge para tipo de acción */
.sales-action-type-badge {
    background: var(--color-light);
    color: var(--color-dark-variant);
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius-1);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 1rem;
}

.sales-action-type-badge.submenu { 
    background: rgba(115, 128, 236, 0.1); 
    color: var(--color-primary); 
}

.sales-action-type-badge.show_plans { 
    background: rgba(65, 241, 182, 0.1); 
    color: var(--color-success); 
}

.sales-action-type-badge.show_promotions { 
    background: rgba(255, 187, 85, 0.1); 
    color: var(--color-warning); 
}

.sales-action-type-badge.collect_address { 
    background: rgba(255, 119, 130, 0.1); 
    color: var(--color-danger); 
}

.sales-action-type-badge.start_sales_conversation { 
    background: rgba(125, 141, 161, 0.1); 
    color: var(--color-info-dark); 
}

.sales-action-type-badge.request_callback { 
    background: rgba(102, 126, 234, 0.1); 
    color: var(--color-primary-variant); 
}

.sales-action-type-badge.check_coverage { 
    background: rgba(74, 222, 128, 0.1); 
    color: #059669; 
}

.sales-action-type-badge.quote_installation { 
    background: rgba(239, 68, 68, 0.1); 
    color: #dc2626; 
}

/* Estado vacío del editor de ventas */
.sales-menu-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-info-dark);
}

.sales-menu-empty-state i {
    font-size: 3rem;
    color: var(--color-info-light);
    margin-bottom: 1rem;
}

.sales-menu-empty-state h5 {
    color: var(--color-dark-variant);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.sales-menu-empty-state p {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Modal específico para menús de ventas */
.sales-menu-item-modal {
    max-width: 700px;
}

.sales-menu-item-modal .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sales-menu-item-modal .modal-header h3 i {
    color: var(--color-primary);
}

/* Campos dinámicos del modal de ventas */
.sales-dynamic-fields {
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    padding: 1.2rem;
    margin: 1rem 0;
    border: 1px solid var(--color-info-light);
}

.sales-dynamic-fields h6 {
    color: var(--color-dark);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sales-dynamic-fields h6 i {
    color: var(--color-primary);
}

/* Selector de tipo de acción */
.action-type-selector {
    background: var(--color-white) !important;
    border: 2px solid var(--color-info-light) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    transition: all 300ms ease !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='%23677483' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 20px !important;
    padding-right: 40px !important;
}

.action-type-selector:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(115, 128, 236, 0.1) !important;
}

/* Navegación dentro del modal */
.sales-modal-breadcrumb {
    background: var(--color-background);
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-1);
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-info-light);
}

body[data-theme="dark"] .sales-modal-breadcrumb {
    background: #111b21;
    border-color: #2a3942;
}
/* === ESTILOS PARA SELECTOR DE TIPO DE PAGO === */
.payment-type-selector {
    display: flex;
    gap: 1rem;
    background: var(--color-light);
    padding: 1rem;
    border-radius: var(--border-radius-2);
    justify-content: center;
}

.payment-type-btn {
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius-2);
    cursor: pointer;
    transition: all 300ms ease;
    border: 2px solid transparent;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-dark);
}

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

.payment-type-btn.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #fff 0%, rgba(115, 128, 236, 0.1) 100%);
    color: var(--color-primary);
}

.payment-type-btn i {
    font-size: 2rem;
    transition: all 300ms ease;
}

.payment-type-btn.active i {
    color: var(--color-primary);
}

.payment-type-btn span {
    font-weight: 600;
}

/* Responsive para selector de tipo de pago */
@media screen and (max-width: 768px) {
    .payment-type-selector {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .payment-type-btn {
        max-width: 100%;
        flex-direction: row;
        justify-content: center;
        padding: 1rem;
        gap: 1rem;
    }
    
    .payment-type-btn i {
        font-size: 1.5rem;
    }
}
/* Responsive para el contenedor de webhook */
@media screen and (max-width: 768px) {
    .webhook-url-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-webhook-btn {
        width: 100% !important;
        height: 44px !important;
    }
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}
/* =============================================
   ESTILOS PARA GOOGLE SERVICES
   ============================================= */

/* Contenedor principal de Google Services */
.google-services-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Tarjeta de estado OAuth */
.oauth-status-card {
    padding: 2rem;
    border-radius: var(--border-radius-2);
    border-left: 5px solid;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 300ms ease;
}

.oauth-status-card.connected {
    border-left-color: var(--color-success);
    background: linear-gradient(145deg, rgba(65, 241, 182, 0.05) 0%, var(--color-white) 100%);
}

.oauth-status-card.disconnected {
    border-left-color: var(--color-danger);
    background: linear-gradient(145deg, rgba(255, 119, 130, 0.05) 0%, var(--color-white) 100%);
}

/* Modo oscuro para oauth-status-card */
body[data-theme="dark"] .oauth-status-card {
    background: #202c33 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body[data-theme="dark"] .oauth-status-card.connected {
    background: #202c33 !important;
    border-left-color: #25d366;
}

body[data-theme="dark"] .oauth-status-card.disconnected {
    background: #202c33 !important;
    border-left-color: #ea4335;
}

body[data-theme="dark"] .status-header h4 {
    color: #e9edef;
}

body[data-theme="dark"] .status-description {
    color: #8696a0;
}

/* Header de estado OAuth */
.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.status-header h4 {
    color: var(--color-dark);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.status-header i.fab.fa-google {
    font-size: 1.5rem;
    color: #4285f4;
}

.status-description {
    color: var(--color-info-dark);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

/* Sección de configuración de calendarios */
.calendars-config-section {
    background: var(--color-white);
    border-radius: var(--border-radius-2);
    padding: 2rem;
    border: 1px solid var(--color-info-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body[data-theme="dark"] .calendars-config-section {
    background: #202c33;
    border: 1px solid #2a3942;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.calendars-config-section h4 {
    color: var(--color-dark);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-info-light);
}

body[data-theme="dark"] .calendars-config-section h4 {
    color: #e9edef;
    border-bottom-color: #2a3942;
}

.calendars-config-section h4 i {
    color: var(--color-primary);
    font-size: 1.3rem;
}

body[data-theme="dark"] .calendars-config-section h4 i {
    color: #25d366;
}

body[data-theme="dark"] .calendars-config-section .text-muted {
    color: #8696a0;
}

/* Tarjetas de tipos de calendario */
.calendar-type-card {
    background: var(--color-light);
    border-radius: var(--border-radius-1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-info-light);
    transition: all 300ms ease;
}

body[data-theme="dark"] .calendar-type-card {
    background: #2a3942;
    border: 1px solid #364954;
}

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

body[data-theme="dark"] .calendar-type-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.calendar-type-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

body[data-theme="dark"] .calendar-type-header {
    color: #e9edef;
}

.calendar-type-header i {
    font-size: 1.3rem;
    color: var(--color-primary);
}

body[data-theme="dark"] .calendar-type-header i {
    color: #25d366;
}

.calendar-type-header h5 {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

body[data-theme="dark"] .calendar-type-header h5 {
    color: #e9edef;
}

body[data-theme="dark"] .calendar-type-card label {
    color: #e9edef !important;
}

body[data-theme="dark"] .calendar-type-card small {
    color: #8696a0 !important;
}

/* Selectores de calendario */
.calendar-type-card select {
    background: var(--color-white) !important;
    border: 2px solid var(--color-info-light) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    color: var(--color-dark) !important;
    transition: all 300ms ease !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='%23677483' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 20px !important;
    padding-right: 40px !important;
    width: 100% !important;
}

.calendar-type-card select:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(115, 128, 236, 0.1) !important;
}

.calendar-type-card select option {
    background: var(--color-white);
    color: var(--color-dark);
    padding: 8px 12px;
}

/* Botones específicos de Google Services */
#google-oauth-btn {
    background: #4285f4 !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3) !important;
}

#google-oauth-btn:hover {
    background: #3367d6 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4) !important;
}

#google-oauth-btn i {
    font-size: 1.2rem;
}

#google-disconnect-btn {
    background: var(--color-danger) !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 300ms ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.9rem !important;
    box-shadow: 0 4px 12px rgba(255, 119, 130, 0.3) !important;
}

#google-disconnect-btn:hover {
    background: #e63946 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 119, 130, 0.4) !important;
}

/* Estado de carga para calendarios */
.calendars-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem;
    color: var(--color-info-dark);
    font-style: italic;
}

.calendars-loading i {
    animation: spin 1s linear infinite;
}

/* Responsive para Google Services */
@media screen and (max-width: 768px) {
    .google-services-container {
        max-width: 100%;
        gap: 1.5rem;
    }
    
    .oauth-status-card {
        padding: 1.5rem;
    }
    
    .calendars-config-section {
        padding: 1.5rem;
    }
    
    .calendar-type-card {
        padding: 1.2rem;
        margin-bottom: 1.2rem;
    }
    
    .status-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }
    
    .status-header h4 {
        justify-content: center;
        font-size: 1.1rem;
    }
    
    .calendar-type-header {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .calendar-type-header h5 {
        font-size: 1rem;
    }
    
    #google-oauth-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px !important;
    }
    
    #google-disconnect-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px !important;
    }
}

@media screen and (max-width: 480px) {
    .oauth-status-card {
        padding: 1rem;
    }
    
    .calendars-config-section {
        padding: 1rem;
    }
    
    .calendar-type-card {
        padding: 1rem;
    }
    
    .status-header h4 {
        font-size: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .calendar-type-header i {
        font-size: 1.2rem;
    }
}
.fa-map-marked-alt {
    color: var(--color-primary);
    margin-left: 5px;
}
.zone-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.action-btn-secondary {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background-color: var(--color-white);
    cursor: pointer;
    transition: all 300ms ease;
}

.action-btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-1px);
}
/* === ESTILOS PARA ACCIONES MASIVAS === */
.bulk-actions {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 187, 85, 0.1);
    border: 1px solid var(--color-warning);
    border-radius: var(--border-radius-1);
}

.bulk-selection-info {
    font-weight: 600;
    color: var(--color-dark);
    font-size: 0.9rem;
}

@media screen and (max-width: 768px) {
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.8rem;
    }
}
/* Versión en modo móvil */
@media screen and (max-width: 768px) {
    .sidebar-footer {
        padding: 0.8rem 0;
    }
    
    .version-display {
        font-size: 0.7rem;
        padding: 0.6rem;
    }
}
/* === ESTILOS PARA SELECTOR DE PLATAFORMA POR DEFECTO === */
.default-platform-selector {
    background: var(--color-light);
    border-radius: var(--border-radius-2);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.default-platform-selector h4 {
    color: var(--color-dark);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.default-platform-selector .platform-description {
    color: var(--color-info-dark);
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}
/* === ESTILOS PARA BADGE DE PLATAFORMA ACTIVA === */
.active-platform-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(115, 128, 236, 0.1) 0%, rgba(65, 241, 182, 0.1) 100%);
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius-2);
    margin-bottom: 1.5rem;
}

.active-platform-badge .badge-icon {
    font-size: 1.8rem;
}

.active-platform-badge span {
    font-size: 1rem;
    color: var(--color-dark);
}

.active-platform-badge strong {
    color: var(--color-primary);
    font-weight: 600;
}

@media screen and (max-width: 768px) {
    .active-platform-badge {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .active-platform-badge .badge-icon {
        font-size: 1.5rem;
    }
}
/* === ESTILOS PARA TIPOS DE SESIÓN (COLORES SÓLIDOS) === */
.session-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Chat Directo - Azul sólido */
.session-type-direct {
    background: #5a67d8;
    color: white;
    box-shadow: 0 2px 4px rgba(90, 103, 216, 0.3);
}

/* Ticket Normal - Verde sólido */
.session-type-ticket {
    background: #2ecc71;
    color: white;
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
}

/* Efecto hover para los badges */
.session-type-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Efecto hover para los badges */
.session-type-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}
/* ============================================
   ESTILOS PARA APPOINTMENTS 
   Agregar al final de styles.css
   ============================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

/* Appointment Modal */
.appointment-modal {
    max-width: 700px;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

body[data-theme="dark"] .appointment-modal {
    background: #202c33;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.appointment-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.6em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

body[data-theme="dark"] .appointment-modal h2 {
    color: #e9edef;
    border-bottom-color: #25d366;
}

/* Appointment Sections */
.appointment-section {
    background: #f8f9fa;
}

body[data-theme="dark"] .appointment-section {
    background: #2a3942;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.appointment-section h4 {
    margin-bottom: 12px;
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.appointment-section p {
    margin: 8px 0;
    color: #34495e;
}

/* Form Groups */
.appointment-modal .form-group {
    margin-bottom: 12px;
}

.appointment-modal .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 0.95em;
}

.appointment-modal .form-group input,
.appointment-modal .form-group textarea,
.appointment-modal .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.appointment-modal .form-group input:focus,
.appointment-modal .form-group textarea:focus,
.appointment-modal .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.appointment-modal .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Status Select */
.status-select {
    font-size: 1.1em;
    font-weight: 600;
    padding: 12px;
    background: white;
    cursor: pointer;
}

/* Notes Container */
.notes-container {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 5px;
}

.notes-container::-webkit-scrollbar {
    width: 8px;
}

.notes-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.notes-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.notes-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Note Item */
.note-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.note-item:hover {
    transform: translateX(2px);
}

.note-item p {
    margin: 0 0 8px 0;
    color: #2c3e50;
    line-height: 1.5;
}

.note-item small {
    color: #7f8c8d;
    font-size: 0.85em;
}

/* Modal Actions */
.appointment-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.appointment-modal .modal-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
}

.appointment-modal .btn-primary {
    background: #3498db;
    color: white;
}

.appointment-modal .btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.appointment-modal .btn-secondary {
    background: #95a5a6;
    color: white;
}

.appointment-modal .btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.appointment-modal .btn-danger {
    background: #e74c3c;
    color: white;
}

.appointment-modal .btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

/* Calendar Events */
.fc-event-tech {
    font-size: 0.85em;
    color: #95a5a6;
    display: block;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .appointment-modal {
        max-width: 100%;
        padding: 15px;
        margin: 10px;
    }
    
    .appointment-modal .modal-actions {
        flex-direction: column;
    }
    
    .appointment-modal .modal-actions .btn {
        width: 100%;
    }

    .appointment-section {
        padding: 12px;
    }
}

/* Animaciones para Confirm Dialog */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* ==================== HERRAMIENTAS DE ATENCIÓN ==================== */

/* Tabs de herramientas */
.tools-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

.tool-tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    top: 2px;
}

.tool-tab:hover {
    color: var(--color-primary);
    background: rgba(52, 152, 219, 0.1);
}

.tool-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* Contenedores de herramientas */
.tool-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-container.active {
    display: block;
}

/* Colores de etiquetas */
.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.tag-badge.red { background: #fee; color: #c00; }
.tag-badge.orange { background: #ffe; color: #f80; }
.tag-badge.yellow { background: #ffc; color: #990; }
.tag-badge.green { background: #efe; color: #080; }
.tag-badge.blue { background: #eef; color: #08f; }
.tag-badge.purple { background: #fef; color: #90f; }
.tag-badge.gray { background: #eee; color: #666; }

/* Tema oscuro */
body.dark-mode .tag-badge.red { background: #400; color: #fcc; }
body.dark-mode .tag-badge.orange { background: #420; color: #fc8; }
body.dark-mode .tag-badge.yellow { background: #440; color: #ffa; }
body.dark-mode .tag-badge.green { background: #040; color: #cfc; }
body.dark-mode .tag-badge.blue { background: #024; color: #8cf; }
body.dark-mode .tag-badge.purple { background: #408; color: #fcf; }
body.dark-mode .tag-badge.gray { background: #333; color: #aaa; }


/* Arreglos para modales de herramientas */
#quick-reply-form .form-group label,
#tag-form .form-group label,
#template-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Checkbox de habilitado - Mejorado */
#quick-reply-form .form-group label input[type="checkbox"],
#tag-form .form-group label input[type="checkbox"],
#template-form .form-group label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: var(--background);
    transition: all 0.2s ease;
    position: relative;
}

#quick-reply-form .form-group label input[type="checkbox"]:hover,
#tag-form .form-group label input[type="checkbox"]:hover,
#template-form .form-group label input[type="checkbox"]:hover {
    border-color: var(--color-primary);
}

#quick-reply-form .form-group label input[type="checkbox"]:checked,
#tag-form .form-group label input[type="checkbox"]:checked,
#template-form .form-group label input[type="checkbox"]:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

#quick-reply-form .form-group label input[type="checkbox"]:checked::after,
#tag-form .form-group label input[type="checkbox"]:checked::after,
#template-form .form-group label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Dark mode para checkbox */
:root[data-theme="dark"] #quick-reply-form .form-group label input[type="checkbox"],
:root[data-theme="dark"] #tag-form .form-group label input[type="checkbox"],
:root[data-theme="dark"] #template-form .form-group label input[type="checkbox"] {
    border-color: #555;
}

:root[data-theme="dark"] #quick-reply-form .form-group label input[type="checkbox"]:checked,
:root[data-theme="dark"] #tag-form .form-group label input[type="checkbox"]:checked,
:root[data-theme="dark"] #template-form .form-group label input[type="checkbox"]:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Botones del footer iguales */
#quick-reply-form .modal-footer button,
#tag-form .modal-footer button,
#template-form .modal-footer button {
    min-width: 120px;
    padding: 10px 20px;
}

/* Sistema de notificaciones */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: white;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.hiding {
    opacity: 0;
    transform: translateX(400px);
}

.notification i {
    font-size: 20px;
    flex-shrink: 0;
}

.notification .notification-content {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.notification.success {
    border-color: #28a745;
}

.notification.success i {
    color: #28a745;
}

.notification.error {
    border-color: #dc3545;
}

.notification.error i {
    color: #dc3545;
}

.notification.warning {
    border-color: #ffc107;
}

.notification.warning i {
    color: #ffc107;
}

.notification.info {
    border-color: #17a2b8;
}

.notification.info i {
    color: #17a2b8;
}

/* Dark mode para notificaciones */
:root[data-theme="dark"] .notification {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .notification .notification-content {
    color: #e0e0e0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* Estilos para checkboxes de departamentos en modal de usuario */
#user-form input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    margin: 0 !important;
    accent-color: var(--color-success) !important;
}

#user-form input[type="checkbox"]:checked {
    background-color: var(--color-success) !important;
}

/* Etiquetas de departamentos */
#user-form label[style*="cursor: pointer"] {
    user-select: none;
    transition: opacity 0.2s;
}

#user-form label[style*="cursor: pointer"]:hover {
    opacity: 0.8;
}

/* Tema oscuro - asegurar visibilidad */
body[data-theme="dark"] #user-form input[type="checkbox"] {
    filter: brightness(1.2);
}

/* ===== ESTILOS PARA FILE INPUTS (Planes y Promociones) ===== */
/* Modo claro */
.file-input-field {
    padding: 8px 12px;
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    background: var(--color-white);
    color: var(--color-dark);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.file-input-field:hover {
    border-color: var(--color-primary);
    background: var(--color-light);
}

.file-input-field::file-selector-button {
    padding: 6px 12px;
    margin-right: 10px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
}

.file-input-field::file-selector-button:hover {
    background: var(--color-primary-variant);
}

/* Modo oscuro */
body[data-theme="dark"] .file-input-field {
    background: #2a3942;
    color: #e9edef;
    border-color: #2a3942;
}

body[data-theme="dark"] .file-input-field:hover {
    border-color: var(--color-primary);
    background: #364955;
}

body[data-theme="dark"] .file-input-field::file-selector-button {
    background: var(--color-primary);
    color: #111b21;
}

body[data-theme="dark"] .file-input-field::file-selector-button:hover {
    background: var(--color-primary-variant);
}

/* ===== ESTILOS PARA CHECKBOX DE LOGIN ===== */
.login-checkbox {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    margin: 0 !important;
    accent-color: var(--color-success) !important;
}

.login-checkbox-label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-info-dark);
    cursor: pointer;
    user-select: none;
}

body[data-theme="dark"] .login-checkbox {
    filter: brightness(1.2);
}

body[data-theme="dark"] .login-checkbox-label {
    color: #8696a0;
}

/* ==================== ESTADÍSTICAS DE MENSAJES (COMPACTO) ==================== */

/* Columna que contiene dos cards apiladas */
.card-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Cards de media altura */
.card-half {
    flex: 1;
    min-height: 0;
}

.card-half .card-body {
    padding: 12px;
}

.card-half .card-header h3 {
    font-size: 1rem;
}

/* Chart container más pequeño */
.chart-container-small {
    height: 180px;
    padding: 10px;
}

/* Header con botón */
.stats-header-with-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.stats-header-with-btn h3 {
    margin: 0;
    flex: 1;
}

.btn-header-action {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-header-action:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-header-action i {
    font-size: 0.9rem;
}

.stats-compact-body {
    padding: 12px;
}

.stats-compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.stats-compact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    background: var(--color-light);
    border-radius: 6px;
    text-align: center;
    align-items: center;
}

.stats-compact-item.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.stats-icon-large {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.stats-compact-item:nth-child(1) .stats-icon-large {
    color: #3498db; /* Azul para entrantes */
}

.stats-compact-item:nth-child(2) .stats-icon-large {
    color: #2ecc71; /* Verde para procesados */
}

.stats-compact-item:nth-child(3) .stats-icon-large {
    color: #f39c12; /* Naranja para pendientes */
}

.stats-compact-item.highlight .stats-icon-large {
    color: #9b59b6; /* Morado para tasa */
}

.stats-compact-label {
    font-size: 0.7rem;
    color: var(--color-info-dark);
    font-weight: 500;
}

.stats-compact-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-dark);
}

.stats-compact-value.success {
    color: var(--color-success);
}

.stats-compact-value.rate-medium {
    color: #f39c12;
}

.stats-compact-value.rate-low {
    color: var(--color-danger);
}

#stats-month-name-short {
    font-size: 0.85rem;
    font-weight: normal;
    opacity: 0.9;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Modal de Histórico */
.stats-history-table-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.stats-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.stats-history-table thead {
    position: sticky;
    top: 0;
    background: var(--color-primary);
    color: white;
    z-index: 1;
}

.stats-history-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.stats-history-table tbody tr {
    border-bottom: 1px solid var(--color-light);
    transition: background 0.2s;
}

.stats-history-table tbody tr:hover {
    background: var(--color-light);
}

.stats-history-table td {
    padding: 12px;
}

.stats-history-table .month-cell {
    font-weight: 600;
    color: var(--color-dark);
}

.stats-history-table .number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.stats-history-table .rate-cell {
    text-align: center;
    font-weight: 600;
}

.stats-history-table .rate-good {
    color: var(--color-success);
}

.stats-history-table .rate-medium {
    color: #f39c12;
}

.stats-history-table .rate-low {
    color: var(--color-danger);
}

.stats-history-table .diff-cell {
    text-align: center;
    font-weight: 600;
}

.stats-history-table .diff-positive {
    color: var(--color-success);
}

.stats-history-table .diff-negative {
    color: var(--color-danger);
}

/* Tema oscuro para stats compactos */
body[data-theme="dark"] .stats-compact-item {
    background: #2a2f32;
}

body[data-theme="dark"] .stats-compact-item.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

body[data-theme="dark"] .stats-compact-label {
    color: #8696a0;
}

body[data-theme="dark"] .stats-compact-value {
    color: #e4e6eb;
}

/* Íconos en tema oscuro mantienen sus colores pero más brillantes */
body[data-theme="dark"] .stats-compact-item:nth-child(1) .stats-icon-large {
    color: #5dade2;
}

body[data-theme="dark"] .stats-compact-item:nth-child(2) .stats-icon-large {
    color: #58d68d;
}

body[data-theme="dark"] .stats-compact-item:nth-child(3) .stats-icon-large {
    color: #f5b041;
}

body[data-theme="dark"] .stats-compact-item.highlight .stats-icon-large {
    color: #bb8fce;
}

/* Botón en header para tema oscuro */
body[data-theme="dark"] .btn-header-action {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .btn-header-action:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

body[data-theme="dark"] .stats-history-table tbody tr {
    border-bottom-color: #3e4042;
}

body[data-theme="dark"] .stats-history-table tbody tr:hover {
    background: #2a2f32;
}

body[data-theme="dark"] .stats-history-table .month-cell {
    color: #e4e6eb;
}

/* Estilos para botón TEST de ISP */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-test {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-test:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.btn-test:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-test:active:not(:disabled) {
    transform: translateY(0);
}

body[data-theme="dark"] .btn-test {
    background: #20c997;
}

body[data-theme="dark"] .btn-test:hover:not(:disabled) {
    background: #1bae84;
}

body[data-theme="dark"] .btn-test:disabled {
    background: #495057;
}
