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

:root {
  --navy: #101a2c;
  --navy-soft: #1a2740;
  --gold: #c9a45c;
  --gold-soft: #e0c48a;
  --ivory: #f7f6f2;
  --silver: #d7dee8;
  --charcoal: #17191f;
}

* { box-sizing: border-box; }
html { direction: rtl; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  color: var(--charcoal);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(201,164,92,.12), transparent 55%),
    radial-gradient(900px 400px at 0% 100%, rgba(16,26,44,.06), transparent 50%),
    var(--ivory);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 10px; padding: 0 .85rem; cursor: pointer;
  height: 40px; min-height: 40px; box-sizing: border-box;
  font-weight: 600; font-size: .88rem; line-height: 1.2; transition: .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-wa-off { opacity: .45; }
.wa-toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  z-index: 9999; min-width: 260px; max-width: min(92vw, 420px);
  padding: .7rem 1.1rem; border-radius: 12px; text-align: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: .9rem;
  box-shadow: 0 10px 28px rgba(16,26,44,.28);
  display: none !important;
  pointer-events: none;
}
.wa-toast.is-on { display: block !important; pointer-events: auto; animation: waToastIn .18s ease-out; }
@keyframes waToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.btn-primary { background: var(--navy); color: var(--ivory); }
.btn-primary:hover { background: var(--navy-soft); }
.btn-secondary { background: var(--gold); color: var(--navy); }
.btn-ghost { background: transparent; border: 1px solid var(--silver); color: var(--navy); }
.btn-danger { background: #b91c1c; color: #fff; }

.card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(215,222,232,.9);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 8px 30px rgba(16,26,44,.06);
}
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--silver); border-radius: 11px;
  padding: .45rem .85rem; background: #fff; outline: none;
  height: 40px; box-sizing: border-box; font-size: .9rem;
}
.textarea { height: auto; min-height: 96px; padding: .65rem .85rem; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,92,.25);
}
.label { display: block; margin-bottom: .4rem; font-size: .9rem; font-weight: 500; color: var(--navy); }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .2rem .65rem; font-size: .75rem; font-weight: 500; color: #fff;
}
.flash {
  margin-bottom: 1rem; padding: .75rem 1rem; border-radius: 12px;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
}
.errors { color: #b91c1c; font-size: .9rem; margin: .5rem 0; }

.admin-shell {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px 1fr;
}
.admin-main-col {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .75rem 1.25rem; background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(215,222,232,.95);
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(8px);
}
.topbar-search {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: .5rem;
  background: var(--ivory); border: 1px solid var(--silver); border-radius: 999px;
  padding: .45rem .9rem; color: rgba(23,25,31,.45);
}
.topbar-search input {
  border: 0; outline: none; background: transparent; width: 100%; color: var(--charcoal); font-size: .9rem;
}
.topbar-fx {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding: .35rem .55rem; border-radius: 14px; background: rgba(16,26,44,.04); border: 1px solid var(--silver);
}
.fx-label { font-size: .72rem; font-weight: 700; color: var(--navy); white-space: nowrap; }
.fx-pill {
  font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
  background: #fff; border: 1px solid var(--silver); color: var(--charcoal);
}
.fx-pill.buy { border-color: rgba(6,95,70,.25); background: #ecfdf5; color: #065f46; }
.fx-pill.sell { border-color: rgba(146,64,14,.25); background: #fffbeb; color: #92400e; }
.fx-pill.muted { color: rgba(23,25,31,.5); }
.topbar-profile { position: relative; }
.topbar-calc { position: relative; }
.calc-trigger {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--silver);
  background: #fff; color: var(--navy); cursor: pointer;
  display: grid; place-items: center; transition: .15s;
}
.calc-trigger:hover, .calc-trigger[aria-expanded="true"] {
  background: rgba(201,164,92,.12); border-color: rgba(201,164,92,.45); color: var(--navy);
}
.calc-panel {
  position: absolute; top: calc(100% + .45rem); left: 0; z-index: 60;
  width: 252px; background: #fff; border: 1px solid var(--silver);
  border-radius: 16px; padding: .7rem; box-shadow: 0 16px 40px rgba(16,26,44,.16);
}
.calc-display {
  background: var(--navy); color: #fff; border-radius: 12px;
  padding: .7rem .8rem; margin-bottom: .55rem; text-align: left;
  font-size: 1.35rem; font-weight: 700; min-height: 48px;
  overflow: hidden; word-break: break-all; font-variant-numeric: tabular-nums;
}
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.calc-key {
  height: 42px; border: 0; border-radius: 10px; cursor: pointer;
  background: #f3f6fa; color: var(--navy); font-weight: 700; font-size: 1rem;
  font-family: inherit;
}
.calc-key:hover { background: #e8edf4; }
.calc-key.muted { background: #e9edf3; color: rgba(23,25,31,.7); font-size: .92rem; }
.calc-key.op { background: rgba(201,164,92,.18); color: #8a6a28; }
.calc-key.op:hover { background: rgba(201,164,92,.28); }
.calc-key.eq { background: var(--navy); color: #fff; }
.calc-key.eq:hover { background: var(--navy-soft); }
.calc-key.zero { grid-column: span 2; }
.profile-btn {
  display: flex; align-items: center; gap: .55rem; border: 1px solid var(--silver);
  background: #fff; border-radius: 999px; padding: .25rem .7rem .25rem .25rem; cursor: pointer;
}
.profile-avatar {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: var(--navy); color: var(--gold); font-weight: 800;
}
.profile-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.profile-name { font-size: .82rem; font-weight: 700; color: var(--navy); }
.profile-user { font-size: .7rem; color: rgba(23,25,31,.5); }
.profile-menu {
  position: absolute; top: calc(100% + .4rem); left: 0; min-width: 200px;
  background: #fff; border: 1px solid var(--silver); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(16,26,44,.12); padding: .4rem; z-index: 50;
}
.profile-menu a, .profile-menu button {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: right; border: 0; background: transparent;
  padding: .65rem .75rem; border-radius: 10px; cursor: pointer; color: var(--navy); font-size: .9rem;
}
.profile-menu a:hover, .profile-menu button:hover { background: var(--ivory); }
.profile-menu button { color: #b91c1c; }
.profile-caret { opacity: .55; margin-right: .15rem; }
[x-cloak] { display: none !important; }
.ui-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.sidebar {
  background: linear-gradient(180deg, #13233a 0%, var(--navy) 45%, #0c1626 100%);
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: -6px 0 24px rgba(16,26,44,.16);
  scrollbar-width: thin;
  scrollbar-color: rgba(201,164,92,.35) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(201,164,92,.35); border-radius: 999px; }
.sidebar-brand {
  display: flex; gap: .65rem; align-items: center;
  padding: .85rem .9rem; border-bottom: 1px solid rgba(201,164,92,.16); flex-shrink: 0;
}
.sidebar-brand img {
  width: 38px; height: 38px; border-radius: 999px; object-fit: cover;
  box-shadow: 0 0 0 1.5px rgba(201,164,92,.65), 0 4px 10px rgba(0,0,0,.22);
}
.brand-title { font-weight: 800; font-size: .9rem; letter-spacing: .01em; line-height: 1.2; }
.brand-sub { font-size: .68rem; color: var(--gold-soft); margin-top: .05rem; }
.sidebar nav {
  padding: .55rem 0 .55rem .55rem; display: grid; gap: .15rem; flex: 1; align-content: start;
}
.sidebar a {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .55rem .4rem .65rem; border-radius: 10px 0 0 10px;
  color: rgba(247,246,242,.78); font-weight: 500; font-size: .82rem;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.sidebar a .nav-icon {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,.05); color: var(--gold-soft); flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.sidebar a .nav-icon .ui-icon { width: 15px; height: 15px; }
.sidebar a .nav-label { line-height: 1.15; white-space: nowrap; flex: 1; }
.sidebar a .nav-badge {
  margin-inline-start: auto;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--gold); color: var(--navy);
  font-size: .68rem; font-weight: 800; line-height: 1;
}
.sidebar a.active .nav-badge { background: var(--navy); color: var(--gold); }
.sidebar a:not(.active):hover {
  background: rgba(255,255,255,.06); color: #fff;
}
.sidebar a:not(.active):hover .nav-icon {
  background: rgba(201,164,92,.16); color: var(--gold);
}
.sidebar a.active {
  background: var(--gold);
  color: var(--navy); font-weight: 700;
  box-shadow: -4px 4px 14px rgba(201,164,92,.2);
}
.sidebar a.active .nav-icon {
  background: rgba(16,26,44,.1); color: var(--navy);
}
.sidebar-brand-foot {
  margin-top: auto; padding: .85rem .75rem 1rem; text-align: center; flex-shrink: 0;
  border-top: 1px solid rgba(201,164,92,.12);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.1));
}
.sidebar-brand-foot .powered-by {
  display: inline-block; font-size: .72rem; color: rgba(247,246,242,.45);
  letter-spacing: .02em; transition: color .15s;
}
.sidebar-brand-foot .powered-by span {
  color: var(--gold-soft); font-weight: 600;
}
.sidebar-brand-foot .powered-by:hover { color: rgba(247,246,242,.7); }
.sidebar-brand-foot .powered-by:hover span { color: var(--gold); }
.topbar-date {
  display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: rgba(23,25,31,.65);
  white-space: nowrap; padding: .35rem .55rem;
}
.topbar-date .ui-icon { color: var(--navy); opacity: .7; }
.app-footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1.5rem; border-top: 1px solid var(--silver); color: rgba(23,25,31,.45); font-size: .78rem;
  background: rgba(255,255,255,.65);
}
.main { padding: 1.25rem 1.5rem 1.25rem; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; color: var(--navy); font-size: 1.5rem; }
.page-head p { margin: .25rem 0 0; color: rgba(23,25,31,.65); font-size: .9rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat h3 { margin: 0; font-size: .85rem; color: rgba(23,25,31,.6); font-weight: 500; }
.stat .num { margin-top: .4rem; font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.table-wrap { overflow: auto; border-radius: 16px; border: 1px solid var(--silver); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--navy); color: var(--ivory); text-align: right; padding: .8rem .75rem; font-weight: 500; }
td { padding: .75rem; border-top: 1px solid rgba(215,222,232,.7); text-align: right; }
/* أرقام لاتينية داخل span فقط — لا تضع dir=ltr على td (يكسر محاذاة أعمدة RTL) */
.num-ltr {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  width: 100%;
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(420px, 100%); text-align: center; }
.login-card form { text-align: right; }
.login-card img { width: 84px; height: 84px; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 2px var(--gold); margin-bottom: .75rem; }

.odontogram {
  width: 100%; border: 1px solid rgba(215,222,232,.7); border-radius: 16px;
  padding: 1rem; background: linear-gradient(#fff, var(--ivory));
}
.odontogram-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-bottom: .7rem; align-items: center; }
.odontogram-title { font-weight: 800; color: var(--navy); font-size: 1rem; }
.odontogram-sub { font-size: .8rem; color: rgba(23,25,31,.55); margin-top: .1rem; }
.odontogram-view-btns { display: flex; gap: .4rem; }
.odontogram-view-btns .btn { height: 34px; min-height: 34px; padding: 0 .75rem; font-size: .82rem; }
.odontogram-quick {
  margin: 0 0 .85rem; padding: .7rem .8rem; border-radius: 12px;
  background: rgba(201,164,92,.08); border: 1px solid rgba(201,164,92,.28);
}
.odontogram-quick-label {
  font-size: .78rem; font-weight: 700; color: var(--navy); margin-bottom: .4rem;
}
.odontogram-quick-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: .45rem; align-items: center;
}
.odontogram-quick-row .input { height: 36px; min-height: 36px; }
.odontogram-quick-row .btn { height: 36px; min-height: 36px; padding: 0 .85rem; }
.arch-labels {
  display: flex; justify-content: space-between; font-size: 11px;
  color: rgba(23,25,31,.45); margin-bottom: .35rem; padding: 0 .5rem;
}
.arch-labels.below { margin: .35rem 0 0; }
.arch {
  display: flex; flex-wrap: nowrap; justify-content: space-evenly; align-items: flex-start;
  gap: .2rem; flex: 1 1 0; min-width: 0; width: 100%;
}
.arch-row {
  display: flex; flex-wrap: nowrap; justify-content: stretch; align-items: flex-start;
  gap: .35rem; width: 100%;
}
.tooth-btn {
  flex: 1 1 0; min-width: 0; max-width: 64px; width: auto;
  border: 0; background: transparent; border-radius: 10px; padding: .25rem .1rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .15rem; position: relative;
}
.tooth-btn:hover { background: rgba(215,222,232,.4); }
.tooth-btn.selected { background: rgba(16,26,44,.05); box-shadow: 0 0 0 1.5px var(--tooth-color, var(--gold)); }
.tooth-btn .tooth-media {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  width: 100%; min-height: 44px;
}
.tooth-btn.view-h .tooth-media { min-height: 78px; }
.tooth-btn.view-up .tooth-media { min-height: 44px; }
.tooth-btn .tooth-media img {
  max-width: 100%; width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.22));
  display: block;
}
.tooth-btn.view-h .tooth-media img { height: 78px; }
.tooth-btn.view-up .tooth-media img { height: 44px; width: 44px; object-fit: contain; }
.tooth-btn .tooth-tint {
  position: absolute; inset: 2px; border-radius: 8px;
  background: var(--tooth-color, var(--gold));
  opacity: .48; pointer-events: none; display: none;
}
.tooth-btn.selected .tooth-tint { display: block; }
.tooth-btn span.tooth-num { display: none; }
.tooth-btn.selected span.tooth-num { display: none; }

.invoice-case-meta { margin-bottom: 1rem; padding: .85rem 1rem; }
.invoice-case-meta .meta-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(90px, 0.85fr)) minmax(140px, 1.1fr) auto;
  gap: .55rem; align-items: end;
}
.invoice-case-meta .meta-row .label { margin-bottom: .25rem; font-size: .78rem; }
.invoice-case-meta .meta-row .input,
.invoice-case-meta .meta-row .select { height: 38px; min-height: 38px; }
.invoice-case-meta .wt-inline { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.invoice-case-meta .wt-inline-head {
  display: flex; justify-content: space-between; align-items: center; gap: .35rem;
}
.invoice-case-meta .wt-pick-panel {
  max-height: 96px; overflow: auto; margin-top: .45rem;
  border: 1px solid rgba(215,222,232,.85); border-radius: 10px; padding: .45rem;
}
.invoice-case-meta .meta-total {
  background: var(--navy); color: var(--ivory); border-radius: 10px;
  padding: .45rem .7rem; white-space: nowrap; text-align: center;
}
.invoice-case-meta .meta-total strong { display: block; font-size: 1rem; }
.invoice-case-meta .meta-total span { font-size: .68rem; opacity: .7; }
/* قائمة: مخطط عرض كامل | شبكة: مخطط ~2.5/4 + حالات ~1.5/4 جنبًا */
.invoice-case-split {
  margin-bottom: 1rem;
  width: 100%;
}
.invoice-case-split.is-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  gap: 1rem;
}
.invoice-case-split.is-grid > .invoice-odo-card {
  flex: 2.5 1 0% !important;
  width: 0 !important; /* force flex ratio over teeth intrinsic width */
  min-width: 0 !important;
  max-width: none !important;
}
.invoice-case-split.is-grid > .invoice-cases-panel {
  flex: 1.5 1 0% !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
}
.invoice-case-split.is-list > .invoice-odo-card {
  width: 100% !important;
  flex: none !important;
}
.invoice-case-split.is-grid .odontogram { overflow: hidden; }
.invoice-case-split.is-grid .tooth-btn { max-width: none; }
.invoice-case-split.is-grid .tooth-btn.view-h .tooth-media { min-height: 56px; }
.invoice-case-split.is-grid .tooth-btn.view-h .tooth-media img {
  height: auto; max-height: 56px; width: 100%; object-fit: contain;
}
.invoice-cases-panel .side-wt-grid {
  max-height: none; overflow: visible; margin: 0 0 .5rem; border: 0; padding: 0; background: transparent;
}
.invoice-cases-list-card { margin-bottom: 1rem; padding: .85rem 1rem; }
.invoice-cases-list-title {
  font-weight: 800; color: var(--navy); margin-bottom: .65rem; font-size: .95rem;
}
.invoice-cases-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .88rem; border: 1px solid rgba(215,222,232,.95); border-radius: 12px; overflow: hidden;
}
.invoice-cases-table thead th {
  background: var(--navy); color: #fff; font-weight: 700;
  padding: .65rem .75rem; text-align: right; border: 0;
}
.invoice-cases-table tbody td {
  padding: .65rem .75rem; border-bottom: 1px solid rgba(215,222,232,.85); text-align: right;
  background: #fff;
}
.invoice-cases-table tbody tr:last-child td { border-bottom: 0; }
.invoice-cases-table tr.is-active td { background: rgba(201,164,92,.14); }
.invoice-cases-table tbody tr { cursor: pointer; }
.invoice-cases-table tbody tr:hover td { background: rgba(16,26,44,.03); }
.invoice-cases-table .dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: .35rem; vertical-align: middle;
}
/* تفاصيل الفاتورة — تابات حالات + لوحة واحدة ظاهرة */
.invoice-show { display: flex; flex-direction: column; gap: 1rem; }
.invoice-case-tabs {
  display: flex; flex-wrap: wrap; gap: .55rem;
}
.invoice-case-tab {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: .55rem;
  border: 1.5px solid rgba(215,222,232,.95) !important;
  background: #fff !important;
  border-radius: 14px;
  padding: .65rem .9rem;
  cursor: pointer;
  font: inherit;
  color: var(--navy);
  transition: .15s ease;
  min-height: 52px;
  box-shadow: 0 4px 12px rgba(16,26,44,.04);
}
.invoice-case-tab:hover {
  border-color: var(--case-color, var(--gold)) !important;
  background: rgba(16,26,44,.02) !important;
}
.invoice-case-tab.is-active {
  border-color: var(--case-color, var(--gold)) !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(201,164,92,.35), 0 6px 16px rgba(16,26,44,.08);
}
.invoice-case-tab-dot {
  width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0;
  background: var(--case-color, var(--gold));
}
.invoice-case-tab-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: right; min-width: 0;
}
.invoice-case-tab-text strong { font-size: .82rem; line-height: 1.15; font-style: normal; }
.invoice-case-tab-text em {
  font-style: normal; font-size: .8rem; font-weight: 700;
  color: rgba(23,25,31,.58); max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-case-tab.is-active .invoice-case-tab-text em { color: var(--navy); }
.invoice-case-tab-price {
  margin-right: .25rem; font-size: .78rem; font-weight: 800;
  color: rgba(23,25,31,.55); white-space: nowrap;
}
.invoice-case-tab.is-active .invoice-case-tab-price { color: var(--navy); }

.invoice-case-panel { display: none !important; }
.invoice-case-panel.is-active { display: block !important; }
.invoice-case-panel[hidden] { display: none !important; }

.invoice-case-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.35fr);
  gap: 1rem;
  align-items: start;
}
.invoice-case-detail-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; margin-bottom: .85rem; flex-wrap: wrap;
}
.invoice-wt-badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .4rem .9rem; color: #fff; font-weight: 800; font-size: .9rem;
}
.invoice-case-total { color: var(--navy); font-size: 1.15rem; }
.invoice-case-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .75rem; margin-bottom: .9rem;
}
.invoice-case-meta-grid > div {
  background: var(--ivory); border: 1px solid rgba(215,222,232,.85);
  border-radius: 11px; padding: .55rem .7rem;
}
.invoice-case-meta-grid .span-2 { grid-column: 1 / -1; }
.invoice-case-meta-grid span { display: block; font-size: .72rem; color: rgba(23,25,31,.5); margin-bottom: .15rem; }
.invoice-case-meta-grid strong { color: var(--navy); font-size: .9rem; word-break: break-word; }
.invoice-teeth-names-title { font-weight: 800; color: var(--navy); margin-bottom: .5rem; font-size: .9rem; }
.invoice-tooth-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.invoice-tooth-chip {
  min-width: 2.2rem; height: 2rem; padding: 0 .55rem; border-radius: 9px;
  display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: .85rem;
  direction: ltr; unicode-bidi: isolate;
}
.invoice-lab-formula { margin-top: .65rem; font-size: .84rem; color: rgba(23,25,31,.55); }
.invoice-lab-formula strong { color: var(--navy); }
.invoice-teeth-empty { margin: 0; color: rgba(23,25,31,.45); font-size: .88rem; }
.invoice-odo-panel { min-width: 0; }
.invoice-odo-title { margin: 0 0 .75rem; color: var(--navy); font-size: 1.05rem; }
@media (max-width: 960px) {
  .invoice-case-layout { grid-template-columns: 1fr; }
  .invoice-case-tab-text em { max-width: 100px; }
  .invoice-case-tab-price { display: none; }
}
@media (max-width: 1100px) {
  .invoice-case-meta .meta-row { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
  .invoice-case-split.is-grid {
    flex-direction: column !important;
  }
  .invoice-case-split.is-grid > .invoice-odo-card,
  .invoice-case-split.is-grid > .invoice-cases-panel {
    flex: none !important;
    max-width: none !important;
    width: 100% !important;
  }
  .invoice-case-meta .meta-row { grid-template-columns: 1fr 1fr; }
}
.midline { height: 1px; margin: .85rem 0; background: linear-gradient(to left, transparent, var(--gold), transparent); }
.lab-note {
  margin-top: .85rem; padding: .6rem .8rem; border-radius: 12px;
  background: rgba(16,26,44,.03); border: 1px solid rgba(215,222,232,.8); font-size: .88rem;
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.lab-note-label { color: rgba(23,25,31,.55); }
.lab-note-sep { margin: 0 .25rem; color: rgba(23,25,31,.25); }

/* Work type picker (invoice) */
.wt-pick-head {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .45rem;
}
.wt-pick-modes { display: flex; gap: .3rem; }
.wt-pick-modes .btn { height: 32px; min-height: 32px; padding: 0 .7rem; font-size: .78rem; }
.wt-selected-chip {
  display: flex; align-items: center; gap: .45rem;
  padding: .55rem .7rem; border-radius: 11px; background: var(--ivory);
  border: 1px solid var(--silver); margin-top: .15rem;
}
.wt-selected-dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; }
.wt-selected-chip strong { color: var(--navy); font-size: .88rem; }
.wt-pick-panel {
  margin-bottom: .85rem; padding: .85rem .9rem; border-radius: 14px;
  background: linear-gradient(180deg, #f7f8fb, #eef1f6);
  border: 1px solid rgba(215,222,232,.95);
}
.wt-pick-panel-title {
  font-size: .84rem; font-weight: 800; color: var(--navy); margin-bottom: .7rem;
}
.wt-pick-cat { margin-bottom: .75rem; }
.wt-pick-cat:last-child { margin-bottom: 0; }
.wt-pick-cat-name {
  font-size: .74rem; font-weight: 700; color: rgba(23,25,31,.5);
  margin-bottom: .4rem;
}
.wt-pick-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .4rem;
}
.wt-pick-btn {
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: .65rem .7rem; cursor: pointer;
  color: #fff; text-align: center;
  font: inherit; font-weight: 700; font-size: .82rem; line-height: 1.25;
  box-shadow: 0 2px 8px rgba(16,26,44,.1);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  min-height: 42px;
}
.wt-pick-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.wt-pick-btn.is-active {
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(16,26,44,.35), 0 4px 10px rgba(16,26,44,.12);
  transform: translateY(-1px);
}
@media (min-width: 961px) {
  .wt-pick-btn.is-active {
    box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 0 0 2px rgba(16,26,44,.28), 0 3px 8px rgba(16,26,44,.1);
  }
  .odontogram { border-color: rgba(215,222,232,.55); }
  .tooth-btn.selected { box-shadow: 0 0 0 1.25px var(--tooth-color, var(--gold)); }
}
.doctor-top { background: linear-gradient(90deg, #13233a, var(--navy)); color: var(--ivory); }
.doctor-top .inner { max-width: 960px; margin: 0 auto; padding: 1rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; }
.doctor-top nav { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.doctor-top a, .doctor-top button {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--ivory); background: transparent; border: 0; border-radius: 12px; padding: .5rem .8rem; cursor: pointer;
}
.doctor-top a.active { background: var(--gold); color: var(--navy); font-weight: 700; }
.doctor-main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; }

/* Home dashboard */
.dash-currency-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1rem;
}
.dash-currency-pill {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem .45rem .4rem .85rem;
  background: #fff;
  border: 1px solid rgba(215,222,232,.95);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(16,26,44,.06);
}
.dash-currency-label {
  font-weight: 800;
  color: var(--navy);
  font-size: .84rem;
  white-space: nowrap;
  line-height: 1;
}
.currency-switch {
  display: inline-flex;
  align-items: center;
  padding: .18rem;
  gap: .15rem;
  background: var(--ivory);
  border-radius: 999px;
}
.currency-switch-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  outline: 0;
  box-shadow: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  min-width: 52px;
  height: 32px;
  min-height: 32px;
  line-height: 1;
  border-radius: 999px;
  padding: 0 .85rem;
  font-weight: 800;
  font-size: .88rem;
  color: rgba(23,25,31,.5);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.currency-switch-btn:hover { color: var(--navy); }
.currency-switch-btn.is-on {
  background: var(--navy) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(16,26,44,.2);
}
.stat-value.is-unpaid { color: #b91c1c !important; }
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card {
  background: #fff; border: 1px solid rgba(215,222,232,.9); border-radius: 16px; padding: 1rem 1.1rem;
  display: flex; gap: .85rem; align-items: flex-start; box-shadow: 0 8px 24px rgba(16,26,44,.05);
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-weight: 800; flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(145deg, #e8f1fb, #d7e7f8); color: #1f4e79; }
.stat-icon.green { background: linear-gradient(145deg, #e8f7ef, #d4f0e0); color: #1f7a4d; }
.stat-icon.amber { background: linear-gradient(145deg, #fff4e5, #ffe8c4); color: #b86e00; }
.stat-icon.navy { background: linear-gradient(145deg, #e9edf5, #dce3ef); color: var(--navy); }
.stat-label { font-size: .8rem; color: rgba(23,25,31,.55); margin-bottom: .2rem; }
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.15; }
.stat-sub { font-size: .78rem; color: rgba(23,25,31,.55); margin-top: .2rem; }
.stat-change { font-size: .75rem; margin-top: .25rem; font-weight: 700; }
.stat-change.up { color: #1f7a4d; }
.quick-ops { margin-bottom: 1rem; }
.section-title { margin: 0 0 .85rem; color: var(--navy); font-size: 1.05rem; font-weight: 800; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.section-head .section-title { margin: 0; }
.link-more { font-size: .85rem; color: #1f4e79; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; }
.quick-btn {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  text-align: center; padding: 1rem; border-radius: 14px; font-weight: 700; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.quick-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,26,44,.1); }
.quick-btn.soft { background: #eef4fb; color: #1f4e79; border-color: #d5e4f5; }
.quick-btn.blue { background: #1f4e79; color: #fff; }
.quick-btn.gold { background: var(--gold); color: var(--navy); }
.quick-btn.navy { background: var(--navy); color: #fff; }
.home-charts { display: grid; grid-template-columns: 1.4fr .8fr; gap: 1rem; margin-bottom: 1rem; }
.chart-card { min-height: 280px; }
.donut-wrap { position: relative; max-width: 260px; margin: 0 auto; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none;
}
.donut-center strong { font-size: 1.6rem; color: var(--navy); line-height: 1; }
.donut-center span { font-size: .8rem; color: rgba(23,25,31,.5); }
.home-bottom { display: grid; grid-template-columns: 1.45fr .85fr; gap: 1rem; }
.home-side-stack { display: grid; gap: 1rem; align-content: start; }
.table-wrap.flat { border: 0; border-radius: 0; box-shadow: none; }
.table-wrap.flat th { background: #f3f6fa; color: var(--navy); font-size: .8rem; }
.status-pill { display: inline-flex; border-radius: 999px; padding: .15rem .55rem; font-size: .72rem; font-weight: 700; }
.st-blue { background: #e8f1fb; color: #1f4e79; }
.st-gold { background: #f7efd9; color: #8a6a28; }
.st-green { background: #ecfdf5; color: #065f46; }
.st-red { background: #fef2f2; color: #b91c1c; }
.drive-status-card {
  display: flex; align-items: flex-start; gap: .75rem;
  margin-bottom: 1rem; padding: .85rem 1rem; border-radius: 14px;
  border: 1px solid rgba(215,222,232,.9); background: #f8fafc;
}
.drive-status-card.is-live { background: #ecfdf5; border-color: #a7f3d0; }
.drive-status-card.is-warn { background: #fffbeb; border-color: #fde68a; }
.drive-status-card.is-off { background: #f8fafc; border-color: rgba(215,222,232,.9); }
.drive-status-dot {
  width: 12px; height: 12px; border-radius: 999px; margin-top: .35rem; flex-shrink: 0;
  background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.2);
}
.drive-status-card.is-live .drive-status-dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.22); }
.drive-status-card.is-warn .drive-status-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
.drive-status-card strong { display: block; color: var(--navy); font-size: .95rem; }
.drive-status-card small { display: block; margin-top: .2rem; color: rgba(23,25,31,.55); font-size: .82rem; line-height: 1.45; }
.bars { display: grid; gap: .65rem; }
.bar-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; align-items: center; }
.bar-label { font-size: .82rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #1f4e79, #3b82a0); border-radius: 999px; }
.bar-num { font-size: .8rem; font-weight: 700; color: var(--navy); min-width: 1.5rem; text-align: left; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.mini-list li { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; padding: .35rem 0; border-bottom: 1px dashed rgba(215,222,232,.8); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-left: .4rem; }
.muted { color: rgba(23,25,31,.5); font-size: .85rem; }

/* Doctors pages */
.doctors-page-head { margin-bottom: .9rem; }
.page-head-with-art { display: flex; align-items: center; gap: .7rem; }
.page-art-avatar {
  width: 44px; height: 44px; border-radius: 999px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(201,164,92,.4), 0 6px 14px rgba(16,26,44,.08);
  background: #f3f5f8;
}
.page-art-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(201,164,92,.2), rgba(16,26,44,.06));
  color: var(--navy); box-shadow: 0 0 0 1px rgba(201,164,92,.3);
}
.doctors-page-head h1 { font-size: 1.35rem; line-height: 1.2; }
.doctors-page-head p { font-size: .82rem; margin-top: .15rem; }
.btn-page-action { height: 36px; padding: 0 .9rem; border-radius: 10px; }

.doctors-toolbar, .list-toolbar {
  margin-bottom: 1rem; padding: .7rem .8rem;
  border-radius: 14px;
}
.doctors-toolbar-form, .list-toolbar-form {
  display: flex; gap: .55rem; align-items: center;
}
.doctors-search-field, .list-search-field {
  flex: 1; min-width: 0; height: 40px;
  display: flex; align-items: center; gap: .45rem;
  background: #f4f6f9; border: 1px solid #e2e8f0; border-radius: 11px;
  padding: 0 .8rem; color: rgba(23,25,31,.4);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.doctors-search-field:focus-within, .list-search-field:focus-within {
  border-color: rgba(201,164,92,.7);
  box-shadow: 0 0 0 3px rgba(201,164,92,.18);
  background: #fff;
}
.doctors-search-field .field-icon, .list-search-field .field-icon {
  display: grid; place-items: center; color: rgba(16,26,44,.4);
}
.doctors-search-field .input, .list-search-field .input {
  border: 0; background: transparent; box-shadow: none;
  height: 100%; padding: 0; font-size: .9rem;
}
.list-date-field { width: 180px; flex-shrink: 0; }
.list-date-field .input { height: 40px; }
.list-toolbar { display: grid; gap: .55rem; }
.wt-rate-hint {
  font-size: .78rem; color: rgba(23,25,31,.55);
  padding: .15rem .15rem 0;
}
.wt-rate-hint strong { color: var(--navy); }
.wt-table .wt-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-left: .4rem;
}
.wt-table .wt-name { color: var(--navy); font-weight: 700; }
.price-input {
  width: 110px; height: 34px !important; min-height: 34px !important;
  padding: 0 .5rem !important; font-size: .84rem; border-radius: 9px;
}
.price-input.is-saving { opacity: .65; }
.price-input.is-saved {
  border-color: #86efac; box-shadow: 0 0 0 2px rgba(34,197,94,.2);
}
.doctors-toolbar-actions {
  display: flex; align-items: center; gap: .4rem; flex-shrink: 0;
}
.btn-tool {
  height: 40px; min-height: 40px; min-width: 40px; padding: 0;
  border-radius: 11px; background: var(--navy); color: #fff;
  box-shadow: 0 2px 8px rgba(16,26,44,.12);
  box-sizing: border-box;
}
.btn-tool:hover { background: var(--navy-soft); }
.btn-tool.is-on {
  background: var(--gold); color: var(--navy);
  box-shadow: 0 0 0 2px rgba(201,164,92,.3);
}
.btn-tool-label { padding: 0 .85rem; gap: .35rem; font-size: .86rem; }
.btn-tool-label .caret { opacity: .7; margin-inline-start: .05rem; }
.export-wrap { position: relative; }
.export-menu {
  position: absolute; top: calc(100% + .4rem); left: 0; min-width: 150px; z-index: 30;
  background: #fff; border: 1px solid var(--silver); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(16,26,44,.12); padding: .3rem; display: grid; gap: .1rem;
}
.export-menu a {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .65rem; border-radius: 9px; color: var(--navy); font-size: .86rem; font-weight: 600;
}
.export-menu a:hover { background: var(--ivory); }
.doctors-filter-panel {
  margin-top: .7rem; padding-top: .7rem; border-top: 1px solid rgba(215,222,232,.9);
}
.doctors-filter-grid {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: .7rem; align-items: end;
}
.doctors-filter-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.ui-icon { shape-rendering: geometricPrecision; }
.doctors-table-wrap { background: #fff; }
.doctors-table {
  font-size: .88rem;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.doctors-table th,
.doctors-table td {
  vertical-align: middle;
  text-align: right;
  padding: .75rem .7rem;
  box-sizing: border-box;
}
.doctors-table th { font-size: .78rem; white-space: nowrap; }
.doctors-table th:nth-child(1),
.doctors-table td:nth-child(1) { width: 22%; }
.doctors-table th:nth-child(2),
.doctors-table td:nth-child(2),
.doctors-table th:nth-child(3),
.doctors-table td:nth-child(3) { width: 13%; }
.doctors-table th:nth-child(4),
.doctors-table td:nth-child(4) { width: 14%; }
.doctors-table th:nth-child(5),
.doctors-table td:nth-child(5) { width: 10%; }
.doctors-table th:nth-child(6),
.doctors-table td:nth-child(6) { width: 12%; }
.doctors-table th:nth-child(7),
.doctors-table td:nth-child(7) { width: 16%; }
.doctor-row { cursor: pointer; transition: background .12s ease; }
.doctor-row:hover { background: rgba(201,164,92,.08); }
.doctor-row-id { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.doctor-row-avatar {
  width: 36px; height: 36px; border-radius: 999px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(201,164,92,.4);
}
.doctor-row-id strong {
  color: var(--navy); font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.col-actions { white-space: nowrap; }
.row-actions { display: flex; gap: .3rem; align-items: center; justify-content: flex-end; }
.btn-row { padding: .28rem .55rem; font-size: .75rem; border-radius: 8px; height: auto; }
.btn-icon-only {
  width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 9px;
  display: inline-grid; place-items: center;
}
.btn-page-action { height: 36px; min-height: 36px; }
.doctor-status {
  font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .18rem .55rem; white-space: nowrap;
}
.doctor-status.is-active { background: #ecfdf5; color: #065f46; }
.doctor-status.is-suspended { background: #fef2f2; color: #991b1b; }
.doctor-row-balance { display: flex; flex-direction: column; gap: .12rem; line-height: 1.25; }
.doctor-row-balance .bal-syp { font-weight: 800; font-size: .84rem; color: #101a2c; white-space: nowrap; }
.doctor-row-balance .bal-usd { font-weight: 800; font-size: .84rem; color: #0f766e; white-space: nowrap; }
.doctors-empty {
  text-align: center; padding: 2rem 1rem;
  display: grid; place-items: center; gap: .45rem;
}
.doctors-empty.inline { padding: 1.5rem .5rem; }
.doctors-empty-cell { background: #fff; }
.doctors-empty p { margin: 0 0 .35rem; color: rgba(23,25,31,.55); font-size: .88rem; }

.doctor-show-actions {
  display: flex; gap: .4rem; flex-wrap: nowrap; align-items: center;
  margin-bottom: .75rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: .15rem;
}
.doctor-show-actions-main {
  display: flex; gap: .4rem; flex-wrap: nowrap; align-items: center; flex: 1; min-width: 0;
}
.doctor-show-actions > .btn,
.doctor-show-actions-main > .btn,
.doctor-show-actions-main > form,
.doctor-show-actions-main > div {
  flex-shrink: 0;
}
.doctor-show-actions .btn,
.doctor-show-actions-main .btn {
  height: 36px; min-height: 36px; box-sizing: border-box;
  padding-top: 0; padding-bottom: 0; border-radius: 10px;
}
.doctor-show-actions .btn-icon-only,
.doctor-show-actions-main .btn-icon-only {
  width: 36px; height: 36px; min-height: 36px; padding: 0;
}
.doctor-info-card {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: center; margin-bottom: .7rem; padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #fff 55%, rgba(201,164,92,.08));
}
.doctor-info-main { display: flex; gap: .85rem; align-items: flex-start; min-width: 0; flex: 1; }
.doctor-info-avatar {
  width: 68px; height: 68px; border-radius: 999px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(201,164,92,.45), 0 8px 18px rgba(16,26,44,.08);
}
.doctor-info-card h1 { margin: 0; font-size: 1.3rem; color: var(--navy); }
.doctor-info-grid {
  display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: .45rem; margin-top: .7rem;
}
.info-chip {
  display: flex; gap: .45rem; align-items: flex-start;
  background: rgba(255,255,255,.85); border: 1px solid rgba(215,222,232,.9);
  border-radius: 11px; padding: .45rem .55rem; color: rgba(16,26,44,.45);
}
.info-chip span { display: block; font-size: .7rem; color: rgba(23,25,31,.5); line-height: 1.2; }
.info-chip strong { font-size: .86rem; color: var(--navy); font-weight: 700; }
.doctor-balance-pills { display: flex; gap: .5rem; flex-wrap: wrap; }
.balance-pill {
  border-radius: 14px; padding: .65rem .9rem; min-width: 128px;
  border: 1px solid transparent;
}
.balance-pill.syp { background: #f3f6fa; border-color: #dce3ef; }
.balance-pill.usd { background: #ecfdf5; border-color: #c6f0d8; }
.balance-pill span { display: block; font-size: .72rem; color: rgba(23,25,31,.5); margin-bottom: .15rem; }
.balance-pill strong { color: var(--navy); font-size: 1rem; }
.doctor-filters-card { margin-bottom: .7rem; padding: .8rem 1rem; }
.filters-title {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .84rem; font-weight: 700; color: var(--navy); margin-bottom: .65rem;
}
.doctor-filters-form {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) auto; gap: .6rem; align-items: end;
}
.doctor-filters-form .label { font-size: .78rem; margin-bottom: .25rem; }
.doctor-filters-form .input,
.doctor-filters-form .select { height: 40px; padding: .4rem .7rem; font-size: .86rem; }
.doctor-filters-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.doctor-show-panels { display: grid; gap: .7rem; }
.panel-card { padding: .95rem 1rem 1rem; }
.panel-card .section-title {
  display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: 1rem;
}
.count-badge {
  min-width: 26px; height: 26px; border-radius: 999px; padding: 0 .5rem;
  display: inline-grid; place-items: center;
  background: rgba(16,26,44,.06); color: var(--navy); font-size: .78rem; font-weight: 800;
}
.unpaid-amount { color: #b91c1c !important; font-weight: 800; }
.empty-state {
  text-align: center; padding: 1.6rem 1rem 1.35rem;
  color: rgba(16,26,44,.35); display: grid; place-items: center; gap: .35rem;
}
.empty-state strong { color: var(--navy); font-size: .95rem; }
.empty-state p { margin: 0 0 .35rem; font-size: .84rem; color: rgba(23,25,31,.5); }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(201,164,92,.07); }

/* Credentials success */
.cred-page { display: grid; place-items: start center; padding-top: .25rem; }
.cred-card {
  width: min(560px, 100%); background: #fff; border: 1px solid rgba(215,222,232,.95);
  border-radius: 18px; padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 0 12px 36px rgba(16,26,44,.08);
}
.cred-hero { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.cred-avatar {
  width: 64px; height: 64px; border-radius: 999px; object-fit: cover;
  box-shadow: 0 0 0 2px rgba(201,164,92,.45);
}
.cred-ok {
  display: inline-flex; align-items: center; gap: .3rem;
  background: #ecfdf5; color: #065f46; border-radius: 999px;
  padding: .15rem .55rem; font-size: .72rem; font-weight: 700; margin-bottom: .25rem;
}
.cred-hero h1 { margin: 0; font-size: 1.2rem; color: var(--navy); }
.cred-hero p { margin: .2rem 0 0; font-size: .82rem; color: rgba(23,25,31,.55); }
.cred-box {
  background: linear-gradient(160deg, #13233a, var(--navy));
  color: var(--ivory); border-radius: 14px; padding: 1rem 1.05rem;
}
.cred-line { font-size: .9rem; line-height: 1.65; opacity: .92; }
.cred-creds {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .85rem;
}
.cred-creds > div {
  background: rgba(255,255,255,.08); border: 1px solid rgba(201,164,92,.25);
  border-radius: 11px; padding: .55rem .65rem;
}
.cred-creds span { display: block; font-size: .72rem; color: var(--gold-soft); margin-bottom: .15rem; }
.cred-creds strong {
  font-size: 1.05rem; letter-spacing: .03em;
  user-select: all; -webkit-user-select: all;
  cursor: text; display: inline-block; max-width: 100%;
  word-break: break-all;
}
.cred-creds .cred-pass-clear {
  background: rgba(201,164,92,.95); color: var(--navy);
  border-radius: 8px; padding: .35rem .55rem; margin-top: .15rem;
  font-size: 1.15rem; font-weight: 800; letter-spacing: .04em;
  user-select: all; -webkit-user-select: all; cursor: text;
  display: inline-block; direction: ltr;
}
.cred-field-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; }
.cred-copy-mini {
  width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px;
  border: 1px solid rgba(201,164,92,.35); background: rgba(255,255,255,.08);
  color: var(--gold-soft); cursor: pointer; display: grid; place-items: center;
}
.cred-copy-mini:hover { background: rgba(255,255,255,.14); }
.cred-hidden { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.cred-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 1rem; }
.cred-modal-dialog { width: min(520px, 100%); }
.cred-modal-dialog .cred-box { margin-bottom: .15rem; }
.cred-modal-dialog .cred-ok { margin-bottom: .35rem; }

.doctor-form-card { max-width: 680px; }
.doctor-form-hero {
  display: flex; align-items: center; gap: .85rem; margin-bottom: 1.15rem;
  padding: .8rem .95rem; border-radius: 14px;
  background: linear-gradient(120deg, rgba(201,164,92,.12), rgba(16,26,44,.04));
  border: 1px solid rgba(201,164,92,.2);
}
.doctor-form-avatar {
  width: 58px; height: 58px; border-radius: 999px; object-fit: cover;
  box-shadow: 0 0 0 2px rgba(201,164,92,.4);
}
.doctor-form-hero strong { display: block; color: var(--navy); font-size: .98rem; }
.doctor-form-hero span { font-size: .78rem; color: rgba(23,25,31,.55); }
.phone-dial-row {
  display: flex;
  gap: .45rem;
  align-items: stretch;
  direction: ltr;
}
.phone-dial-cc {
  flex: 0 0 9.5rem;
  max-width: 42%;
  padding-inline: .45rem;
  font-size: .82rem;
}
.phone-dial-num {
  flex: 1 1 auto;
  min-width: 0;
}
.doctor-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem;
}
.doctor-form-grid .span-2 { grid-column: 1 / -1; }
.doctor-form-grid .label { margin-bottom: .3rem; }
.label-optional { color: rgba(23,25,31,.45); font-weight: 500; font-size: .8rem; }
.doctor-form-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 1.1rem; }

.doctor-profile-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: flex-start; margin-bottom: 1.15rem;
}
.doctor-profile-identity { display: flex; gap: .9rem; align-items: center; }
.doctor-profile-title-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.doctor-profile-title-row h1 { margin: 0; color: var(--navy); font-size: 1.45rem; }
.doctor-profile-identity p {
  margin: .35rem 0 0; color: rgba(23,25,31,.55); font-size: .85rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
}
.doctor-profile-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.doctor-month-row {
  display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: center;
  padding: .8rem .9rem; margin-bottom: .5rem; border-radius: 12px;
  border: 1px solid var(--silver); background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.doctor-month-row:hover { border-color: rgba(201,164,92,.5); background: rgba(201,164,92,.06); }
.doctor-month-sub { font-size: .8rem; color: rgba(23,25,31,.55); margin-top: .25rem; }
.doctor-month-totals { font-size: .85rem; text-align: left; color: var(--navy); font-weight: 600; }

/* Modal dialog */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(16,26,44,.48);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 1rem;
}
.modal-dialog {
  width: min(520px, 100%);
  background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(16,26,44,.28);
  border: 1px solid rgba(215,222,232,.9);
  max-height: calc(100vh - 2rem); overflow: auto;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem;
  padding: 1rem 1.1rem .85rem;
  border-bottom: 1px solid rgba(215,222,232,.85);
  background: linear-gradient(120deg, rgba(201,164,92,.12), rgba(16,26,44,.03));
}
.modal-head-art { display: flex; align-items: center; gap: .7rem; }
.modal-head-art img {
  width: 48px; height: 48px; border-radius: 999px; object-fit: cover;
  box-shadow: 0 0 0 2px rgba(201,164,92,.4);
}
.modal-head h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.modal-head p { margin: .15rem 0 0; font-size: .78rem; color: rgba(23,25,31,.55); }
.modal-close {
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: rgba(16,26,44,.06); color: var(--navy); cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.modal-close:hover { background: rgba(16,26,44,.1); }
.modal-body { padding: 1rem 1.1rem 1.15rem; }
.modal-actions {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.05rem;
  padding-top: .9rem; border-top: 1px solid rgba(215,222,232,.85);
}

@media (max-width: 1100px) {
  .home-stats, .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .home-charts, .home-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar, .admin-main-col {
    height: auto;
    overflow: visible;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .profile-meta { display: none; }
  .topbar-fx .fx-label { display: none; }
  .topbar-date { display: none; }
  .home-stats, .quick-grid { grid-template-columns: 1fr; }
  .doctor-form-grid, .doctors-filter-grid, .doctor-filters-form, .doctor-info-grid, .cred-creds { grid-template-columns: 1fr; }
  .doctors-toolbar-form, .list-toolbar-form { flex-direction: column; align-items: stretch; }
  .doctors-toolbar-actions { width: 100%; }
  .list-date-field { width: 100%; }
  .btn-tool-label { flex: 1; }
  .row-actions { flex-wrap: wrap; }
  .odontogram-quick-row { grid-template-columns: 1fr; }
  .odontogram-quick-row .btn { width: 100%; }
  .wt-pick-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}

.payments-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .payments-filter-grid { grid-template-columns: 1fr; }
}
.pager {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  margin-top: 1rem; flex-wrap: wrap;
}
.pager-meta { font-size: .85rem; color: rgba(23,25,31,.55); font-weight: 600; }

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.settings-nav {
  padding: .65rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  position: sticky;
  top: .5rem;
}
.settings-nav-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem .75rem;
  border-radius: 12px;
  color: var(--navy);
  transition: .15s;
}
.settings-nav-item small {
  display: block;
  margin-top: .15rem;
  font-size: .72rem;
  color: rgba(23,25,31,.5);
  font-weight: 500;
}
.settings-nav-item strong {
  font-size: .9rem;
  font-weight: 700;
}
.settings-nav-item:hover { background: rgba(16,26,44,.04); }
.settings-nav-item.active {
  background: rgba(16,26,44,.08);
  box-shadow: inset -3px 0 0 var(--gold);
}
.settings-nav-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(201,164,92,.14); color: var(--navy); flex-shrink: 0;
}
.settings-panel { min-width: 0; }
.settings-panel-head { margin-bottom: 1.1rem; }
.settings-panel-head h2 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.settings-panel-head p { margin: .25rem 0 0; color: rgba(23,25,31,.55); font-size: .86rem; }
.settings-form .field { margin-bottom: 1rem; }
.settings-form .grid { margin-bottom: 0; }
.settings-form .grid .field { margin-bottom: 1rem; }
.check-row {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-bottom: 1rem; font-weight: 600; color: var(--navy); cursor: pointer;
}
.check-row input { width: 1rem; height: 1rem; accent-color: var(--navy); }
.settings-divider {
  height: 1px; margin: 1.4rem 0 1.1rem;
  background: linear-gradient(to left, transparent, var(--silver), transparent);
}
.settings-qr-preview {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: .65rem; padding: .65rem; border-radius: 12px;
  background: rgba(16,26,44,.03); border: 1px solid var(--silver);
}
.settings-qr-preview img {
  width: 96px; height: 96px; object-fit: contain; border-radius: 8px; background: #fff;
}
.settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
