/* MAS Doctors — one stylesheet for all interfaces */
:root {
  --bs-primary: #0e7c86; --bs-primary-rgb: 14,124,134; --bs-link-color: #0e7c86; --bs-link-color-rgb: 14,124,134; --bs-link-hover-color: #095a61;
  --mas-ink: #10233a; --mas-soft: #eef6f7; --mas-line: #e3e8ee; --mas-bg: #f5f7fa; --mas-side: #0f2a3d; --mas-accent: #f59f00;
  --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[dir=rtl] { --bs-body-font-family: Cairo, Tahoma, sans-serif; }
body { background: var(--mas-bg); color: var(--mas-ink); }
.btn-primary { --bs-btn-bg: #0e7c86; --bs-btn-border-color: #0e7c86; --bs-btn-hover-bg: #0b6870; --bs-btn-hover-border-color: #0b6870; --bs-btn-active-bg: #095a61; --bs-btn-disabled-bg: #0e7c86; --bs-btn-disabled-border-color: #0e7c86; }
.btn-outline-primary { --bs-btn-color: #0e7c86; --bs-btn-border-color: #0e7c86; --bs-btn-hover-bg: #0e7c86; --bs-btn-hover-border-color: #0e7c86; --bs-btn-active-bg: #0b6870; }
.text-bg-primary { background-color: #0e7c86 !important; }
.text-primary { color: #0e7c86 !important; }
.bg-primary-subtle { background: var(--mas-soft) !important; }
.form-control:focus, .form-select:focus { border-color: #5fb4bb; box-shadow: 0 0 0 .2rem rgba(14,124,134,.15); }
.page-link { color: #0e7c86; } .active > .page-link { background: #0e7c86; border-color: #0e7c86; }
.card { border: 1px solid var(--mas-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,35,58,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--mas-line); font-weight: 600; border-radius: 14px 14px 0 0 !important; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7a8c; font-weight: 600; background: #fafbfc; }
[dir=rtl] .table thead th { text-transform: none; letter-spacing: 0; }
.bs-status { font-weight: 500; }
.tiny { font-size: .75rem; }

/* ---------- work area (clinic, doctor, platform) ---------- */
.bs-layout { display: flex; min-height: 100vh; }
.bs-side { width: 250px; flex: 0 0 250px; background: var(--mas-side); color: #c9d6e2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040; }
.bs-area-doctor .bs-side { background: #12304a; }
.bs-area-platform .bs-side { background: #241a3d; }
.bs-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.bs-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.bs-brand b { display: block; font-size: .95rem; line-height: 1.2; }
.bs-brand small { display: block; font-size: .72rem; color: #8fa6bb; }
.bs-brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #14a3ad, #0e7c86); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex: 0 0 auto; }
.bs-brand-mark.lg { width: 58px; height: 58px; font-size: 1.8rem; border-radius: 16px; }
.bs-nav { padding: .6rem .5rem; flex: 1; }
.bs-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 9px; color: #c9d6e2; text-decoration: none; font-size: .92rem; margin-bottom: 2px; }
.bs-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.bs-nav a.active { background: rgba(20,163,173,.22); color: #fff; }
.bs-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.bs-nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6f879c; padding: .9rem .8rem .3rem; }
.bs-side-foot { padding: .8rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.bs-side-foot a { color: #c9d6e2; text-decoration: none; font-size: .88rem; }
.bs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bs-top { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.5rem; background: #fff; border-bottom: 1px solid var(--mas-line); position: sticky; top: 0; z-index: 1030; }
.bs-title { font-size: 1.15rem; margin: 0; font-weight: 600; }
.bs-content { padding: 1.5rem; flex: 1; }
.bs-backdrop { display: none; }
@media (max-width: 991.98px) {
  .bs-side { position: fixed; inset-inline-start: 0; transform: translateX(-100%); transition: transform .2s; }
  [dir=rtl] .bs-side { transform: translateX(100%); }
  body.side-open .bs-side { transform: none; }
  body.side-open .bs-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
  .bs-content { padding: 1rem; }
  .bs-top { padding: .6rem 1rem; }
}

/* stats */
.bs-stat { display: flex; gap: .9rem; align-items: center; background: #fff; border: 1px solid var(--mas-line); border-radius: 14px; padding: 1rem 1.1rem; text-decoration: none; color: inherit; height: 100%; }
a.bs-stat:hover { border-color: #9fd0d4; }
.bs-stat > i { font-size: 1.4rem; width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bs-stat-primary > i { background: var(--mas-soft); color: #0e7c86; }
.bs-stat-success > i { background: #e7f6ec; color: #198754; }
.bs-stat-warning > i { background: #fff4de; color: #c27c00; }
.bs-stat-danger > i { background: #fde8ea; color: #c22b3a; }
.bs-stat-info > i { background: #e6f1fe; color: #0b62c4; }
.bs-stat-v { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.bs-stat-l { font-size: .8rem; color: #6b7a8c; }

.bs-empty { text-align: center; color: #8696a7; padding: 2.5rem 1rem; }
.bs-empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }
.bs-empty p { margin: 0; }

/* avatars */
.bs-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; object-fit: cover; flex: 0 0 auto; background: #0e7c86; }
.bs-avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.bs-avatar-md { width: 52px; height: 52px; font-size: 1.05rem; }
.bs-avatar-lg { width: 96px; height: 96px; font-size: 1.8rem; }

/* agenda rows */
.bs-appt { display: flex; gap: .9rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--mas-line); text-decoration: none; color: inherit; }
.bs-appt:last-child { border-bottom: 0; }
a.bs-appt:hover { background: #fafcfd; }
.bs-appt-time { width: 72px; flex: 0 0 72px; font-weight: 600; font-size: .92rem; }
.bs-appt-time small { display: block; font-weight: 400; color: #8696a7; font-size: .72rem; }
.bs-appt-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 4px; }
.bs-appt-main { flex: 1; min-width: 0; }
.bs-appt-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-appt-main small { color: #6b7a8c; }

/* slots */
.bs-days { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
.bs-day { flex: 0 0 auto; min-width: 74px; text-align: center; padding: .5rem .4rem; border: 1px solid var(--mas-line); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; line-height: 1.2; }
.bs-day small { display: block; font-size: .72rem; color: #6b7a8c; }
.bs-day b { font-size: 1.15rem; }
.bs-day.off { opacity: .45; pointer-events: none; }
.bs-day.active { background: #0e7c86; border-color: #0e7c86; color: #fff; }
.bs-day.active small { color: #d6f0f2; }
.bs-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.bs-slots .btn { font-weight: 500; }
.btn-check:checked + .btn-outline-primary { background: #0e7c86; color: #fff; }

/* chat */
.bs-chat { max-height: 60vh; overflow-y: auto; padding: 1rem; background: #f7f9fb; border-radius: 12px; display: flex; flex-direction: column; gap: .35rem; }
.bs-msg { max-width: 78%; align-self: flex-start; }
.bs-msg.own { align-self: flex-end; }
.bs-bubble { background: #fff; border: 1px solid var(--mas-line); padding: .55rem .8rem; border-radius: 14px; border-end-start-radius: 4px; white-space: normal; word-wrap: break-word; }
.bs-msg.own .bs-bubble { background: #0e7c86; color: #fff; border-color: #0e7c86; border-radius: 14px; border-end-end-radius: 4px; }
.bs-msg-meta { font-size: .7rem; color: #8696a7; margin: .15rem .4rem 0; }
.bs-msg.own .bs-msg-meta { text-align: end; }
.bs-chat-day { text-align: center; margin: .5rem 0; }
.bs-chat-day span { font-size: .72rem; color: #6b7a8c; background: #e9eef3; padding: .15rem .6rem; border-radius: 20px; }
.bs-threads a { display: flex; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--mas-line); color: inherit; text-decoration: none; align-items: center; }
.bs-threads a:hover, .bs-threads a.active { background: var(--mas-soft); }
.bs-threads .unread b { color: #0e7c86; }

/* teeth chart */
.bs-teeth { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.bs-tooth { aspect-ratio: 3/4; border: 1.5px solid #cbd5df; border-radius: 9px 9px 14px 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; background: #fff; cursor: pointer; padding: 0; line-height: 1.05; color: var(--mas-ink); }
.bs-teeth.lower .bs-tooth { border-radius: 14px 14px 9px 9px; }
.bs-tooth small { font-size: .58rem; opacity: .75; }
.bs-tooth:hover { border-color: #0e7c86; }
.bs-teeth-gap { height: 10px; border-bottom: 2px dashed #d5dde5; margin-bottom: 10px; }
@media (max-width: 575.98px) { .bs-teeth { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.bs-legend span { display: inline-flex; align-items: center; gap: .3rem; margin-inline-end: .8rem; font-size: .8rem; }
.bs-legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #cbd5df; display: inline-block; }

/* hours */
.bs-hours th { font-weight: 500; color: #6b7a8c; width: 40%; }

/* sign-in */
.bs-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(circle at 20% 10%, #e3f4f5, transparent 50%), radial-gradient(circle at 80% 90%, #fdf0d9, transparent 45%), var(--mas-bg); }
.bs-auth-box { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; border: 1px solid var(--mas-line); padding: 2rem; box-shadow: 0 10px 30px rgba(16,35,58,.07); }
.bs-auth-box.wide { max-width: 640px; }
.bs-demo-box { background: var(--mas-soft); border-radius: 12px; padding: .9rem 1rem; }

/* ---------- patient site ---------- */
.bs-pnav { background: #fff; border-bottom: 1px solid var(--mas-line); }
.bs-pnav .navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--mas-ink); }
.bs-pnav .nav-link { color: #44566b; font-weight: 500; }
.bs-pnav .nav-link.active { color: #0e7c86; }
.bs-hero { background: linear-gradient(135deg, #0f2a3d 0%, #0e7c86 100%); color: #fff; padding: 3.2rem 0 4.5rem; }
.bs-hero h1 { font-weight: 700; }
.bs-hero p { color: #cfe7ea; }
.bs-search { background: #fff; border-radius: 16px; padding: .6rem; box-shadow: 0 10px 30px rgba(0,0,0,.15); margin-top: -2.4rem; position: relative; }
.bs-ccard { background: #fff; border: 1px solid var(--mas-line); border-radius: 16px; overflow: hidden; height: 100%; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.bs-ccard:hover { box-shadow: 0 10px 25px rgba(16,35,58,.09); transform: translateY(-2px); color: inherit; }
.bs-ccard-cover { height: 110px; background: linear-gradient(135deg, #cfeef0, #f6e7c8); background-size: cover; background-position: center; position: relative; }
.bs-ccard-logo { position: absolute; bottom: -26px; inset-inline-start: 16px; width: 60px; height: 60px; border-radius: 14px; background: #fff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); object-fit: contain; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #0e7c86; }
.bs-ccard-body { padding: 2.1rem 1rem 1rem; flex: 1; }
.bs-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; padding: .2rem .6rem; border-radius: 20px; background: var(--mas-soft); color: #0e5f66; }
.bs-chip.demo { background: #fff4de; color: #9a6200; }
.bs-cover { height: 220px; background: linear-gradient(135deg, #0f2a3d, #0e7c86); background-size: cover; background-position: center; }
.bs-profile-head { margin-top: 1rem; align-items: flex-start !important; }
.bs-profile-head > .bs-profile-logo { margin-top: -76px; }
.bs-profile-logo { width: 120px; height: 120px; border-radius: 22px; background: #fff; border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); object-fit: contain; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #0e7c86; }
.bs-doc-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--mas-line); border-radius: 14px; background: #fff; height: 100%; }
.bs-steps { display: flex; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.bs-steps span { font-size: .8rem; padding: .3rem .75rem; border-radius: 20px; background: #e9eef3; color: #6b7a8c; }
.bs-steps span.on { background: #0e7c86; color: #fff; }
.bs-footer { background: #0f2a3d; color: #9fb3c6; padding: 2rem 0; margin-top: 3rem; font-size: .88rem; }
.bs-footer a { color: #d5e3ef; }
.bs-pmain { min-height: 60vh; }

/* printing */
@media print {
  .bs-side, .bs-top, .no-print, .bs-pnav, .bs-footer { display: none !important; }
  .bs-content { padding: 0; } body { background: #fff; }
}

/* small screens and right-to-left fixes */
.bs-teeth { direction: ltr; }                       /* dental chart keeps the standard orientation */
@media (max-width: 575.98px) {
  .bs-doc-card .bs-avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
  .bs-doc-card { flex-wrap: wrap; }
  .bs-profile-logo { width: 88px; height: 88px; font-size: 2.2rem; }
  .bs-profile-head > .bs-profile-logo { margin-top: -56px; }
  .bs-cover { height: 150px; }
}
