:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f8f9fc;
}

/* Login Screen */
.login-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: none;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    color: #333;
    border-radius: 0.25rem;
    margin: 0.2rem;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

/* Main content */
main {
    margin-top: 48px;
}

/* Cards */
.card {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border: none;
    border-radius: 0.5rem;
}

.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

/* Status badges */
.badge-estado {
    padding: 0.5em 0.75em;
    font-size: 0.875em;
    border-radius: 0.25rem;
}

.badge-esperando {
    background-color: var(--warning-color);
    color: #212529;
}

.badge-llamando {
    background-color: var(--info-color);
    color: white;
    animation: pulse 2s infinite;
}

.badge-atendido {
    background-color: var(--success-color);
    color: white;
}

.badge-cancelado {
    background-color: var(--danger-color);
    color: white;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Tipo de turno badges */
.badge-ordinario {
    background-color: #6c757d;
    color: white;
}

.badge-prioritario {
    background-color: var(--danger-color);
    color: white;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

/* Consultorio cards */
.consultorio-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.consultorio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.consultorio-activo {
    border-left: 0.25rem solid var(--success-color);
}

.consultorio-inactivo {
    border-left: 0.25rem solid var(--danger-color);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
        padding: 0;
    }
    
    main {
        margin-top: 0;
    }
    
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1055;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Utility classes */
.text-xs {
    font-size: 0.75rem;
}

.font-weight-bold {
    font-weight: 700;
}

.text-gray-800 {
    color: #5a5c69;
}

.text-gray-300 {
    color: #dddfeb;
}

/* Form enhancements */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 0.35rem;
    font-weight: 400;
}

.btn:focus {
    box-shadow: none;
}

/* Animation for new elements */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Badges for states and types */
.badge-esperando {
    background-color: #ffc107;
    color: #000;
}

.badge-llamando {
    background-color: #17a2b8;
    color: #fff;
}

.badge-atendido {
    background-color: #28a745;
    color: #fff;
}

.badge-cancelado {
    background-color: #dc3545;
    color: #fff;
}

.badge-normal,
.badge-ordinario {
    background-color: #6c757d;
    color: #fff;
}

.badge-prioritario {
    background-color: #fd7e14;
    color: #fff;
}

.badge-estado {
    font-size: 0.75em;
    padding: 0.25em 0.5em;
}