/* DentaCare CyberClinic - Futuristic Master SPA Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: #070a12;
    --bg-surface: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-input: rgba(30, 41, 59, 0.6);
    
    --primary: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.4);
    --primary-hover: #0891b2;
    --primary-light: rgba(6, 182, 212, 0.15);
    
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.35);
    --accent-pink: #ec4899;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --border-glow: rgba(255, 255, 255, 0.08);
    --border-active: rgba(6, 182, 212, 0.5);
    
    --sidebar-width: 270px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.15);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.8) 0%, #070a12 100%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 10, 18, 0.8);
    backdrop-filter: blur(12px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Styling */
aside.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glow);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
}

.brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-glow);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
    flex-shrink: 0;
}

.brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
}

.nav-menu {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 14px 12px 6px;
    letter-spacing: 1.2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    border-color: var(--border-active);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.user-profile-summary {
    padding: 14px 16px;
    margin: 14px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-glow);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-purple-glow));
    color: var(--primary);
    border: 2px solid var(--border-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--primary-glow);
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.user-role {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

/* Main Content Wrapper */
.main-wrapper {
    width: 100%;
    margin-left: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition);
}

.main-wrapper > .content {
    width: min(100%, 1440px);
    margin-right: auto;
    margin-left: auto;
}

.main-wrapper.appointments-fullscreen {
    width: 100vw;
    margin-left: 0 !important;
}

.appointments-fullscreen .content {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
}

.appointments-body {
    --bg-base: #eef2f5;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-main: #172534;
    --text-muted: #667587;
    --text-dim: #93a0ae;
    --border-glow: rgba(28, 48, 67, 0.12);
    --primary: #087f8c;
    --primary-light: rgba(8, 127, 140, 0.09);
    --primary-glow: rgba(8, 127, 140, 0.2);
    --accent-purple: #64748b;
    --shadow-card: 0 18px 45px rgba(28, 48, 67, 0.1);
    background: #eef2f5;
    background-image: linear-gradient(135deg, #f7fafb 0%, #eef2f5 60%, #e7eef1 100%);
    color: var(--text-main);
}

.appointments-body .appointments-page {
    width: min(100%, 1320px);
    max-width: 1320px;
}

.appointments-body .welcome-title h2,
.appointments-body .calendar-toolbar h3 {
    color: #172534;
}

.appointments-body .welcome-title p,
.appointments-body .calendar-toolbar p {
    color: #667587;
}

.appointments-body .eyebrow {
    color: #087f8c;
}

.appointments-body .agenda-summary {
    border-color: rgba(8, 127, 140, 0.22);
    background: #ffffff;
    color: #087f8c;
    box-shadow: 0 8px 22px rgba(28, 48, 67, 0.08);
}

/* Header / Topbar */
header.topbar {
    height: 76px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 16px;
}

.btn-toggle-sidebar {
    display: none;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    padding: 10px;
    color: var(--text-main);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-toggle-sidebar:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-glow);
    border-radius: 30px;
    padding: 10px 18px;
    width: 360px;
    max-width: 100%;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 20px var(--primary-glow);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    color: var(--text-main);
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0284c7);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.5);
    background: linear-gradient(135deg, #0891b2, var(--primary));
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-main);
    border: 1px solid var(--border-glow);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.3);
    border-color: #f43f5e;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

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

/* Content Area & SPA Views */
.content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.spa-view {
    display: none;
}

.spa-view.active-view {
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.welcome-title h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.welcome-title p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.date-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* KPI Grid - High Tech Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0; width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-active);
    box-shadow: 0 15px 35px -10px rgba(6, 182, 212, 0.2);
}

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

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { background: rgba(6, 182, 212, 0.15); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.stat-icon.teal { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.3); }

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.trend-up { color: #10b981; }
.trend-down { color: #f43f5e; }

/* Dashboard Layout Grid */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

/* Card Panel Component */
.card-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-card);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.panel-action:hover {
    color: #38bdf8;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Table Styling & Touch Scrolling */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
    min-width: 600px;
}

th {
    background: rgba(30, 41, 59, 0.4);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-glow);
    white-space: nowrap;
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-glow);
    color: var(--text-main);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(30, 41, 59, 0.4);
}

.patient-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.patient-info strong {
    display: block;
    font-weight: 700;
    color: var(--text-main);
}

.patient-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Futuristic Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-confirmada, .status-confirmed { 
    background: rgba(16, 185, 129, 0.15); 
    color: #34d399; 
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}
.status-en-proceso, .status-in-progress { 
    background: rgba(6, 182, 212, 0.15); 
    color: #38bdf8; 
    border-color: rgba(6, 182, 212, 0.3);
}
.status-pendiente, .status-pending { 
    background: rgba(245, 158, 11, 0.15); 
    color: #fbbf24; 
    border-color: rgba(245, 158, 11, 0.3);
}
.status-completada { 
    background: rgba(139, 92, 246, 0.15); 
    color: #a78bfa; 
    border-color: rgba(139, 92, 246, 0.3);
}
.status-cancelada, .status-cancelled { 
    background: rgba(244, 63, 94, 0.15); 
    color: #fb7185; 
    border-color: rgba(244, 63, 94, 0.3);
}

/* Quick Action Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.action-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.action-card:hover {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.15);
    transform: translateY(-3px);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-card strong {
    font-size: 14px;
}

.action-card span {
    font-size: 11px;
    color: var(--text-muted);
}

/* Form Controls & Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 15px var(--primary-glow);
}

.form-group option {
    background: #0f172a;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Futuristic Dental Odontogram Component */
.odontogram-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid var(--border-glow);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    color: white;
    padding: 28px;
    border-radius: var(--radius-lg);
}

.quadrant-title {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.teeth-container {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.tooth-card {
    min-width: 56px;
    width: 58px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tooth-card:hover {
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.tooth-num {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
}

.tooth-status-icon {
    font-size: 20px;
    margin: 6px 0;
}

.tooth-tag {
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    text-transform: uppercase;
}

/* Tooth status colors */
.tooth-sano { border-color: #06b6d4 !important; }
.tooth-carie { border-color: #f43f5e !important; background: rgba(244, 63, 94, 0.25) !important; box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
.tooth-endodoncia { border-color: #f59e0b !important; background: rgba(245, 158, 11, 0.25) !important; box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
.tooth-obturacion { border-color: #3b82f6 !important; background: rgba(59, 130, 246, 0.25) !important; box-shadow: 0 0 10px rgba(59, 130, 246, 0.2); }
.tooth-corona { border-color: #8b5cf6 !important; background: rgba(139, 92, 246, 0.25) !important; box-shadow: 0 0 10px rgba(139, 92, 246, 0.2); }
.tooth-implante { border-color: #10b981 !important; background: rgba(16, 185, 129, 0.25) !important; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
.tooth-extraccion { border-color: #64748b !important; opacity: 0.35; }

.treatment-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

/* Toast Notifications - High Tech Cyber Floating */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 14px 22px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-glow);
    border-left: 5px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.toast-success { border-left-color: #10b981; box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
.toast.toast-error { border-left-color: #f43f5e; box-shadow: 0 0 20px rgba(244, 63, 94, 0.2); }

/* Futuristic Modal System */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-active);
    overflow: hidden;
    transform: scale(0.92);
    transition: var(--transition);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
    box-shadow: 0 0 40px var(--primary-glow);
}

.modal-container form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.4);
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 26px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--border-glow);
    background: rgba(30, 41, 59, 0.4);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Login Shell */
.login-shell {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.15) 0%, #070a12 80%);
    padding: 20px;
}

.login-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border: 1px solid var(--border-active);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-brand .brand-icon {
    width: 60px;
    height: 60px;
}

.login-brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 900;
    color: var(--text-main);
}

.login-brand p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Clinic entry point */
body.home-body {
    display: block;
    min-height: 100vh;
    background: #edf3f4;
    background-image:
        radial-gradient(circle at 12% 15%, rgba(8, 127, 140, 0.14), transparent 32%),
        radial-gradient(circle at 88% 85%, rgba(48, 112, 143, 0.12), transparent 34%);
    color: #1b3040;
}

.home-shell {
    display: flex;
    width: min(100%, 1040px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 48px 28px;
    flex-direction: column;
    justify-content: center;
}

.home-heading {
    margin-bottom: 30px;
    text-align: center;
}

.home-kicker {
    color: #087f8c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.4px;
}

.home-heading h1 {
    margin-top: 10px;
    color: #193244;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.7px;
}

.home-heading p {
    margin-top: 10px;
    color: #6c7d8b;
    font-size: 14px;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.home-card {
    display: flex;
    min-height: 190px;
    padding: 28px;
    align-items: flex-start;
    gap: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid #d7e3e7;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 32px rgba(36, 71, 87, 0.1);
    color: #193244;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.home-card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    right: -48px;
    bottom: -68px;
    border-radius: 50%;
    background: rgba(8, 127, 140, 0.08);
}

.home-card:hover {
    transform: translateY(-6px);
    border-color: #8bc8ca;
    box-shadow: 0 22px 42px rgba(36, 71, 87, 0.16);
}

.home-card-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border-radius: 15px;
    background: #e4f5f4;
    color: #087f8c;
}

.home-card-icon svg {
    width: 29px;
    height: 29px;
}

.home-card-patients .home-card-icon {
    background: #eaf0f8;
    color: #386a9b;
}

.home-card-copy {
    display: flex;
    min-width: 0;
    padding-top: 5px;
    flex-direction: column;
    gap: 8px;
}

.home-card-copy strong {
    font-family: 'Outfit', sans-serif;
    font-size: 25px;
    font-weight: 800;
}

.home-card-copy small {
    max-width: 220px;
    color: #6c7d8b;
    font-size: 12px;
    line-height: 1.6;
}

.home-card-arrow {
    position: absolute;
    right: 24px;
    bottom: 22px;
    color: #087f8c;
    font-size: 22px;
    transition: transform 0.25s ease;
}

.home-card:hover .home-card-arrow {
    transform: translateX(5px);
}

@media (max-width: 640px) {
    .home-shell {
        padding: 32px 18px;
    }

    .home-cards {
        grid-template-columns: 1fr;
    }

    .home-card {
        min-height: 155px;
    }
}

.demo-credentials {
    background: rgba(30, 41, 59, 0.5);
    border: 1px dashed var(--border-glow);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* Action Buttons Grid */
.btn-action-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-action-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

/* =======================================================
   RESPONSIVE BREAKPOINTS: PC, TABLET & MOBILE
   ======================================================= */

/* 1. Large Screens & PC (Desktop Default > 1024px) */
@media (min-width: 1025px) {
    aside.sidebar {
        transform: translateX(0) !important;
    }
}

/* 2. Tablet Screen (768px - 1024px) */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* 3. Mobile & Small Tablet Screen (< 992px) */
@media (max-width: 992px) {
    aside.sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    aside.sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .btn-toggle-sidebar {
        display: flex;
    }

    header.topbar {
        padding: 0 20px;
    }

    .content {
        padding: 24px 20px;
        gap: 20px;
    }
}

/* 4. Mobile Screen (< 640px) */
@media (max-width: 640px) {
    header.topbar {
        height: 66px;
        padding: 0 14px;
        gap: 10px;
    }

    .search-box {
        width: 100%;
        padding: 6px 14px;
    }

    .content {
        padding: 16px 12px;
        gap: 16px;
    }

    .welcome-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .welcome-title h2 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
    }

    .card-panel {
        padding: 18px;
        border-radius: var(--radius-md);
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

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

    .modal-container {
        padding: 0;
        border-radius: var(--radius-md);
    }

    .modal-body {
        padding: 18px;
    }

    .modal-header {
        padding: 16px 18px;
    }

    .modal-footer {
        padding: 14px 18px;
    }

    .login-card {
        padding: 28px 20px;
    }

    .toast-container {
        bottom: 14px; right: 14px; left: 14px;
    }
}

/* Appointments workspace */
.appointments-page {
    align-self: center;
    padding: 42px clamp(20px, 4vw, 54px) 56px;
    gap: 22px;
}

.appointments-page .appointment-form-panel {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.appointments-page .calendar-panel {
    order: 2;
}

.appointment-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.appointment-modal.is-open {
    display: flex;
}

.appointment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease both;
}

.appointment-modal .appointment-form-panel {
    position: relative;
    z-index: 1;
    margin: 0;
    animation: modalIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.modal-open {
    overflow: hidden;
}

.appointment-modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-glow);
    border-radius: 50%;
    color: var(--text-muted);
    background: rgba(30, 41, 59, 0.55);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.appointment-modal-close:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.appointments-page .welcome-header {
    padding: 4px 2px 2px;
}

.appointments-page .eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.appointments-page .welcome-title h2 {
    font-size: 32px;
    letter-spacing: -0.8px;
}

.appointments-page .welcome-title p {
    max-width: 560px;
    line-height: 1.6;
}

.agenda-summary {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 15px;
    border: 1px solid rgba(6, 182, 212, 0.24);
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.08);
    color: #a5f3fc;
    font-size: 12px;
    font-weight: 700;
}

.agenda-summary-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.appointments-page .card-panel {
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.appointment-form-panel {
    border-top: 2px solid var(--primary);
}

.appointments-page .panel-title {
    align-items: flex-start;
}

.appointments-page .panel-title > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.appointments-page .panel-title small {
    color: var(--text-muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
}

.appointments-page .form-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 16px;
}

.appointments-page .form-group label {
    color: #a8b5c7;
    font-size: 10px;
    letter-spacing: 1px;
}

.appointments-page .form-group input,
.appointments-page .form-group select,
.appointments-page .form-group textarea {
    background: rgba(7, 10, 18, 0.32);
    border-color: rgba(148, 163, 184, 0.18);
}

.appointments-page .form-group input:hover,
.appointments-page .form-group select:hover,
.appointments-page .form-group textarea:hover {
    border-color: rgba(6, 182, 212, 0.42);
}

.appointment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-glow);
}

.appointment-form-actions .btn-primary {
    padding: 12px 18px;
}

.appointment-filter {
    display: flex;
    align-items: center;
    gap: 9px;
}

.appointment-filter label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.appointment-filter select {
    min-width: 145px;
    padding: 9px 30px 9px 11px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(7, 10, 18, 0.35);
    color: var(--text-main);
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.appointments-list-panel .table-responsive {
    margin: 0 -8px -8px;
}

.appointments-list-panel th {
    background: rgba(6, 182, 212, 0.06);
    color: #9fb0c5;
}

.appointments-list-panel td {
    padding-top: 17px;
    padding-bottom: 17px;
}

.appointments-list-panel tbody tr {
    transition: background 0.2s ease;
}

.appointments-list-panel tbody tr:hover td {
    background: rgba(6, 182, 212, 0.055);
}

@media (max-width: 900px) {
    .appointments-page .form-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .appointments-page .welcome-title h2 {
        font-size: 26px;
    }

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

    .appointments-page .panel-header {
        align-items: flex-start;
    }

    .appointment-filter {
        width: 100%;
    }

    .appointment-filter select {
        flex: 1;
    }

    .appointment-form-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Daily calendar */
.calendar-panel {
    position: relative;
    background:
        linear-gradient(120deg, rgba(18, 30, 48, 0.98), rgba(12, 25, 39, 0.96)),
        var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.calendar-panel::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #38bdf8 48%, var(--accent-purple));
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 28px 30px 24px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.12), transparent 62%);
}

.calendar-toolbar h3 {
    margin-top: 4px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 25px;
    font-weight: 800;
}

.calendar-toolbar p {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 7px;
}

.calendar-arrow,
.today-link {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    background: rgba(30, 41, 59, 0.55);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
}

.today-link {
    padding: 0 12px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.calendar-arrow:hover,
.today-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.calendar-controls input[type='date'] {
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    background: rgba(7, 10, 18, 0.38);
    color: var(--text-main);
    font-family: inherit;
    font-size: 11px;
    outline: none;
}

.calendar-controls input[type='date']:focus {
    border-color: var(--primary);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    padding: 0 30px 24px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 54px;
    padding: 10px 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: rgba(8, 18, 31, 0.42);
    text-decoration: none;
    transition: var(--transition);
}

.calendar-day:first-child,
.calendar-day:last-child {
    opacity: 0.72;
}

.calendar-day span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-day strong {
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
}

.calendar-day:hover,
.calendar-day.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: inset 0 -2px 0 var(--primary), 0 8px 20px rgba(6, 182, 212, 0.12);
}

.calendar-day.active {
    transform: translateY(-2px);
}

.calendar-day.active strong {
    color: var(--primary);
}

.calendar-grid {
    border-top: 1px solid var(--border-glow);
}

.calendar-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 78px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    transition: background 0.2s ease;
}

.calendar-row:hover {
    background: rgba(255, 255, 255, 0.018);
}

.calendar-row:last-child {
    border-bottom: 0;
}

.calendar-time {
    padding: 19px 20px 0 30px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
}

.calendar-slot {
    min-width: 0;
    padding: 10px 30px 10px 18px;
    border-left: 1px solid rgba(148, 163, 184, 0.1);
    background-image: linear-gradient(to right, transparent 0, transparent calc(100% - 1px), rgba(148, 163, 184, 0.025) 100%);
}

.calendar-slot-add {
    display: block;
    width: 100%;
    min-height: 54px;
    border: 1px dashed transparent;
    border-radius: var(--radius-sm);
    color: transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    text-align: left;
    transition: var(--transition);
}

.calendar-slot-add span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 5px;
    border: 1px solid transparent;
    border-radius: 50%;
    font-size: 16px;
}

.calendar-slot:hover .calendar-slot-add {
    border-color: rgba(6, 182, 212, 0.32);
    color: var(--primary);
    background: rgba(6, 182, 212, 0.045);
}

.calendar-slot:hover .calendar-slot-add span {
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(6, 182, 212, 0.12);
}

.calendar-slot:has(.calendar-appointment) .calendar-slot-add {
    min-height: 26px;
}

.calendar-appointment {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 11px 13px;
    border: 1px solid rgba(6, 182, 212, 0.22);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-appointment:hover {
    transform: translateX(3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.calendar-appointment + .calendar-appointment {
    margin-top: 7px;
}

.calendar-appointment.status-pendiente {
    border-left-color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.08);
}

.calendar-appointment.status-completada {
    border-left-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.08);
}

.calendar-appointment.status-cancelada {
    border-left-color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.08);
}

.calendar-appointment-main,
.calendar-appointment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-appointment-main {
    min-width: 0;
}

.calendar-appointment-time {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.calendar-appointment-main strong,
.calendar-appointment-main span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-appointment-main strong {
    color: var(--text-main);
    font-size: 13px;
}

.calendar-appointment-main span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.calendar-appointment-actions select {
    max-width: 126px;
    padding: 7px 8px;
    border: 1px solid var(--border-glow);
    border-radius: 7px;
    background: rgba(7, 10, 18, 0.38);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    outline: none;
}

.calendar-delete {
    padding: 6px 8px;
    border: 0;
    color: #fb7185;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
}

.calendar-delete:hover {
    color: #fda4af;
}

.calendar-empty {
    padding: 34px 20px 42px;
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}

.calendar-empty strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-main);
    font-size: 14px;
}

@media (max-width: 800px) {
    .calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px 18px 16px;
    }

    .calendar-controls {
        width: 100%;
    }

    .calendar-controls form,
    .calendar-controls input[type='date'] {
        flex: 1;
    }

    .calendar-days {
        gap: 6px;
        overflow-x: auto;
        padding: 0 18px 18px;
    }

    .calendar-day {
        min-width: 88px;
        flex-direction: column;
        justify-content: center;
        padding: 9px 7px;
    }

    .calendar-row {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .calendar-time {
        padding-left: 18px;
        padding-right: 10px;
    }

    .calendar-slot {
        padding-right: 18px;
        padding-left: 12px;
    }

    .calendar-appointment {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .calendar-appointment-actions {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-slot-add {
        color: var(--text-dim);
    }

    .calendar-slot-add span {
        border-color: rgba(148, 163, 184, 0.22);
    }
}

/* Clean clinical calendar theme */
.appointments-body .calendar-panel {
    background: #ffffff;
    border: 1px solid #dce5ea;
    box-shadow: 0 20px 50px rgba(28, 48, 67, 0.12);
}

.appointments-body .calendar-panel::before {
    height: 5px;
    background: #087f8c;
}

.appointments-body .calendar-toolbar {
    padding: 30px 34px 26px;
    background: #ffffff;
    border-bottom: 1px solid #e4ebef;
}

.appointments-body .calendar-toolbar h3 {
    font-size: 27px;
    letter-spacing: -0.4px;
}

.appointments-body .calendar-arrow,
.appointments-body .today-link,
.appointments-body .calendar-controls input[type='date'] {
    border-color: #d6e1e6;
    background: #ffffff;
    color: #314456;
}

.appointments-body .today-link,
.appointments-body .calendar-arrow:hover,
.appointments-body .today-link:hover {
    color: #087f8c;
}

.appointments-body .calendar-days {
    gap: 0;
    padding: 18px 34px 20px;
    background: #f8fafb;
    border-bottom: 1px solid #e4ebef;
}

.appointments-body .calendar-day {
    min-height: 62px;
    border: 0;
    border-right: 1px solid #e4ebef;
    border-radius: 0;
    background: transparent;
    color: #768696;
    box-shadow: none;
}

.appointments-body .calendar-day:first-child,
.appointments-body .calendar-day:last-child {
    opacity: 1;
}

.appointments-body .calendar-day:first-child {
    border-left: 1px solid #e4ebef;
}

.appointments-body .calendar-day:hover,
.appointments-body .calendar-day.active {
    border-color: #e4ebef;
    background: #e7f5f5;
    color: #087f8c;
    box-shadow: inset 0 -3px 0 #087f8c;
}

.appointments-body .calendar-day.active strong {
    color: #087f8c;
}

.appointments-body .calendar-grid {
    border-top: 0;
    background: #ffffff;
}

.appointments-body .calendar-row {
    min-height: 82px;
    border-bottom: 1px solid #edf1f3;
}

.appointments-body .calendar-row:hover {
    background: #fbfdfd;
}

.appointments-body .calendar-time {
    padding-left: 34px;
    color: #8795a3;
    font-size: 11px;
    letter-spacing: 0.2px;
}

.appointments-body .calendar-slot {
    border-left: 1px solid #e4ebef;
    background-image: none;
}

.appointments-body .calendar-slot-add {
    color: transparent;
}

.appointments-body .calendar-slot:hover .calendar-slot-add {
    border-color: #b9dfe0;
    color: #087f8c;
    background: #f5fbfb;
}

.appointments-body .calendar-appointment {
    border: 1px solid #b9e0df;
    border-left: 4px solid #087f8c;
    background: #f0fbfa;
    box-shadow: none;
}

.appointments-body .calendar-appointment:hover {
    transform: translateX(2px);
    border-color: #8ccaca;
    box-shadow: 0 6px 15px rgba(8, 127, 140, 0.1);
}

.appointments-body .calendar-appointment.status-pendiente {
    border-color: #f0d69e;
    border-left-color: #d59a16;
    background: #fff9eb;
}

.appointments-body .calendar-appointment.status-completada {
    border-color: #b8dec9;
    border-left-color: #2f9364;
    background: #f0faf5;
}

.appointments-body .calendar-appointment.status-cancelada {
    border-color: #edc5cb;
    border-left-color: #c94b5d;
    background: #fff5f6;
}

.appointments-body .calendar-appointment-main strong {
    color: #203446;
}

.appointments-body .calendar-appointment-main span {
    color: #6c7d8d;
}

.appointments-body .calendar-appointment-time {
    color: #087f8c;
}

.appointments-body .calendar-appointment-actions select {
    border-color: #d3e0e5;
    background: #ffffff;
    color: #526577;
}

.appointments-body .calendar-empty {
    background: #ffffff;
    color: #778898;
}

.appointments-body .calendar-empty strong {
    color: #203446;
}

@media (max-width: 800px) {
    .appointments-body .calendar-toolbar {
        padding: 20px 18px 16px;
    }

    .appointments-body .calendar-days {
        gap: 6px;
        overflow-x: auto;
        padding: 0 18px 18px;
    }

    .appointments-body .calendar-day {
        min-width: 88px;
        border: 1px solid #e4ebef;
        border-radius: var(--radius-sm);
    }

    .appointments-body .calendar-day:first-child {
        border-left: 1px solid #e4ebef;
    }

    .appointments-body .calendar-time {
        padding-left: 18px;
    }

    .appointments-body .calendar-slot {
        padding-right: 18px;
        padding-left: 12px;
    }
}

/* Wide agenda layout */
.appointments-body .agenda-page {
    width: min(100%, 1600px);
    max-width: 1600px;
    padding-right: clamp(16px, 2.5vw, 42px);
    padding-left: clamp(16px, 2.5vw, 42px);
}

.agenda-page .agenda-head {
    margin-bottom: 28px;
}

.agenda-page .agenda-head h2 {
    font-size: 34px;
    letter-spacing: -0.7px;
}

.agenda-page .calendar-panel {
    width: 100%;
    border-radius: 20px;
}

.agenda-page .calendar-toolbar,
.agenda-page .calendar-days {
    padding-right: clamp(24px, 3vw, 48px);
    padding-left: clamp(24px, 3vw, 48px);
}

.agenda-page .calendar-row {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 88px;
}

.agenda-page .calendar-time {
    padding-left: clamp(24px, 3vw, 48px);
    font-size: 12px;
}

.agenda-page .calendar-slot {
    padding-right: clamp(24px, 3vw, 48px);
    padding-left: 24px;
}

.agenda-page .calendar-appointment {
    min-height: 58px;
    padding: 14px 18px;
}

@media (max-width: 800px) {
    .appointments-body .agenda-page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .agenda-page .agenda-head h2 {
        font-size: 28px;
    }

    .agenda-page .calendar-row {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .agenda-page .calendar-time {
        padding-left: 18px;
    }

    .agenda-page .calendar-slot {
        padding-right: 18px;
        padding-left: 12px;
    }
}
