/* =====================================================================
   Dentex - Global stylesheet (navy / teal brand, RTL + LTR aware)
   ===================================================================== */
:root {
    --navy: #0F172A;
    --navy-2: #16233d;
    --navy-3: #1e2f4d;
    --teal: #14B8A6;
    --teal-2: #2dd4bf;
    --teal-deep: #0D9488;
    --ink: #0b1220;
    --text: #0F172A;
    --muted: #64748B;
    --line: #E2E8F0;
    --bg: #F8FAFC;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --primary: #14B8A6;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 12px rgba(15, 23, 42, .05);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, .12);
    --sidebar-w: 264px;
}

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

html { scroll-behavior: smooth; overflow-x: clip; }

body {
    font-family: 'Manrope', 'Cairo', 'Tajawal', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
body > main { flex: 1 0 auto; }
body > .site-footer { flex-shrink: 0; }

[dir="rtl"] body { font-family: 'Cairo', 'Tajawal', 'Manrope', system-ui, Arial, sans-serif; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer;
    padding: 13px 24px; border-radius: var(--radius-sm); border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: var(--navy); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(0, 194, 168, .35); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { box-shadow: 0 12px 28px rgba(11, 29, 54, .3); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--teal); color: var(--navy); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }

/* ---------- Public header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 29, 54, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: #fff; }
.brand .logo-mark { width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--teal), #0891b2); display: grid; place-items: center; color: var(--navy); }
.brand .logo-mark .icon { width: 22px; height: 22px; }
.brand img { height: 40px; width: auto; }
.brand b { color: var(--teal); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.main-nav a {
    color: #cdd8e8; font-weight: 600; font-size: 15px; padding: 9px 14px; border-radius: 8px;
    transition: color .15s, background .15s;
}
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.main-nav .nav-extra { display: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
    display: inline-flex; align-items: center; gap: 6px; color: #cdd8e8; font-weight: 700;
    font-size: 14px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
    transition: color .15s, border-color .15s;
}
.lang-toggle:hover { color: #fff; border-color: var(--teal); }
.nav-toggle { display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 4px; }
.nav-toggle .icon { width: 28px; height: 28px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(circle at 75% 15%, var(--navy-2), var(--navy) 60%); }
[dir="rtl"] .hero { background: radial-gradient(circle at 25% 15%, var(--navy-2), var(--navy) 60%); }
.hero .container { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr;
    gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero h1 { font-size: clamp(30px, 4vw, 50px); line-height: 1.18; font-weight: 800; letter-spacing: -.5px; }
.hero p.lead { margin-top: 18px; font-size: 19px; color: #c3d0e2; max-width: 560px; }
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badges { margin-top: 34px; display: flex; gap: 26px; flex-wrap: wrap; }
.hero-badges .b { display: flex; align-items: center; gap: 8px; color: #aebfd6; font-size: 14px; font-weight: 600; }
.hero-badges .b .icon { color: var(--teal); }
.hero-visual { position: relative; }
.hero-media { width: 100%; border-radius: 20px; box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,.1); }
.hero-art {
    position: relative; aspect-ratio: 4 / 3.4; border-radius: 22px;
    background: linear-gradient(160deg, rgba(0,194,168,.14), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.12); overflow: hidden;
    display: grid; place-items: center;
}
.hero-art .pulse-tooth { width: 130px; height: 130px; color: var(--teal);
    filter: drop-shadow(0 0 26px rgba(20,184,166,.5)); animation: floaty 4s ease-in-out infinite; }
.hero-art .hero-logo { position: relative; z-index: 2; max-width: 62%; max-height: 210px; width: auto;
    object-fit: contain; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35)); animation: floaty 5s ease-in-out infinite; }
.hero-art .hero-wordmark { position: relative; z-index: 2; font-size: clamp(38px, 6vw, 60px); font-weight: 800;
    letter-spacing: -1px; color: #fff; text-shadow: 0 8px 30px rgba(0,0,0,.35); animation: floaty 5s ease-in-out infinite; }
.hero-art .hero-wordmark b { color: var(--teal-2); }
.hero-art .ring { position: absolute; border: 2px solid rgba(20,184,166,.22); border-radius: 50%; }
.hero-art .ring.r1 { width: 220px; height: 220px; animation: spin 16s linear infinite; }
.hero-art .ring.r2 { width: 320px; height: 320px; animation: spin 26s linear infinite reverse; }
.hero-art .dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--teal);
    box-shadow: 0 0 16px var(--teal); }
.hero-art .dot.d1 { top: 18%; inset-inline-start: 24%; animation: floaty 5s ease-in-out infinite; }
.hero-art .dot.d2 { bottom: 20%; inset-inline-end: 22%; animation: floaty 6s ease-in-out infinite .5s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section.alt { background: var(--white); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section-head .eyebrow { color: var(--teal); font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    font-size: 13px; }
.section-head h2 { font-size: clamp(26px, 3vw, 38px); color: var(--navy); margin-top: 10px; font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 17px; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.feature-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card .ic {
    width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
    background: rgba(0,194,168,.12); color: var(--teal); margin-bottom: 18px;
}
.feature-card .ic .icon { width: 26px; height: 26px; }
.feature-card h3 { color: var(--navy); font-size: 19px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 15px; }

/* Steps */
.step-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; position: relative; box-shadow: var(--shadow); }
.step-card .num { position: absolute; inset-block-start: -16px; inset-inline-start: 28px;
    width: 40px; height: 40px; border-radius: 11px; background: var(--navy); color: var(--teal);
    display: grid; place-items: center; font-weight: 800; }
.step-card .ic { color: var(--teal); margin: 8px 0 14px; }
.step-card .ic .icon { width: 30px; height: 30px; }
.step-card h3 { color: var(--navy); font-size: 18px; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 15px; }

/* Stats */
.stats { background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; }
.stat { text-align: center; padding: 12px; }
.stat .n { font-size: 44px; font-weight: 800; color: var(--teal); }
.stat .l { color: #c3d0e2; margin-top: 6px; font-weight: 600; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--teal), #0891b2); color: var(--navy);
    border-radius: 22px; padding: 52px; text-align: center; box-shadow: var(--shadow-lg); }
.cta-band h2 { font-size: 32px; font-weight: 800; }
.cta-band p { margin: 12px auto 26px; max-width: 540px; font-size: 17px; color: #06343a; }

/* Pricing */
.price-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 36px; text-align: center; box-shadow: var(--shadow); }
.price-card .amount { font-size: 48px; font-weight: 800; color: var(--navy); }
.price-card .amount span { font-size: 18px; color: var(--muted); font-weight: 600; }
.price-card h3 { color: var(--teal); font-weight: 800; margin-bottom: 14px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.info-item .ic { width: 46px; height: 46px; border-radius: 12px; background: rgba(0,194,168,.12);
    color: var(--teal); display: grid; place-items: center; flex: none; }
.info-item b { color: var(--navy); display: block; }
.info-item span { color: var(--muted); font-size: 15px; }

/* ---------- Forms ---------- */
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 30px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 7px; }
.field .req { color: var(--danger); }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.input, .select, .textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; color: var(--text); background: #fbfdff; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,194,168,.15); background: #fff;
}
.textarea { min-height: 120px; resize: vertical; }
.field.error .input, .field.error .select, .field.error .textarea { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Alerts / flash ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; margin-bottom: 18px; border: 1px solid transparent; }
.alert .icon { flex: none; margin-top: 1px; }
.alert-success { background: #e7f8f1; color: #0a7355; border-color: #bfead9; }
.alert-error { background: #fdecec; color: #b42626; border-color: #f6cccc; }
.alert-info { background: #e8f1fe; color: #1c4f9c; border-color: #c8ddf9; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
    font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.badge-success { background: #def7ec; color: #0a7355; }
.badge-warning { background: #fdf3e0; color: #9a6207; }
.badge-danger { background: #fde4e4; color: #b42626; }
.badge-info { background: #e3effd; color: #1c4f9c; }
.badge-primary { background: #d8f7f1; color: #06806e; }
.badge-muted { background: #eef2f7; color: #5a6b80; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 40px 20px;
    background: radial-gradient(circle at 50% 0%, #eef4fb, var(--bg)); }
.auth-box { width: 100%; max-width: 440px; }
.auth-box .auth-head { text-align: center; margin-bottom: 24px; }
.auth-box .auth-head h1 { color: var(--navy); font-size: 26px; }
.auth-box .auth-head p { color: var(--muted); margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 15px; }
.auth-foot a { color: var(--teal); font-weight: 700; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.role-pick label { cursor: pointer; }
.role-pick input { position: absolute; opacity: 0; }
.role-pick .opt { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 16px;
    text-align: center; transition: all .15s; }
.role-pick .opt .icon { width: 26px; height: 26px; color: var(--muted); margin-bottom: 6px; }
.role-pick input:checked + .opt { border-color: var(--teal); background: rgba(0,194,168,.07); }
.role-pick input:checked + .opt .icon { color: var(--teal); }

/* ---------- Dashboard layout ---------- */
.dash { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--navy); color: #cdd8e8; flex: none;
    position: fixed; inset-block: 0; inset-inline-start: 0; display: flex; flex-direction: column;
    z-index: 60; transition: transform .25s ease; }
.sidebar .s-brand { display: flex; align-items: center; gap: 10px; padding: 20px 22px; font-weight: 800;
    font-size: 20px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .s-brand .logo-mark { width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--teal), #0891b2); display: grid; place-items: center; color: var(--navy); }
.sidebar .s-brand b { color: var(--teal); }
.sidebar .s-brand img { height: 38px; width: auto; max-width: 100%; }
.sidebar nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.sidebar nav .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: #6781a3; padding: 14px 12px 6px; font-weight: 700; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
    font-weight: 600; font-size: 15px; color: #b9c8de; margin-bottom: 2px; transition: background .15s, color .15s; }
.sidebar nav a .icon { width: 20px; height: 20px; flex: none; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--teal); color: var(--navy); }
.sidebar .s-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .badge-count { margin-inline-start: auto; background: var(--teal); color: var(--navy);
    border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 800; }

.dash-main { flex: 1; margin-inline-start: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 66px; background: var(--white); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px; padding: 0 26px; position: sticky; top: 0; z-index: 40; }
.topbar h1 { font-size: 19px; color: var(--navy); font-weight: 800;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { margin-inline-start: auto; }
.topbar .t-user > div { min-width: 0; }
.topbar .t-user b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.topbar .t-actions { display: flex; align-items: center; gap: 12px; }
.topbar .t-user { display: flex; align-items: center; gap: 10px; }
.topbar .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--teal);
    display: grid; place-items: center; font-weight: 800; }
.topbar .t-user small { color: var(--muted); display: block; font-size: 12px; }
.topbar .t-user b { color: var(--navy); font-size: 14px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
    background: #fff; display: grid; place-items: center; color: var(--navy); cursor: pointer; }
.icon-btn:hover { border-color: var(--teal); }
.icon-btn .dot { position: absolute; top: 7px; inset-inline-end: 7px; width: 9px; height: 9px;
    border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.menu-btn { display: none; }
.dash-body { padding: 26px; flex: 1; min-width: 0; }
body.no-scroll { overflow: hidden; }

/* Stat cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.kpi .ic { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi .ic.teal { background: rgba(0,194,168,.13); color: var(--teal); }
.kpi .ic.blue { background: rgba(59,130,246,.13); color: var(--info); }
.kpi .ic.amber { background: rgba(245,158,11,.14); color: var(--warning); }
.kpi .ic.green { background: rgba(16,185,129,.14); color: var(--success); }
.kpi .ic.red { background: rgba(239,68,68,.12); color: var(--danger); }
.kpi .n { font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 14px; font-weight: 600; }

/* Panel / cards */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; color: var(--navy); font-weight: 800; }
.panel-head .spacer { margin-inline-start: auto; }
.panel-body { padding: 22px; }
.panel-body.flush { padding: 0; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--line); }
table.data th { background: #f7fafd; color: var(--muted); font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
table.data tbody tr:hover { background: #f9fcff; }
table.data td .id-pill { font-weight: 800; color: var(--navy); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { width: 54px; height: 54px; color: var(--line); margin: 0 auto 14px; }

/* Toolbar / filters */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar form { display: flex; gap: 12px; flex-wrap: wrap; width: 100%; }

/* Case detail */
.case-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; align-items: start; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.detail-list .di b { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .3px; }
.detail-list .di span { color: var(--navy); font-weight: 600; }

/* Lab services (price-list cards) */
.svc-list { display: grid; gap: 14px; }
.svc-card { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 14px; background: #fff; align-items: flex-start; }
.svc-media { flex: 0 0 88px; width: 88px; height: 88px; border-radius: var(--radius-sm); overflow: hidden;
    background: var(--bg); display: grid; place-items: center; border: 1px solid var(--line); }
.svc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-media-empty { color: var(--muted); display: grid; place-items: center; }
.svc-media-empty svg { width: 32px; height: 32px; }
.svc-info { flex: 1 1 auto; min-width: 0; display: grid; gap: 7px; }
.svc-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.svc-top b { color: var(--navy); font-size: 15px; }
.svc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-price { color: var(--teal); font-weight: 800; font-size: 15px; }
.svc-desc { margin: 0; font-size: 13px; line-height: 1.5; }
.svc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.svc-edit { width: 100%; }
.svc-edit > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.svc-edit > summary::-webkit-details-marker { display: none; }
.svc-edit[open] > summary { margin-bottom: 12px; }
.svc-edit-form { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.auth-remember { margin: 4px 0 16px; }
.auth-terms { margin: 4px 0 16px; align-items: flex-start; }
.auth-terms a { color: var(--teal); font-weight: 700; }

/* Lab cases grouped by doctor */
.toolbar-toggle { display: inline-flex; gap: 8px; margin-inline-start: auto; }
.doctor-groups { display: grid; gap: 16px; }
.doctor-group { overflow: hidden; }
.doctor-group-head { cursor: pointer; list-style: none; user-select: none; }
.doctor-group-head::-webkit-details-marker { display: none; }
.doctor-group-head h2 { margin: 0; }
.doctor-group-head .badge { margin-inline-start: 4px; }
.doctor-group-head > svg:last-child { margin-inline-start: auto; transition: transform .2s; }
.doctor-group[open] > .doctor-group-head > svg:last-child { transform: rotate(180deg); }

/* Doctor catalog (browse a lab's products) */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff;
    display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.product-card:hover { border-color: var(--teal); box-shadow: 0 8px 24px rgba(11,29,54,.08); }
.product-media { aspect-ratio: 4 / 3; background: var(--bg); display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: 14px; display: grid; gap: 8px; flex: 1 1 auto; }
.product-name { color: var(--navy); font-size: 15px; }
.product-desc { margin: 0; font-size: 13px; line-height: 1.5; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.product-days { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.product-days svg { width: 14px; height: 14px; }

/* Payment ledger / settlement */
.ledger-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ledger-summary > div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.ledger-summary .l { font-size: 12.5px; color: var(--muted); }
.ledger-summary b { font-size: 16px; font-weight: 700; }
.ledger-summary b.ok { color: var(--success, #0a7355); }
.ledger-summary b.due { color: #b42318; }
.settle-box { margin-top: 4px; }
.settle-box > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.settle-box > summary::-webkit-details-marker { display: none; }
.settle-form { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.settle-form .check { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* Timeline */
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 7px;
    width: 2px; background: var(--line); }
.timeline .tl { position: relative; padding-bottom: 20px; }
.timeline .tl::before { content: ""; position: absolute; inset-inline-start: -23px; top: 4px;
    width: 14px; height: 14px; border-radius: 50%; background: var(--teal); border: 3px solid #d8f7f1; }
.timeline .tl .st { font-weight: 700; color: var(--navy); }
.timeline .tl .nt { color: var(--muted); font-size: 14px; }
.timeline .tl .mt { color: #9aa7b8; font-size: 12.5px; margin-top: 2px; }

/* Chat / comments */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 14px; background: #f1f5fb; }
.bubble .who { font-size: 12.5px; font-weight: 800; color: var(--navy); margin-bottom: 3px; }
.bubble .tm { font-size: 11.5px; color: #9aa7b8; margin-top: 4px; }
.bubble.mine { background: rgba(0,194,168,.13); margin-inline-start: auto; }

/* Files */
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); margin-bottom: 10px; }
.file-row .fi { width: 40px; height: 40px; border-radius: 10px; background: rgba(0,194,168,.12);
    color: var(--teal); display: grid; place-items: center; flex: none; }
.file-row b { color: var(--navy); font-size: 14px; }
.file-row small { color: var(--muted); }
.file-row .dl { margin-inline-start: auto; }

/* Stars */
.stars { display: inline-flex; gap: 2px; color: var(--warning); }
.stars .icon { width: 18px; height: 18px; }
.stars.input .icon { cursor: pointer; }
.star-empty { color: var(--line); }

/* Misc */
.muted { color: var(--muted); }
.text-danger { color: var(--danger); font-weight: 600; }
.check-line { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-line input { width: 16px; height: 16px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pagehead { margin-bottom: 22px; }
.pagehead h1 { color: var(--navy); font-size: 24px; font-weight: 800; }
.pagehead p { color: var(--muted); }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Lab catalog (doctor browse) ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.lab-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; }
.lab-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lab-card-head b { color: var(--navy); font-size: 16px; }
.lab-ic { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
    background: rgba(0,194,168,.13); color: var(--teal); }
.lab-rate { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--warning); font-weight: 700; font-size: 14px; }
.lab-rate .icon { width: 16px; height: 16px; }
.lab-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.lab-meta .icon { width: 17px; height: 17px; flex: none; color: var(--teal); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #aebfd6; padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,.08); }
.site-footer .brand { margin-bottom: 14px; }
.site-footer p { font-size: 15px; max-width: 360px; }
.site-footer h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.site-footer .f-links a { display: block; padding: 6px 0; color: #aebfd6; transition: color .15s; }
.site-footer .f-links a:hover { color: var(--teal); }
.site-footer .f-contact div { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 15px; }
.site-footer .f-contact .icon { color: var(--teal); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding-top: 22px; flex-wrap: wrap; font-size: 14px; }
.aaa-link { color: var(--teal); font-weight: 800; text-shadow: 0 0 12px rgba(0,194,168,.55);
    transition: text-shadow .2s; }
.aaa-link:hover { text-shadow: 0 0 22px rgba(0,194,168,.95); }

/* ---------- Overlay for mobile sidebar ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11,29,54,.5); z-index: 55; display: none;
    opacity: 0; transition: opacity .25s ease; }
.overlay.show { display: block; opacity: 1; }

/* ---------- Responsive ---------- */
/* Tablet / small laptop */
@media (max-width: 1080px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
    .container { padding-inline: 22px; }
    .hero .container { grid-template-columns: 1fr; }
    .hero-visual { order: -1; max-width: 420px; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .case-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait & below: off-canvas dashboard sidebar */
@media (max-width: 860px) {
    .sidebar { width: min(var(--sidebar-w), 86vw); transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(11,29,54,.25); }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .dash-main { margin-inline-start: 0; width: 100%; max-width: 100%; }
    .menu-btn { display: grid; }
    .dash-body { padding: 20px; }
    .topbar { padding: 0 18px; gap: 10px; }
    .topbar h1 { font-size: 17px; flex: 1; }
    .topbar .spacer { display: none; }
    .topbar .t-actions { gap: 8px; flex: none; }
    .topbar .t-user > div { display: none; }
}

/* Phone */
@media (max-width: 760px) {
    .main-nav, .header-actions { display: none; }
    .nav-toggle { display: inline-flex; margin-inline-start: auto; }
    .main-nav.open { display: flex; position: absolute; top: 100%; inset-inline: 0;
        flex-direction: column; align-items: stretch; background: var(--navy); padding: 16px 22px 22px; gap: 2px;
        border-top: 1px solid rgba(255,255,255,.08);
        border-bottom: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow-lg); z-index: 50; }
    .main-nav.open a { width: 100%; color: #cdd8e8; padding: 12px 6px; border-radius: 8px; }
    .main-nav.open .nav-extra { display: flex; flex-direction: column; gap: 10px; width: 100%;
        margin-top: 12px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
    .main-nav.open .nav-extra .lang-toggle { justify-content: center; padding: 11px 12px; }
    .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { justify-content: center; text-align: center; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi { padding: 16px; gap: 12px; }
    .kpi .ic { width: 42px; height: 42px; }
    .kpi .n { font-size: 23px; }
    .detail-list { grid-template-columns: 1fr; }
    .cta-band { padding: 36px 22px; }
    .pagehead h1 { font-size: 21px; }
    .panel-head { padding: 16px; }
    .panel-body { padding: 16px; }
    .bubble { max-width: 88%; }
    .toolbar form { flex-direction: column; align-items: stretch; }
    .toolbar .grow { min-width: 0; }
    .site-footer { padding: 44px 0 22px; }
}

/* Small phone */
@media (max-width: 480px) {
    .container { padding-inline: 16px; }
    .dash-body { padding: 14px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; gap: 6px; }
    .topbar h1 { font-size: 16px; }
    .topbar .t-actions { gap: 6px; }
    .topbar .t-user { display: none; }
    .icon-btn { width: 36px; height: 36px; }
    .hero h1 { font-size: 30px; }
    .actions-row { flex-direction: column; }
    .actions-row .btn { width: 100%; justify-content: center; }
    .auth-box { padding: 26px 20px; }
}

/* =====================================================================
   Clinic & patient management — "coming soon" teaser
   ===================================================================== */
.clinic-hero { position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%); border: none; }
.clinic-hero .panel-body { padding: 48px 40px; text-align: center; color: #fff; }
.clinic-hero::after { content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 80% -20%, rgba(0,194,168,.35), transparent 55%); pointer-events: none; }
.clinic-hero .clinic-soon { display: inline-flex; align-items: center; gap: 7px;
    background: rgba(0,194,168,.18); color: var(--teal-2); border: 1px solid rgba(0,194,168,.35);
    padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; margin-bottom: 22px; }
.clinic-hero .clinic-soon .icon { width: 15px; height: 15px; }
.clinic-hero-ic { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.clinic-hero-ic .icon { width: 40px; height: 40px; color: var(--teal-2); }
.clinic-hero h2 { font-size: 28px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.4px; }
.clinic-hero p.muted { color: rgba(255,255,255,.72); max-width: 560px; margin: 0 auto; font-size: 15.5px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.feature-card { display: flex; gap: 16px; align-items: flex-start; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-ic { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,194,168,.10); color: var(--teal); }
.feature-ic .icon { width: 24px; height: 24px; }
.feature-card h3 { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 5px; }
.feature-card p.muted { font-size: 14px; line-height: 1.55; }

.clinic-cta { display: flex; align-items: center; gap: 14px; justify-content: center; text-align: center; }
.clinic-cta .icon { width: 26px; height: 26px; color: var(--teal); flex: 0 0 auto; }
.clinic-cta p { color: var(--muted); font-size: 15px; }

@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
    .feature-grid { grid-template-columns: 1fr; }
    .clinic-hero .panel-body { padding: 36px 22px; }
    .clinic-hero h2 { font-size: 23px; }
}

/* =====================================================================
   Live notifications: bell badge + toasts
   ===================================================================== */
.is-hidden { display: none !important; }

.notif-bell .notif-count {
    position: absolute; top: 3px; inset-inline-end: 3px; min-width: 17px; height: 17px;
    padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 800; line-height: 17px; text-align: center;
    box-shadow: 0 0 0 2px var(--white); animation: notifPop .28s ease;
}
@keyframes notifPop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

.toast-wrap {
    position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 1200;
    display: flex; flex-direction: column; gap: 12px; max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 12px; text-decoration: none;
    background: var(--white); border: 1px solid var(--line); border-inline-start: 4px solid var(--teal);
    border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-lg);
    transform: translateY(14px); opacity: 0; transition: transform .3s ease, opacity .3s ease;
    pointer-events: auto;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-ic { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.toast-body { min-width: 0; }
.toast-body b { display: block; color: var(--navy); font-size: 14.5px; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-body small { display: block; color: var(--muted); font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
    .toast-wrap { inset-inline: 12px; inset-block-end: 12px; max-width: none; }
}

/* Financial: prominent "you pay / you receive" total */
.fin-total {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(0,194,168,.10), rgba(0,194,168,.04));
    border: 1px solid rgba(0,194,168,.25);
}
.fin-total span { color: var(--muted); font-weight: 700; font-size: 14px; }
.fin-total b { color: var(--navy); font-weight: 800; font-size: 20px; }
p.hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* =====================================================================
   UI/UX polish — smoother interactions, sharper responsiveness
   ===================================================================== */
.btn { transition: background-color .16s ease, border-color .16s ease, color .16s ease,
    transform .12s ease, box-shadow .16s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary:hover, .btn-success:hover, .btn-dark:hover, .btn-danger:hover { box-shadow: var(--shadow); }
.panel { transition: box-shadow .2s ease; }
table.data tbody tr { transition: background-color .14s ease; }
.icon-btn { transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.icon-btn:hover { background: rgba(0,194,168,.08); color: var(--teal); }
a, .btn, .icon-btn, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,194,168,.15); }
.badge { transition: background-color .16s ease; }

/* Make wide data tables graceful on small screens. */
@media (max-width: 560px) {
    table.data th, table.data td { padding: 11px 12px; font-size: 13.5px; }
    .fin-total b { font-size: 18px; }
    .toast-body b { white-space: normal; }
}
