/* ==================== RESET & VARIABLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #60A5FA;
    --secondary: #8B5CF6;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    
    --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;
    
    --sidebar-width: 280px;
    --header-height: 70px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accessibility: focus-visible and reduced-motion */
*:focus { outline: none; }
*:focus-visible {
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}


.brand-logo img {
    width: 200px;
    height: auto;
    display: block;
}

.sidebar .brand-logo img {
    max-width: 170px;
    margin-bottom: 8px;
}

.header .brand-logo img {
    max-width: 180px;
}
.footer-logo img {
    width: 180px;
    height: auto;
    display: block;
    background-color: #E0E7FF;
    padding: 8px;
    border-radius: 12px;
}


/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar.active {
    left: 0;
    box-shadow: var(--shadow-xl);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

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

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    z-index: 1001;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
    transition: var(--transition);
}

.sidebar-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.sidebar-nav {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.appointment-widget {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
}

.widget-icon {
    font-size: 24px;
}

.widget-content {
    flex: 1;
}

.widget-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

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

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* ==================== PROFILE ==================== */
.profile-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}
.profile-sidebar {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    text-align: center;
}
.profile-avatar img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}
.profile-info h3 {
    font-size: 22px;
    margin-top: 12px;
    margin-bottom: 0;
}
.profile-info .muted {
    color: var(--gray-600);
    margin-bottom: 8px;
}
.profile-info .account-type {
    display: inline-block;
    background: #EEF2FF;
    color: var(--primary);
    padding: 6px 10px;
    border-radius: 18px;
    font-weight: 600;
    font-size: 13px;
}
.profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}
.btn-outline {
    border: 2px solid var(--gray-200);
    background: #3b82f6;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}
.profile-main .profile-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--gray-200);
}
.profile-header h2 {
    font-size: 24px;
    font-weight: 800;
}
.profile-header p {
    color: var(--gray-600);
}
.profile-body .input-group {
    margin-bottom: 12px;
}
.profile-body .input-group input,
.profile-body .input-group textarea {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.profile-body .input-group input[disabled],
.profile-body .input-group textarea[disabled] {
    background: var(--gray-50);
    color: var(--gray-700);
}
.profile-body .auth-actions {
    margin-top: 12px;
}

/* Profile Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.form-grid .input-group {
    margin-bottom: 0;
}

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

/* Responsive */
@media (max-width: 900px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
    .profile-avatar img {
        width: 100px;
        height: 100px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.header-content {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-700);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand .brand-icon {
    width: 40px;
    height: 40px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    padding: 8px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.header-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.header-link.active {
    background: var(--primary);
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-700);
    position: relative;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: white;
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    color: var(--gray-700);
    font-weight: 500;
    transition: var(--transition);
}

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

/* ==================== HERO SECTION ==================== */
.btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

a.btn.btn-outline {
    color: white;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    
}

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

/* ==================== AUTH / LOGIN ==================== */
.auth-section {
    padding: 80px 0;
}

/* ==================== CONFIRMATION CARD ==================== */
.confirmation-wrap { padding: 48px 0; }
.confirmation-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 32px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto; }
.confirmation-card h1 { font-size: 28px; margin-bottom: 6px; }
.confirmation-card p.lead { color: var(--gray-700); margin-bottom: 18px; font-size: 16px; }
.confirmation-card h3 { margin-bottom: 12px; }

.confirmation-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.confirmation-meta { padding: 16px; background: var(--gray-50); border-radius: 10px; border: 1px solid var(--gray-100); }
.confirmation-meta .row { margin-bottom: 12px; display:flex; gap:8px; align-items:center; }
.confirmation-meta .label { font-weight: 700; color: var(--gray-700); width: 86px; }
.confirmation-meta .value { color: var(--gray-900); }
.patient-details { background: white; padding: 16px; border-radius: 10px; border: 1px solid var(--gray-200); }
.receipt-header { display:flex; gap:12px; align-items:center; margin-bottom:12px; }
.receipt-header .brand-icon { width:48px; height:48px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--primary),var(--primary-dark)); color:white; font-weight:bold; }
.receipt-header .clinic-meta { font-size:14px; color:var(--gray-700); }
.confirmation-actions { display:flex; gap:12px; align-items:center; margin-top: 18px; }
.confirm-print-logo { display: none; max-width: 120px; margin: 0 0 12px 0; }
@media (max-width: 900px) {
    .confirmation-grid { grid-template-columns: 1fr; }
    .confirmation-card { padding: 20px; }
}
@media print {
    header, .header, footer { display: none !important; }
    body { background: #fff; }
    .confirmation-card { box-shadow: none; border: none; }
    /* Show logo and make the card receipt-like */
    .confirm-print-logo { display: block; margin: 0 auto 6px; }
    .confirmation-card { width: 100%; max-width: 100%; border: none; }
    .confirmation-actions { display: none; }
    .confirmation-card { font-size: 14px; padding: 8mm; }
    .confirmation-card h1 { font-size: 18px; text-align: center; margin-bottom: 6px; }
    .confirmation-meta { background: transparent; border: none; padding: 0; }
    body { color: #000; }
}

.welcome-banner {
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(59,130,246,0.06));
    padding: 12px 0;
    border-bottom: 1px solid rgba(59,130,246,0.06);
}
.welcome-content p {
    color: var(--gray-800);
    font-weight: 600;
}
.welcome-content a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 6px;
}

/* Toasts */
.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: white;
    border: 1px solid var(--gray-200);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 2000;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }

/* ==================== FOOTER ==================== */
.footer {
    background: var(--gray-900);
    color: white;
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-brand .brand-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.footer-about {
    color: var(--gray-400);
    line-height: 1.7;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-contact {
    list-style: none;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--gray-400);
    font-size: 14px;
}

.footer-contact svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    margin-top: 2px;
    flex-shrink: 0;
}

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

.footer-bottom p {
    color: var(--gray-400);
    font-size: 14px;
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: white;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .profile-btn span {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}


/* =========================
   appointments.css
   Dedicated styling for appointments.php
   ========================= */

/* Container */
.appointments-section {
    padding: 60px 0;
    background: var(--bg, #F9FAFB);
}

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

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text, #111827);
}

.section-header p {
    color: var(--muted, #6B7280);
    margin-top: 4px;
}

/* Badge Mini */
.badge-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card, #fff);
    border: 1px solid var(--border, #ddd);
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text, #111827);
}

.badge-mini .badge-count {
    background: var(--primary, #3B82F6);
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-weight: 700;
}

/* Appointments Controls */
.appointments-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.appointments-controls input[type="search"],
.appointments-controls select {
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background: var(--card, #fff);
    color: var(--text, #111827);
    transition: all 0.3s;
}

.appointments-controls input[type="search"]:focus,
.appointments-controls select:focus {
    border-color: var(--primary, #3B82F6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* Appointment Cards */
.appointments-list {
    display: grid;
    gap: 20px;
}

.appointment-card {
    background: var(--card, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
    transition: all 0.3s;
}

.appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.1));
}

.appointment-info p {
    margin-bottom: 6px;
    color: var(--text, #111827);
    font-size: 16px;
}

.appointment-info .status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.status-upcoming {
    background: #D1FAE5;
    color: #065F46;
}

.status-not.visited {
    background: #FFEDEC;
    color: #e70a1c;
}

.status-rescheduled {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-cancel,
.status-canceled,
.status-cancelled {
    background: #FFEDEC;
    color: #991B1B;
}

.status-not-visited,
.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

/* Appointment Actions */
.appointment-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn {
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary, #3B82F6);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.1));
}

.btn-secondary {
    background: var(--card, #fff);
    color: var(--primary, #3B82F6);
    border: 1px solid var(--primary, #3B82F6);
}

.btn-secondary:hover {
    background: var(--primary, #3B82F6);
    color: #fff;
}

/* Success / Error Messages */
.success-message,
.error-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 20px;
}

.success-message {
    background: #D1FAE5;
    color: #065F46;
}

.error-message {
    background: #FFEDEC;
    color: #991B1B;
}

/* Reschedule input */
input[type="datetime-local"] {
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background: var(--card, #fff);
    color: var(--text, #111827);
}

/* Responsive */
@media (max-width: 900px) {
    .appointment-card {
        flex-direction: column;
    }

    .appointment-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .appointments-controls {
        flex-direction: column;
    }

    .appointments-controls input,
    .appointments-controls select {
        width: 100%;
    }


@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
}