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

/* Prevenir desbordamiento horizontal en móviles */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Hacer que todos los elementos respeten el ancho de pantalla */
*, *::before, *::after {
    max-width: 100%;
}

:root {
    /* Colores base del tema naranja (default) */
    --jesy-orange: #ff6b35;
    --jesy-orange-dark: #e55a2b;
    --jesy-orange-light: #ff8a5c;
    
    /* Variables de color principal que cambiarán según el tema */
    --primary-color: var(--primary-color);
    --primary-dark: var(--primary-dark);
    --primary-light: var(--primary-light);
    
    /* Colores neutros (no cambian con el tema) */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
}

/* Tema Azul */
[data-theme="blue"] {
    --primary-color: #4a69bd;
    --primary-dark: #3c5aa6;
    --primary-light: #5f7cdb;
}

/* Tema Naranja (explícito para cuando se selecciona) */
[data-theme="orange"] {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8a5c;
}

/* Tema Negro */
[data-theme="black"] {
    --primary-color: #1f2937;
    --primary-dark: #111827;
    --primary-light: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    /* Prevenir zoom horizontal en móviles */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* Mejorar scrolling en iOS */
    -webkit-overflow-scrolling: touch;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Call Transcript Modal Styles */
.transcript-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.transcript-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.call-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.info-value {
    color: var(--gray-800);
    font-size: 1rem;
}

.conversation-section,
.extracted-info-section {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.conversation-section h4,
.extracted-info-section h4 {
    background: var(--gray-100);
    padding: 12px 16px;
    margin: 0;
    font-size: 1rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.conversation-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.conversation-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    position: relative;
}

.conversation-message.user {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.conversation-message.assistant {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-speaker {
    font-weight: 600;
    font-size: 0.875rem;
}

.message-speaker.user {
    color: #1976d2;
}

.message-speaker.assistant {
    color: #7b1fa2;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.message-content {
    line-height: 1.5;
    color: var(--gray-800);
}

.extracted-info-content {
    padding: 16px;
}

.extracted-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.extracted-item:last-child {
    border-bottom: none;
}

.extracted-label {
    font-weight: 500;
    color: var(--gray-600);
}

.extracted-value {
    color: var(--gray-800);
    font-weight: 500;
}

.no-transcript {
    text-align: center;
    padding: 32px;
    color: var(--gray-500);
    font-style: italic;
}

.transcript-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.default {
    background: var(--gray-200);
    color: var(--gray-700);
}

.no-transcript-text {
    color: var(--gray-500);
    font-style: italic;
    font-size: 0.875rem;
}

/* Authentication Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--gray-600);
    font-size: 16px;
}

.auth-form h2 {
    color: var(--gray-800);
    margin-bottom: 24px;
    font-size: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--gray-600);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-areas: 
        "header header"
        "main main";
    grid-template-columns: 1fr;
    grid-template-rows: 70px 1fr;
    min-height: 100vh;
    overflow: hidden; /* Evitar scroll en el contenedor principal */
}

/* Ajustar el grid cuando el sidebar está colapsado */
.dashboard.sidebar-collapsed {
    /* El grid permanece igual, solo cambia el margen del main-content */
}

/* Header */
.header {
    grid-area: header;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    color: var(--gray-700);
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 24px 0;
    transition: width 0.3s ease, min-width 0.3s ease;
    width: 250px;
    min-width: 250px;
    position: fixed;
    top: 70px; /* Altura del header */
    left: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px !important;
    min-width: 80px !important;
}

.sidebar.collapsed .nav-menu li a span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .nav-menu li a {
    justify-content: center;
    padding: 16px 8px;
}

.sidebar.collapsed .nav-menu li a i {
    margin-right: 0;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--gray-50);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--gray-50);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 24px;
    background: var(--gray-50);
    overflow-y: auto;
    height: calc(100vh - 70px);
    margin-left: 250px; /* Espacio para el sidebar fijo */
    transition: margin-left 0.3s ease;
}

/* Ajustar margen cuando el sidebar está colapsado */
.dashboard.sidebar-collapsed .main-content {
    margin-left: 80px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    color: var(--gray-800);
    font-size: 24px;
    font-weight: 700;
}

.period-selector select {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.metric-content h3 {
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.metric-value {
    color: var(--gray-800);
    font-size: 24px;
    font-weight: 700;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.chart-container h3 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-placeholder {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    border: 2px dashed var(--gray-200);
    border-radius: 8px;
}

.chart-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.agent-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.agent-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.agent-phone {
    color: var(--gray-600);
    font-size: 14px;
}

.agent-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.agent-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.agent-status.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.agent-description {
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.5;
}

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

.agent-actions button {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

.btn-edit:hover {
    background: #2563eb;
}

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

.btn-delete:hover {
    background: #dc2626;
}

.btn-toggle {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-toggle:hover {
    background: var(--gray-300);
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filters input,
.filters select {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
}

.filters input {
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--gray-50);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

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

/* Integration Styles */
.integration-status {
    margin-bottom: 32px;
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.status-card h3 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.status-indicator.online {
    color: var(--success);
}

.status-indicator.offline {
    color: var(--error);
}

.status-indicator.checking {
    color: var(--warning);
}

.integration-agents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.integration-agent {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.integration-agent h4 {
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.webhook-url {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 12px;
    color: var(--gray-700);
    margin-bottom: 12px;
    word-break: break-all;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--gray-800);
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--gray-600);
}

#agent-form {
    padding: 24px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

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

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

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

.toast-icon {
    font-size: 18px;
}

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

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

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

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

.toast-message {
    flex: 1;
    color: var(--gray-800);
}

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

/* Dashboard Loading Styles */
.dashboard-loading {
    color: var(--gray-400);
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Data Sections Styles */
.data-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.data-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-header {
    padding: 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-header h3 i {
    color: var(--primary-color);
}

.data-count {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.data-content {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Call Item Styles */
.call-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s;
}

.call-item:hover {
    background-color: var(--gray-50);
}

.call-item:last-child {
    border-bottom: none;
}

.call-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.call-info strong {
    color: var(--gray-800);
    font-weight: 600;
}

.call-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-completed {
    background-color: #dcfce7;
    color: #166534;
}

.status-failed {
    background-color: #fecaca;
    color: #991b1b;
}

.status-in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

/* Estilos para nuevos status de IA */
.status-reservada {
    background-color: #dcfce7;
    color: #166534;
}

.status-reagendó {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-cancelación {
    background-color: #fecaca;
    color: #991b1b;
}

.status-disponibilidad {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.status-información {
    background-color: #e0f2fe;
    color: #0277bd;
}

.status-sin_respuesta {
    background-color: #f5f5f5;
    color: #6b7280;
}

.status-incompleta {
    background-color: #fef3c7;
    color: #92400e;
}

.call-details {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.call-duration {
    font-weight: 500;
}

.reservation-created {
    color: var(--success);
    font-weight: 500;
    font-size: 0.75rem;
}

.call-transcript {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-style: italic;
    line-height: 1.4;
    background-color: var(--gray-50);
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* Resource Item Styles */
.resource-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s;
}

.resource-item:hover {
    background-color: var(--gray-50);
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-item.inactive {
    opacity: 0.6;
}

.resource-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.resource-info strong {
    color: var(--gray-800);
    font-weight: 600;
}

.resource-type {
    padding: 0.25rem 0.5rem;
    background-color: var(--gray-100);
    color: var(--gray-700);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.resource-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.resource-status.active {
    background-color: #dcfce7;
    color: #166534;
}

.resource-status.inactive {
    background-color: #fecaca;
    color: #991b1b;
}

.resource-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
}

/* Metric Card Variants */
.metric-card.success {
    border-left: 4px solid var(--success);
}

.metric-card.warning {
    border-left: 4px solid var(--warning);
}

.metric-card.error {
    border-left: 4px solid var(--error);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Layout principal móvil - limpio y ordenado */
    .dashboard {
        grid-template-areas: 
            "header"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 100vh;
    }

    /* Header móvil - más compacto */
    .header {
        padding: 0.75rem 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .header h1 {
        font-size: 1.25rem;
    }

    /* Sidebar móvil - overlay limpio */
    .sidebar {
        position: fixed;
        z-index: 1000;
        left: -280px;
        top: 0;
        height: 100vh;
        background: #fff;
        box-shadow: 2px 0 20px rgba(0,0,0,0.15);
        width: 280px;
        min-width: 280px;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* Overlay para cerrar sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

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

    /* Main content móvil - espaciado limpio */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        min-height: calc(100vh - 70px);
    }

    /* Páginas específicas más limpias */
    .page {
        padding: 0;
        margin: 0;
    }

    /* Dashboard metrics más compacto */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .metric-card {
        padding: 1rem;
        text-align: center;
    }

    .metric-card h3 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .metric-card .metric-value {
        font-size: 1.5rem;
        font-weight: 700;
    }

    /* Charts más apropiados para móvil */
    .chart-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }

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

    /* Tablas responsivas */
    .table-container {
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    /* Botones más touch-friendly */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .btn-small {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Formularios más limpios */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Evitar zoom iOS */
        padding: 0.75rem;
    }
}

/* Media query para móviles muy pequeños - más limpia */
@media (max-width: 480px) {
    /* Autenticación más compacta */
    .auth-card {
        padding: 1rem;
        margin: 0.75rem;
        width: calc(100% - 1.5rem);
    }

    /* Main content ultra compacto */
    .main-content {
        padding: 0.75rem;
    }

    /* Metrics en una columna para pantallas muy pequeñas */
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Header más compacto */
    .header {
        padding: 0.5rem 0.75rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    /* Cards aún más compactas */
    .metric-card {
        padding: 0.75rem;
    }

    .chart-container {
        padding: 0.75rem;
    }

    /* Modales adaptados */
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }

    /* Tablas ultra compactas */
    table {
        font-size: 0.75rem;
    }

    table th,
    table td {
        padding: 0.25rem;
    }

    /* Botones más pequeños pero touch-friendly */
    .btn {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        z-index: 10;
        left: 0;
        top: 0;
        height: 100vh;
        background: #fff;
        box-shadow: 2px 0 8px rgba(0,0,0,0.07);
        width: 220px;
        min-width: 220px;
        transition: left 0.2s;
    }
    .sidebar.collapsed {
        left: -220px;
    }
}

.hide-for-client {
    display: none !important;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    margin-right: 16px;
    cursor: pointer;
    color: #ff6600;
}

.header-center {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: #222;
}

.calendar-container {
    margin: 16px 0 24px 0;
    text-align: left;
}

#calendar-date {
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

#reservations-table th, #reservations-table td {
    text-align: center;
}

/* Modal de Reservas Mejorado */
#reservation-modal .modal-content {
    max-width: 700px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}

#reservation-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 32px;
    border-bottom: none;
}

#reservation-modal .modal-header h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
}

#reservation-modal .modal-header .close-btn {
    color: white;
    opacity: 0.8;
    font-size: 28px;
}

#reservation-modal .modal-header .close-btn:hover {
    opacity: 1;
}

#reservation-modal form {
    padding: 32px;
    background: white;
}

#reservation-modal .form-group {
    margin-bottom: 24px;
}

#reservation-modal .form-group label {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    display: block;
}

#reservation-modal .form-group input,
#reservation-modal .form-group select,
#reservation-modal .form-group textarea {
    font-size: 16px;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    width: 100%;
    transition: all 0.3s ease;
    background: white;
}

#reservation-modal .form-group input:focus,
#reservation-modal .form-group select:focus,
#reservation-modal .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    outline: none;
}

#reservation-modal .form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

#reservation-modal .form-group label i {
    color: var(--primary-color);
    margin-right: 6px;
}

#reservation-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#reservation-modal .form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

#reservation-modal .btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#reservation-modal .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

#reservation-modal .btn-secondary {
    background: white;
    color: var(--gray-700);
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.3s ease;
}

#reservation-modal .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.reservations-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 18px;
    margin-top: -8px;
}

/* =====================================================
   ATTENDANCE SECTION STYLES
   ===================================================== */

/* Attendance Container */
.attendance-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Attendance Info Card */
.attendance-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.info-card h3 {
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-card p {
    color: var(--gray-600);
    font-size: 14px;
    margin: 0;
}

.info-card span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Staff Attendance List */
.staff-attendance-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

/* Staff Item */
.staff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.2s ease;
}

.staff-item:last-child {
    border-bottom: none;
}

.staff-item:hover {
    background-color: var(--gray-50);
}

/* Staff Info */
.staff-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.staff-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.staff-details h4 {
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.staff-role {
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
}

.staff-notes {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
}

/* Attendance Toggle */
.attendance-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

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

/* Status Text */
.status-text {
    font-size: 14px;
    font-weight: 500;
    min-width: 70px;
}

.status-text.present {
    color: var(--success);
}

.status-text.absent {
    color: var(--error);
}

/* Attendance History */
.attendance-history {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.attendance-history h3 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    padding: 20px 24px 16px;
    margin: 0;
    border-bottom: 1px solid var(--gray-200);
}

.history-list {
    padding: 16px 24px 24px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.history-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-info strong {
    color: var(--gray-800);
    font-size: 14px;
    font-weight: 600;
}

.history-date {
    color: var(--gray-500);
    font-size: 12px;
}

.history-reason {
    color: var(--gray-600);
    font-size: 13px;
    font-style: italic;
    max-width: 200px;
    text-align: right;
}

/* No Data State */
.no-data {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    padding: 40px 20px;
    margin: 0;
}

/* Header Info for Attendance Page */
.header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--gray-600);
}

#current-date {
    font-weight: 500;
    text-transform: capitalize;
}

#refresh-attendance {
    font-size: 14px;
    padding: 8px 16px;
}

/* Responsive Design for Attendance */
@media (max-width: 768px) {
    .attendance-container {
        gap: 16px;
    }
    
    .staff-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 20px;
    }
    
    .attendance-toggle {
        align-self: flex-end;
        width: 100%;
        justify-content: space-between;
    }
    
    .staff-info {
        width: 100%;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .history-reason {
        text-align: left;
        max-width: 100%;
    }
    
    .header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .info-card {
        padding: 16px;
    }
    
    .staff-item {
        padding: 16px;
    }
    
    .attendance-history h3 {
        padding: 16px 20px 12px;
    }
    
    .history-list {
        padding: 12px 20px 20px;
    }
}

/* =====================================================
   RESERVATION DETAILS MODAL STYLES
   ===================================================== */

.reservation-details {
    padding: 20px;
}

.detail-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-section:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 8px 0;
}

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

.detail-item.full-width {
    flex-direction: column;
    align-items: flex-start;
}

.detail-label {
    font-weight: 600;
    color: var(--gray-700);
    min-width: 100px;
    margin-right: 16px;
}

.detail-value {
    color: var(--gray-800);
    font-weight: 500;
    flex: 1;
    text-align: right;
}

.detail-item.full-width .detail-value {
    text-align: left;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: 6px;
    width: 100%;
    min-height: 20px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.detail-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-actions .btn-primary {
    background: var(--primary-color);
    color: white;
}

.detail-actions .btn-primary:hover {
    background: var(--primary-dark);
}

.detail-actions .btn-delete {
    background: var(--error);
    color: white;
}

.detail-actions .btn-delete:hover {
    background: #dc2626;
}

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-confirmed {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-cancelled {
    background: #fecaca;
    color: #991b1b;
}

/* Responsive design for details modal */
@media (max-width: 768px) {
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-label {
        margin-bottom: 4px;
        min-width: auto;
        margin-right: 0;
    }
    
    .detail-value {
        text-align: left;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .detail-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   CALENDAR IMPROVEMENTS
   ===================================================== */

/* Hacer el calendario más grande y espacioso */
#calendar {
    min-height: 600px; /* Altura mínima reducida para permitir expansión natural */
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin-bottom: 24px;
}

/* Permitir que el calendario se expanda completamente */
#calendar .fc-scroller {
    overflow: visible !important;
    height: auto !important;
}

#calendar .fc-timegrid-body {
    height: auto !important;
}

/* Mejorar espaciado de eventos en el calendario */
.fc-event {
    margin-bottom: 2px !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* Mejorar altura de las celdas de tiempo */
.fc-timegrid-slot {
    height: 40px !important; /* Aumentar altura de cada slot de tiempo */
}

/* Mejorar el header del calendario */
.fc-header-toolbar {
    margin-bottom: 20px !important;
    padding: 12px 0 !important;
}

/* Mejorar botones del calendario */
.fc-button {
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    border: 1px solid var(--gray-300) !important;
    background: white !important;
    color: var(--gray-700) !important;
    transition: all 0.2s !important;
}

.fc-button:hover {
    background: var(--gray-50) !important;
    border-color: var(--gray-400) !important;
}

.fc-button-primary {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.fc-button-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

/* Mejorar grid del calendario */
.fc-scrollgrid {
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Mejorar días de la semana */
.fc-col-header-cell {
    background: var(--gray-50) !important;
    padding: 12px 8px !important;
    font-weight: 600 !important;
    color: var(--gray-700) !important;
}

/* Mejorar horarios laterales */
.fc-timegrid-axis {
    font-size: 12px !important;
    color: var(--gray-600) !important;
    padding: 4px 8px !important;
}

/* Responsive para calendario */
@media (max-width: 768px) {
    #calendar {
        min-height: 600px !important;
        padding: 12px;
    }
    
    .fc-timegrid-slot {
        height: 35px !important;
    }
    
    .fc-event {
        font-size: 11px !important;
        padding: 1px 4px !important;
    }
}


/* =====================================================
   HORIZONTAL METRICS SCROLL
   ===================================================== */

.metrics-scroll-container {
    margin-bottom: 32px;
    position: relative;
}

.metrics-horizontal {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 8px 4px 16px 4px;
    scroll-behavior: smooth;
}

.metrics-horizontal::-webkit-scrollbar {
    height: 6px;
}

.metrics-horizontal::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.metrics-horizontal::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.metrics-horizontal::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.metric-card.clickable {
    min-width: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.metric-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.metric-card.clickable:active {
    transform: translateY(-2px);
}

.metric-card.clickable::after {
    content: "Haz clic para ver gráfica";
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 10px;
    color: var(--gray-500);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card.clickable:hover::after {
    opacity: 1;
}

/* =====================================================
   CHART CONTAINER
   ===================================================== */

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    max-height: 350px;
}

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

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.chart-header h3 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
}

#close-chart {
    padding: 6px 12px;
    font-size: 14px;
}

#metric-chart {
    max-width: 100%;
    height: auto !important;
}

/* =====================================================
   SETTINGS PAGE STYLES
   ===================================================== */

.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.settings-section h3 {
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.setting-item {
    margin-bottom: 20px;
}

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

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
}

.setting-item input[type="text"],
.setting-item input[type="time"],
.setting-item select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="time"]:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.time-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-range input {
    flex: 1;
}

.time-range span {
    color: var(--gray-600);
    font-weight: 500;
}

/* 🔥 NUEVO: Estilos para Horarios del Personal */
.section-description {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.barber-selector-container {
    margin-bottom: 24px;
}

.barber-selector-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
}

.barber-selector {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.barber-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

#staff-schedule-editor {
    margin-bottom: 20px;
}

.loading-schedules {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

.staff-schedule-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    background: var(--gray-50);
    transition: all 0.2s;
}

.staff-schedule-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.staff-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.staff-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.staff-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.staff-status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.schedule-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.day-schedule {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 12px;
}

.day-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.day-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

.day-toggle {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.day-times {
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-times input[type="time"] {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
}

.day-times input[type="time"]:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}

.day-times span {
    color: var(--gray-500);
    font-size: 12px;
}

.day-schedule.disabled {
    opacity: 0.5;
}

.day-schedule.disabled .day-name {
    text-decoration: line-through;
    color: var(--gray-400);
}

/* Responsive for settings */
@media (max-width: 768px) {
    .settings-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .time-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-range span {
        text-align: center;
        margin: 4px 0;
    }
}

/* =====================================================
   VIEW TOGGLE SWITCH STYLES
   ===================================================== */

/* =====================================================
   NEW RESERVATION SECTION STYLES
   ===================================================== */

.new-reservation-section {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-start;
}

.new-reservation-section .btn-primary {
    font-size: 16px;
    padding: 14px 28px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
}

.new-reservation-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* =====================================================
   VIEW TOGGLE SECTION STYLES
   ===================================================== */

.view-toggle-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.view-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.barber-date-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Remover margin-top para alineación horizontal */
}

.barber-date-selector label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-700);
    background: white;
    transition: border-color 0.2s ease;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.view-toggle-label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.view-toggle-switch {
    position: relative;
    display: inline-block;
    width: 180px;
    height: 36px;
}

.view-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.view-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-200);
    border-radius: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 3px;
    border: 2px solid var(--gray-300);
}

.view-toggle-slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 85px;
    background: var(--primary-color);
    border-radius: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.view-toggle-text {
    position: relative;
    z-index: 2;
    width: 85px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    transition: color 0.3s ease;
    padding: 8px 4px;
}

.view-toggle-input:checked + .view-toggle-slider:before {
    transform: translateX(85px);
}

.view-toggle-input:checked + .view-toggle-slider .calendar-view {
    color: var(--gray-600);
}

.view-toggle-input:not(:checked) + .view-toggle-slider .barber-view {
    color: var(--gray-600);
}

.view-toggle-input:checked + .view-toggle-slider .barber-view {
    color: white;
}

.view-toggle-input:not(:checked) + .view-toggle-slider .calendar-view {
    color: white;
}

/* =====================================================
   BARBER SCHEDULE VIEW STYLES
   ===================================================== */

.barber-schedule-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    overflow-x: auto; /* 🔥 NUEVO: Scroll horizontal para múltiples barberos */
    overflow-y: visible;
}

.schedule-header {
    display: grid;
    grid-template-columns: 100px repeat(auto-fit, minmax(150px, 1fr)); /* 🔥 NUEVO: Columnas dinámicas, min 150px por barbero */
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    min-width: max-content; /* 🔥 NUEVO: Permitir expansión más allá del contenedor */
}

.time-column-header,
.barber-column-header {
    padding: 16px 12px;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
    border-right: 1px solid var(--gray-200);
    font-size: 15px;
}

.time-column-header {
    background: var(--gray-100);
    border-right: 2px solid var(--gray-300);
}

.barber-column-header:last-child {
    border-right: none;
}

.schedule-body {
    /* Remover limitación de altura para expansión completa */
    /* max-height: 600px; */
    /* overflow-y: auto; */
    overflow-y: visible;
}

.schedule-row {
    display: grid;
    grid-template-columns: 100px repeat(auto-fit, minmax(150px, 1fr)); /* 🔥 NUEVO: Columnas dinámicas, min 150px por barbero */
    border-bottom: 1px solid var(--gray-100);
    min-height: 50px;
    min-width: max-content; /* 🔥 NUEVO: Permitir expansión más allá del contenedor */
}

.schedule-row:hover {
    background: var(--gray-50);
}

.time-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-right: 2px solid var(--gray-300);
    font-weight: 500;
    color: var(--gray-600);
    font-size: 13px;
}

.barber-slot {
    border-right: 1px solid var(--gray-200);
    padding: 4px;
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barber-slot:last-child {
    border-right: none;
}

.appointment-block {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 2px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    width: calc(100% - 4px);
    position: absolute;
    top: 2px;
    left: 2px;
    line-height: 1.2;
}

.appointment-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, var(--primary-dark), #d14d21);
}

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

.appointment-name {
    font-weight: 600;
    font-size: 11px;
}

.appointment-service {
    font-size: 10px;
    opacity: 0.9;
}

.empty-slot {
    color: var(--gray-400);
    font-style: italic;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-slot:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

/* Drag & Drop styles for barber schedule */
.appointment-block[draggable="true"] {
    cursor: move;
}

.appointment-block.dragging {
    opacity: 0.5;
}

.barber-slot.drag-over {
    background-color: rgba(255, 107, 53, 0.1);
    border: 2px dashed var(--primary-color);
}

/* Responsive design for barber schedule */
@media (max-width: 768px) {
    .new-reservation-section {
        margin-bottom: 16px;
        justify-content: center;
    }
    
    .new-reservation-section .btn-primary {
        width: 100%;
        max-width: 300px;
    }
    
    .view-toggle-section {
        margin-bottom: 16px;
        padding: 12px 0;
    }
    
    .view-toggle-switch {
        width: 160px;
        height: 32px;
    }
    
    .view-toggle-slider:before {
        height: 24px;
        width: 75px;
    }
    
    .view-toggle-input:checked + .view-toggle-slider:before {
        transform: translateX(75px);
    }
    
    .view-toggle-text {
        width: 75px;
        font-size: 11px;
        padding: 6px 4px;
    }
    
    .schedule-header {
        grid-template-columns: 70px repeat(auto-fit, minmax(120px, 1fr)); /* 🔥 Columnas dinámicas en tablet */
    }

    .schedule-row {
        grid-template-columns: 70px repeat(auto-fit, minmax(120px, 1fr)); /* 🔥 Columnas dinámicas en tablet */
    }
    
    .time-column-header,
    .barber-column-header {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .appointment-block {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .appointment-name {
        font-size: 10px;
    }
    
    .appointment-service {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .schedule-header {
        grid-template-columns: 60px repeat(auto-fit, minmax(100px, 1fr)); /* 🔥 Columnas dinámicas en mobile */
    }

    .schedule-row {
        grid-template-columns: 60px repeat(auto-fit, minmax(100px, 1fr)); /* 🔥 Columnas dinámicas en mobile */
    }
    
    .time-column-header,
    .barber-column-header {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .barber-column-header {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        height: 60px;
    }
    
    .appointment-block {
        font-size: 9px;
        padding: 4px 6px;
    }
    
    .appointment-name,
    .appointment-service {
        font-size: 8px;
    }
}

/* === SISTEMA DE BLOQUEO DE HORARIOS === */
.barber-controls {
    /* Remover margin para alineación horizontal dentro de view-toggle-section */
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.block-mode-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.selected-count {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Estados de los slots en modo bloqueo */
.barber-slot.block-mode {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.barber-slot.block-mode:hover {
    background-color: rgba(255, 107, 53, 0.1);
    border: 2px solid var(--primary-color);
}

.barber-slot.selected-for-block {
    background-color: rgba(255, 107, 53, 0.3) !important;
    border: 2px solid var(--primary-color) !important;
}

.barber-slot.blocked-slot {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border: 2px solid var(--error) !important;
    position: relative;
}

.barber-slot.blocked-slot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--error);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.barber-slot.blocked-slot::after {
    content: '🚫';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    z-index: 2;
}

/* 🔥 NUEVO: Estilos para horarios fuera del horario de trabajo del barbero */
.barber-slot.out-of-hours {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e8e8e8 10px,
        #e8e8e8 20px
    ) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    position: relative;
}

.barber-slot.out-of-hours:hover {
    background: repeating-linear-gradient(
        45deg,
        #f0f0f0,
        #f0f0f0 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    ) !important;
}

.barber-slot.out-of-hours .block-icon {
    font-size: 14px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.blocked-slot {
    background-color: rgba(239, 68, 68, 0.8);
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: not-allowed;
    position: relative;
}

.blocked-slot::before {
    content: '🚫 ';
    margin-right: 4px;
}

.slot-blocked {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border: 2px solid var(--error) !important;
}

.blocked-slot .empty-slot {
    opacity: 0.5;
    pointer-events: none;
}

/* Botones específicos para bloqueo */
.btn-danger {
    background-color: var(--error);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* =====================================================
   THEME SELECTOR STYLES
   ===================================================== */

.theme-selector {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

.theme-option:hover {
    border-color: var(--gray-400);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: var(--gray-50);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.theme-option.active .theme-preview {
    transform: scale(1.1);
}

.theme-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.theme-option span {
    font-size: 13px;
    margin-top: 4px;
}

/* =====================================================
   ESTILOS DIFERENCIADOS PARA BLOQUEOS Y AUSENCIAS
   ===================================================== */

/* Citas normales - Color naranja sólido de Jesy */
.appointment-normal {
    background: var(--primary-color, #ff6b35) !important;
    border-color: var(--primary-dark, #e55a2b) !important;
    color: white;
}

/* BLOQUEO - Gris transparente con borde punteado */
.appointment-bloqueo {
    background: rgba(128, 128, 128, 0.2) !important;
    border: 2px dashed rgba(128, 128, 128, 0.5) !important;
    color: #666 !important;
}

.appointment-bloqueo .appointment-name {
    color: #666 !important;
    font-style: italic;
}

.appointment-bloqueo .appointment-service {
    display: none; /* Ocultar servicio en bloqueos */
}

/* AUSENCIA - Rojo muy suave/transparente */
.appointment-ausencia {
    background: rgba(255, 0, 0, 0.08) !important;
    border: 2px solid rgba(255, 0, 0, 0.2) !important;
    color: rgba(255, 0, 0, 0.7) !important;
    position: relative;
}

.appointment-ausencia .appointment-name {
    color: rgba(255, 0, 0, 0.7) !important;
    font-weight: 600;
}

.appointment-ausencia .appointment-service {
    display: none; /* Ocultar servicio en ausencias */
}

/* Patrón rayado sutil para ausencias */
.appointment-ausencia::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 0, 0, 0.03) 10px,
        rgba(255, 0, 0, 0.03) 20px
    );
    pointer-events: none;
    border-radius: inherit;
}

/* Hover effects diferenciados */
.appointment-bloqueo:hover {
    background: rgba(128, 128, 128, 0.3) !important;
    transform: none; /* Sin zoom en bloqueos */
}

.appointment-ausencia:hover {
    background: rgba(255, 0, 0, 0.12) !important;
    transform: none; /* Sin zoom en ausencias */
}

/* Hacer que bloqueos y ausencias no sean arrastrables visualmente */
.appointment-bloqueo[draggable="true"],
.appointment-ausencia[draggable="true"] {
    cursor: not-allowed !important;
    opacity: 0.8;
}

/* =====================================================
   SISTEMA DE VENTAS E INVENTARIO - FASE 2D
   ===================================================== */

/* =====================================================
   1. SISTEMA DE TABS
   ===================================================== */

.tabs-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

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

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

.tab-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

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

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

/* =====================================================
   2. PÁGINA VENTAS - TAB 1: CAJA DEL DÍA
   ===================================================== */

.caja-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.caja-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: linear-gradient(135deg, white 0%, var(--gray-50) 100%);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.summary-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label i {
    color: var(--primary-color);
    font-size: 18px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

/* =====================================================
   3. PÁGINA VENTAS - TAB 2: HISTORIAL
   ===================================================== */

.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.filter-input {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.filter-input::placeholder {
    color: var(--gray-400);
}

/* =====================================================
   4. PÁGINA VENTAS - TAB 3: COMISIONES
   ===================================================== */

.commissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.commission-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}

.commission-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--success);
}

.commission-barber {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.commission-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 12px;
}

.commission-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.commission-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--gray-600);
}

.commission-detail-row strong {
    color: var(--gray-800);
}

/* =====================================================
   5. PÁGINA VENTAS - TAB 4: REPORTES
   ===================================================== */

.reportes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.periodo-selector {
    display: flex;
    gap: 12px;
    align-items: center;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.chart-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.chart-box h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.chart-canvas {
    width: 100%;
    height: 300px;
}

/* =====================================================
   6. PÁGINA INVENTARIO - ALERTAS Y FILTROS
   ===================================================== */

.alerts-container {
    margin-bottom: 24px;
}

.alert {
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert i {
    font-size: 20px;
}

.alert.alert-warning {
    background: #fef3c7;
    border-left-color: var(--warning);
    color: #92400e;
}

.alert.alert-danger {
    background: #fee2e2;
    border-left-color: var(--error);
    color: #991b1b;
}

.alert.alert-info {
    background: #dbeafe;
    border-left-color: var(--info);
    color: #1e40af;
}

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

/* =====================================================
   7. PÁGINA INVENTARIO - TOGGLE VISTA
   ===================================================== */

.inventory-view-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn:hover {
    color: var(--gray-900);
    background: rgba(255, 255, 255, 0.5);
}

.view-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-btn i {
    font-size: 16px;
}

/* =====================================================
   8. PÁGINA INVENTARIO - GRID DE PRODUCTOS
   ===================================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 24px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.product-card.low-stock {
    border-left: 4px solid #f59e0b;
}

.product-card.ok-stock {
    border-left: 4px solid #10b981;
}

/* Imagen del producto */
.product-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Badge de stock */
.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.stock-badge.low {
    color: #f59e0b;
    border: 2px solid #f59e0b;
}

.stock-badge.low::before {
    content: '⚠️';
    font-size: 14px;
}

/* Info del producto */
.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-sku {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.product-description {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Metadata del producto (categoría, SKU) */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.product-category,
.product-sku {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.product-sku {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Stock del producto */
.product-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 13px;
}

.stock-label {
    color: var(--gray-600);
    font-weight: 500;
}

.stock-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--gray-900);
}

.stock-value.low {
    color: #f59e0b;
}

.stock-min {
    color: var(--gray-500);
    font-size: 12px;
}

/* Precios del producto */
.product-prices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200);
}

.cost-price,
.sale-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.cost-price {
    color: var(--gray-600);
}

.cost-price::before {
    content: '💰 Costo:';
    font-weight: 500;
}

.sale-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 20px;
}

.sale-price::before {
    content: '💵 Venta:';
    font-size: 14px;
    font-weight: 600;
}

/* Acciones del producto */
.product-actions {
    display: flex;
    gap: 6px;
    padding: 12px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.btn-icon {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

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

.btn-edit:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-adjust:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.stock-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-badge.ok {
    background: #d1fae5;
    color: #065f46;
}

.stock-badge.low-stock {
    background: #fef3c7;
    color: #92400e;
}

.stock-badge.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

/* =====================================================
   VISTA DE LISTA - HORIZONTAL
   ===================================================== */

.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.products-list.hidden {
    display: none;
}

.product-list-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 20px;
    align-items: center;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
}

.product-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.product-list-item.low-stock {
    border-left: 4px solid #f59e0b;
}

.product-list-item.ok-stock {
    border-left: 4px solid #10b981;
}

/* Thumbnail */
.product-list-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-list-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info Container */
.product-list-info {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.product-info-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-info-column label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info-column .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.product-info-column .value.name {
    font-size: 16px;
    color: var(--gray-900);
}

.product-info-column .value.category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    width: fit-content;
}

.product-info-column .value.stock {
    font-size: 18px;
    font-weight: 700;
}

.product-info-column .value.stock.low {
    color: #f59e0b;
}

.product-info-column .value.stock.ok {
    color: #10b981;
}

.product-info-column .value.price {
    color: var(--primary-color);
    font-size: 16px;
}

/* Actions */
.product-list-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.product-list-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-list-info {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .product-info-column:nth-child(4),
    .product-info-column:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {
    .product-list-item {
        grid-template-columns: 60px 1fr;
        gap: 12px;
    }

    .product-list-thumbnail {
        width: 60px;
        height: 60px;
    }

    .product-list-info {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-list-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

/* =====================================================
   8. PÁGINA INVENTARIO - MOVIMIENTOS RECIENTES
   ===================================================== */

.movements-section {
    margin-top: 32px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.movements-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.movements-table {
    width: 100%;
}

.movement-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.movement-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.movement-icon.entrada {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.movement-icon.salida {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.movement-icon.ajuste {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* =====================================================
   9. MODALES - NUEVA VENTA
   ===================================================== */

.modal-large {
    max-width: 800px !important;
}

.sale-items-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 10px;
    border: 2px dashed var(--gray-300);
}

.add-item-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 500;
}

.sale-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.sale-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sale-item-info {
    flex: 1;
}

.sale-item-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.sale-item-price {
    font-size: 14px;
    color: var(--gray-600);
}

.sale-item-remove {
    background: var(--error);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.sale-item-remove:hover {
    background: #dc2626;
}

.sale-summary {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 15px;
    color: var(--gray-700);
}

.summary-row.total-row {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    border-top: 2px solid var(--gray-300);
    padding-top: 16px;
    margin-top: 8px;
}

.discount-input {
    width: 100px;
    padding: 6px 10px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
}

.discount-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* =====================================================
   10. MODALES - DETALLES DE VENTA
   ===================================================== */

.sale-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-box {
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.detail-box-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.detail-box-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.sale-items-display {
    margin: 20px 0;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.sale-items-display h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.sale-item-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

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

/* =====================================================
   11. MODALES - AGREGAR/EDITAR PRODUCTO
   ===================================================== */

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

.form-grid-full {
    grid-column: 1 / -1;
}

.photo-preview {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 48px;
    border: 2px dashed var(--gray-300);
    overflow: hidden;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =====================================================
   12. UTILIDADES GENERALES
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    color: var(--gray-500);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon i {
    font-size: 16px;
}

/* Colores de estado adicionales para badges */
.badge-paid {
    background: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* =====================================================
   13. RESPONSIVE DESIGN PARA VENTAS/INVENTARIO
   ===================================================== */

@media (max-width: 768px) {
    /* Tabs responsive */
    .tabs-header {
        overflow-x: scroll;
    }

    .tab-btn {
        font-size: 13px;
        padding: 14px 16px;
    }

    .tab-content {
        padding: 16px;
    }

    /* Ventas responsive */
    .caja-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-value {
        font-size: 28px;
    }

    .filters-row {
        flex-direction: column;
    }

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

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

    .charts-container {
        grid-template-columns: 1fr;
    }

    .reportes-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .periodo-selector {
        flex-direction: column;
        align-items: stretch;
    }

    /* Inventario responsive */
    .products-grid {
        grid-template-columns: 1fr;
    }

    .sale-details-grid {
        grid-template-columns: 1fr;
    }

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

    /* Modal de nueva venta */
    .add-item-controls {
        flex-direction: column;
    }

    .movement-row {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .movement-row > *:nth-child(3),
    .movement-row > *:nth-child(4),
    .movement-row > *:nth-child(5) {
        grid-column: 2;
    }
}

@media (max-width: 480px) {
    /* Ajustes adicionales para móviles pequeños */
    .btn-large {
        padding: 12px 24px;
        font-size: 16px;
    }

    .summary-label {
        font-size: 12px;
    }

    .summary-value {
        font-size: 24px;
    }

    .product-photo {
        height: 160px;
    }

    .chart-canvas {
        height: 250px;
    }

    .commission-amount {
        font-size: 28px;
    }

    .sale-summary {
        padding: 16px;
    }

    .summary-row {
        font-size: 14px;
    }

    .summary-row.total-row {
        font-size: 18px;
    }
}
/* =========================================== */
/* PAYMENT MODAL STYLES - MEJORADO */
/* =========================================== */

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.payment-info-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #cbd5e1;
}

.payment-info-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label i {
    font-size: 0.875rem;
    color: #ff6b35;
}

.info-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
}

.payment-items-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.payment-items-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.payment-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.payment-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.payment-item i {
    color: #ff6b35;
    font-size: 1.125rem;
}

.add-product-buttons {
    display: flex;
    gap: 0.5rem;
}

.payment-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.payment-method-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-method-section label {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-method-section label i {
    color: #ff6b35;
}

.payment-totals {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 1.25rem;
    border: 2px solid #fbbf24;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #fbbf24;
}

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

.total-row.total-final {
    padding-top: 1rem;
    border-top: 2px solid #f59e0b;
    margin-top: 0.5rem;
}

.total-label {
    font-size: 0.9375rem;
    color: #78350f;
    font-weight: 500;
}

.total-final .total-label {
    font-size: 1.125rem;
}

.total-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #92400e;
}

.total-final .total-value {
    font-size: 1.5rem;
}

.discount-input {
    width: 100px;
    padding: 0.375rem 0.5rem;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    background: #ffffff;
    color: #92400e;
    text-align: right;
}

.discount-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.btn-icon {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .payment-footer {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .total-value {
        font-size: 1rem;
    }

    .total-final .total-value {
        font-size: 1.25rem;
    }
}
/* =====================================================
   PÁGINA CLIENTES - BASE DE CLIENTES
   ===================================================== */

/* Métricas de clientes */
.clients-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.clients-metrics .metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.clients-metrics .metric-card i {
  font-size: 32px;
  color: var(--primary-color);
}

.clients-metrics .metric-card.success i {
  color: #10b981;
}

.clients-metrics .metric-card.warning i {
  color: #f59e0b;
}

.clients-metrics .metric-card.error i {
  color: #ef4444;
}

/* Client Status Badges */
.client-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.client-status-badge.vip {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #856404;
}

.client-status-badge.regular {
  background: #e3f2fd;
  color: #1565c0;
}

.client-status-badge.new {
  background: #e8f5e9;
  color: #2e7d32;
}

.client-status-badge.inactive {
  background: #ffebee;
  color: #c62828;
}

/* Client Row Hover */
.client-row:hover {
  background: var(--gray-50);
}

/* =====================================================
   MODAL DE DETALLE DE CLIENTE
   ===================================================== */

.client-detail-content {
  max-height: 70vh;
  overflow-y: auto;
}

/* Client Detail Header */
.client-detail-header {
  padding: 20px;
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
}

.client-info-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.client-info-main h2 {
  margin: 0;
  font-size: 24px;
  color: var(--gray-900);
}

.client-info-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-600);
  font-size: 14px;
}

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

/* Client Contact Section */
.client-contact-section {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.client-contact-section h4 {
  margin: 0 0 16px 0;
  color: var(--gray-700);
  font-size: 16px;
  font-weight: 600;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-item.full-width {
  grid-column: 1 / -1;
}

.contact-label {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 600;
}

.contact-label i {
  margin-right: 6px;
  color: var(--primary-color);
}

.contact-value {
  font-size: 14px;
  color: var(--gray-900);
}

/* Quick Actions */
.client-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Client Detail Tabs */
.client-detail-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.client-tab {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.client-tab:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.client-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: var(--gray-50);
}

.client-tab i {
  font-size: 16px;
}

/* Tab Content */
.client-tab-content {
  display: none;
  padding: 20px;
}

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

/* Client Reservations List */
.client-reservations-list {
  max-height: 400px;
  overflow-y: auto;
}

.client-reservation-item {
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 10px;
  background: white;
  transition: all 0.2s;
}

.client-reservation-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Client Calls List */
.client-calls-list {
  max-height: 400px;
  overflow-y: auto;
}

.client-call-item {
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 10px;
  background: white;
  transition: all 0.2s;
}

.client-call-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.call-transcript {
  background: var(--gray-50);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 8px;
  max-height: 100px;
  overflow-y: auto;
  color: var(--gray-700);
  line-height: 1.5;
}

/* Status Badges dentro de items */
.status-badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.success {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.error {
  background: #fee2e2;
  color: #991b1b;
}

/* =====================================================
   MODAL DE EDITAR CLIENTE
   ===================================================== */

#edit-client-form .form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

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

@media (max-width: 768px) {
  .clients-metrics {
    grid-template-columns: 1fr;
  }

  .client-info-stats {
    flex-direction: column;
    gap: 12px;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
  }

  .client-quick-actions {
    flex-direction: column;
  }

  .client-quick-actions .btn-sm {
    width: 100%;
  }

  .client-detail-tabs {
    flex-direction: column;
  }

  .client-tab {
    border-bottom: 1px solid var(--gray-200);
    border-left: 3px solid transparent;
  }

  .client-tab.active {
    border-left-color: var(--primary-color);
    border-bottom-color: var(--gray-200);
  }
}

/* =====================================================
   AUTOCOMPLETE DROPDOWN DE CLIENTES
   ===================================================== */
.client-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-300);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 2px;
}

.client-suggestions-dropdown.hidden {
  display: none;
}

.client-suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-suggestion-item:last-child {
  border-bottom: none;
}

.client-suggestion-item:hover {
  background: var(--gray-50);
}

.client-suggestion-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-suggestion-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 14px;
}

.client-suggestion-phone {
  font-size: 13px;
  color: var(--gray-600);
}

.client-suggestion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
}

.client-suggestion-visits {
  display: flex;
  align-items: center;
  gap: 4px;
}

.no-suggestions {
  padding: 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

/* =====================================================
   INDICADOR DE PAGO EN VISTA POR BARBERO
   ===================================================== */
.payment-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.payment-indicator.payment-paid {
  background-color: #4caf50; /* Verde */
}

.payment-indicator.payment-pending {
  background-color: #f44336; /* Rojo */
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Asegurar que appointment-block tenga posición relativa */
.appointment-block {
  position: relative;
}

/* Vercel webhook test: 1760633934 */
