/* =====================================================================
   MyDentist Dental Clinic – Web-Based Dental Appointment System
   ===================================================================== */
:root {
  color-scheme: light;   /* the browser's own colours for buttons and fields follow the chosen mode, not the device */
  /* Colour palette "Calm and trustworthy": Sky mist #E3F1F7 · Ocean blue #2A759A · Deep navy #1E3A4C
     (variable names kept from the earlier teal theme so the rest of the stylesheet is unchanged) */
  --md-teal: #2a759a;        /* Ocean blue – buttons, links, highlights */
  --md-teal-600: #246686;
  --md-teal-700: #1f5672;
  --md-teal-50: #e3f1f7;     /* Sky mist */
  --md-teal-100: #c8e1ec;
  --md-bg: #eef6fa;          /* page background (lighter sky mist) */
  --md-ink: #1e3a4c;         /* Deep navy – text */
  --md-muted: #5f7383;
  --md-line: #d3e5ee;
  --md-card: #ffffff;
  --md-green-deep: #1e3a4c;  /* patient sidebar & footer: Deep navy */
  --md-green-deeper: #172e3d;
  --md-navy: #1e3a4c;        /* admin sidebar: Deep navy */
  --md-navy-deep: #132733;
  --md-radius: 14px;
  --md-shadow: 0 1px 2px rgba(30, 58, 76, .05), 0 6px 22px rgba(30, 58, 76, .07);

  --bs-primary: var(--md-teal);
  --bs-primary-rgb: 42, 117, 154;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--md-ink);
  --bs-body-bg: var(--md-bg);
  --bs-border-color: var(--md-line);
  --bs-link-color: var(--md-teal-600);
  --bs-link-hover-color: var(--md-teal-700);
}

h1, h2, h3, h4, h5, h6 { color: var(--md-ink); }
body { font-size: .94rem; -webkit-font-smoothing: antialiased; }
.min-w-0 { min-width: 0; }
a { text-decoration: none; }
.text-muted { color: var(--md-muted) !important; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--md-muted); }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--md-teal); --bs-btn-border-color: var(--md-teal); --bs-btn-hover-bg: var(--md-teal-600); --bs-btn-hover-border-color: var(--md-teal-600); --bs-btn-active-bg: var(--md-teal-700); --bs-btn-active-border-color: var(--md-teal-700); --bs-btn-disabled-bg: #8fb8cc; --bs-btn-disabled-border-color: #8fb8cc; }
.btn-outline-primary { --bs-btn-color: var(--md-teal-600); --bs-btn-border-color: var(--md-teal); --bs-btn-hover-bg: var(--md-teal); --bs-btn-hover-border-color: var(--md-teal); --bs-btn-active-bg: var(--md-teal-600); }
.btn-soft { background: var(--md-teal-50); color: var(--md-teal-700); border: 1px solid var(--md-teal-100); }
.btn-soft:hover { background: var(--md-teal-100); color: var(--md-teal-700); }
.btn-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff; border: 1px solid var(--md-line); color: var(--md-ink); padding: 0; }
.btn-icon:hover { background: var(--md-teal-50); }
.form-control, .form-select { border-radius: 10px; border-color: var(--md-line); background-color: #f7fbfd; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--md-teal); box-shadow: 0 0 0 .2rem rgba(42, 117, 154, .15); background-color: #fff; }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--md-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.3rem; }
.input-icon > .toggle-pass { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--md-muted); padding: .25rem .45rem; }
.alert { border-radius: 12px; }

/* ---------- Cards ---------- */
.card-md { background: var(--md-card); border: 1px solid var(--md-line); border-radius: var(--md-radius); box-shadow: var(--md-shadow); }
.card-md > .card-head { padding: 1rem 1.15rem .4rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-md > .card-head h2, .card-md > .card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.card-md > .card-body-md { padding: 1rem 1.15rem 1.15rem; }
.stat-card { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; height: 100%; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { color: var(--md-muted); font-size: .82rem; font-weight: 500; }
.tint-teal { background: var(--md-teal-50); color: var(--md-teal-700); }
.tint-amber { background: #fff4e0; color: #b45309; }
.tint-green { background: #e5f7ec; color: #15803d; }
.tint-violet { background: #f1ebff; color: #6d28d9; }
.tint-red { background: #fde8e8; color: #b91c1c; }
.tint-blue { background: #e7efff; color: #1d4ed8; }

/* ---------- Status badges ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.status-pending { background: #fff6e5; color: #b45309; border-color: #fde3b0; }
.status-confirmed { background: #e3f1f7; color: var(--md-teal-700); border-color: var(--md-teal-100); }
.status-completed { background: #e7f7ec; color: #15803d; border-color: #c4ebd1; }
.status-cancelled { background: #fdecec; color: #b91c1c; border-color: #f7cccc; }
.status-no_show { background: #f1f5f9; color: #475569; border-color: #dbe3ea; }
.tag-emergency { background: #b91c1c; color: #fff; font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }

/* ---------- Public site ---------- */
.site-nav { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--md-line); }
.site-nav .nav-link { font-weight: 600; color: var(--md-ink); font-size: .9rem; }
.site-nav .nav-link.active, .site-nav .nav-link:hover { color: var(--md-teal); }
.site-nav .navbar-toggler { border: 0; font-size: 1.6rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; color: var(--md-ink); }
.brand-text strong { color: var(--md-teal-600); font-size: 1rem; }
.brand-text small { font-size: .68rem; color: var(--md-muted); }
.hero { background: radial-gradient(1200px 500px at 85% 20%, #c8e1ec 0%, rgba(200, 225, 236, 0) 60%), linear-gradient(180deg, #e3f1f7 0%, #f1f8fb 100%); padding: 4.5rem 0 4rem; overflow: hidden; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.hero h1 span { color: var(--md-teal); }
.hero .lead { color: #4b6475; font-size: 1.05rem; max-width: 34rem; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px; background: #fff; border: 1px solid var(--md-line); font-size: .78rem; font-weight: 600; color: var(--md-teal-700); }
.pill .live { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.hero-card { background: #fff; border-radius: 18px; box-shadow: 0 18px 50px rgba(30, 58, 76, .16); padding: 1.2rem; max-width: 360px; margin-left: auto; }
.slot-row { display: flex; align-items: center; justify-content: space-between; padding: .55rem .75rem; border-radius: 10px; background: var(--md-teal-50); margin-bottom: .5rem; font-size: .85rem; font-weight: 600; }
.slot-row.taken { background: #f4f6f8; color: #9aa7b0; }
.hero-stats .num { font-size: 1.5rem; font-weight: 800; color: var(--md-teal-600); }
.hero-stats .lbl { font-size: .78rem; color: var(--md-muted); }
.section { padding: 4rem 0; }
.section-title { font-weight: 800; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.01em; }
.service-card { background: #fff; border: 1px solid var(--md-line); border-radius: var(--md-radius); padding: 1.15rem; height: 100%; transition: transform .15s, box-shadow .15s; }
.service-card:hover { transform: translateY(-2px); box-shadow: var(--md-shadow); }
.service-card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--md-teal-50); color: var(--md-teal-600); font-size: 1.3rem; margin-bottom: .7rem; }
.step-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--md-teal); color: #fff; font-weight: 800; }
.site-footer h6 { color: inherit; }
.site-footer { background: var(--md-green-deep); color: #e3f1f7; padding: 3rem 0 1.5rem; margin-top: 2rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4.5rem 16px 2rem; background: #e3f1f7; position: relative; }
.auth-back { position: absolute; top: 16px; left: 16px; border: 1px solid var(--md-line); background: #fff; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; padding: 2rem 1.75rem; box-shadow: 0 16px 50px rgba(30, 58, 76, .15); }
.auth-card h1 { font-size: 1.45rem; font-weight: 800; text-align: center; margin-bottom: .2rem; }
.auth-card .sub { text-align: center; color: var(--md-muted); font-size: .88rem; margin-bottom: 1.3rem; }
.brand-mini { color: var(--md-teal-600); font-weight: 700; font-size: .82rem; margin-top: .4rem; }
.auth-foot { color: var(--md-muted); font-size: .78rem; margin-top: 1rem; }

/* ---------- App shell (patient & admin) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex-shrink: 0; color: #e3f1f7; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 1040; transition: transform .25s ease; }
.sidebar-patient { background: linear-gradient(180deg, var(--md-green-deep), var(--md-green-deeper)); }
.sidebar-admin { background: linear-gradient(180deg, var(--md-navy), var(--md-navy-deep)); }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.15rem 1.1rem; color: #fff; }
.sidebar-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand small { font-size: .7rem; opacity: .7; }
.sidebar-user { display: flex; align-items: center; gap: .7rem; margin: 0 .8rem .6rem; padding: .7rem; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.sidebar-user .name { font-weight: 700; font-size: .88rem; color: #fff; }
.sidebar-user .role { font-size: .72rem; opacity: .75; display: flex; align-items: center; gap: .35rem; }
.sidebar-user .dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--md-teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar.light { background: var(--md-teal-50); color: var(--md-teal-700); }
.sidebar-nav { padding: .3rem .7rem; flex: 1; overflow-y: auto; }
.sidebar-nav a, .sidebar-foot a { display: flex; align-items: center; gap: .7rem; padding: .58rem .75rem; border-radius: 10px; color: rgba(255, 255, 255, .78); font-size: .87rem; font-weight: 500; margin-bottom: 2px; }
.sidebar-nav a:hover, .sidebar-foot a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a.active { background: var(--md-teal); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(42, 117, 154, .35); }
.sidebar-admin .sidebar-nav a.active { background: rgba(255, 255, 255, .16); box-shadow: none; }
.sidebar-nav a .badge { background: #f59e0b; font-size: .68rem; }
.sidebar-nav .nav-section { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; opacity: .5; padding: .9rem .75rem .35rem; font-weight: 700; }
.sidebar-foot { padding: .7rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.app-main { flex: 1; margin-left: 252px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.5rem; background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--md-line); position: sticky; top: 0; z-index: 1020; }
.page-title { font-size: 1.15rem; font-weight: 800; margin: 0; }
.page-sub { font-size: .78rem; color: var(--md-muted); }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .65rem .25rem .3rem; border-radius: 999px; background: var(--md-teal-50); font-weight: 600; font-size: .85rem; }
.app-content { padding: 1.4rem 1.5rem 2.5rem; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(19, 39, 51, .45); z-index: 1035; }
  .app-main { margin-left: 0; }
  .topbar { padding: .75rem 1rem; }
  .app-content { padding: 1rem 1rem 2rem; }
}

/* ---------- Dashboard pieces ---------- */
.welcome-banner { background: linear-gradient(110deg, var(--md-teal-700), var(--md-teal) 70%, #3a8db5); color: #fff; border-radius: var(--md-radius); padding: 1.4rem 1.5rem; position: relative; overflow: hidden; }
.welcome-banner::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.welcome-banner h2 { color: #fff; font-weight: 800; font-size: 1.35rem; margin: 0 0 .2rem; }
.info-tile { background: var(--md-teal-50); border-radius: 12px; padding: .7rem .85rem; display: flex; gap: .6rem; align-items: center; height: 100%; }
.info-tile i { color: var(--md-teal-600); font-size: 1.1rem; }
.info-tile .k { font-size: .7rem; color: var(--md-muted); }
.info-tile .v { font-weight: 700; font-size: .9rem; }
.quick-action { display: block; background: #fff; border: 1px solid var(--md-line); border-radius: var(--md-radius); padding: 1rem; color: var(--md-ink); height: 100%; transition: border-color .15s, transform .15s; }
.quick-action:hover { border-color: var(--md-teal); transform: translateY(-2px); color: var(--md-ink); }
.quick-action .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: .6rem; font-size: 1.1rem; }
.quick-action .t { font-weight: 700; font-size: .9rem; }
.quick-action .d { font-size: .78rem; color: var(--md-muted); }
.appt-item { display: flex; gap: .85rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--md-line); }
.appt-item:last-child { border-bottom: 0; }
.date-box { width: 52px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--md-teal-50); padding: .35rem 0; }
.date-box .m { font-size: .66rem; font-weight: 700; text-transform: uppercase; color: var(--md-teal-700); }
.date-box .d { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--md-muted); }
.empty-state i { font-size: 2.2rem; color: #a6c6d6; display: block; margin-bottom: .5rem; }
.chart-box { position: relative; height: 230px; }
.chart-box.sm { height: 190px; }
.ring-wrap { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.ring-wrap .ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.ring-wrap .ring-label small { display: block; font-size: .62rem; font-weight: 600; color: var(--md-muted); }

/* ---------- Tables ---------- */
.table-md { margin: 0; font-size: .87rem; }
.table-md thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--md-muted); font-weight: 700; background: #f3f8fb; border-bottom-color: var(--md-line); white-space: nowrap; padding: .7rem .8rem; }
.table-md td { padding: .7rem .8rem; vertical-align: middle; border-color: #e8f1f6; }
.table-md tbody tr:hover { background: #f7fbfd; }
.person { display: flex; align-items: center; gap: .6rem; }
.person .n { font-weight: 600; }
.person .s { font-size: .76rem; color: var(--md-muted); }
.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-tabs a { padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--md-line); color: var(--md-ink); font-weight: 600; font-size: .8rem; }
.filter-tabs a.active { background: var(--md-teal); border-color: var(--md-teal); color: #fff; }
.filter-tabs a .count { opacity: .7; margin-left: .25rem; }

/* ---------- Booking wizard ---------- */
.stepper { display: flex; align-items: flex-start; justify-content: center; gap: 0; margin: .3rem auto 1.6rem; max-width: 560px; }
.stepper .st { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; position: relative; font-size: .75rem; color: var(--md-muted); font-weight: 600; }
.stepper .st .c { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--md-line); font-weight: 800; z-index: 1; }
.stepper .st:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: 50%; width: 100%; height: 2px; background: var(--md-line); }
.stepper .st.done .c, .stepper .st.current .c { background: var(--md-teal); border-color: var(--md-teal); color: #fff; }
.stepper .st.done:not(:last-child)::after { background: var(--md-teal); }
.stepper .st.current { color: var(--md-teal-700); }
.choice { position: relative; display: block; cursor: pointer; height: 100%; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box { background: #fff; border: 1.5px solid var(--md-line); border-radius: var(--md-radius); padding: 1rem; height: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
.choice:hover .box { border-color: #9cc6da; }
.choice input:checked + .box { border-color: var(--md-teal); box-shadow: 0 0 0 3px rgba(42, 117, 154, .15); background: #f2f8fb; }
.choice input:focus-visible + .box { outline: 2px solid var(--md-teal); outline-offset: 2px; }
/* Services: several can be ticked – a round tick in the corner shows each choice */
.choice-multi .box { position: relative; }
.choice-multi .box::after { content: ""; position: absolute; top: .7rem; right: .7rem; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--md-line); background: #fff; }
.choice-multi input:checked + .box::after { content: "✓"; background: var(--md-teal); border-color: var(--md-teal); color: #fff; font-size: .8rem; font-weight: 800; line-height: 19px; text-align: center; }
.svc-total { margin: .25rem 0 .75rem; padding: .6rem .85rem; border-radius: 10px; background: #f2f8fb; border: 1px solid #c3dfeb; color: var(--md-teal-700); font-size: .86rem; }
.svc-checks-cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--md-teal-700); margin: .55rem 0 .3rem; }
.svc-checks-cat:first-child { margin-top: .1rem; }
.svc-checks { max-height: 320px; overflow-y: auto; border: 1px solid var(--md-line); border-radius: 10px; padding: .5rem .75rem; background: #f7fbfd; }
.svc-checks .form-check { margin-bottom: .3rem; }
.svc-checks .form-check-label { width: 100%; }
.svc-total span { color: var(--md-muted); }
.choice .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--md-teal-50); color: var(--md-teal-600); font-size: 1.15rem; margin-bottom: .55rem; }
.choice .t { font-weight: 700; font-size: .92rem; }
.choice .meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--md-muted); margin-top: .35rem; }
.choice .meta .price { color: var(--md-teal-700); font-weight: 700; }
/* services grouped by price-list section (booking wizard, price list) */
.svc-search { position: relative; margin-bottom: .75rem; }
.svc-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--md-muted); }
.svc-search .form-control { padding-left: 2.4rem; border-radius: 999px; }
.svc-cat { border: 1px solid var(--md-line); border-radius: var(--md-radius); background: #fff; margin-bottom: .5rem; padding: 0 .85rem; }
.svc-cat[open] { background: #f7fbfd; padding-bottom: .6rem; }
.svc-cat summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .7rem 0; cursor: pointer; font-weight: 700; font-size: .92rem; color: var(--md-navy, #1E3A4C); }
.svc-cat summary::-webkit-details-marker { display: none; }
.svc-cat summary > .bi:first-child { color: var(--md-teal-600); font-size: 1.05rem; }
.svc-cat summary .n { flex: 1; }
.svc-cat summary .c { font-size: .72rem; font-weight: 700; color: var(--md-muted); background: var(--md-teal-50); border-radius: 999px; padding: .1rem .55rem; }
.svc-cat summary .picked { font-size: .72rem; font-weight: 700; color: #fff; background: var(--md-teal); border-radius: 999px; padding: .1rem .55rem; }
.svc-cat summary .chev { color: var(--md-muted); transition: transform .15s; }
.svc-cat[open] summary .chev { transform: rotate(180deg); }
.svc-cat summary:focus-visible { outline: 2px solid var(--md-teal); outline-offset: 2px; border-radius: 6px; }
.choice-row .box { padding: .7rem 2.4rem .7rem .85rem; }
.choice-row .t { font-size: .88rem; }
/* Appointment Records: requests waiting for approval are marked at the left edge */
.table-md tr.row-pending > td:first-child { box-shadow: inset 3px 0 0 #f0ad4e; }
/* Services & Rates: each category is a dropdown */
.price-cat { overflow: hidden; scroll-margin-top: 90px; }
.price-cat > summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: 1rem 1.15rem; cursor: pointer; }
.price-cat > summary::-webkit-details-marker { display: none; }
.price-cat > summary > .bi:first-child { font-size: 1.1rem; }
.price-cat > summary h2 { flex: 1; font-size: 1rem; font-weight: 700; margin: 0; }
.price-cat > summary .c { font-size: .72rem; font-weight: 700; color: var(--md-muted); background: var(--md-teal-50); border-radius: 999px; padding: .15rem .6rem; white-space: nowrap; }
.price-cat > summary .chev { color: var(--md-muted); transition: transform .15s; }
.price-cat[open] > summary { border-bottom: 1px solid var(--md-line); }
.price-cat[open] > summary .chev { transform: rotate(180deg); }
.price-cat > summary:hover h2 { color: var(--md-teal-700); }
.price-cat > summary:focus-visible { outline: 2px solid var(--md-teal); outline-offset: -2px; border-radius: var(--md-radius); }
@media (prefers-reduced-motion: reduce) { .price-cat > summary .chev { transition: none; } }
.price-table td, .price-table th { font-size: .88rem; vertical-align: middle; }
.price-table td.rate { white-space: nowrap; text-align: right; font-weight: 700; color: var(--md-teal-700); }
.price-table .addon td:first-child { padding-left: 1.6rem; color: var(--md-muted); }
.cat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--md-muted); margin: .4rem 0 .6rem; }
.day-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory; }
.day-chip { scroll-snap-align: start; flex: 0 0 auto; width: 74px; text-align: center; border: 1.5px solid var(--md-line); border-radius: 12px; padding: .45rem .2rem; background: #fff; cursor: pointer; }
.day-chip .w { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--md-muted); }
.day-chip .d { font-size: 1.25rem; font-weight: 800; line-height: 1.15; }
.day-chip .n { font-size: .66rem; color: var(--md-teal-700); font-weight: 600; }
.day-chip.full { opacity: .45; cursor: not-allowed; }
.day-chip.full .n { color: var(--md-muted); }
.day-chip.selected { border-color: var(--md-teal); background: var(--md-teal); color: #fff; }
.day-chip.selected .w, .day-chip.selected .n { color: rgba(255, 255, 255, .85); }
/* Month calendar for picking a date */
.cal { max-width: 460px; margin-bottom: 1rem; border: 1px solid var(--md-line); border-radius: 14px; padding: .75rem; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal-title { font-weight: 800; font-size: 1.05rem; }
.cal-nav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--md-line); background: #fff; font-size: 1.3rem; line-height: 1; color: var(--md-teal-700); }
.cal-nav:hover:not(:disabled) { border-color: var(--md-teal); background: #f2f8fb; }
.cal-nav:disabled { opacity: .35; cursor: not-allowed; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.cal-dow { text-align: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--md-muted); padding: .2rem 0; }
.cal-day { position: relative; aspect-ratio: 1 / 1; border: 1.5px solid transparent; border-radius: 10px; background: transparent; font-weight: 700; font-size: .92rem; color: #b8c4c8; cursor: not-allowed; }
.cal-day .dot { position: absolute; left: 50%; bottom: 14%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--md-teal); }
.cal-day.open { color: var(--md-ink, #1e3a4c); background: #f2f8fb; border-color: #cde3ee; cursor: pointer; }
.cal-day.open:hover { border-color: var(--md-teal); }
.cal-day.full, .cal-day.closed { background: #f3f5f6; }
.cal-day.today .num { text-decoration: underline; text-underline-offset: 3px; }
.cal-day.selected { background: var(--md-teal); border-color: var(--md-teal); color: #fff; }
.cal-day.selected .dot { background: #fff; }
.cal-legend { display: flex; gap: 1rem; margin-top: .6rem; font-size: .72rem; color: var(--md-muted); }
.cal-legend i { display: inline-block; vertical-align: middle; margin-right: .25rem; }
.cal-legend .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--md-teal); }
.cal-legend .sq { width: 10px; height: 10px; border-radius: 3px; background: #f3f5f6; border: 1px solid var(--md-line); }
.times-head { grid-column: 1 / -1; font-weight: 700; font-size: .9rem; margin-bottom: .1rem; }
.cal-prompt { grid-column: 1 / -1; color: var(--md-muted); font-size: .88rem; padding: .5rem 0; }
.time-grid > .empty-state { grid-column: 1 / -1; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.time-btn { color: var(--md-ink); border: 1.5px solid var(--md-line); background: #fff; border-radius: 10px; padding: .5rem; font-weight: 600; font-size: .85rem; cursor: pointer; }
.time-btn:hover { border-color: var(--md-teal); }
.time-btn.selected { background: var(--md-teal); border-color: var(--md-teal); color: #fff; }
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--md-line); font-size: .9rem; }
.summary-list li span:first-child { color: var(--md-muted); }
.summary-list li span:last-child { font-weight: 600; text-align: right; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 1.4rem; gap: .5rem; }

/* ---------- Schedule grid (admin) ---------- */
.sched-grid { width: 100%; border-collapse: separate; border-spacing: 5px; min-width: 760px; }
.sched-grid th { font-size: .74rem; text-align: center; font-weight: 700; color: var(--md-muted); padding: .3rem; }
.sched-grid th .dd { display: block; font-size: .95rem; color: var(--md-ink); }
.sched-grid th.today .dd { background: var(--md-teal); color: #fff; border-radius: 8px; padding: 0 .4rem; display: inline-block; }
.sched-grid td.time { font-size: .74rem; color: var(--md-muted); white-space: nowrap; width: 70px; font-weight: 600; }
.cell { display: flex; align-items: center; justify-content: center; gap: .25rem; width: 100%; border-radius: 8px; font-size: .74rem; font-weight: 600; padding: .4rem .3rem; border: 1px solid transparent; min-height: 34px; line-height: 1.15; text-align: center; }
.cell.open { background: #eaf4f9; color: var(--md-teal-700); border-color: #cbe2ee; cursor: pointer; }
.cell.open:hover { background: var(--md-teal-100); }
.cell.booked { background: #e9eefb; color: #1e40af; border-color: #cfdcff; }
.cell.booked.pending { background: #fff6e5; color: #b45309; border-color: #fde3b0; }
.cell.booked.emergency { background: #fde8e8; color: #b91c1c; border-color: #f7cccc; }
.cell.blocked { background: #fdecec; color: #b91c1c; border-color: #f7cccc; cursor: pointer; }
.cell.closed { background: #f2f5f7; color: #a0adb6; }
.cell.past { opacity: .55; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .75rem; color: var(--md-muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.legend .l-open::before { background: #cbe2ee; } .legend .l-booked::before { background: #cfdcff; } .legend .l-pending::before { background: #fde3b0; } .legend .l-blocked::before { background: #f7cccc; }

/* ---------- QR ---------- */
.qr-box { display: inline-block; padding: .6rem; background: #fff; border: 1px solid var(--md-line); border-radius: 14px; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; display: block; }
.code-ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .05em; }
#qr-reader { width: 100%; max-width: 420px; border-radius: 14px; overflow: hidden; border: 1px solid var(--md-line) !important; }

/* ---------- Print (reports) ---------- */
@media print {
  .sidebar, .topbar, .no-print, .sidebar-backdrop { display: none !important; }
  .app-main { margin: 0; }
  .app-content { padding: 0; }
  .card-md { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.appt-item.flex-wrap > .flex-grow-1 { flex-basis: 0; }

/* Language switcher */
.lang-switch .dropdown-menu { min-width: 10rem; font-size: .88rem; }
.lang-switch .dropdown-item.active { background: var(--md-teal); }
.auth-lang { position: absolute; top: 16px; right: 16px; }

/* Password requirements checklist */
.pw-rules { list-style: none; padding: 0; margin: .35rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .6rem; font-size: .72rem; line-height: 1.35; color: var(--md-muted); }
/* Checklist: ○ not checked yet · ✓ requirement met · ✗ still missing */
.pw-rules li { display: flex; align-items: flex-start; gap: .35rem; transition: color .15s; }
.pw-rules li::before { content: "○"; flex: 0 0 1rem; width: 1rem; height: 1rem; line-height: 1rem; text-align: center; border-radius: 50%; font-size: .7rem; font-weight: 800; }
.pw-rules li.ok { color: #15803d; }
.pw-rules li.ok::before { content: "✓"; background: #16a34a; color: #fff; }
.pw-rules li.bad { color: #b91c1c; }
.pw-rules li.bad::before { content: "✗"; background: #dc2626; color: #fff; }
@media (max-width: 420px) { .pw-rules { grid-template-columns: 1fr; } }

/* Profile pictures */
img.avatar-img { object-fit: cover; padding: 0; background: var(--md-teal-50); }
.avatar-preview { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--md-shadow); }
.avatar-lg { width: 112px; height: 112px; font-size: 2.2rem; border: 3px solid #fff; box-shadow: var(--md-shadow); }

/* Correct fields: green only, no check-mark icon */
.was-validated .form-control:valid, .form-control.is-valid,
.was-validated .form-select:valid, .form-select.is-valid {
  background-image: none !important;
  padding-right: .8rem;
  border-color: #16a34a;
}
.was-validated .form-control:valid:focus, .form-control.is-valid:focus { box-shadow: 0 0 0 .2rem rgba(22, 163, 74, .15); }
/* Wrong fields (e.g. password without a special character, or not matching): plain red, no icon */
.was-validated .form-control:invalid, .form-control.is-invalid,
.was-validated .form-select:invalid, .form-select.is-invalid {
  background-image: none !important;
  padding-right: .8rem;
  border-color: #dc2626;
}
.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus { box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .15); }
.pw-match.text-danger { color: #dc2626 !important; }
.input-icon > .form-control[data-password], .input-icon > .form-control[data-password-confirm] { padding-right: 2.6rem !important; }
.pw-match.text-success::before, .pw-match.text-danger::before { content: none; }

/* Verification code box */
.verify-code { max-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: .4em; text-align: center; }

/* ---------- Formal printed report (Reports > Print / PDF) ---------- */
.report-formal { color: #000; font-family: "Times New Roman", Times, serif; font-size: 12pt; line-height: 1.4; }
/* Page frame: the page itself has no margin (so the browser cannot add its own date / web address);
   the top and bottom spacers repeat on every printed page and act as the margins. */
.report-formal .rf-page { width: 100%; border-collapse: collapse; }
.report-formal .rf-page > thead > tr > td, .report-formal .rf-page > tbody > tr > td, .report-formal .rf-page > tfoot > tr > td { padding: 0 20mm; border: 0; }
.report-formal .rf-space-top { height: 16mm; }
.report-formal .rf-space-bottom { height: 20mm; display: flex; justify-content: space-between; align-items: flex-start; padding-top: 7mm; font-size: 9pt; }
.report-formal .rf-space-bottom span { border-top: 1px solid #000; padding-top: 2px; flex: 1; }
.report-formal .rf-space-bottom span:last-child { text-align: right; }
.report-formal .rf-head { display: flex; align-items: center; justify-content: center; gap: 16px; text-align: center; padding-bottom: 9px; border-bottom: 1px solid #000; box-shadow: 0 3px 0 #fff, 0 5px 0 #000; margin-bottom: 5px; }
.report-formal .rf-head img { flex: 0 0 auto; filter: grayscale(1) contrast(1.4); }
.report-formal .rf-clinic { font-size: 19pt; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.15; }
.report-formal .rf-sub { font-style: italic; }
.report-formal .rf-kind { text-align: center; font-size: 10.5pt; letter-spacing: .22em; margin-top: 16px; }
.report-formal .rf-title { text-align: center; font-size: 14pt; font-weight: 700; letter-spacing: .08em; margin: 2px 0 2px; }
.report-formal .rf-subtitle { text-align: center; margin-bottom: 10px; }
.report-formal h3 { font-family: inherit; font-size: 12pt; font-weight: 700; color: #000; margin: 13px 0 5px; page-break-after: avoid; break-after: avoid; }
.report-formal .rf-meta { width: 100%; border-collapse: collapse; margin-bottom: 12px; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.report-formal .rf-meta td { padding: 2px 0; vertical-align: top; border: 0; }
.report-formal .rf-meta tr:first-child td { padding-top: 6px; }
.report-formal .rf-meta tr:last-child td { padding-bottom: 6px; }
.report-formal .rf-meta td:nth-child(1) { width: 38mm; font-weight: 700; white-space: nowrap; }
.report-formal .rf-meta td:nth-child(2) { width: 5mm; }
.report-formal .rf-para { text-align: justify; text-indent: 2.5em; margin: 0 0 6px; }
.report-formal .rf-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.report-formal .rf-table th, .report-formal .rf-table td { border: 1px solid #000; padding: 3px 6px; vertical-align: top; overflow-wrap: normal; word-break: normal; hyphens: none; }
.report-formal .rf-table th { font-weight: 700; text-align: center; vertical-align: middle; text-transform: uppercase; font-size: 9pt; letter-spacing: 0; padding: 4px 3px; border-bottom-width: 2px; }
.report-formal .rf-table.rf-list td { font-size: 11pt; padding: 3px 5px; }
.report-formal .rf-table .num { text-align: right; white-space: nowrap; }
.report-formal .rf-table .ctr { text-align: center; }
.report-formal .nw { white-space: nowrap; }
.report-formal .rf-table tr.total td { font-weight: 700; border-top-width: 2px; }
.report-formal .rf-table td.none { text-align: center; font-style: italic; padding: 8px; }
.report-formal .rf-table .ref { font-size: 9.5pt; }
.report-formal .rf-table tr { page-break-inside: avoid; break-inside: avoid; }
.report-formal .rf-end { text-align: center; font-style: italic; font-size: 10.5pt; margin-top: 8px; }
.report-formal .rf-obs { margin: 0 0 4px; padding-left: 2.2em; text-align: justify; }
.report-formal .rf-obs li { margin-bottom: 4px; }
.report-formal .rf-cert { margin-top: 24px; page-break-inside: avoid; break-inside: avoid; }
.report-formal .rf-sign { width: 100%; border-collapse: collapse; margin-top: 22px; table-layout: fixed; }
.report-formal .rf-sign td { border: 0; padding: 0; width: 44%; }
.report-formal .rf-sign td.gap { width: 12%; }
.report-formal .rf-sign td.lbl { padding-bottom: 42px; }
.report-formal .rf-sign td.line { border-top: 1px solid #000; padding-top: 3px; font-weight: 700; text-transform: uppercase; text-align: center; }
.report-formal .rf-sign td.cap { text-align: center; font-size: 10.5pt; }
.report-formal .rf-issued { width: 100%; border-collapse: collapse; margin-top: 24px; page-break-inside: avoid; break-inside: avoid; }
.report-formal .rf-issued td { border: 0; padding: 0; width: 56%; }
.report-formal .rf-issued td:last-child { width: 44%; }
.report-formal .rf-issued .lbl { margin-bottom: 6px; }
.report-formal .rf-issued .name { font-weight: 700; text-transform: uppercase; }
.report-formal .rf-foot { margin-top: 24px; font-size: 8.5pt; font-style: italic; text-align: justify; border-top: 1px solid #000; padding-top: 5px; }
@page report { size: A4 portrait; margin: 0; }
@media print {
  .report-formal { page: report; }
  .app-content:has(.report-formal) { padding: 0 !important; }
  .app-content:has(.report-formal) > footer, .app-content:has(.report-formal) ~ footer { display: none !important; }
}


/* patient feedback: stars, rating input, review cards */
.stars { position: relative; display: inline-block; white-space: nowrap; letter-spacing: 2px; line-height: 1; font-size: 1rem; vertical-align: middle; }
.stars-bg { color: #d3dde3; }
.stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; color: #f5b301; }
.stars-lg { font-size: 1.4rem; }
.rating-big { font-size: 3rem; font-weight: 800; color: var(--md-navy); line-height: 1; }
.rating-mid { font-size: 1.6rem; font-weight: 800; color: var(--md-navy); }
.rating-bars .rb-row { display: flex; align-items: center; gap: .6rem; margin: .3rem 0; font-size: .85rem; }
.rating-bars .rb-label { width: 2.6rem; color: var(--md-muted); white-space: nowrap; }
.rating-bars .rb-star { color: #f5b301; }
.rating-bars .rb-track { flex: 1; height: .55rem; background: var(--md-teal-50); border-radius: 99px; overflow: hidden; }
.rating-bars .rb-fill { height: 100%; background: #f5b301; border-radius: 99px; }
.rating-bars .rb-n { width: 2rem; text-align: right; color: var(--md-muted); }
.star-input { display: flex; flex-direction: row-reverse; justify-content: center; gap: .35rem; border: 0; padding: 0; margin: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2.6rem; color: #d3dde3; cursor: pointer; line-height: 1; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f5b301; }
.star-input label:hover { transform: scale(1.08); }
.star-input input:focus-visible + label { outline: 2px solid var(--md-teal); outline-offset: 3px; border-radius: 6px; }
.feedback-box { background: #fff8e6; border: 1px solid #f5dfa3; border-radius: var(--md-radius); padding: .8rem 1rem; }
.review p { white-space: pre-line; }
.review { display: flex; flex-direction: column; }
.qr-box svg { width: 170px; height: 170px; display: block; }

/* Phone menu: the language list opens under the EN button (it opened off the left edge of the screen) */
@media (max-width: 991.98px) {
  .site-nav .lang-switch .dropdown-menu,
  .site-nav .lang-switch .dropdown-menu[data-bs-popper] { left: 0; right: auto; max-width: calc(100vw - 2rem); }
}
.uname-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .4rem; }
.uname-suggest .btn { padding: .15rem .6rem; font-size: .8rem; border-radius: 99px; }


/* Booking: the total and the Back / Next buttons stay visible at the bottom of the screen while scrolling */
.wizard-dock { position: sticky; bottom: 0; z-index: 20; margin: 1rem -1.15rem -1.15rem; padding: .7rem 1.15rem calc(.7rem + env(safe-area-inset-bottom, 0px)); background: var(--md-card); border-top: 1px solid var(--md-line); border-radius: 0 0 var(--md-radius) var(--md-radius); box-shadow: 0 -8px 20px rgba(30, 58, 76, .08); }
.wizard-dock .svc-total { margin: 0 0 .5rem; padding: .4rem .7rem; font-size: .8rem; }
.wizard-dock .wizard-nav { margin-top: 0; }
[data-bs-theme="dark"] .wizard-dock { box-shadow: 0 -8px 20px rgba(0, 0, 0, .35); }
/* "About prices and payment": closed until tapped, so it does not take space while choosing */
.price-note { margin: -.25rem 0 .75rem; }
.price-note summary { display: inline-flex; align-items: center; gap: .35rem; list-style: none; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--md-teal-600); padding: .2rem .6rem; border: 1px solid var(--md-line); border-radius: 999px; background: var(--md-teal-50); }
.price-note summary::-webkit-details-marker { display: none; }
.price-note[open] summary { background: var(--md-teal); color: #fff; border-color: var(--md-teal); }


/* Booking guide (assets/js/tour.js) */
.tour-block { position: fixed; inset: 0; z-index: 2000; }
.tour-hole { position: fixed; z-index: 2001; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 22, 30, .62); outline: 3px solid #f5b301; outline-offset: 0; pointer-events: none; transition: top .2s, left .2s, width .2s, height .2s; }
.tour-card { position: fixed; z-index: 2002; background: var(--md-card); color: var(--md-ink); border-radius: 14px; padding: .9rem 1rem .7rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); border: 1px solid var(--md-line); }
.tour-count { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--md-muted); }
.tour-title { font-weight: 800; font-size: 1rem; margin: .1rem 0 .25rem; }
.tour-text { font-size: .88rem; line-height: 1.45; }
.tour-actions { display: flex; align-items: center; gap: .4rem; margin-top: .7rem; }
.tour-skip { padding-left: 0; color: var(--md-muted); text-decoration: underline; }


/* Verification code boxes (6 digits) */
.otp { display: flex; justify-content: center; gap: .5rem; max-width: 22rem; }
.otp-box { width: 2.9rem; height: 3.4rem; flex: 0 1 2.9rem; min-width: 0; text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--md-ink);
  background: var(--md-teal-50); border: 1.5px solid var(--md-line); border-radius: 12px; caret-color: var(--md-teal); transition: border-color .12s, box-shadow .12s, background .12s; }
.otp-box:focus { outline: none; border-color: var(--md-teal); background: var(--md-card); box-shadow: 0 0 0 .22rem rgba(42, 117, 154, .2); }
.otp-box.filled { border-color: var(--md-teal); background: var(--md-card); }
.otp.otp-error .otp-box:not(.filled) { border-color: #dc2626; box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .15); }
.otp-real { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; padding: 0 !important; border: 0 !important; }
@media (max-width: 380px) { .otp { gap: .35rem; } .otp-box { height: 3rem; font-size: 1.3rem; } }

/* =====================================================================
   Dark mode (html[data-bs-theme="dark"]). Same brand colours, dark surfaces.
   ===================================================================== */
.theme-toggle .theme-ico-light { display: none; }
[data-bs-theme="dark"] .theme-toggle .theme-ico-light { display: inline; }
[data-bs-theme="dark"] .theme-toggle .theme-ico-dark { display: none; }

[data-bs-theme="dark"] {
  color-scheme: dark;
  --md-teal-50: #1b3240;
  --md-teal-100: #24475a;
  --md-teal-600: #6fb6d8;
  --md-teal-700: #9fd0e6;
  --md-bg: #0e1a22;
  --md-ink: #e3eef4;
  --md-muted: #9ab1bf;
  --md-line: #2a4352;
  --md-card: #15252f;
  --md-soft: #1a2d38;
  --md-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 22px rgba(0, 0, 0, .25);
  --bs-body-color: var(--md-ink);
  --bs-body-bg: var(--md-bg);
  --bs-border-color: var(--md-line);
  --bs-link-color: #6fb6d8;
  --bs-link-hover-color: #9fd0e6;
  --bs-secondary-color: var(--md-muted);
  --bs-tertiary-bg: var(--md-soft);
  --bs-secondary-bg: #1f3644;
  --bs-emphasis-color: #ffffff;
}
[data-bs-theme="dark"] body { background: var(--md-bg); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #6fb6d8; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: var(--md-soft); --bs-btn-color: var(--md-ink); --bs-btn-border-color: var(--md-line); --bs-btn-hover-bg: #223b49; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--md-line); }
[data-bs-theme="dark"] .btn-light.border { border-color: var(--md-line) !important; }
[data-bs-theme="dark"] .btn-dark { --bs-btn-bg: #e3eef4; --bs-btn-color: #0e1a22; --bs-btn-border-color: #e3eef4; --bs-btn-hover-bg: #ffffff; --bs-btn-hover-color: #0e1a22; }
[data-bs-theme="dark"] .text-primary { color: #6fb6d8 !important; }

/* surfaces that were white */
[data-bs-theme="dark"] .btn-icon,
[data-bs-theme="dark"] .pill,
[data-bs-theme="dark"] .hero-card,
[data-bs-theme="dark"] .service-card,
[data-bs-theme="dark"] .auth-back,
[data-bs-theme="dark"] .auth-card,
[data-bs-theme="dark"] .quick-action,
[data-bs-theme="dark"] .filter-tabs a:not(.active),
[data-bs-theme="dark"] .stepper .st:not(.done):not(.current) .c,
[data-bs-theme="dark"] .choice .box,
[data-bs-theme="dark"] .choice-multi .box::after,
[data-bs-theme="dark"] .svc-cat,
[data-bs-theme="dark"] .day-chip:not(.selected),
[data-bs-theme="dark"] .cal,
[data-bs-theme="dark"] .cal-nav,
[data-bs-theme="dark"] .time-btn:not(.selected) { background: var(--md-card); color: var(--md-ink); }
[data-bs-theme="dark"] .choice-multi input:checked + .box::after { background: var(--md-teal); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: var(--md-soft); color: var(--md-ink); }
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { background-color: #1f3644; color: #fff; }
[data-bs-theme="dark"] .form-control::placeholder { color: #7f97a6; }
[data-bs-theme="dark"] .form-control:disabled { background-color: #13222b; color: var(--md-muted); }

/* page areas */
[data-bs-theme="dark"] .site-nav { background: rgba(14, 26, 34, .92); }
[data-bs-theme="dark"] .site-nav .nav-link { color: var(--md-ink); }
[data-bs-theme="dark"] .site-nav .nav-link.active, [data-bs-theme="dark"] .site-nav .nav-link:hover { color: #6fb6d8; }
[data-bs-theme="dark"] .navbar-toggler { border-color: var(--md-line); }
[data-bs-theme="dark"] .topbar { background: rgba(14, 26, 34, .88); }
[data-bs-theme="dark"] .hero { background: radial-gradient(1200px 500px at 85% 20%, #1d3a4a 0%, rgba(29, 58, 74, 0) 60%), linear-gradient(180deg, #11212b 0%, #0e1a22 100%); }
[data-bs-theme="dark"] .section.bg-white, [data-bs-theme="dark"] .bg-white { background: #112029 !important; }
[data-bs-theme="dark"] .auth-wrap { background: var(--md-bg); }
[data-bs-theme="dark"] .notif-dot { border-color: var(--md-card); }
[data-bs-theme="dark"] .navbar-brand img, [data-bs-theme="dark"] .brand-mini { filter: none; }

/* tables and lists */
[data-bs-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: var(--md-ink); --bs-table-border-color: var(--md-line); --bs-table-hover-bg: var(--md-soft); --bs-table-hover-color: var(--md-ink); }
[data-bs-theme="dark"] .table-md thead th { background: #1a2e3a; }
[data-bs-theme="dark"] .table-md td { border-color: #223a48; }
[data-bs-theme="dark"] .table-md tbody tr:hover { background: var(--md-soft); }
[data-bs-theme="dark"] .list-group { --bs-list-group-bg: var(--md-card); --bs-list-group-color: var(--md-ink); --bs-list-group-border-color: var(--md-line); --bs-list-group-action-hover-bg: var(--md-soft); --bs-list-group-action-hover-color: var(--md-ink); }
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: var(--md-card); --bs-dropdown-color: var(--md-ink); --bs-dropdown-link-color: var(--md-ink); --bs-dropdown-link-hover-bg: var(--md-soft); --bs-dropdown-border-color: var(--md-line); --bs-dropdown-header-color: var(--md-muted); }

/* booking */
[data-bs-theme="dark"] .choice input:checked + .box { background: #1b3442; }
[data-bs-theme="dark"] .svc-total { background: #1b3442; border-color: #2c5468; color: #9fd0e6; }
[data-bs-theme="dark"] .svc-checks, [data-bs-theme="dark"] .svc-cat[open] { background: var(--md-soft); }
[data-bs-theme="dark"] .svc-cat summary { color: var(--md-ink); }
[data-bs-theme="dark"] .cal-nav:hover:not(:disabled) { background: #1b3442; }
[data-bs-theme="dark"] .cal-day { color: var(--md-muted); }
[data-bs-theme="dark"] .cal-day.open { background: #1b3442; border-color: #2c5468; color: var(--md-ink); }
[data-bs-theme="dark"] .cal-day.full, [data-bs-theme="dark"] .cal-day.closed, [data-bs-theme="dark"] .cal-legend .sq { background: #17242c; }
[data-bs-theme="dark"] .cal-day.selected { background: var(--md-teal); color: #fff; }
[data-bs-theme="dark"] .slot-row.taken { background: #17242c; color: #6b7f8b; }

/* status colours: same meaning, darker backgrounds */
[data-bs-theme="dark"] .tint-amber, [data-bs-theme="dark"] .status-pending, [data-bs-theme="dark"] .cell.booked.pending { background: #3a2c12; color: #f5c46b; border-color: #5a4318; }
[data-bs-theme="dark"] .tint-green, [data-bs-theme="dark"] .status-completed { background: #143222; color: #7bd69a; border-color: #1f4d33; }
[data-bs-theme="dark"] .tint-violet { background: #2a2342; color: #c4b2ff; }
[data-bs-theme="dark"] .tint-red, [data-bs-theme="dark"] .status-cancelled, [data-bs-theme="dark"] .cell.booked.emergency, [data-bs-theme="dark"] .cell.blocked { background: #3b1a1a; color: #f3a3a3; border-color: #5a2626; }
[data-bs-theme="dark"] .tint-blue, [data-bs-theme="dark"] .cell.booked { background: #1c2a4a; color: #a9c1ff; border-color: #2c3f6a; }
[data-bs-theme="dark"] .status-confirmed, [data-bs-theme="dark"] .cell.open { background: #1b3442; color: #9fd0e6; border-color: #2c5468; }
[data-bs-theme="dark"] .status-no_show, [data-bs-theme="dark"] .cell.closed { background: #1d2730; color: #9aa9b4; border-color: #2c3a45; }
[data-bs-theme="dark"] .feedback-box { background: #2f2712; border-color: #5a4a1e; }
[data-bs-theme="dark"] .stars-bg, [data-bs-theme="dark"] .star-input label { color: #3a4f5c; }
[data-bs-theme="dark"] .star-input label:hover, [data-bs-theme="dark"] .star-input label:hover ~ label, [data-bs-theme="dark"] .star-input input:checked ~ label { color: #f5b301; }
[data-bs-theme="dark"] .avatar-preview, [data-bs-theme="dark"] .avatar-lg { border-color: var(--md-card); }
/* QR codes stay black on white so phones can scan them */
[data-bs-theme="dark"] .qr-box { background: #ffffff; }

[data-bs-theme="dark"] .hero .lead { color: #b5c8d3; }
[data-bs-theme="dark"] .pw-rules li.ok, [data-bs-theme="dark"] .text-success { color: #7bd69a !important; }
[data-bs-theme="dark"] .pw-rules li.bad, [data-bs-theme="dark"] .text-danger { color: #f39b9b !important; }
[data-bs-theme="dark"] .empty-state i { color: #4f7184; }
[data-bs-theme="dark"] .choice:hover .box { border-color: #3b6b82; }
/* light and dark buttons: solid colours (some Bootstrap themes paint them with a white gradient) */
[data-bs-theme="dark"] .btn-light { background-color: var(--md-soft) !important; background-image: none !important; color: var(--md-ink) !important; border-color: var(--md-line) !important; }
[data-bs-theme="dark"] .btn-light:hover, [data-bs-theme="dark"] .btn-light:focus { background-color: #223b49 !important; color: #fff !important; }
[data-bs-theme="dark"] .btn-dark { background-color: #e3eef4 !important; background-image: none !important; color: #0e1a22 !important; border-color: #e3eef4 !important; }
[data-bs-theme="dark"] .alert-info { --bs-alert-bg: #12303d; --bs-alert-color: #a8d8ec; --bs-alert-border-color: #1f4a5c; }
[data-bs-theme="dark"] .alert-warning { --bs-alert-bg: #33290f; --bs-alert-color: #f5d27a; --bs-alert-border-color: #5a4a1e; }
[data-bs-theme="dark"] .alert-danger { --bs-alert-bg: #3b1a1a; --bs-alert-color: #f3a3a3; --bs-alert-border-color: #5a2626; }
[data-bs-theme="dark"] .alert-success { --bs-alert-bg: #143222; --bs-alert-color: #7bd69a; --bs-alert-border-color: #1f4d33; }
[data-bs-theme="dark"] .alert-light { --bs-alert-bg: var(--md-soft); --bs-alert-color: var(--md-ink); --bs-alert-border-color: var(--md-line); }

/* Printing (reports, schedules) always uses the light colours */
@media print {
  [data-bs-theme="dark"] {
    --md-teal-50: #e3f1f7; --md-teal-100: #c8e1ec; --md-teal-600: #246686; --md-teal-700: #1f5672;
    --md-bg: #ffffff; --md-ink: #1e3a4c; --md-muted: #5f7383; --md-line: #d3e5ee; --md-card: #ffffff; --md-soft: #f7fbfd;
    --bs-body-color: #1e3a4c; --bs-body-bg: #ffffff; --bs-border-color: #d3e5ee; color-scheme: light;
  }
  [data-bs-theme="dark"] body, [data-bs-theme="dark"] .card-md, [data-bs-theme="dark"] .table-md thead th { background: #ffffff !important; color: #1e3a4c; }
}

/* Buttons that use the browser's default text colour get the page's colour instead */
button.time-btn, button.day-chip, .theme-toggle { color: var(--md-ink); }
button.time-btn.selected, button.day-chip.selected { color: #fff; }
.pw-rules[hidden] { display: none !important; }

/* Clinic map (homepage "Visit Our Clinic") */
.map-frame { position: relative; height: 100%; min-height: 340px; border-radius: 16px; overflow: hidden; border: 1px solid var(--bs-border-color); background: var(--md-teal-50); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 991.98px) { .map-frame { min-height: 300px; } }
@media print { .map-frame { display: none; } }

/* End time under each start time in the booking calendar */
.time-btn .until { display: block; font-size: .7rem; font-weight: 500; opacity: .7; margin-top: 1px; }
.slot-taken { grid-column: 1 / -1; }

/* Visit tracking (Start / Finish Visit) */
.visit-box { border: 1px solid var(--md-line); border-radius: 12px; padding: .7rem .9rem; background: var(--md-teal-50); }
.visit-box.live { border-color: var(--md-teal); }
.visit-box.late { border-color: #e0a3a3; background: #fff4f4; }
[data-bs-theme="dark"] .visit-box.late { background: rgba(220, 53, 69, .12); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 3px; animation: livepulse 1.4s infinite; }
@keyframes livepulse { 50% { opacity: .25; } }
.spam-hint { text-align: center; }
.card-body-md .spam-hint, form .spam-hint.text-start { text-align: left; }

/* Profile picture cropper (1:1) */
.crop-wrap { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.crop-wrap[hidden] { display: none; }
.crop-box { position: relative; width: min(260px, 72vw); aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px; background: #1b2b36; touch-action: none; cursor: grab; outline-offset: 3px; user-select: none; }
.crop-box.dragging { cursor: grabbing; }
.crop-box img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-box::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; pointer-events: none; }
.crop-box::before { content: ''; position: absolute; inset: 0; border: 2px solid rgba(255, 255, 255, .9); border-radius: 12px; z-index: 1; pointer-events: none; }
.crop-tools { flex: 1 1 180px; min-width: 180px; }

/* Camera button on the profile picture (opens the photo chooser) */
.avatar-edit { position: relative; display: inline-block; }
.avatar-cam { position: absolute; right: 0; bottom: 4px; width: 38px; height: 38px; border-radius: 50%; background: var(--md-teal); color: #fff;
  display: grid; place-items: center; font-size: 1.05rem; cursor: pointer; border: 3px solid var(--md-card, #fff); box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .15s, background .15s; }
.avatar-cam:hover { background: var(--md-teal-600, #22617f); transform: scale(1.06); }
#avatarInput:focus-visible + * , .avatar-edit:focus-within .avatar-cam { outline: 3px solid rgba(42, 117, 153, .45); outline-offset: 2px; }

/* Full-size profile picture viewer */
.pic-clickable { cursor: zoom-in; }
.pic-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 20, 28, .82); display: grid; place-items: center; padding: 16px; }
.pic-viewer[hidden] { display: none; }
.pic-viewer img { width: min(420px, 88vw); height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.pic-viewer-close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.pic-viewer-close:hover { background: rgba(255,255,255,.28); }
[data-pic-view] { cursor: zoom-in; }

/* Login: message under the box that is wrong */
.field-error { color: #b91c1c; font-size: .82rem; font-weight: 600; margin-top: .35rem; }
.field-error a { font-weight: 700; }
.input-icon > .form-control.is-invalid { border-color: #dc3545; background-image: none; }
.input-icon > .form-control.is-invalid:focus { box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .15); }
[data-bs-theme="dark"] .field-error { color: #f19a9a; }
.reset-link { display: inline-flex; align-items: center; gap: .3rem; margin-top: .3rem; font-size: .82rem; font-weight: 700; color: var(--md-teal-600); }
.reset-link:hover { text-decoration: underline; }
