/* ═══════════════════════════════════════════════════════════
   DR. AMR QAHWAJI CLINIC — Premium Dental UI
   Aesthetic: Teal + Dark · Medical Professional
   Fonts: Cairo (AR) · Comfortaa (EN) · DM Mono (numbers)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════════
   DESIGN TOKENS — Dark Mode Default
   ══════════════════════════════════════════════ */
:root {
  /* ── Brand Colors (مأخوذة من الواجهة الثانية) ── */
  --primary: #5CB8B2;
  --primary-glow: #5CB8B240;
  --primary-deep: #3D8A85;
  --primary-light: #7DD4CE;
  --secondary: #2D3436;

  /* ── Legacy teal palette (للتماشي مع المكونات الحالية) ── */
  --teal:        #5CB8B2;
  --teal2:       #4A9E98;
  --teal3:       #7DCEC8;
  --teal-dim:    rgba(92,184,178,0.12);
  --teal-glow:   rgba(92,184,178,0.22);
  --teal-border: rgba(92,184,178,0.30);

  /* ── Surfaces ── */
  --bg:          #060C14;
  --bg2:         #111c2a;   /* أفتح */
  --bg3:         #162234;   /* أفتح */
  --glass:       rgba(17, 28, 42, 0.90); /* للبانيل الفاتح */
  --glass2:      rgba(11, 19, 32, 0.95);

  /* ── Text ── */
  --txt:         #F0F4FA;   /* نص رئيسي فاتح */
  --txt2:        #C8D4E4;   /* نص ثانوي */
  --txt3:        #8A9BB0;   /* نص خافت */
  --txt-inv:     #060C14;

  /* ── Semantic ── */
  --ok:          #2ECC71;
  --ok-dim:      rgba(46,204,113,0.10);
  --ok-border:   rgba(46,204,113,0.22);

  --warn:        #F39C12;
  --warn-dim:    rgba(243,156,18,0.10);
  --warn-border: rgba(243,156,18,0.22);

  --danger:      #E74C3C;
  --danger-dim:  rgba(231,76,60,0.10);
  --danger-border: rgba(231,76,60,0.22);

  --info:        #3498DB;
  --info-dim:    rgba(52,152,219,0.10);
  --info-border: rgba(52,152,219,0.22);

  /* ── Borders / Shadows ── */
  --border:      rgba(255,255,255,0.05);
  --side-border: rgba(255,255,255,0.06);
  --side-label:  rgba(180,200,220,0.45);
  --border2:     rgba(255,255,255,0.09);
  --shadow:      0 8px 40px rgba(0,0,0,0.5);
  --shadow2:     0 4px 20px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.35);
  --glow-teal:   0 0 32px rgba(92,184,178,0.18), 0 0 80px rgba(92,184,178,0.06);
  --glow-sm:     0 0 16px rgba(92,184,178,0.15);

  /* ── Layout ── */
  --radius:      18px;
  --radius2:     12px;
  --radius3:     8px;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --bottom-h:    72px;

  /* ── Fonts ── */
  --font-ar:   "Cairo", system-ui, sans-serif;
  --font-en:   "Cascadia Code", "Comfortaa", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "DM Mono", "Consolas", monospace;

  /* ── Motion ── */
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease2:  cubic-bezier(0.4, 0, 0.2, 1);
  --dur:    200ms;
  --dur2:   350ms;
}

/* ══════════════════════════════════════════════
   RESET
   ══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-ar);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  direction: rtl;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

/* ══════════════════════════════════════════════
   UTILITIES (مستعارة من الواجهة الثانية)
   ══════════════════════════════════════════════ */
.en { font-family: var(--font-en); direction: ltr; }
.mono { font-family: var(--font-mono); direction: ltr; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   GLOBAL BACKGROUND TEXTURE
   ══════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 70% -5%, rgba(92,184,178,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(45,52,54,0.08) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════════
   SPLASH SCREEN
   ══════════════════════════════════════════════ */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(160deg, #060C14 0%, #0A1520 40%, #08101A 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}

#splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(92,184,178,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(45,52,54,0.15) 0%, transparent 55%);
  pointer-events: none;
}

.splash-logo-wrap {
  position: relative;
  animation: splashLogoIn 0.9s var(--ease) both;
  animation-delay: 0.2s;
}

.splash-logo-wrap img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(92,184,178,0.35));
}

.splash-brand {
  margin-top: 28px;
  text-align: center;
  animation: splashTextIn 0.8s var(--ease) both;
  animation-delay: 0.55s;
}

.splash-name {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 600;
  color: #FDFAF5;
  letter-spacing: 1px;
}

.splash-name span {
  color: var(--teal);
}

.splash-tag {
  font-size: 12px;
  color: rgba(253,250,245,0.4);
  margin-top: 6px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: var(--font-en);
}

/* Progress bar */
.splash-progress-wrap {
  margin-top: 48px;
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  animation: splashTextIn 0.5s var(--ease) both;
  animation-delay: 0.8s;
}

.splash-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal3));
  border-radius: 99px;
  animation: splashProgress 2.5s var(--ease2) both;
  animation-delay: 0.85s;
  box-shadow: 0 0 8px rgba(92,184,178,0.5);
}

.splash-powered {
  position: absolute;
  bottom: 32px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  animation: splashTextIn 0.5s ease both;
  animation-delay: 1s;
}

@keyframes splashLogoIn {
  from { opacity: 0; transform: scale(0.7) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes splashTextIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes splashProgress {
  from { width: 0; }
  to   { width: 100%; }
}

/* Exit animation */
#splash.exit {
  animation: splashExit 0.6s var(--ease) both;
}
@keyframes splashExit {
  to { opacity: 0; transform: scale(1.04); pointer-events: none; }
}

/* ══════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════ */
.app-shell {
  display: none;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.app-shell.visible {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  animation: appFadeIn 0.5s var(--ease) both;
}

@keyframes appFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.sidebar {
  background: linear-gradient(180deg, var(--glass) 0%, var(--glass2) 100%);
  border-left: 1px solid rgba(92,184,178,0.12);
  box-shadow: 0 22px 48px rgba(5,14,24,0.12);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

/* Brand block */
.side-brand {
  padding: 22px 18px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--side-border);
}

.brand-logo {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(92,184,178,0.18);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal2);
  margin-top: 3px;
  line-height: 1.3;
}

.brand-power {
  font-family: var(--font-en);
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 5px;
  line-height: 1;
}

/* Sidebar scroll area */
.side-scroll {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.side-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--side-label);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 12px 6px;
  font-family: var(--font-en);
}

.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius3);
  color: var(--txt2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0;
  border-right: 3px solid transparent;
  border: 1px solid transparent;
}

.side-item:hover {
  background: rgba(92,184,178,0.06);
  color: var(--txt);
  border-color: rgba(92,184,178,0.15);
}

.side-item.active {
  background: linear-gradient(180deg, #2a3f67 0%, #3f5f96 100%);
  color: #fff;
  border-color: rgba(42,63,103,0.4);
}

.side-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.side-icon svg {
  width: 18px;
  height: 18px;
}

/* ══════════════════════════════════════════════
   MAIN AREA
   ══════════════════════════════════════════════ */
.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 5;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius3);
  display: grid;
  place-items: center;
  color: var(--txt2);
  transition: all var(--dur);
}

.topbar-btn:hover {
  background: var(--teal-dim);
  color: var(--teal);
}

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  scroll-behavior: smooth;
}

.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
}

/* ══════════════════════════════════════════════
   COVER BANNER — Dashboard
   ══════════════════════════════════════════════ */
.cover-banner {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(92,184,178,0.12);
}

.cover-banner > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.04);
  transition: transform 8s ease;
}

.cover-banner:hover > img:first-child {
  transform: scale(1.07);
}

/* Dramatic multi-stop gradient overlay */
.cover-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(6,12,20,0.05) 0%,
      rgba(6,12,20,0.15) 30%,
      rgba(6,12,20,0.65) 65%,
      rgba(6,12,20,0.92) 100%
    ),
    linear-gradient(
      90deg,
      rgba(6,12,20,0) 40%,
      rgba(6,12,20,0.55) 100%
    );
}

/* Watermark overlay */
.cover-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  z-index: 1;
  pointer-events: none;
}

.cover-watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-info {
  position: absolute;
  bottom: 22px;
  right: 24px;
  z-index: 2;
  text-align: right;
}

.cover-name {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.cover-name span {
  color: var(--teal3);
}

.cover-name-ar {
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin-top: 3px;
  direction: rtl;
}

.cover-role {
  font-family: var(--font-ar);
  font-size: 12px;
  color: rgba(255,255,255,0.50);
  margin-top: 5px;
  font-weight: 600;
}

.cover-badges { display: none !important; }
.cover-badge { display: none !important; }
.cover-badge-sport { display: none !important; }
.cover-badge svg { display: none !important; }

/* ══════════════════════════════════════════════
   CARDS & KPIs
   ══════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  transition: all var(--dur2) var(--ease);
}

.card:hover {
  border-color: var(--teal-border);
  box-shadow: var(--glow-sm);
}

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--dur2) var(--ease);
}

.kpi-card:hover {
  border-color: var(--teal-border);
  box-shadow: var(--glow-sm);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kpi-icon.teal   { background: var(--teal-dim); color: var(--teal); }
.kpi-icon.ok     { background: var(--ok-dim); color: var(--ok); }
.kpi-icon.warn   { background: var(--warn-dim); color: var(--warn); }
.kpi-icon.danger { background: var(--danger-dim); color: var(--danger); }
.kpi-icon.info   { background: var(--info-dim); color: var(--info); }

.kpi-icon svg {
  width: 22px;
  height: 22px;
}

.kpi-body {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: 12px;
  color: var(--txt3);
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--txt);
  line-height: 1;
}

.kpi-sub {
  font-size: 11px;
  color: var(--txt3);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
}

.section-action {
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--dur);
}

.section-action:hover {
  opacity: 0.7;
}

/* ══════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════ */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--txt3);
  text-align: right;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
}

.table-wrap td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--txt2);
  border-bottom: 1px solid var(--border);
}

.table-wrap tr:last-child td {
  border-bottom: none;
}

.table-wrap tr:hover td {
  background: rgba(92,184,178,0.03);
}

/* ══════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius3);
  color: var(--txt);
  font-size: 14px;
  transition: border-color var(--dur);
}

.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.form-input::placeholder {
  color: var(--txt3);
}

/* Search */
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-wrap .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--txt3);
  pointer-events: none;
}

.search-wrap .search-icon svg {
  width: 18px;
  height: 18px;
}

.search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 14px;
  padding-right: 40px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius3);
  color: var(--txt);
  font-size: 14px;
  transition: border-color var(--dur);
}

.search-wrap input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius3);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  cursor: pointer;
}

.btn-primary {
  background: var(--teal);
  color: var(--txt-inv);
}

.btn-primary:hover {
  background: var(--teal2);
  box-shadow: var(--glow-sm);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--txt2);
  border: 1px solid var(--border2);
}

.btn-secondary:hover {
  border-color: var(--teal-border);
  color: var(--teal);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ══════════════════════════════════════════════
   BADGE
   ══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-ok     { background: var(--ok-dim); color: var(--ok); border: 1px solid var(--ok-border); }
.badge-warn   { background: var(--warn-dim); color: var(--warn); border: 1px solid var(--warn-border); }
.badge-danger { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-info   { background: var(--info-dim); color: var(--info); border: 1px solid var(--info-border); }
.badge-teal   { background: var(--teal-dim); color: var(--teal); border: 1px solid var(--teal-border); }

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--txt3);
  opacity: 0.4;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--txt2);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--txt3);
}

/* ══════════════════════════════════════════════
   LIST ITEMS
   ══════════════════════════════════════════════ */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  margin-bottom: 8px;
  transition: all var(--dur);
  cursor: pointer;
}

.list-item:hover {
  border-color: var(--teal-border);
  background: rgba(92,184,178,0.03);
}

.list-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal-dim);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
}

.list-sub {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 2px;
}

.list-meta {
  text-align: left;
  flex-shrink: 0;
}

.list-meta-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--txt2);
}

.list-meta-badge {
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════════ */
.toast-host {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius3);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  pointer-events: auto;
  animation: toastIn 0.35s var(--ease) both;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: 420px;
}

.toast.exit {
  animation: toastOut 0.3s var(--ease) both;
}

.toast-ok     { background: var(--ok); }
.toast-warn   { background: var(--warn); }
.toast-danger { background: var(--danger); }
.toast-info   { background: var(--info); }

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
}

.toast-msg {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-20px) scale(0.96); }
}

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal-host {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-host.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: modalBgIn 0.3s ease both;
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.35s var(--ease) both;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--txt3);
  transition: all var(--dur);
}

.modal-close:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

@keyframes modalBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ══════════════════════════════════════════════
   BOTTOM TABS (Mobile)
   ══════════════════════════════════════════════ */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-h);
  background: var(--side-bg);
  border-top: 1px solid var(--side-border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  color: var(--side-txt);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur);
  border-radius: var(--radius3);
  min-width: 56px;
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

.tab-item.active {
  color: var(--teal);
}

.tab-item:hover {
  color: var(--side-txt2);
}

/* ══════════════════════════════════════════════
   SETTINGS PAGE
   ══════════════════════════════════════════════ */
.settings-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.setting-row + .setting-row {
  border-top: 1px solid var(--border);
}

.setting-label {
  font-size: 14px;
  color: var(--txt2);
}

.setting-value {
  font-size: 14px;
  color: var(--txt);
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════ */
.text-teal   { color: var(--teal); }
.text-ok     { color: var(--ok); }
.text-warn   { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-muted  { color: var(--txt3); }
.text-mono   { font-family: var(--font-mono); }
.text-en     { font-family: var(--font-en); }
.text-center { text-align: center; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ══════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .app-shell.visible {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .sidebar {
    display: none;
  }

  .bottom-tabs {
    display: flex;
  }

  .content {
    padding: 16px;
    padding-bottom: calc(var(--bottom-h) + 20px);
  }

  .topbar {
    padding: 0 16px;
  }

  .cover-banner {
    height: 180px;
    border-radius: var(--radius2);
  }

  .cover-name {
    font-size: 18px;
  }

  .cover-name-ar {
    font-size: 12px;
  }

  .cover-info {
    right: 16px;
    bottom: 14px;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .modal-box {
    max-width: 100%;
    border-radius: var(--radius2);
  }

  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .cover-banner {
    height: 150px;
  }

  .cover-name {
    font-size: 15px;
  }

  .cover-name-ar {
    display: none;
  }

  .cover-badges {
    display: none;
  }
}

/* ══════════════════════════════════════════════
   SCROLLBAR GLOBAL
   ══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}

/* ══════════════════════════════════════════════
   QUICK-ACTIONS — Dashboard
   ══════════════════════════════════════════════ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
}

.quick-action:hover {
  border-color: var(--teal-border);
  color: var(--teal);
  background: rgba(92,184,178,0.04);
}

.quick-action svg {
  width: 20px;
  height: 20px;
  color: var(--teal);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   RECENT ACTIVITY — Dashboard
   ══════════════════════════════════════════════ */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.activity-item + .activity-item {
  border-top: 1px solid var(--border);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.teal   { background: var(--teal); }
.activity-dot.ok     { background: var(--ok); }
.activity-dot.warn   { background: var(--warn); }
.activity-dot.danger { background: var(--danger); }

.activity-text {
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.5;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--txt3);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   SPLASH — Bilingual + Skip
   ══════════════════════════════════════════════ */
.splash-bilingual {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  animation: splashTextIn 0.7s var(--ease) both;
  animation-delay: 0.9s;
  opacity: 0;
}

.splash-ar {
  font-family: var(--font-ar);
  font-size: 12px;
  color: rgba(216,232,240,0.45);
}

.splash-sep {
  color: var(--teal-border);
  font-size: 14px;
}

.splash-en {
  font-family: var(--font-en);
  font-size: 11px;
  color: rgba(92,184,178,0.5);
  letter-spacing: 0.5px;
}

.splash-skip {
  position: absolute;
  bottom: 60px;
  font-family: var(--font-ar);
  font-size: 11px;
  color: rgba(255,255,255,0.12);
  letter-spacing: 1px;
  animation: splashTextIn 0.5s ease both;
  animation-delay: 1.8s;
  opacity: 0;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: linear-gradient(160deg, #060C14 0%, #0A1520 45%, #07111C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(92,184,178,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 15% 90%, rgba(45,52,54,0.10) 0%, transparent 55%);
  pointer-events: none;
}

.login-screen.exit {
  animation: loginExit 0.5s var(--ease) forwards;
}

@keyframes loginExit {
  to { opacity: 0; transform: scale(1.03); }
}

.login-card {
  position: relative;
  z-index: 1;
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow-teal);
  overflow: hidden;
  max-width: 700px;
  width: 100%;
  animation: loginCardIn 0.65s var(--ease) both;
  animation-delay: 0.15s;
  opacity: 0;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Left pane: branding ─── */
.login-left {
  width: 270px;
  flex-shrink: 0;
  background: linear-gradient(180deg,
    rgba(92,184,178,0.07) 0%,
    rgba(6,12,20,0) 100%);
  border-left: 1px solid var(--teal-border);
  padding: 44px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.login-logo-wrap {
  width: 120px;
  height: 140px;
  animation: loginLogoIn 0.8s var(--ease) both;
  animation-delay: 0.4s;
  opacity: 0;
  filter: drop-shadow(0 0 28px rgba(92,184,178,0.30));
}

@keyframes loginLogoIn {
  from { opacity: 0; transform: scale(0.82) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.login-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-clinic-name {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
  letter-spacing: 0.3px;
  margin-top: 6px;
}

.login-clinic-name-ar {
  font-family: var(--font-ar);
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
  direction: rtl;
}

.login-clinic-sub {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--teal);
  letter-spacing: 4px;
  margin-top: 2px;
  opacity: 0.85;
}

.login-divider {
  width: 36px;
  height: 1px;
  background: var(--teal-border);
  margin: 6px 0;
}

.login-powered {
  font-family: var(--font-en);
  font-size: 9px;
  color: rgba(255,255,255,0.14);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ─── Right pane: PIN ─── */
.login-right {
  flex: 1;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-greeting {
  font-family: var(--font-ar);
  font-size: 24px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 6px;
  text-align: center;
}

.login-hint {
  font-family: var(--font-ar);
  font-size: 13px;
  color: var(--txt3);
  margin-bottom: 24px;
  text-align: center;
}

/* ─── User selection cards ─── */
.user-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 18px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  position: relative;
}

.user-card:hover {
  border-color: var(--teal-border);
  background: var(--teal-dim);
}

.user-card.active {
  border-color: var(--teal);
  background: rgba(92,184,178,0.08);
  box-shadow: 0 0 0 1px rgba(92,184,178,0.20);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.ua-admin {
  background: rgba(92,184,178,0.18);
  color: var(--teal);
  font-family: var(--font-en);
  border: 1.5px solid var(--teal-border);
}

.ua-staff {
  background: rgba(74,159,216,0.15);
  color: var(--info);
  font-family: var(--font-ar);
  border: 1.5px solid var(--info-border);
}

.user-info {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.user-name-en {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
}

.user-name-ar {
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
}

.user-role-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 3px;
  font-family: var(--font-ar);
}

.role-admin {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid var(--teal-border);
}

.role-staff {
  background: var(--info-dim);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.user-check {
  font-size: 14px;
  color: var(--teal);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}

.user-card.active .user-check {
  opacity: 1;
}

/* ─── Password field ─── */
.lpass-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.lpass-input {
  width: 100%;
  padding: 12px 46px 12px 14px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--txt);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 3px;
  transition: border-color var(--dur), box-shadow var(--dur);
  direction: ltr;
  text-align: center;
}

.lpass-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.lpass-input::placeholder {
  color: var(--txt3);
  letter-spacing: normal;
  font-family: var(--font-ar);
  font-size: 13px;
}

.lpass-input.shake {
  animation: lpassShake 0.55s ease both;
}

@keyframes lpassShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.lpass-eye {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--txt3);
  transition: color var(--dur);
  padding: 4px;
}

.lpass-eye:hover {
  color: var(--teal);
}

.lpass-eye svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ─── Submit button ─── */
.login-submit-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--teal);
  color: #060C14;
  border-radius: var(--radius2);
  font-family: var(--font-ar);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
}

.login-submit-btn:hover {
  background: var(--teal2);
  box-shadow: var(--glow-sm);
  transform: translateY(-1px);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-submit-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ─── Login error ─── */
.login-error {
  height: 20px;
  font-family: var(--font-ar);
  font-size: 13px;
  color: var(--danger);
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   DENTAL CHART — خريطة الأسنان التفاعلية
   ═══════════════════════════════════════════════ */

.chart-patient-select {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-patient-select .form-input {
  max-width: 300px;
}

.chart-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 20px;
  background: var(--bg2);
  border-radius: var(--rad);
  border: 1px solid var(--teal-border);
}

.chart-patient-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
}

.chart-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--txt3);
}

.chart-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 16px;
  background: var(--bg2);
  border-radius: var(--rad);
  border: 1px solid rgba(255,255,255,0.05);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--txt3);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Chart container */
.dental-chart {
  background: var(--bg2);
  border-radius: var(--rad-lg);
  border: 1px solid var(--teal-border);
  padding: 24px 16px;
  overflow-x: auto;
}

/* Jaw */
.jaw-label {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
  padding: 8px 0;
  letter-spacing: 1px;
}

.jaw-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
}

/* Quadrant */
.quadrant {
  flex: 1;
  max-width: 380px;
}

.q-label {
  text-align: center;
  font-size: 11px;
  color: var(--txt3);
  padding: 6px 0;
  font-weight: 600;
}

.q-teeth {
  display: flex;
  justify-content: center;
  gap: 2px;
}

/* Midline */
.jaw-midline {
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--teal), transparent);
  min-height: 100px;
  margin: 0 4px;
  align-self: stretch;
}

/* Jaw divider (occlusal line) */
.jaw-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.jaw-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--teal-border), transparent);
}

.jaw-divider-label {
  font-size: 11px;
  color: var(--txt3);
  white-space: nowrap;
  font-weight: 600;
}

/* Tooth cell */
.tooth-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  min-width: 40px;
}

.tooth-cell:hover {
  background: var(--teal-dim);
  transform: scale(1.08);
}

.tooth-cell:active {
  transform: scale(0.96);
}

.tooth-cell.extracted {
  opacity: 0.4;
}

.tooth-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt3);
  margin-bottom: 2px;
  font-family: var(--font-mono);
}

/* Tooth shape */
.tooth-shape {
  position: relative;
  width: 36px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tooth-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
  transition: all 0.2s ease;
}

.tooth-cell:hover .tooth-svg {
  filter: drop-shadow(0 0 8px var(--tooth-color));
}

.tooth-status-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: var(--tooth-color);
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
}

.tooth-treatment-tag {
  font-size: 8px;
  color: var(--teal);
  margin-top: 2px;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Tooth modal preview */
.tooth-modal-preview {
  display: flex;
  justify-content: center;
  padding: 10px 0 16px;
}

/* Status grid in modal */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  font-size: 12px;
  color: var(--txt3);
  transition: all 0.2s ease;
}

.status-option:hover {
  border-color: var(--teal-border);
  background: var(--teal-dim);
}

.status-option.active {
  border-color: var(--teal);
  background: var(--teal-dim);
  color: var(--teal);
  font-weight: 700;
}

.status-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

/* Tooth history */
.tooth-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.history-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--txt3);
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-text {
  flex: 1;
}

.history-date {
  font-size: 11px;
  opacity: 0.7;
}

/* Dental chart responsive */
@media (max-width: 700px) {
  .dental-chart {
    padding: 16px 8px;
  }

  .jaw-row {
    flex-direction: column;
    align-items: center;
  }

  .jaw-midline {
    width: 80%;
    height: 1px;
    min-height: auto;
    margin: 6px 0;
    background: linear-gradient(to right, transparent, var(--teal), transparent);
  }

  .quadrant {
    max-width: 100%;
  }

  .q-teeth {
    gap: 1px;
  }

  .tooth-cell {
    min-width: 34px;
  }

  .tooth-shape {
    width: 30px;
    height: 40px;
  }

  .chart-header-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Login responsive ─── */
@media (max-width: 620px) {
  .login-card {
    flex-direction: column;
    max-width: 340px;
  }

  .login-left {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid var(--teal-border);
    padding: 22px 18px;
    flex-direction: row;
    gap: 14px;
    text-align: right;
    justify-content: flex-start;
  }

  .login-logo-wrap {
    width: 58px;
    height: 70px;
    flex-shrink: 0;
  }

  .login-divider,
  .login-powered {
    display: none;
  }

  .login-right {
    padding: 24px 18px;
  }
}

/* ══════════════════════════════════════════════
   SASKA — Floating AI Assistant
   ══════════════════════════════════════════════ */
#saskaFab {
  position: fixed;
  bottom: 90px;
  left: 20px;
  z-index: 9999;
}

@media (min-width: 769px) {
  #saskaFab { bottom: 24px; left: 24px; }
}

.saska-fab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(92,184,178,0.4), 0 0 0 0 rgba(92,184,178,0.3);
  transition: all 0.3s;
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 700;
  animation: saskaPulse 3s ease-in-out infinite;
}

@keyframes saskaPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(92,184,178,0.4), 0 0 0 0 rgba(92,184,178,0.3); }
  50% { box-shadow: 0 4px 24px rgba(92,184,178,0.4), 0 0 0 8px rgba(92,184,178,0); }
}

.saska-fab-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 32px rgba(92,184,178,0.5);
}

.saska-fab-btn.active {
  background: var(--danger);
  animation: none;
}

.saska-fab-btn.active .saska-fab-label::after { content: ' ✕'; }

.saska-fab-label {
  font-size: 13px;
}

.saska-panel {
  position: absolute;
  bottom: 64px;
  left: 0;
  width: 380px;
  max-height: 520px;
  background: var(--bg2);
  border: 1px solid var(--teal-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.6), var(--glow-teal);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.saska-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

@media (max-width: 480px) {
  .saska-panel {
    width: calc(100vw - 32px);
    left: -6px;
    max-height: 400px;
  }
}

.saska-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border2);
  background: linear-gradient(135deg, rgba(92,184,178,0.08) 0%, transparent 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}

.saska-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.saska-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  font-family: var(--font-ar);
}

.saska-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--teal3);
}

.saska-subtitle {
  font-size: 11px;
  color: var(--txt3);
}

.saska-close {
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.saska-close:hover { background: var(--danger-dim); color: var(--danger); }

.saska-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 200px;
  max-height: 360px;
}

.saska-welcome {
  text-align: center;
  padding: 24px 8px;
}

.saska-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.saska-chip {
  background: var(--teal-dim);
  border: 1px solid var(--teal-border);
  color: var(--teal3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-ar);
  cursor: pointer;
  transition: all 0.2s;
}
.saska-chip:hover {
  background: var(--teal);
  color: #fff;
}

.saska-msg {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.saska-msg-user {
  flex-direction: row-reverse;
}

.saska-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.saska-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.saska-msg-user .saska-msg-bubble {
  background: var(--teal);
  color: #fff;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}

.saska-msg-bot .saska-msg-bubble {
  background: var(--bg3);
  color: var(--teal3);
  border: 1px solid var(--border2);
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 4px;
}

.saska-loading .saska-msg-bubble {
  animation: saskaTyping 1.2s ease-in-out infinite;
}

@keyframes saskaTyping {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.saska-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border2);
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

.saska-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 10px 16px;
  color: #fff;
  font-family: var(--font-ar);
  font-size: 13px;
  outline: none;
  transition: border 0.2s;
}
.saska-input:focus { border-color: var(--teal); }
.saska-input::placeholder { color: var(--txt3); }

.saska-send-btn {
  background: var(--teal);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.saska-send-btn:hover { background: var(--teal2); transform: scale(1.05); }

/* ══════════════════════════════════════════════
   REPORTS PAGE
   ══════════════════════════════════════════════ */
.report-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.report-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--txt3);
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.report-tab:hover { color: var(--teal3); }
.report-tab.active {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(92,184,178,0.3);
}

.report-date-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.report-date-label {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--teal3);
  margin-bottom: 16px;
}

.report-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt2);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border2);
}

.report-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  margin-bottom: 16px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th {
  background: var(--bg3);
  padding: 10px 12px;
  text-align: right;
  font-weight: 700;
  color: var(--teal3);
  white-space: nowrap;
}
.report-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border2);
  color: var(--txt2);
}
.report-table tr:hover td { background: rgba(92,184,178,0.04); }

/* Bar Chart (Daily) */
.report-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  padding: 8px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 16px;
}
.bar-col {
  flex: 1;
  min-width: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-fill {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal2) 100%);
  border-radius: 4px 4px 0 0;
  text-align: center;
  font-size: 10px;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
  min-height: 0;
  transition: height 0.4s ease;
}
.bar-label {
  font-size: 10px;
  color: var(--txt3);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Horizontal Bars (Treatments & Revenue) */
.report-horizontal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.h-bar-label {
  width: 120px;
  font-size: 13px;
  color: var(--txt2);
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h-bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg3);
  border-radius: 6px;
  overflow: hidden;
}
.h-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal2) 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
}
.h-bar-fill.gold {
  background: linear-gradient(90deg, var(--warn) 0%, #e67e22 100%);
}
.h-bar-val {
  width: 70px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal3);
  flex-shrink: 0;
}

/* Collection Progress Bar */
.collection-bar {
  position: relative;
  height: 32px;
  background: var(--bg3);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.collection-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--ok) 100%);
  border-radius: 16px;
  transition: width 0.6s ease;
}
.collection-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.empty-state {
  text-align: center;
  color: var(--txt3);
  padding: 40px 16px;
  font-size: 14px;
}

/* KPI icon color helpers */
.kpi-icon.gold { color: var(--warn); background: var(--warn-dim); }
.kpi-icon.danger { color: var(--danger); background: var(--danger-dim); }

@media (max-width: 480px) {
  .h-bar-label { width: 80px; font-size: 12px; }
  .h-bar-val { width: 55px; font-size: 12px; }
  .report-bar-chart { height: 100px; }
  .bar-fill { max-width: 18px; }
}

/* ══════════════════════════════════════════════
   DOCTOR PROFILE PHOTO — Settings
   ══════════════════════════════════════════════ */
.doctor-profile-photo {
  transition: transform 0.2s, box-shadow 0.2s;
}
.doctor-profile-photo:hover {
  transform: scale(1.06);
  box-shadow: 0 0 20px var(--teal-glow);
}

/* ══════════════════════════════════════════════
   RATING STARS
   ══════════════════════════════════════════════ */
.rating-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  direction: ltr;
}
.rating-stars .star {
  transition: color 0.15s, transform 0.15s;
}
.rating-stars .star:hover {
  transform: scale(1.2);
}

/* ══════════════════════════════════════════════
   STATUS NOTE INDICATOR
   ══════════════════════════════════════════════ */
.list-rating {
  letter-spacing: 1px;
  direction: ltr;
  display: inline-block;
}
