* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #F5F5F7; color: #1a1a1a; }
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 200px; background: linear-gradient(180deg, #534AB7, #3C3489); position: fixed; top: 0; left: 0; height: 100vh; display: flex; flex-direction: column; z-index: 100; overflow-y: auto; }
.sidebar-logo { padding: 20px 16px; border-bottom: 0.5px solid rgba(255,255,255,0.1); }
.sidebar-logo-name { font-size: 16px; font-weight: 600; color: #fff; }
.sidebar-logo-sub { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.nav-section { font-size: 10px; color: rgba(255,255,255,0.4); padding: 16px 16px 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: rgba(255,255,255,0.7); font-size: 13px; text-decoration: none; transition: all 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.15); color: #fff; border-left: 3px solid #9FE1CB; padding-left: 13px; }
.nav-item i { font-size: 16px; }
.sidebar-bottom { margin-top: auto; padding: 16px; border-top: 0.5px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }

/* Main content */
.main-content { margin-left: 200px; flex: 1; padding: 24px; min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 600; color: #1a1a1a; }
.page-subtitle { font-size: 13px; color: #888; margin-top: 2px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* Cards */
.card { background: #fff; border: 0.5px solid #E5E5E5; border-radius: 12px; padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.stat-card { background: #fff; border: 0.5px solid #E5E5E5; border-radius: 10px; padding: 16px; }
.stat-icon { font-size: 20px; margin-bottom: 8px; }
.stat-num { font-size: 28px; font-weight: 600; color: #1a1a1a; }
.stat-label { font-size: 12px; color: #888; margin-top: 4px; }
.stat-sub { font-size: 11px; color: #aaa; margin-top: 2px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }

/* Badges */
.badge { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.badge-confirmed { background: #EAF3DE; color: #3B6D11; }
.badge-cancelled { background: #FCEBEB; color: #A32D2D; }
.badge-pending { background: #FAEEDA; color: #854F0B; }
.badge-available { background: #EAF3DE; color: #3B6D11; }
.badge-booked { background: #FCEBEB; color: #A32D2D; }
.badge-gp { background: #EEEDFE; color: #3C3489; }
.badge-cardio { background: #E6F1FB; color: #185FA5; }
.badge-derm { background: #E1F5EE; color: #085041; }
.badge-orth { background: #FAEEDA; color: #633806; }
.badge-admin { background: #EEEDFE; color: #3C3489; }
.badge-agent { background: #E1F5EE; color: #085041; }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: 12px; border: 0.5px solid #E5E5E5; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #F8F8F8; font-weight: 600; color: #666; padding: 12px 14px; text-align: left; border-bottom: 0.5px solid #E5E5E5; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 0.5px solid #F0F0F0; color: #333; vertical-align: middle; }
.data-table tr:hover td { background: #FAFAFA; }
.data-table tr:last-child td { border-bottom: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: 0.5px solid #ddd; background: #fff; color: #333; text-decoration: none; transition: all 0.15s; white-space: nowrap; }
.btn:hover { background: #F5F5F7; }
.btn-primary { background: #534AB7; color: #fff; border-color: #534AB7; }
.btn-primary:hover { background: #3C3489; border-color: #3C3489; }
.btn-danger { background: #FCEBEB; color: #A32D2D; border-color: #F0C0C0; }
.btn-danger:hover { background: #F7C1C1; }
.btn-success { background: #EAF3DE; color: #3B6D11; border-color: #C0DD97; }
.btn-warning { background: #FAEEDA; color: #854F0B; border-color: #FAC775; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 6px; border-radius: 6px; }
.btn-group { display: flex; gap: 6px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 0.5px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; background: #fff; color: #1a1a1a; transition: border-color 0.15s; }
.form-control:focus { border-color: #534AB7; box-shadow: 0 0 0 3px rgba(83,74,183,0.08); }
.form-control.error { border-color: #E24B4A; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-gp { background: #EEEDFE; color: #3C3489; }
.avatar-cardio { background: #E6F1FB; color: #185FA5; }
.avatar-derm { background: #E1F5EE; color: #085041; }
.avatar-orth { background: #FAEEDA; color: #633806; }
.avatar-default { background: #F1EFE8; color: #444441; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; min-width: 260px; animation: slideIn 0.2s ease; pointer-events: all; }
.toast-success { background: #EAF3DE; color: #3B6D11; border: 0.5px solid #C0DD97; }
.toast-error { background: #FCEBEB; color: #A32D2D; border: 0.5px solid #F0C0C0; }
.toast-info { background: #E6F1FB; color: #185FA5; border: 0.5px solid #B5D4F4; }
.toast-warning { background: #FAEEDA; color: #854F0B; border: 0.5px solid #FAC775; }
@keyframes slideIn { from { transform: translateX(120px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.modal-lg { width: 680px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #888; padding: 4px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 0.5px solid #F0F0F0; }

/* Tabs */
.tabs { display: flex; border-bottom: 0.5px solid #E5E5E5; margin-bottom: 20px; }
.tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: #888; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab.active { color: #534AB7; border-bottom-color: #534AB7; }

/* Search bar */
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-input { padding: 9px 12px 9px 36px; border: 0.5px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center; width: 220px; }
.search-input:focus { border-color: #534AB7; }
.filter-select { padding: 9px 12px; border: 0.5px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; background: #fff; cursor: pointer; }

/* Spinner */
.spinner { width: 32px; height: 32px; border: 3px solid #E5E5E5; border-top-color: #534AB7; border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrapper { display: flex; justify-content: center; padding: 40px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: #aaa; }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* Schedule pills */
.schedule-days { display: flex; gap: 4px; flex-wrap: wrap; }
.day-pill { font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 500; }
.day-pill.available { background: #EAF3DE; color: #3B6D11; }
.day-pill.unavailable { background: #F1EFE8; color: #B4B2A9; }

/* Scheduler */
.scheduler-wrapper { background: #fff; border: 0.5px solid #E5E5E5; border-radius: 12px; overflow: hidden; }
.sch-controls { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 0.5px solid #E5E5E5; }
.sch-grid { display: grid; overflow-x: auto; }
.sch-header-cell { padding: 10px 8px; font-size: 12px; font-weight: 600; text-align: center; background: #F8F8F8; border-right: 0.5px solid #F0F0F0; border-bottom: 0.5px solid #E5E5E5; }
.sch-header-cell.today { background: #EEEDFE; color: #534AB7; }
.sch-time-cell { padding: 6px 8px; font-size: 11px; color: #aaa; text-align: right; background: #FAFAFA; border-right: 0.5px solid #E5E5E5; border-bottom: 0.5px solid #F5F5F5; white-space: nowrap; }
.sch-cell { border-right: 0.5px solid #F5F5F5; border-bottom: 0.5px solid #F5F5F5; min-height: 52px; position: relative; padding: 2px; }
.apt-block { border-radius: 4px; padding: 3px 6px; font-size: 11px; font-weight: 500; cursor: pointer; margin-bottom: 2px; }
.apt-block:hover { opacity: 0.8; }
.apt-gp { background: #EEEDFE; color: #3C3489; border-left: 3px solid #534AB7; }
.apt-cardio { background: #E6F1FB; color: #0C447C; border-left: 3px solid #185FA5; }
.apt-derm { background: #E1F5EE; color: #085041; border-left: 3px solid #1D9E75; }
.apt-orth { background: #FAEEDA; color: #633806; border-left: 3px solid #BA7517; }

/* Profile panel */
.profile-panel { position: fixed; top: 0; right: -420px; width: 420px; height: 100vh; background: #fff; border-left: 0.5px solid #E5E5E5; z-index: 500; transition: right 0.3s ease; overflow-y: auto; padding: 24px; }
.profile-panel.open { right: 0; }
.profile-panel-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.2); z-index: 499; }
.profile-panel-overlay.open { display: block; }

/* Tag input (allergies) */
.tag-input-wrapper { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 0.5px solid #ddd; border-radius: 8px; min-height: 42px; cursor: text; }
.tag { background: #FCEBEB; color: #A32D2D; border-radius: 4px; padding: 2px 8px; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.tag-remove { cursor: pointer; font-size: 14px; line-height: 1; }
.tag-input { border: none; outline: none; font-size: 13px; flex: 1; min-width: 80px; background: transparent; }

/* Step progress */
.step-progress { display: flex; gap: 8px; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aaa; }
.step.active { color: #534AB7; font-weight: 600; }
.step.done { color: #3B6D11; }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: #F1EFE8; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.step.active .step-num { background: #534AB7; color: #fff; }
.step.done .step-num { background: #EAF3DE; color: #3B6D11; }
.step-line { flex: 1; height: 0.5px; background: #E5E5E5; }

/* Doctor cards grid */
.doctors-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.doctor-card { background: #fff; border: 0.5px solid #E5E5E5; border-radius: 12px; padding: 16px; }
.doctor-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.doctor-name { font-size: 14px; font-weight: 600; }
.doctor-specialty { font-size: 12px; color: #888; margin-top: 2px; }

/* Department cards */
.dept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dept-card { border-radius: 14px; padding: 24px; color: #fff; }
.dept-card-gp { background: #534AB7; }
.dept-card-cardio { background: #185FA5; }
.dept-card-derm { background: #1D9E75; }
.dept-card-orth { background: #BA7517; }
.dept-stat { font-size: 28px; font-weight: 700; }
.dept-stat-label { font-size: 12px; opacity: 0.8; }

/* Misc */
.divider { height: 0.5px; background: #F0F0F0; margin: 16px 0; }
.text-muted { color: #888; }
.text-sm { font-size: 12px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
