:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --bg: #f3f4f6;
    --bg-2: #eceef2;
    --card-bg: #ffffff;
    --card-bg-2: #fbfcfe;
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --radius: 1px;
    --radius-sm: 1px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 20px rgba(16, 24, 40, 0.07);
    --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.06), 0 14px 34px rgba(16, 24, 40, 0.11);
    --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.18);
    --input-bg: #ffffff;
}

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd2da; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-corner { background: #f1f5f9; }
* { scrollbar-width: thin; scrollbar-color: #cbd2da #f1f5f9; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    font-size: 0.95rem;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); text-decoration: none; }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; }

/* App Layout */
.app-layout { min-height: 100vh; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: #ffffff;
    color: var(--text);
    border-right: none;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 24px rgba(16, 24, 40, 0.06);
}
.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}
.sidebar-logo-mark svg { width: 18px; height: 18px; }
.sidebar-logo {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1.2px;
    color: var(--text);
    white-space: nowrap;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.85rem 0.75rem;
}
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.8rem;
    border-radius: 6px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sidebar-nav a:hover {
    background: #f1f5f9;
    color: var(--text);
    transform: translateX(2px);
}
.sidebar-nav a.active {
    background: #e8effc;
    color: var(--primary-dark);
    font-weight: 600;
}
.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    color: var(--primary);
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-text { opacity: 1; transition: opacity 0.2s ease; }
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-user { display: flex; align-items: center; gap: 0.6rem; overflow: hidden; }
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-user-meta { display: flex; flex-direction: column; overflow: hidden; transition: opacity 0.2s ease; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-muted); }
.btn-logout {
    margin-top: 0.7rem;
    width: 100%;
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}
.btn-logout:hover { color: #fff; background: var(--primary-dark); box-shadow: 0 5px 16px rgba(37, 99, 235, 0.4); }

/* Collapsed sidebar - show only icons, cleanly centered */
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .sidebar-header { justify-content: center; padding: 0; gap: 0; }
body.sidebar-collapsed .sidebar-logo { display: none; }
body.sidebar-collapsed .sidebar-nav { padding: 0.85rem 0.35rem; }
body.sidebar-collapsed .sidebar-nav ul { gap: 0.2rem; }
body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 0; gap: 0; width: 100%; height: 46px; }
body.sidebar-collapsed .sidebar-nav a:hover { transform: none; }
body.sidebar-collapsed .nav-text { display: none; }
body.sidebar-collapsed .nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
body.sidebar-collapsed .sidebar-footer { padding: 0.7rem 0; }
body.sidebar-collapsed .sidebar-user { justify-content: center; }
body.sidebar-collapsed .sidebar-user-meta { display: none; }
body.sidebar-collapsed .sidebar-user-avatar { width: 32px; height: 32px; }
body.sidebar-collapsed .btn-logout { display: none; }

/* Main content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.sidebar-collapsed .main-content { margin-left: 68px; }

/* Topbar */
.topbar {
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 150;
}
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; }
.sidebar-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}
.sidebar-toggle:hover { background: #f1f5f9; color: var(--text); }
.sidebar-toggle svg { width: 20px; height: 20px; }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background: #fff;
    padding: 0.9rem 0;
    margin-top: auto;
}
.footer-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Login page - clean light */
.login-page { overflow: hidden; height: 100vh; display: block; }
.login-page main { padding: 0 !important; height: 100vh; overflow: hidden; }
.auth-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #eef2f7 0%, #e6ebf3 100%);
    padding: 2rem;
}
.auth-bg-shape { display: none; }
.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 10px;
    padding: 2.75rem 2.5rem;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08), 0 24px 60px rgba(16, 24, 40, 0.14);
    animation: card-in 0.35s ease;
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 0.25rem;
    font-weight: 800;
    color: var(--text);
    font-size: 1.6rem;
    letter-spacing: 0.5px;
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
}
.auth-card .form-control { padding: 0.75rem 0.95rem; font-size: 0.95rem; }
.auth-card .btn-primary { padding: 0.75rem; font-size: 0.95rem; font-weight: 700; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3); }
.auth-card .btn-primary:hover { box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42); transform: translateY(-1px); }
.auth-card .form-group { margin-bottom: 1.25rem; }
.auth-logo-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.auth-logo-mark svg { width: 32px; height: 32px; }

/* Hero */
.hero { text-align: center; padding: 3.5rem 1rem 2.5rem; }
.hero h1 { font-size: 2.2rem; font-weight: 800; color: var(--text); }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); margin: 0.5rem 0 1.5rem; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}
.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; font-weight: 500; }

/* Feature Grid */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin: 1.75rem 0; }
.feature-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-card h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.feature-card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.9rem; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem; }
.page-header h2 { font-size: 1.4rem; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.subtitle { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.55rem 1.15rem;
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none !important;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.btn:hover { background: #f3f4f6; color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 24, 40, 0.1); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4); }
.btn-success { background: var(--success); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 3px 12px rgba(5, 150, 105, 0.3); }
.btn-success:hover { background: #047857; color: #fff; border-color: transparent; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: #fff; border-color: transparent; font-weight: 700; }
.btn-warning:hover { background: #b45309; color: #fff; border-color: transparent; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 3px 12px rgba(220, 38, 38, 0.28); }
.btn-danger:hover { background: #b91c1c; color: #fff; border-color: transparent; transform: translateY(-1px); }
.btn-sm { padding: 0.32rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
.btn-block { width: 100%; text-align: center; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); background: transparent; font-weight: 600; box-shadow: none; }
.btn-outline-primary:hover { background: #eff6ff; color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-strong); background: transparent; box-shadow: none; }
.btn-outline-secondary:hover { background: #f3f4f6; color: var(--text); border-color: var(--border-strong); }

/* Cards - floating white cards, sharp edges, no borders */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: 8px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    width: 100%;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Tables - floating, sharp */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
}
.table th, .table td {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
}
.table th { background: #f8fafc; font-weight: 700; color: #475569; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.6px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fafc; }
.table-sm th, .table-sm td { padding: 0.42rem 0.65rem; font-size: 0.8rem; }
.table-responsive { overflow-x: auto; }

/* Badges - solid readable */
.badge {
    display: inline-block;
    padding: 0.28rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: none;
}
.badge-active, .badge-completed, .badge-good, .badge-ready, .badge-dispensed { background: #ecfdf5; color: #047857; }
.badge-inactive, .badge-pending { background: #f3f4f6; color: #4b5563; }
.badge-scheduled, .badge-confirmed, .badge-sent_to_lab, .badge-in_production { background: #eff6ff; color: #1d4ed8; }
.badge-arrived, .badge-in_progress, .badge-qc_pass, .badge-shipped, .badge-received { background: #fffbeb; color: #b45309; }
.badge-cancelled, .badge-no_show { background: #fef2f2; color: #b91c1c; }
.badge-expired { background: #fff7ed; color: #c2410c; }
.badge-open { background: #ecfdf5; color: #047857; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }
.badge-primary { background: #eff6ff; color: #1d4ed8; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-success { background: #ecfdf5; color: #047857; }

/* Forms - bold labels, strong contrast */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text); }
.form-label { color: var(--text); font-weight: 600; }

.form-control, .form-group input[type="text"], .form-group input[type="number"],
.form-group input[type="password"], .form-group input[type="date"], .form-group input[type="time"],
.form-group input[type="email"], .form-group input[type="search"], .form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid #d7dbe1;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control::placeholder, .form-group input::placeholder, .form-group textarea::placeholder { color: #9ca3af; }
.form-control:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}
.form-control-sm { padding: 0.32rem 0.6rem; font-size: 0.82rem; }
select.form-control option { background: #fff; color: var(--text); }
.form-check-input { background-color: #fff; border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* Textarea */
.form-group textarea, textarea.form-control { resize: vertical; min-height: 76px; max-height: 260px; }
textarea.form-control-sm { min-height: 54px; max-height: 220px; }

.form-actions { display: flex; gap: 0.9rem; padding-top: 1rem; border-top: 1px solid var(--border); margin-top: 1rem; }

/* Form section */
.form-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.1rem;
}
.form-section h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.85rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

/* Filter */
.filter-form { margin-bottom: 1.1rem; }
.filter-row { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.search-section {
    background: #fff;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    box-shadow: var(--shadow);
}

/* Tabs */
.nav-tabs { border-bottom: 1px solid var(--border); --bs-nav-tabs-border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); font-weight: 600; border: none; border-radius: 6px 6px 0 0; }
.nav-tabs .nav-link:hover { color: var(--text); }
.nav-tabs .nav-link.active { background: #fff; color: var(--primary-dark); font-weight: 700; box-shadow: 0 -3px 0 var(--primary) inset; }

/* Doctor Cards */
.doctor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.1rem; }
.doctor-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem !important; }
.doctor-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.doctor-info { flex: 1; }
.doctor-info h3 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.doctor-creds { font-size: 0.8rem; color: var(--text-muted); }
.doctor-specialty { margin: 0.25rem 0; }
.doctor-contact { font-size: 0.78rem; color: var(--text-muted); }
.doctor-license { font-size: 0.78rem; color: var(--text-muted); }
.doctor-fee { font-size: 0.84rem; font-weight: 700; color: var(--success); margin-top: 0.25rem; }
.doctor-actions { display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-end; }

/* Dashboard Grid */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.15rem; margin: 1.25rem 0; }
.dash-card { background: #fff; border-radius: 8px; padding: 1.15rem 1.25rem; box-shadow: var(--shadow); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.dash-card-header h3 { font-size: 0.98rem; font-weight: 700; }

/* Pagination */
.pagination { display: flex; gap: 0.3rem; list-style: none; margin: 1.1rem 0; justify-content: center; }
.pagination a { display: block; padding: 0.45rem 0.8rem; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 0.84rem; color: var(--text); text-decoration: none; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pagination .active a { background: var(--primary); color: white; border-color: var(--primary); }

/* Empty state */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); font-size: 0.88rem; }

/* Progress Bar */
.progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; min-width: 60px; display: inline-block; vertical-align: middle; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }

/* Alerts - light with dark readable text */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 0.9rem; font-size: 0.86rem; font-weight: 500; border: none; box-shadow: var(--shadow); animation: alert-in 0.25s ease; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-error, .alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* Dashboard - light */
.dashboard-page { background: var(--bg); }
.dash-orbs { display: none; }
.glass-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.glass-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.glass-stat { text-align: center; border-radius: 8px; }
.glass-stat:hover { transform: translateY(-3px); }
.glass-stat .stat-num { font-size: 1.9rem; font-weight: 800; line-height: 1.15; color: var(--text); }
.glass-stat .stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; font-weight: 500; }
.glass-card .table { background: transparent; border: none; box-shadow: none; }
.glass-card .table th { background: #f8fafc; }
.glass-card .table tr:hover td { background: #f8fafc; }
.glass-card .list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--border); }
.list-group-item { background: transparent; color: var(--text); border-color: var(--border); font-weight: 500; }
.list-group-item:hover { background: #f8fafc; }
.list-group-item-action { color: var(--text); }

/* Activity feed */
.activity-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.42rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.activity-dot-blue { background: #2563eb; }
.activity-dot-green { background: #059669; }
.activity-dot-amber { background: #d97706; }
.activity-dot-red { background: #dc2626; }
.activity-dot-gray { background: #9ca3af; }
.activity-text { flex: 1; min-width: 0; }
.activity-title { font-weight: 600; font-size: 0.84rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { font-size: 0.74rem; color: var(--text-muted); }

/* Accordion */
.accordion-item { background: #fff; border-color: var(--border); }
.accordion-button { background: #fff; color: var(--text); font-weight: 600; }
.accordion-button:not(.collapsed) { background: #f8fafc; color: var(--primary-dark); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); border-color: var(--primary); }

/* Border helpers on light */
.border-bottom { border-color: var(--border) !important; }
.border-top { border-color: var(--border) !important; }
.text-muted { color: var(--text-muted) !important; }
hr { border-color: var(--border); }
.table .text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary) !important; }

/* Compact clock time picker */
.time-picker-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #d7dbe1;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.time-picker-sm:focus-within { border-color: var(--primary); box-shadow: var(--shadow-focus); }
.time-field-sm {
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-weight: 700;
    width: 1.9rem;
    text-align: center;
    padding: 0.1rem;
    background: transparent;
    color: var(--text);
    -moz-appearance: textfield;
    appearance: textfield;
}
.time-field-sm::-webkit-inner-spin-button,
.time-field-sm::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.time-field-sm:focus { background: #f1f5f9; color: var(--primary-dark); }
.separator-sm { font-size: 0.95rem; font-weight: 700; color: var(--text-muted); user-select: none; }
.ampm-toggle-sm { display: flex; flex-direction: column; gap: 2px; margin-left: 0.25rem; }
.ampm-btn-sm {
    border: 1px solid var(--border);
    background: #fff;
    padding: 0.08rem 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    line-height: 1.2;
    transition: all 0.15s;
}
.ampm-btn-sm.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3); }

/* Prescription card expandable details */
.card details {
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    background: #fafbfc;
    padding: 0.35rem 0.6rem;
    transition: background 0.15s ease;
}
.card details:hover { background: #f1f5f9; }
.card details > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0.1rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s;
    color: var(--text);
}
.card details > summary:hover { color: var(--primary-dark); }
.card details > summary::-webkit-details-marker { display: none; }
.card details > summary::before { content: '▸'; display: inline-block; font-size: 0.8rem; transition: transform 0.18s; color: var(--primary); }
.card details[open] > summary::before { transform: rotate(90deg); }
.card details[open] > summary { color: var(--primary-dark); }
.card details > div { border-top: 1px solid var(--border); margin-top: 0.4rem; }

/* Page fade-in */
main.container-fluid { flex: 1 0 auto; animation: page-in 0.25s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Small helper text on light */
.small, .form-text { color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
    .doctor-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .header-actions { flex-direction: column; align-items: flex-start; }
    .auth-wrapper { padding: 1rem; }
    .auth-card { padding: 2rem 1.5rem; }
}

/* ============================================================
   VISION 360 - Unify all border-radius to 1px (sharp, clean)
   ============================================================ */
* { border-radius: 1px !important; }

/* Keep true circles circular (profile/doctor avatars, status dots) */
.sidebar-user-avatar, .doctor-avatar, .activity-dot, .avatar, .rounded-circle,
.status-dot, .btn-close { border-radius: 50% !important; }

/* Thin, matching scrollbars (webkit + firefox) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd2da; border-radius: 1px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-corner { background: #f1f5f9; }
* { scrollbar-width: thin; scrollbar-color: #cbd2da #f1f5f9; }

/* ============================================================
   DARK THEME (applied via data-theme="dark" on <body>)
   ============================================================ */
body[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #60a5fa;
    --primary-light: #93c5fd;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;
    --bg: #0f172a;
    --bg-2: #1e293b;
    --card-bg: #1e293b;
    --card-bg-2: #273449;
    --text: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-strong: #475569;
    background: var(--bg);
    color: var(--text);
}
body[data-theme="dark"] .sidebar { background: #111c2e; box-shadow: 6px 0 24px rgba(0,0,0,0.4); }
body[data-theme="dark"] .sidebar-nav a:hover { background: #1e293b; color: var(--text); }
body[data-theme="dark"] .sidebar-nav a.active { background: #1d4ed8; color: #fff; }
body[data-theme="dark"] .sidebar-footer { border-color: var(--border); }
body[data-theme="dark"] .topbar { background: rgba(17, 28, 46, 0.92); border-color: var(--border); }
body[data-theme="dark"] .footer { background: #111c2e; border-color: var(--border); }
body[data-theme="dark"] .table { background: var(--card-bg); }
body[data-theme="dark"] .table th { background: #273449; color: #cbd5e1; }
body[data-theme="dark"] .table tr:hover td { background: #273449; }
body[data-theme="dark"] .form-control, body[data-theme="dark"] .form-select,
body[data-theme="dark"] .form-group input, body[data-theme="dark"] .form-group select,
body[data-theme="dark"] .form-group textarea { background: #0f172a; color: var(--text); border-color: var(--border-strong); }
body[data-theme="dark"] select option { background: #1e293b; color: var(--text); }
body[data-theme="dark"] .btn { background: #1e293b; color: var(--text); border-color: var(--border-strong); }
body[data-theme="dark"] .btn:hover { background: #334155; color: var(--text); }
body[data-theme="dark"] .btn-outline-primary { color: var(--primary-light); border-color: var(--primary); background: transparent; }
body[data-theme="dark"] .btn-outline-primary:hover { background: #1d4ed8; color: #fff; }
body[data-theme="dark"] .list-group-item { background: var(--card-bg); color: var(--text); border-color: var(--border); }
body[data-theme="dark"] .list-group-item:hover { background: #273449; }
body[data-theme="dark"] .modal-content { background: var(--card-bg); color: var(--text); }
body[data-theme="dark"] .modal-header, body[data-theme="dark"] .modal-footer { border-color: var(--border); }
body[data-theme="dark"] .dropdown-menu { background: var(--card-bg); color: var(--text); }
body[data-theme="dark"] .dropdown-item { color: var(--text); }
body[data-theme="dark"] .dropdown-item:hover { background: #273449; color: var(--text); }
body[data-theme="dark"] .nav-tabs .nav-link { color: var(--text-muted); }
body[data-theme="dark"] .nav-tabs .nav-link.active { background: var(--card-bg); color: var(--text); }
body[data-theme="dark"] .pagination a { background: var(--card-bg); color: var(--text); border-color: var(--border-strong); }
body[data-theme="dark"] .pagination .active a { background: var(--primary); color: #fff; }
body[data-theme="dark"] .card details { background: #0f172a; border-color: var(--border-strong); }
body[data-theme="dark"] .accordion-item, body[data-theme="dark"] .accordion-button { background: var(--card-bg); color: var(--text); }
body[data-theme="dark"] .accordion-button:not(.collapsed) { background: #273449; color: var(--text); }
body[data-theme="dark"] .form-section, body[data-theme="dark"] .search-section { background: var(--card-bg); }
body[data-theme="dark"] .time-picker-sm { background: #0f172a; border-color: var(--border-strong); }
body[data-theme="dark"] .time-field-sm { color: var(--text); }
body[data-theme="dark"] .ampm-btn-sm { background: #0f172a; color: var(--text-muted); border-color: var(--border); }
body[data-theme="dark"] .auth-wrapper { background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%); }
body[data-theme="dark"] .auth-card { background: #1e293b; }
body[data-theme="dark"] ::-webkit-scrollbar-track { background: #1e293b; }
body[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }
body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #64748b; }
body[data-theme="dark"] { scrollbar-color: #475569 #1e293b; }

/* ---- Dark mode: dashboard + summary cards + text utilities ---- */
body[data-theme="dark"] .glass-card, body[data-theme="dark"] .glass-stat,
body[data-theme="dark"] .stat-card, body[data-theme="dark"] .dash-card {
    background: var(--card-bg); color: var(--text); }
body[data-theme="dark"] .stat-num, body[data-theme="dark"] .stat-value { color: var(--text); }
body[data-theme="dark"] .stat-label, body[data-theme="dark"] .glass-stat .stat-label { color: var(--text-muted); }
body[data-theme="dark"] .glass-stat .stat-num { color: var(--text); }
/* lighter text utilities for readability on dark surfaces */
body[data-theme="dark"] .text-primary { color: #60a5fa !important; }
body[data-theme="dark"] .text-secondary { color: #94a3b8 !important; }
body[data-theme="dark"] .text-success { color: #34d399 !important; }
body[data-theme="dark"] .text-warning { color: #fbbf24 !important; }
body[data-theme="dark"] .text-danger { color: #f87171 !important; }
body[data-theme="dark"] .text-info { color: #38bdf8 !important; }
/* headings / labels on dashboard cards */
body[data-theme="dark"] .glass-card h5, body[data-theme="dark"] .glass-card h6,
body[data-theme="dark"] .dash-card h3, body[data-theme="dark"] .card h6 { color: var(--text); }
body[data-theme="dark"] .activity-title { color: var(--text); }
body[data-theme="dark"] .activity-meta { color: var(--text-muted); }
/* alerts readable on dark */
body[data-theme="dark"] .alert-success { background: #0f2e22; color: #6ee7b7; }
body[data-theme="dark"] .alert-warning { background: #3a2f14; color: #fde68a; }
body[data-theme="dark"] .alert-danger, body[data-theme="dark"] .alert-error { background: #3b1518; color: #fca5a5; }
body[data-theme="dark"] .alert-info { background: #0c2a3d; color: #7dd3fc; }
body[data-theme="dark"] .alert a, body[data-theme="dark"] .alert .alert-link { color: inherit; }

/* ============================================================
   REPORTS - sharp 1px tables + clear section spacing
   ============================================================ */
.report-table { border: 1px solid var(--border); border-radius: 1px; overflow: hidden; }
.report-table table { margin: 0; }
.report-table thead th {
    background: #f1f5f9;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 0.85rem;
}
.report-table tbody td { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); }
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover td { background: #f8fafc; }

.report-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.report-section:first-child { border-top: none; }
.report-row { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; }
.report-row + .report-row { border-top: 1px dashed var(--border); }
.report-row .label { color: var(--text-secondary); }
.report-row .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.report-row.highlight { background: #eef2ff; border-top: 1px solid var(--border); }
.report-row.highlight .label, .report-row.highlight .value { color: var(--primary-dark); font-weight: 700; }

body[data-theme="dark"] .report-table thead th,
body[data-theme="dark"] .report-section { background: #273449; color: #cbd5e1; border-color: var(--border); }
body[data-theme="dark"] .report-table tbody tr:hover td { background: #273449; }
body[data-theme="dark"] .report-row.highlight { background: #1e3a5f; }
body[data-theme="dark"] .report-row.highlight .label,
body[data-theme="dark"] .report-row.highlight .value { color: var(--primary-light); }

