:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --bg: #f1f5f9;
    --sidebar-bg: rgba(255, 255, 255, 0.8);
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass: blur(12px) saturate(180%);
    --col-width: 150px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    overflow: hidden;
}

h1, h2, h3, .logo span {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
#app {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    color: var(--primary);
}

.logo i {
    font-size: 24px;
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-bottom: 8px;
    font-weight: 500;
}

.nav-links li:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-links li.active {
    background-color: var(--primary);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

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

.user-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 600;
    font-size: 14px;
}

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

#logoutBtn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

#logoutBtn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.sidebar-clinic {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: var(--radius-md);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.sidebar-clinic small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    font-weight: 600;
}

.sidebar-clinic span {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Landing Page Styles */
.landing-page {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    padding: 24px 8%;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.hero-section {
    display: flex;
    align-items: center;
    padding: 80px 8%;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
}

.badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
}

.hero-content h1 {
    font-size: 52px;
    line-height: 1.1;
    margin-bottom: 24px;
    color: #1e293b;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 16px;
}

.hero-visual {
    flex: 1;
    position: relative;
}

.hero-img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.floating-card {
    position: absolute;
    background: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    color: var(--primary);
    font-size: 20px;
}

.floating-card span {
    font-weight: 600;
    font-size: 14px;
}

.floating-card.c1 { top: -20px; left: -20px; }
.floating-card.c2 { bottom: 40px; right: -30px; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    padding: 100px 8%;
    background: white;
}

.feature-card {
    padding: 40px;
    border-radius: 20px;
    background: #f8fafc;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 24px;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: #1e293b;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: #f1f5f9;
}

/* Super Admin Styles */
.clinic-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.clinic-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text);
}

.clinic-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.clinic-actions {
    display: flex;
    gap: 10px;
}

.super-admin-only.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 968px) {
    .hero-section {
        flex-direction: column;
        padding-top: 40px;
        text-align: center;
    }
    .hero-btns {
        justify-content: center;
    }
    .hero-content h1 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px;
    }
    .main-layout {
        flex-direction: column;
    }
}
.content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 24px 32px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 600;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--bg);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.date-picker button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.date-picker button:hover {
    color: var(--primary);
}

.date-input-wrapper {
    position: relative;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.date-input-wrapper:hover {
    background: var(--border);
}

#hiddenDatePicker {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

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

#currentDateDisplay {
    font-weight: 500;
    min-width: 160px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.filters select {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
}

/* Agenda Grid - Responsive & Complex */
#viewContent {
    flex-grow: 1;
    overflow: auto;
    padding: 20px;
}

.agenda-grid {
    display: grid;
    grid-template-columns: 80px 1fr; /* Time col + Professionals grid */
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-width: 1000px;
    position: relative;
}

.time-column {
    border-right: 1px solid var(--border);
    padding-top: 60px; /* Offset for prof header */
}

.time-slot {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border);
}

.professionals-grid {
    display: flex;
    overflow-x: auto;
}

.professional-col {
    flex: 1;
    min-width: var(--col-width);
    border-right: 1px solid var(--border);
}

.prof-header {
    height: 60px;
    background-color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border);
}

.appointments-container {
    position: relative;
    height: 720px; /* 12 hours * 60px */
}

.appointment-card {
    position: absolute;
    left: 4px;
    right: 4px;
    background-color: #dbeafe; /* Blue for scheduled */
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.appointment-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.appointment-card.scheduled {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
}

.appointment-card.confirmed {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
}

.appointment-card.present {
    background-color: #dcfce7; /* Green for present */
    border-left-color: #22c55e;
}

.appointment-card.absent {
    background-color: #fee2e2;
    border-left-color: #ef4444;
}

.appointment-card.absent_notice {
    background-color: #ffedd5;
    border-left-color: #f59e0b;
}

.appointment-card.cancelled_prof {
    background-color: #f3e8ff;
    border-left-color: #7c3aed;
}

.appointment-card .time {
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
}

.appointment-card .patient {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.3s;
}

.modal {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    background: white;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 24px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.prof-login-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.prof-login-btn {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.prof-login-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.admin-only {
    display: flex; /* Will be toggled by JS */
}

/* Professional View Overrides */
#app.professional-view .admin-only {
    display: none !important;
}

@media (max-width: 768px) {
    #app {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}
.checkbox-container {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-container:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.checkbox-container input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.badge-insurance {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.patient-name-link:hover {
    text-decoration: underline;
    filter: brightness(0.8);
}

.prof-report-link:hover {
    text-decoration: underline;
    filter: brightness(0.8);
}

.phone-link:hover {
    color: #128c7e !important;
    text-decoration: underline;
}
