/* ------------------------------------------------------------------
   Digident — dental clinic mini ERP
   Persian / RTL design system
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Sahel";
  src: url("../fonts/Sahel-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sahel";
  src: url("../fonts/Sahel.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sahel";
  src: url("../fonts/Sahel-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sahel";
  src: url("../fonts/Sahel-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sahel";
  src: url("../fonts/Sahel-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand (from logo) */
  --navy-900: #16293c;
  --navy-800: #1e3d5a;
  --navy-700: #244a6b;
  --navy-600: #2e5a80;
  --sky-600: #2e93c4;
  --sky-500: #58c0e4;
  --sky-100: #e5f6fb;
  --sky-50: #f1fafd;

  /* Neutrals */
  --white: #ffffff;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e3e9f0;
  --border-strong: #cfd9e4;
  --ink: #1c2b3a;
  --ink-soft: #4a5c6e;
  --muted: #7b8a9a;
  --muted-2: #9aa8b6;

  /* Semantic */
  --green-600: #178f5f;
  --green-50: #e8f8f0;
  --green-100: #d2f0e1;
  --amber-600: #b7791f;
  --amber-50: #fdf5e6;
  --amber-100: #fbeac7;
  --red-600: #cb3b3b;
  --red-50: #fdeeee;
  --red-100: #fadada;
  --blue-50: var(--sky-50);
  --primary: var(--navy-700);
  --primary-strong: var(--navy-800);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(22, 41, 60, 0.06);
  --shadow: 0 4px 14px rgba(22, 41, 60, 0.07);
  --shadow-lg: 0 18px 50px rgba(16, 33, 49, 0.18);
  --shadow-drawer: -20px 0 60px rgba(16, 33, 49, 0.2);

  --sidebar: 232px;
  --topbar-h: 64px;

  --font: "Sahel", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, dl, dd, figure {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--navy-700);
  text-decoration: none;
}

a:hover {
  color: var(--sky-600);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--sky-100);
  color: var(--navy-800);
}

:focus-visible {
  outline: 2px solid var(--sky-600);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #c4d1de transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  background: #c4d1de;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #a9bacb;
  background-clip: padding-box;
}

/* ------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  inset-inline-start: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--navy-800);
  color: #fff;
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.text-muted {
  color: var(--muted) !important;
}

.text-success {
  color: var(--green-600) !important;
}

.text-danger {
  color: var(--red-600) !important;
}

.num {
  font-variant-numeric: tabular-nums;
  unicode-bidi: plaintext;
  letter-spacing: 0.01em;
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.money small {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--muted);
}

.link-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sky-600);
  white-space: nowrap;
}

.link-sm:hover {
  color: var(--navy-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-sm .icon {
  width: 14px;
  height: 14px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.req {
  color: var(--red-600);
  margin-inline-start: 4px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.app {
  background:
    radial-gradient(1100px 420px at 100% -180px, rgba(88, 192, 228, 0.16), transparent 70%),
    var(--bg);
}

/* Sidebar ---------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: rgba(255, 255, 255, 0.76);
  overflow-y: auto;
  z-index: 60;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  min-width: 0;
}

.brand:hover {
  color: #fff;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: none;
  padding: 4px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar .icon-btn {
  color: rgba(255, 255, 255, 0.7);
  border-color: transparent;
}

.sidebar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar .sidebar-close {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 10px;
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .icon {
  width: 19px;
  height: 19px;
  opacity: 0.86;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(88, 192, 228, 0.18);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(88, 192, 228, 0.28);
}

.nav-item.is-active .icon {
  color: var(--sky-500);
  opacity: 1;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: var(--sky-500);
}

.nav-item--muted {
  font-size: 13px;
  opacity: 0.86;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.sidebar-user-text strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-text small {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-user form {
  margin: 0;
}

.sidebar-scrim {
  display: none;
}

/* Main ------------------------------------------------------------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar-h);
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar .menu-btn {
  display: none;
}

.global-search {
  position: relative;
  flex: 1;
  max-width: 460px;
}

.global-search .icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  padding-inline-start: 38px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-muted);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.global-search input::placeholder {
  color: var(--muted-2);
}

.global-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--sky-500);
  box-shadow: 0 0 0 4px rgba(88, 192, 228, 0.16);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-inline-start: auto;
}

.topbar-date {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-divider {
  width: 1px;
  height: 26px;
  background: var(--border);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1.3;
}

.topbar-user strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.topbar-user small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}

.content {
  padding: 24px 26px 48px;
  flex: 1;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------------------------------------------
   Avatars, icon buttons, buttons
   ------------------------------------------------------------------ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--sky-100), #d7ecf7);
  color: var(--navy-700);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.avatar--xs {
  width: 29px;
  height: 29px;
  font-size: 12px;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.topbar-user .avatar--sm {
  background: linear-gradient(140deg, var(--sky-100), #d7ecf7);
  color: var(--navy-700);
}

.avatar--lg {
  width: 58px;
  height: 58px;
  font-size: 23px;
  background: linear-gradient(140deg, #dff2fa, #cde9f6);
  box-shadow: inset 0 0 0 1px rgba(46, 147, 196, 0.16);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--navy-700);
}

.icon-btn--danger:hover {
  background: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-600);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.06s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  color: #fff;
  box-shadow: 0 2px 6px rgba(36, 74, 107, 0.24);
}

.btn--primary:hover {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  color: #fff;
  box-shadow: 0 4px 12px rgba(36, 74, 107, 0.28);
}

.btn--secondary {
  background: var(--sky-50);
  border-color: #cbe8f4;
  color: var(--navy-700);
}

.btn--secondary:hover {
  background: var(--sky-100);
  border-color: var(--sky-500);
  color: var(--navy-800);
}

.btn--ghost {
  background: var(--white);
  border-color: var(--border);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--navy-700);
}

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

.btn--danger:hover {
  background: #b32f2f;
  color: #fff;
}

.btn--danger-ghost {
  background: transparent;
  border-color: var(--red-100);
  color: var(--red-600);
}

.btn--danger-ghost:hover {
  background: var(--red-50);
  color: #b32f2f;
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Page header
   ------------------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--navy-900);
  line-height: 1.4;
}

.page-title > p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   Panels
   ------------------------------------------------------------------ */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}

.panel--flush {
  padding: 0;
}

.panel--tinted {
  background: linear-gradient(180deg, #fff, var(--sky-50));
}

.panel--inset {
  background: var(--surface-muted);
  border-style: dashed;
  box-shadow: none;
  padding: 14px;
  border-radius: var(--radius);
}

.panel--sticky {
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
}

.panel--toolbar {
  padding: 0;
  box-shadow: none;
  background: transparent;
  border: 0;
  overflow: visible;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy-900);
}

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

.panel-mini-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.panel-head > .btn,
.panel-head > a.btn {
  flex: none;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--amber-50);
  color: var(--amber-600);
  font-size: 11.5px;
  font-weight: 700;
}

/* ------------------------------------------------------------------
   Stats
   ------------------------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  min-width: 0;
}

a.stat-card:hover {
  border-color: #c3e3f0;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  color: inherit;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: var(--sky-50);
  color: var(--sky-600);
}

.stat-icon .icon {
  width: 21px;
  height: 21px;
}

.stat-icon--sky {
  background: var(--sky-50);
  color: var(--sky-600);
}

.stat-icon--navy {
  background: #eaf0f6;
  color: var(--navy-700);
}

.stat-icon--green {
  background: var(--green-50);
  color: var(--green-600);
}

.stat-icon--amber {
  background: var(--amber-50);
  color: var(--amber-600);
}

.stat-icon--muted {
  background: var(--surface-muted);
  color: var(--muted);
}

.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.stat-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}

.stat-value--money {
  font-size: 19px;
}

.stat-value small {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--muted);
}

.stat-body small {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 1px;
}

/* ------------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------------ */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.alert-list {
  display: flex;
  flex-direction: column;
}

.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  transition: background 0.15s ease;
}

.alert-row:last-child {
  border-bottom: 0;
}

.alert-row:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.alert-row > .icon {
  margin-inline-start: auto;
  color: var(--muted-2);
  width: 16px;
  height: 16px;
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
}

.alert-icon .icon {
  width: 17px;
  height: 17px;
}

.alert-icon--warning {
  background: var(--amber-50);
  color: var(--amber-600);
}

.alert-icon--danger {
  background: var(--red-50);
  color: var(--red-600);
}

.alert-icon--sky {
  background: var(--sky-50);
  color: var(--sky-600);
}

.alert-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.45;
}

.alert-text strong {
  font-size: 12.5px;
  font-weight: 600;
}

.alert-text small {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-head {
  padding: 16px 18px 0;
}

.quick-head h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-900);
}

.quick-head p {
  font-size: 11.5px;
  color: var(--muted);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 14px 18px 18px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
  border: 1px solid #d8ecf5;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-700);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.quick-link .icon {
  width: 20px;
  height: 20px;
  color: var(--sky-600);
}

.quick-link:hover {
  background: #fff;
  border-color: var(--sky-500);
  color: var(--navy-800);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
}

.table th {
  padding: 10px 16px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 11px 16px;
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: #fafcfe;
}

.table--compact th {
  padding: 8px 13px;
}

.table--compact td {
  padding: 9px 13px;
  font-size: 12.4px;
}

.th-action {
  width: 56px;
  text-align: center;
}

.cell-action {
  text-align: center;
  white-space: nowrap;
}

.cell-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--navy-700);
  white-space: nowrap;
}

.cell-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.45;
  min-width: 0;
}

.cell-stack strong {
  font-weight: 600;
}

.cell-stack small {
  font-size: 11px;
}

.cell-body {
  max-width: 300px;
  color: var(--ink-soft);
}

.entity-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  min-width: 0;
}

.entity-link:hover {
  color: var(--navy-700);
}

.entity-link strong {
  font-weight: 600;
  white-space: nowrap;
}

.entity-link > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.45;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}

.row-actions form {
  display: inline-flex;
  margin: 0;
}

.item-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--sky-50);
  color: var(--sky-600);
  flex: none;
}

.item-mark .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  background: var(--surface-muted);
  color: var(--muted);
  border: 1px solid transparent;
}

.badge--tiny {
  padding: 1px 7px;
  font-size: 10px;
}

.badge--block {
  width: 100%;
  justify-content: center;
  padding: 8px;
  font-size: 12.5px;
}

.badge-success {
  background: var(--green-50);
  border-color: var(--green-100);
  color: var(--green-600);
}

.badge-warning {
  background: var(--amber-50);
  border-color: var(--amber-100);
  color: var(--amber-600);
}

.badge-danger {
  background: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-600);
}

.badge-info {
  background: var(--sky-50);
  border-color: #d3ecf6;
  color: var(--sky-600);
}

.badge-muted {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--muted);
}

/* ------------------------------------------------------------------
   Empty states
   ------------------------------------------------------------------ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state--sm {
  padding: 26px 18px;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--sky-50);
  color: var(--sky-600);
  margin-bottom: 4px;
}

.empty-state--sm .empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.empty-icon .icon {
  width: 22px;
  height: 22px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.empty-state p {
  font-size: 12.5px;
  max-width: 420px;
}

.empty-state .btn {
  margin-top: 8px;
}

/* ------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------ */

.form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-grid {
  display: grid;
  gap: 15px;
}

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

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.input,
.select,
.textarea,
input[type="text"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea,
.textarea {
  min-height: 74px;
  resize: vertical;
  line-height: 1.7;
}

.select,
select {
  appearance: none;
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8a9a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  cursor: pointer;
}

.input:focus,
.select:focus,
.textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--sky-500);
  box-shadow: 0 0 0 4px rgba(88, 192, 228, 0.16);
}

.input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

.input:disabled,
.select:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}

.field--error .input,
.field--error .select,
.field--error input,
.field--error select,
.field--error textarea {
  border-color: #e59a9a;
  background: #fffbfb;
}

.field-error {
  font-size: 11.5px;
  color: var(--red-600);
  display: flex;
  align-items: center;
  gap: 4px;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field--inline .input {
  max-width: 150px;
}

.hint .icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.check-field:hover {
  background: var(--surface-muted);
}

.check-field input[type="checkbox"],
.check-field input[type="radio"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 2px 0 0;
  accent-color: var(--navy-700);
  flex: none;
  cursor: pointer;
}

.check-field--inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  white-space: nowrap;
  font-size: 12.5px;
}

.check-field--inline input {
  margin: 0;
}

.check-field--warning {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  color: #8a5c12;
  padding: 11px 13px;
  border-radius: var(--radius);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.choices label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  cursor: pointer;
}

.choices input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--navy-700);
}

.choice-list {
  display: grid;
  gap: 0;
}

.textarea--mono {
  font-family: "SFMono-Regular", ui-monospace, monospace;
  font-size: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 4px;
  flex-wrap: wrap;
}

.form-actions--column {
  flex-direction: column;
  align-items: stretch;
}

.form-actions--column .btn {
  width: 100%;
}

.sticky-form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -6px 24px rgba(22, 41, 60, 0.06);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* Inline / filter forms */
.inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.inline-form--stack {
  flex-direction: column;
  align-items: stretch;
}

.inline-form .input {
  width: auto;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12.5px;
}

.inline-form--stack .input {
  width: 100%;
}

/* ------------------------------------------------------------------
   Toolbar (filters)
   ------------------------------------------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar--wrap {
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 390px;
}

.search-field > .icon {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  min-height: 36px;
  padding-inline-start: 35px;
  font-size: 12.5px;
  background: var(--surface-muted);
  border-color: var(--border);
}

.search-field input:focus {
  background: #fff;
}

.toolbar-select {
  width: auto;
  min-width: 132px;
  min-height: 36px;
  font-size: 12.5px;
  background-color: #fff;
}

.toolbar-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-date .input {
  width: 118px;
  min-height: 36px;
  font-size: 12.5px;
}

.toolbar-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-inline-start: auto;
}

/* ------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------ */

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
}

.tab {
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  background: var(--surface-muted);
  color: var(--navy-700);
}

.tab.is-active {
  background: var(--navy-700);
  color: #fff;
  box-shadow: 0 2px 6px rgba(36, 74, 107, 0.22);
}

/* ------------------------------------------------------------------
   Alerts & toasts
   ------------------------------------------------------------------ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.alert > .icon {
  margin-top: 2px;
  flex: none;
}

.alert p + p {
  margin-top: 4px;
}

.alert--error {
  background: var(--red-50);
  border-color: var(--red-100);
  color: #9c2c2c;
}

.alert--warning {
  background: var(--amber-50);
  border-color: var(--amber-100);
  color: #8a5c12;
}

.alert--info {
  background: var(--sky-50);
  border-color: #d5edf7;
  color: #23647f;
}

.alert--success {
  background: var(--green-50);
  border-color: var(--green-100);
  color: #116b47;
}

.toast-stack {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 22px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  line-height: 1.6;
  animation: toast-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

.toast p {
  flex: 1;
}

.toast-icon {
  display: inline-flex;
  margin-top: 1px;
  color: var(--sky-500);
}

.toast-icon .icon {
  width: 17px;
  height: 17px;
}

.toast--success .toast-icon {
  color: #6fe3b0;
}

.toast--error .toast-icon {
  color: #ff9d9d;
}

.toast--warning .toast-icon {
  color: #ffd27d;
}

.toast-close {
  color: rgba(255, 255, 255, 0.6);
  width: 24px;
  height: 24px;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 12px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-soft);
  font-weight: 500;
}

.pagination-btn .icon {
  width: 14px;
  height: 14px;
}

.pagination-btn:hover {
  border-color: var(--sky-500);
  color: var(--navy-700);
}

.pagination-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination-info {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------
   Drawer
   ------------------------------------------------------------------ */

.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-start;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 33, 49, 0.44);
  backdrop-filter: blur(1.5px);
  animation: fade-in 0.2s ease;
}

.drawer {
  position: relative;
  width: min(480px, 94vw);
  height: 100%;
  margin-inline-start: auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-drawer);
  animation: drawer-in 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.drawer--wide {
  width: min(620px, 96vw);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, var(--sky-50));
}

.drawer-head h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
}

.drawer-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
}

.drawer-body .form {
  gap: 16px;
}

.drawer-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.drawer-actions-row form {
  margin: 0;
}

@keyframes drawer-in {
  from {
    transform: translateX(-42px);
    opacity: 0.4;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ------------------------------------------------------------------
   Modal
   ------------------------------------------------------------------ */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-layer.is-open {
  display: flex;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(16, 33, 49, 0.48);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease;
}

.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.24s cubic-bezier(0.22, 0.9, 0.3, 1);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
}

.modal-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.modal-body {
  padding: 20px 22px 22px;
  overflow-y: auto;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

/* ------------------------------------------------------------------
   Patient profile
   ------------------------------------------------------------------ */

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px;
  background: linear-gradient(120deg, #fff 0%, var(--sky-50) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.profile-main {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  min-width: 0;
}

.profile-text {
  min-width: 0;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.profile-title h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.2px;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.profile-alert {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--red-50);
  border: 1px solid var(--red-100);
  color: #a53030;
  font-size: 12px;
}

.profile-alert .icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.profile-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.profile-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 15px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.profile-tab:hover {
  color: var(--navy-700);
}

.profile-tab.is-active {
  color: var(--navy-800);
  font-weight: 700;
}

.profile-tab.is-active::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sky-500), var(--sky-600));
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--sky-50);
  color: var(--sky-600);
  font-size: 10.5px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.detail-grid--narrow {
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 1fr);
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 18px;
  background: #fff;
  min-width: 0;
}

.mini-stat > span {
  font-size: 11.5px;
  color: var(--muted);
}

.mini-stat strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.mini-stat strong small {
  font-size: 0.72em;
  font-weight: 500;
  color: var(--muted);
}

.mini-stat small {
  font-size: 11px;
  color: var(--muted-2);
}

.info-list {
  display: flex;
  flex-direction: column;
}

.info-list > div {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 12.5px;
}

.info-list > div:last-child {
  border-bottom: 0;
}

.info-list--tight > div {
  padding: 8px 18px;
}

.info-list dt {
  color: var(--muted);
  font-size: 12px;
}

.info-list dd {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.appointment-list {
  display: flex;
  flex-direction: column;
}

.appointment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #eef2f7;
  color: var(--ink);
}

.appointment-row:last-child {
  border-bottom: 0;
}

.appointment-row:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.appointment-row > .icon {
  margin-inline-start: auto;
  color: var(--muted-2);
  width: 15px;
  height: 15px;
}

.date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 8px;
  border-radius: 9px;
  background: var(--sky-50);
  border: 1px solid #d9edf6;
  line-height: 1.4;
}

.date-box strong {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-700);
  white-space: nowrap;
}

.date-box small {
  font-size: 11px;
  color: var(--sky-600);
  font-variant-numeric: tabular-nums;
}

.appointment-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.5;
}

.appointment-row-body strong {
  font-size: 12.5px;
  font-weight: 600;
}

.appointment-row-body small {
  font-size: 11.5px;
  color: var(--muted);
}

/* Documents */
.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}

.document-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.document-card:hover {
  border-color: #cfe6f1;
  box-shadow: var(--shadow);
}

.document-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 124px;
  background: var(--surface-muted);
  overflow: hidden;
}

.document-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.document-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.document-type .icon {
  width: 30px;
  height: 30px;
}

.document-type small {
  font-size: 10.5px;
  text-transform: uppercase;
}

.document-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  font-size: 11.5px;
}

.document-body strong {
  font-size: 12.5px;
  font-weight: 600;
}

.document-body small {
  color: var(--muted);
}

/* ------------------------------------------------------------------
   Appointment calendar
   ------------------------------------------------------------------ */

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-date-input {
  width: 108px;
  min-height: 32px;
  padding: 4px 9px;
  font-size: 12.5px;
  text-align: center;
}

.cal-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.segmented a {
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.segmented a:hover {
  color: var(--navy-700);
}

.segmented a.is-active {
  background: #fff;
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}

.cal-filter {
  width: auto;
  min-width: 140px;
  min-height: 34px;
  font-size: 12.5px;
}

.cal-scroll {
  overflow-x: auto;
  background: #fff;
}

.cal-head {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, 1fr);
  border-bottom: 1px solid var(--border);
  min-width: 100%;
}

.cal-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 6px;
  border-inline-end: 1px solid var(--border);
  background: var(--surface-muted);
  line-height: 1.4;
}

.cal-day-head.is-today {
  background: var(--sky-50);
  box-shadow: inset 0 2px 0 var(--sky-500);
}

.cal-day-head.is-closed {
  opacity: 0.65;
}

.cal-weekday {
  font-size: 11px;
  color: var(--muted);
}

.cal-day-head strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-800);
  white-space: nowrap;
}

.cal-day-head small {
  font-size: 10px;
  color: var(--sky-600);
}

.cal-day-head.is-closed small {
  color: var(--muted-2);
}

.cal-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  background: var(--surface-muted);
  font-size: 10.5px;
  color: var(--muted);
  border-inline-start: 1px solid var(--border);
}

.cal-body {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  min-width: 100%;
}

.cal-col {
  position: relative;
  flex: 1;
  min-width: 110px;
  border-inline-end: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 47px,
    #f0f4f8 47px,
    #f0f4f8 48px
  );
}

.cal-col.is-closed {
  background-color: #fcfdfe;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 7px,
    rgba(227, 233, 240, 0.5) 7px,
    rgba(227, 233, 240, 0.5) 8px
  );
}

.cal-times {
  position: relative;
  width: 62px;
  flex: none;
  border-inline-start: 1px solid var(--border);
  background: var(--surface-muted);
}

.cal-hour {
  position: absolute;
  inset-inline: 0;
  transform: translateY(-50%);
  padding-inline-end: 8px;
  text-align: left;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cal-event {
  position: absolute;
  inset-inline: 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 7px;
  border-radius: 7px;
  border: 1px solid transparent;
  border-inline-start-width: 3px;
  background: #eef2f6;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cal-event:hover {
  z-index: 5;
  box-shadow: 0 4px 14px rgba(22, 41, 60, 0.16);
  transform: translateY(-1px);
  color: var(--ink);
}

.cal-event-time {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.cal-event-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-service {
  font-size: 10px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* status colors */
.cal-event--scheduled,
.cal-legend-dot--scheduled {
  background: #e9f4fb;
  border-color: #b9ddf0;
  border-inline-start-color: var(--sky-600);
  color: #1d5a75;
}

.cal-event--confirmed,
.cal-legend-dot--confirmed {
  background: #e8f7f0;
  border-color: #bde7d4;
  border-inline-start-color: var(--green-600);
  color: #146b49;
}

.cal-event--completed,
.cal-legend-dot--completed {
  background: #edf1f6;
  border-color: #cdd9e5;
  border-inline-start-color: var(--navy-600);
  color: var(--navy-800);
}

.cal-event--canceled,
.cal-legend-dot--canceled {
  background: #fdeeee;
  border-color: #f3cdcd;
  border-inline-start-color: var(--red-600);
  color: #96322f;
}

.cal-event--no_show,
.cal-legend-dot--no_show {
  background: #fdf5e6;
  border-color: #f0ddb7;
  border-inline-start-color: var(--amber-600);
  color: #7d5713;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.cal-legend-item,
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.cal-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.day-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.day-list-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-900);
}

.day-list-head p {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------
   Tooth chart
   ------------------------------------------------------------------ */

.tooth-chart {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tooth-arch {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.tooth-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tooth {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease,
    transform 0.14s ease;
}

.tooth:hover {
  border-color: var(--sky-500);
  color: var(--navy-700);
  background: #fff;
  transform: translateY(-1px);
}

.tooth--empty {
  color: var(--muted-2);
  border-style: dashed;
}

.tooth-mark {
  position: absolute;
  bottom: 5px;
  width: 12px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.5;
}

.tooth--completed {
  background: var(--green-50);
  border-color: var(--green-100);
  color: var(--green-600);
}

.tooth--in_progress {
  background: var(--sky-50);
  border-color: #cfeaf5;
  color: var(--sky-600);
}

.tooth--accepted,
.tooth--proposed {
  background: var(--amber-50);
  border-color: var(--amber-100);
  color: var(--amber-600);
}

.tooth--canceled {
  background: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-600);
}

.tooth--pick[aria-pressed="true"] {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: #fff;
  box-shadow: 0 3px 8px rgba(36, 74, 107, 0.25);
}

.tooth-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}

.tooth-picker-foot strong {
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.legend-dot--completed {
  background: var(--green-50);
  border-color: var(--green-100);
}

.legend-dot--planned {
  background: var(--amber-50);
  border-color: var(--amber-100);
}

.legend-dot--empty {
  background: var(--surface-muted);
  border-color: var(--border);
}

.chart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px 18px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   Finance
   ------------------------------------------------------------------ */

.invoice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.invoice-summary {
  min-width: 0;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  font-size: 12.5px;
}

.summary-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-rows > div > span {
  color: var(--muted);
}

.summary-rows strong {
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

.summary-rows strong small {
  font-size: 0.82em;
  font-weight: 500;
  color: var(--muted);
}

.summary-divider {
  height: 1px;
  background: var(--border);
  padding: 0 !important;
}

.summary-total {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--sky-50);
  border: 1px solid #d9edf6;
}

.summary-total > span {
  color: var(--navy-700) !important;
  font-weight: 600;
}

.summary-total strong {
  font-size: 17px;
  letter-spacing: -0.3px;
}

.invoice-summary .form-actions {
  padding: 0 18px 18px;
}

.invoice-summary > .panel > .hint {
  padding: 0 18px 18px;
}

.invoice-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 0;
}

.invoice-patient {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
}

.invoice-patient small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.invoice-patient > div {
  min-width: 0;
}

.invoice-meta .info-list {
  border-inline-start: 1px solid var(--border);
}

.billing-list {
  display: flex;
  flex-direction: column;
}

.billing-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.billing-item:last-child {
  border-bottom: 0;
}

.billing-item:hover {
  background: var(--surface-muted);
}

.billing-item input {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--navy-700);
  flex: none;
}

.billing-text {
  flex: 1;
  line-height: 1.7;
}

.inline-details {
  display: inline-block;
  text-align: right;
}

.inline-details summary {
  cursor: pointer;
  list-style: none;
}

.inline-details summary::-webkit-details-marker {
  display: none;
}

.inline-details[open] .inline-form {
  margin-top: 6px;
}

/* ------------------------------------------------------------------
   Settings
   ------------------------------------------------------------------ */

.settings-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
}

.settings-nav-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.14s ease, color 0.14s ease;
}

.settings-nav-item:hover {
  background: var(--surface-muted);
  color: var(--navy-700);
}

.settings-nav-item.is-active {
  background: var(--sky-50);
  color: var(--navy-800);
  font-weight: 700;
  box-shadow: inset 2px 0 0 var(--sky-500);
}

.settings-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-content > .panel > .form {
  padding: 18px;
}

/* ------------------------------------------------------------------
   Messaging & misc cards
   ------------------------------------------------------------------ */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  padding: 18px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.template-card:hover {
  border-color: #cfe6f1;
  box-shadow: var(--shadow-sm);
}

.template-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-head strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
}

.template-head small {
  font-size: 11px;
  color: var(--muted);
}

.template-body {
  flex: 1;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--sky-50);
  border: 1px solid #e0f1f8;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-soft);
  white-space: pre-line;
}

.template-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.sms-preview {
  border: 1px solid #d9edf6;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--sky-50), #fff);
  overflow: hidden;
}

.sms-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e0f1f8;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-700);
}

.sms-preview p {
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.9;
  min-height: 64px;
  white-space: pre-line;
}

.sms-preview .hint {
  padding: 0 12px 10px;
}

.placeholder-help {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 12px;
  background: var(--surface-muted);
}

.placeholder-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
}

.placeholder-help ul {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
}

.placeholder-help code {
  font-family: "SFMono-Regular", ui-monospace, monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy-700);
}

/* ------------------------------------------------------------------
   Reports
   ------------------------------------------------------------------ */

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.bar-label {
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 9px;
  border-radius: 99px;
  background: var(--surface-muted);
  border: 1px solid #edf1f6;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sky-500), var(--sky-600));
  min-width: 2px;
  transition: width 0.4s ease;
}

.bar-value {
  text-align: left;
  font-variant-numeric: tabular-nums;
  color: var(--navy-800);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------
   Auth pages
   ------------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 92% -10%, rgba(88, 192, 228, 0.2), transparent 60%),
    var(--bg);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    radial-gradient(600px 400px at 80% 10%, rgba(88, 192, 228, 0.26), transparent 70%),
    linear-gradient(155deg, var(--navy-700), var(--navy-900));
  color: #fff;
  overflow: hidden;
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-brand::before {
  width: 460px;
  height: 460px;
  top: -160px;
  inset-inline-start: -140px;
}

.auth-brand::after {
  width: 620px;
  height: 620px;
  bottom: -300px;
  inset-inline-end: -200px;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.auth-logo {
  width: 66px;
  height: 66px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  margin-bottom: 22px;
}

.auth-brand h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.4;
}

.auth-brand p {
  margin-top: 7px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 320px;
  line-height: 1.9;
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 30px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
}

.auth-points .icon {
  width: 17px;
  height: 17px;
  color: var(--sky-500);
}

.auth-copy {
  display: inline-block;
  margin-top: 38px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 24px;
}

.auth-card {
  width: min(390px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 22px 60px rgba(22, 41, 60, 0.1);
}

.auth-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 20px;
}

.auth-card-head img {
  width: 36px;
  height: 36px;
  flex: none;
}

.auth-card-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
}

.auth-card-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.auth-card .form {
  gap: 14px;
}

.auth-demo {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  font-size: 11.5px;
  color: var(--muted);
}

.auth-demo strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.auth-demo code {
  font-family: "SFMono-Regular", ui-monospace, monospace;
  font-size: 11px;
  color: var(--navy-700);
}

.auth-footer {
  font-size: 11px;
  color: var(--muted);
}

.error-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
}

.error-shell img {
  margin-bottom: 8px;
}

.error-code {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--sky-500);
  line-height: 1;
}

.error-shell h1 {
  font-size: 20px;
  color: var(--navy-900);
}

.error-shell p {
  max-width: 380px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .detail-grid,
  .invoice-layout,
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel--sticky {
    position: static;
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar: 0px;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 248px;
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.22, 0.9, 0.3, 1);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar .sidebar-close {
    display: inline-flex;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(16, 33, 49, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar .menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .content {
    padding: 18px 16px 40px;
  }

  .topbar-date,
  .topbar-divider {
    display: none;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-brand {
    display: none;
  }
}

@media (max-width: 700px) {
  .stat-grid,
  .stat-grid--3,
  .stat-grid--2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid--2,
  .form-grid--3,
  .invoice-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .invoice-meta .info-list {
    border-inline-start: 0;
    border-top: 1px solid var(--border);
  }

  .topbar-user > div {
    display: none;
  }

  .global-search {
    max-width: none;
  }

  .page-title h1 {
    font-size: 19px;
  }

  .profile-head {
    padding: 16px;
  }

  .toast-stack {
    inset-inline: 14px;
    max-width: none;
  }

  .mini-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-list > div {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: 82px minmax(0, 1fr) 74px;
    gap: 8px;
  }

  .toolbar {
    padding: 12px 14px;
  }

  .search-field {
    max-width: none;
  }

  .drawer {
    width: 100%;
  }

  .document-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: 14px;
  }

  .table th,
  .table td {
    padding: 9px 12px;
  }
}

/* ------------------------------------------------------------------
   Reduced motion & print
   ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .page-actions,
  .toast-stack,
  .drawer-layer,
  .modal-layer,
  .pagination,
  .form-actions,
  .sticky-form-actions,
  .tabs,
  .toolbar,
  .profile-tabs,
  .btn,
  .menu-btn {
    display: none !important;
  }

  .app-shell,
  .main {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel {
    border-color: #d5dce4;
    box-shadow: none;
    break-inside: avoid;
  }

  .invoice-layout,
  .detail-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel--sticky {
    position: static;
  }

  a {
    color: inherit;
  }
}

/* ==================================================================
   2026 visual refresh — دیجی‌دنت
   A softer, more colourful layer on top of the original system.
   ================================================================== */

@media screen {
  :root {
    --bg: #f3f8fd;
    --surface: #ffffff;
    --surface-muted: #f6fafd;
    --border: #e2ebf4;
    --border-strong: #cfdfec;
    --ink: #152b3f;
    --ink-soft: #4b6175;
    --muted: #6f8397;
    --muted-2: #94a7b9;
    --primary: #2e6f9e;
    --primary-strong: #244a6b;
    --sky-500: #2fa9dd;
    --sky-600: #1f8fbe;
    --sky-100: #e2f5fc;
    --sky-50: #f1fafe;
    --green-600: #0f9d7e;
    --green-50: #e8faf4;
    --green-100: #cef3e8;
    --amber-600: #b97712;
    --amber-50: #fff7e8;
    --amber-100: #fbe8c7;
    --red-600: #cf4c43;
    --red-50: #fff1ef;
    --red-100: #fbd9d5;
    --violet-600: #6f5bd6;
    --violet-50: #f1effd;
    --violet-100: #e0dcfb;
    --coral-600: #e26653;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(21, 43, 63, 0.04);
    --shadow: 0 12px 34px -24px rgba(21, 59, 91, 0.35);
    --shadow-lg: 0 26px 60px -30px rgba(16, 46, 73, 0.42);
    --sidebar: 240px;
    --topbar-h: 68px;
  }

  body {
    font-size: 14px;
    color: var(--ink);
  }

  body.app {
    background:
      radial-gradient(900px 360px at 96% -120px, rgba(47, 169, 221, 0.16), transparent 62%),
      radial-gradient(760px 420px at 2% 4%, rgba(111, 91, 214, 0.08), transparent 65%),
      radial-gradient(700px 500px at 70% 100%, rgba(15, 157, 126, 0.06), transparent 60%),
      linear-gradient(180deg, #f7fbfe 0%, #f2f8fd 100%);
  }

  a { color: var(--navy-700); }
  a:hover { color: var(--sky-600); }

  /* Shell ------------------------------------------------------- */
  .sidebar {
    padding: 14px 12px 12px;
    background:
      radial-gradient(300px 240px at 10% 0%, rgba(47, 169, 221, 0.24), transparent 70%),
      linear-gradient(180deg, #1d3c58 0%, #142b40 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
    gap: 6px;
  }

  .sidebar-brand {
    padding: 2px 4px 12px;
    border-bottom-color: rgba(255, 255, 255, 0.09);
  }

  .brand { gap: 11px; }

  .brand-logo {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.55);
  }

  .brand-text strong {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  .brand-text small {
    font-size: 10.5px;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.62);
  }

  .nav {
    gap: 2px;
    padding-top: 8px;
  }

  .nav-item {
    padding: 9px 11px;
    border-radius: 11px;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.76);
  }

  .nav-item .icon {
    width: 18px;
    height: 18px;
    opacity: 0.82;
  }

  .nav-item:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
  }

  .nav-item.is-active {
    background: linear-gradient(135deg, rgba(47, 169, 221, 0.34), rgba(47, 169, 221, 0.12));
    border: 1px solid rgba(133, 220, 250, 0.28);
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.9);
    color: #fff;
    font-weight: 700;
  }

  .nav-item.is-active .icon {
    color: #a9ecff;
    opacity: 1;
  }

  .nav-item.is-active::before {
    content: "";
    position: absolute;
    inset-inline-end: 9px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9cecff;
    box-shadow: 0 0 0 4px rgba(156, 236, 255, 0.14);
    transform: translateY(-50%);
  }

  .nav-item--sub {
    padding: 7px 11px 7px 16px;
    font-size: 12.5px;
    opacity: 0.9;
  }

  .nav-item--sub .icon { width: 16px; height: 16px; }

  .nav-item--muted { font-size: 12.5px; opacity: 0.78; }

  .nav-badge {
    margin-inline-start: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffd28a;
    color: #593606;
    font-size: 10px;
    font-weight: 800;
  }

  .sidebar .icon-btn {
    color: rgba(255, 255, 255, 0.72);
    border-radius: 10px;
  }

  .sidebar-foot {
    gap: 6px;
    padding-top: 8px;
    border-top-color: rgba(255, 255, 255, 0.09);
  }

  .sidebar-public-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 11px;
    border: 1px dashed rgba(133, 220, 250, 0.34);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.92);
    font-size: 11.5px;
    font-weight: 600;
  }

  .sidebar-public-link .icon { width: 15px; height: 15px; color: #9cecff; }
  .sidebar-public-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
  .sidebar-public-hint { margin-inline-start: auto; font-size: 9.5px; opacity: 0.55; }

  .sidebar-user {
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-user-text strong { font-size: 12px; }
  .sidebar-user-text small { font-size: 10px; color: rgba(255, 255, 255, 0.55); }

  /* Topbar ------------------------------------------------------ */
  .topbar {
    height: var(--topbar-h);
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid rgba(222, 234, 245, 0.9);
    gap: 14px;
  }

  .global-search {
    max-width: 470px;
    height: 42px;
    border-radius: 13px;
    border-color: #e3edf6;
    background: #f5fafd;
    padding: 0 13px;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  }

  .global-search:focus-within {
    background: #fff;
    border-color: #9ed9ef;
    box-shadow: 0 0 0 4px rgba(47, 169, 221, 0.13);
  }

  .global-search .icon { color: var(--sky-600); }

  .topbar-date {
    font-size: 12px;
    color: var(--ink-soft);
    background: #f4f9fd;
    border: 1px solid #e8f1f8;
    border-radius: 999px;
    padding: 5px 12px;
  }

  .topbar-user { gap: 9px; }
  .topbar-user strong { font-size: 12px; }
  .topbar-user small { font-size: 10px; color: var(--muted); }

  .content {
    padding: 24px 26px 44px;
    max-width: 1560px;
    margin: 0 auto;
  }

  /* Page heading ------------------------------------------------ */
  .page-head {
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 18px;
  }

  .page-title h1 {
    font-size: clamp(24px, 2.3vw, 31px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.2;
    color: var(--navy-900);
  }

  .page-title p {
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--muted);
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e8f8fe, #eef4ff);
    border: 1px solid #d8eef8;
    color: var(--sky-600);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .eyebrow .icon { width: 13px; height: 13px; }

  .page-actions { gap: 8px; flex-wrap: wrap; }

  .btn-badge {
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    font-size: 10px;
    font-weight: 800;
  }

  /* Buttons ----------------------------------------------------- */
  .btn {
    min-height: 38px;
    padding: 8px 15px;
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 700;
    gap: 7px;
    border-color: var(--border);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  }

  .btn--primary {
    background: linear-gradient(135deg, #2b5a7e 0%, #2f89b6 60%, #3aa9d6 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 26px -14px rgba(36, 99, 140, 0.72);
  }

  .btn--primary:hover {
    background: linear-gradient(135deg, #244a6b 0%, #2a7fa9 60%, #2fa9dd 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -14px rgba(36, 99, 140, 0.78);
  }

  .btn--secondary {
    background: #fff;
    border-color: #dbe8f3;
    color: var(--navy-700);
    box-shadow: 0 1px 2px rgba(21, 43, 63, 0.03);
  }

  .btn--secondary:hover {
    background: #f7fbfe;
    border-color: #bcdced;
    color: var(--navy-800);
  }

  .btn--ghost { color: var(--muted); }
  .btn--ghost:hover { background: #f1f8fd; color: var(--navy-700); }

  .btn--success {
    background: linear-gradient(135deg, #0f9d7e, #26b99a);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(15, 157, 126, 0.7);
  }

  .btn--danger {
    background: linear-gradient(135deg, #c84a40, #e26653);
    border-color: transparent;
    color: #fff;
  }

  .btn--danger-ghost { color: var(--red-600); }
  .btn--danger-ghost:hover { background: var(--red-50); }

  .btn--lg { min-height: 46px; padding: 12px 22px; font-size: 13.5px; border-radius: 13px; }
  .btn--sm { min-height: 30px; padding: 5px 10px; font-size: 11.5px; border-radius: 9px; }

  .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border-color: transparent;
  }

  .icon-btn:hover { background: #f1f8fd; border-color: #e6f0f8; color: var(--sky-600); }

  /* Panels ------------------------------------------------------ */
  .panel {
    background: var(--surface);
    border: 1px solid rgba(224, 235, 245, 0.95);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(21, 43, 63, 0.025), 0 24px 50px -42px rgba(21, 59, 91, 0.32);
    overflow: hidden;
  }

  .panel--tinted {
    background:
      radial-gradient(400px 160px at 100% 0%, rgba(47, 169, 221, 0.12), transparent 70%),
      linear-gradient(180deg, #f8fcff, #f2f9fe);
    border-color: #dcecf7;
  }

  .panel--flush { padding: 0; }

  .panel-head {
    padding: 18px 20px 14px;
    align-items: flex-start;
    gap: 12px;
  }

  .panel-head h2 {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--navy-900);
  }

  .panel-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
  }

  .panel-head .btn--sm { margin-top: 1px; }

  .panel-body { padding: 0 20px 20px; }

  .panel--inset {
    border-radius: 14px;
    background: #f6fafd;
    box-shadow: none;
  }

  .panel--success {
    background: linear-gradient(135deg, #effcf7, #f4fffb);
    border-color: #cdf0e5;
  }

  .panel-mini-title { font-size: 12.5px; font-weight: 800; }
  .panel-mini-note { font-size: 11px; color: var(--muted); margin: 4px 0 10px; }

  .count-pill {
    min-width: 23px;
    height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--sky-50);
    border: 1px solid #d8eef8;
    color: var(--sky-600);
    font-size: 11px;
    font-weight: 800;
  }

  /* Forms ------------------------------------------------------- */
  .field label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 5px;
  }

  .input,
  .select,
  .textarea {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 11px;
    border-color: #dce8f2;
    background: #fbfdff;
    font-size: 12.5px;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  }

  .input:hover,
  .select:hover,
  .textarea:hover { border-color: #c4dcec; }

  .input:focus,
  .select:focus,
  .textarea:focus {
    background: #fff;
    border-color: #85cfe9;
    box-shadow: 0 0 0 4px rgba(47, 169, 221, 0.13);
    outline: none;
  }

  .select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #7d92a5 50%),
      linear-gradient(135deg, #7d92a5 50%, transparent 50%);
    background-position: calc(0% + 13px) 18px, calc(0% + 18px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-inline-start: 30px;
  }

  .checkbox,
  input[type="checkbox"],
  input[type="radio"] { accent-color: var(--sky-600); }

  .form-grid { gap: 14px; }
  .form-actions { padding-top: 15px; gap: 8px; }

  .hint { font-size: 10.5px; color: var(--muted); }

  .field-error { color: var(--red-600); font-size: 10.5px; }

  .alert {
    border-radius: 13px;
    padding: 11px 14px;
    font-size: 12px;
  }

  /* Tables ------------------------------------------------------ */
  .table-wrap { overflow: auto; }

  .table { font-size: 12.5px; border-collapse: separate; border-spacing: 0; }

  .table th {
    padding: 10px 14px;
    background: #f7fafd;
    border-bottom: 1px solid #eaf1f8;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.01em;
  }

  .table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf4fa;
    vertical-align: middle;
  }

  .table tbody tr { transition: background 0.12s ease; }
  .table tbody tr:hover { background: #f6fbff; }
  .table tbody tr.is-void { opacity: 0.55; }
  .table tbody tr.is-void td { text-decoration: none; }

  .cell-time { color: var(--sky-600); }
  .cell-sub { font-size: 10px; color: var(--muted); }

  .money { font-variant-numeric: tabular-nums; font-weight: 600; }

  .row-actions .icon-btn { width: 28px; height: 28px; }

  /* Badges ------------------------------------------------------ */
  .badge {
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 999px;
    gap: 3px;
  }

  .badge .icon { width: 12px; height: 12px; }

  .badge-success { background: #e9fbf5; border-color: #c9f2e6; color: #0a8a6f; }
  .badge-warning { background: #fff7e8; border-color: #f8e3ba; color: #a96a0f; }
  .badge-danger { background: #fff1ef; border-color: #f8d4cf; color: #c4443b; }
  .badge-info { background: #ecf9ff; border-color: #d2effa; color: #1c8bb8; }
  .badge-muted { background: #f4f8fb; border-color: #e5eef6; color: #74899b; }
  .badge-violet { background: var(--violet-50); border-color: var(--violet-100); color: var(--violet-600); }

  /* Tabs -------------------------------------------------------- */
  .tabs {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    border-radius: 14px;
    background: #eaf2f9;
    border: 1px solid #e2edf6;
    margin-bottom: 16px;
  }

  .tab {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    border: 0;
  }

  .tab:hover { color: var(--navy-700); background: rgba(255, 255, 255, 0.55); }

  .tab.is-active {
    background: #fff;
    color: var(--navy-800);
    box-shadow: 0 5px 14px -8px rgba(21, 59, 91, 0.35);
  }

  /* Empty state ------------------------------------------------- */
  .empty-state {
    padding: 38px 20px;
    gap: 8px;
    color: var(--muted);
  }

  .empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef9fe, #eef3ff);
    color: var(--sky-600);
  }

  .empty-state h3 { font-size: 14px; color: var(--navy-800); }
  .empty-state p { font-size: 11.5px; }
  .empty-state--sm { padding: 26px 16px; }

  /* Callouts ---------------------------------------------------- */
  .callout {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 17px;
    border-radius: 17px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    position: relative;
  }

  .callout p { font-size: 11px; opacity: 0.8; margin-top: 2px; }
  .callout strong { font-size: 12.5px; }

  .callout-icon {
    width: 38px;
    height: 38px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
  }

  .callout--sky {
    background: linear-gradient(135deg, #eaf9ff, #f4fbff);
    border-color: #d3eff9;
    color: #146e92;
  }

  .callout--amber {
    background: linear-gradient(135deg, #fff8ea, #fffdf7);
    border-color: #f9e7c5;
    color: #94600e;
  }

  .callout--link:hover { color: inherit; border-color: #a9def2; }
  .callout-arrow { margin-inline-start: auto; align-self: center; opacity: 0.55; }

  /* Filter pills ------------------------------------------------ */
  .filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid #e1ecf5;
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }

  .filter-pill:hover { border-color: #b9deee; color: var(--sky-600); }

  .filter-pill.is-active {
    background: linear-gradient(135deg, #2c6288, #3aa9d6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(42, 118, 159, 0.8);
  }

  .range-toolbar {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 16px;
  }

  .range-toolbar .toolbar { padding: 0; border: 0; background: transparent; }
}

@media screen {
  /* Stat cards -------------------------------------------------- */
  .stat-grid { gap: 12px; margin-bottom: 18px; }

  .stat-card {
    padding: 16px 17px;
    gap: 13px;
    border-radius: 18px;
    border: 1px solid #e5eef6;
    box-shadow: 0 1px 2px rgba(21, 43, 63, 0.025), 0 18px 40px -38px rgba(21, 59, 91, 0.4);
    position: relative;
    overflow: hidden;
  }

  .stat-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -30px;
    top: -40px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.035;
  }

  .stat-card--static { background: #fff; }

  .stat-card--sky {
    background: linear-gradient(145deg, #f2fbff, #e8f7fe);
    border-color: #d3eef9;
    color: #1d7fa5;
  }

  .stat-card--mint,
  .stat-card--green {
    background: linear-gradient(145deg, #f0fdf9, #e5faf3);
    border-color: #cff1e7;
    color: #0b8d72;
  }

  .stat-card--amber {
    background: linear-gradient(145deg, #fffaf0, #fff4df);
    border-color: #f9e8c8;
    color: #a2670f;
  }

  .stat-card--violet {
    background: linear-gradient(145deg, #f7f5ff, #efecfe);
    border-color: #e1dcfb;
    color: #6f5bd6;
  }

  a.stat-card:hover {
    transform: translateY(-2px);
    border-color: #bfdeee;
    box-shadow: 0 16px 34px -26px rgba(21, 59, 91, 0.42);
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.75);
    color: currentColor;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  }

  .stat-icon .icon { width: 22px; height: 22px; }

  .stat-icon--sky, .stat-icon--navy { background: rgba(255, 255, 255, 0.78); color: #1d8db6; }
  .stat-icon--green { background: rgba(255, 255, 255, 0.78); color: #0b8d72; }
  .stat-icon--amber { background: rgba(255, 255, 255, 0.78); color: #b97712; }
  .stat-icon--violet { background: rgba(255, 255, 255, 0.78); color: #6f5bd6; }

  .stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: var(--navy-900);
  }

  .stat-value--money { font-size: 21px; }
  .stat-label { font-size: 10.5px; font-weight: 600; color: var(--muted); }
  .stat-body small { font-size: 10px; color: rgba(76, 97, 117, 0.76); margin-top: 1px; }

  /* Dashboard layout -------------------------------------------- */
  .dashboard-grid { gap: 16px; align-items: start; }

  .stack { gap: 14px; }

  .alert-list { padding: 0 10px 10px; }
  .alert-row {
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    border-bottom: 0;
  }

  .alert-row:hover { background: #f5fafd; }

  .alert-icon {
    width: 33px;
    height: 33px;
    border-radius: 10px;
  }

  .alert-text strong { font-size: 11.5px; }
  .alert-text small { font-size: 9.5px; }

  .quick-grid { gap: 8px; padding: 0 14px 14px; }
  .quick-link {
    border-radius: 13px;
    border-color: #dfeef8;
    background: rgba(255, 255, 255, 0.8);
    padding: 11px 9px;
    font-size: 10.5px;
    gap: 6px;
  }

  .quick-link .icon { width: 19px; height: 19px; }
  .quick-link:hover { border-color: #b7dfef; background: #fff; transform: translateY(-1px); }

  .quick-head { padding: 16px 16px 10px; }
  .quick-head h2 { font-size: 13px; font-weight: 800; }
  .quick-head p { font-size: 10px; color: var(--muted); }

  .mini-call-list { padding: 0 10px 10px; }
  .mini-call {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #f8fbfe;
    border: 1px solid #e8f2f9;
    margin-top: 6px;
  }

  .mini-call strong { display: block; font-size: 11.5px; }
  .mini-call small { font-size: 9.5px; color: var(--muted); }

  /* Calendar ---------------------------------------------------- */
  .cal-toolbar {
    padding: 13px 15px;
    gap: 10px;
    background: linear-gradient(180deg, #fbfdff, #f7fbfe);
    border-bottom: 1px solid #e9f1f8;
  }

  .cal-nav { gap: 5px; }
  .cal-date-input { width: 128px; min-height: 32px; height: 32px; font-size: 11.5px; }

  .segmented {
    padding: 3px;
    border-radius: 10px;
    background: #eaf2f9;
    border: 1px solid #e1ecf5;
  }

  .segmented a {
    padding: 4px 11px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
  }

  .segmented a.is-active {
    background: #fff;
    color: var(--navy-800);
    box-shadow: 0 4px 10px -7px rgba(21, 59, 91, 0.5);
  }

  .cal-filter { min-height: 32px; height: 32px; font-size: 11.5px; }

  .cal-head { border-bottom-color: #e7f0f7; }
  .cal-day-head { padding: 9px 10px 8px; }
  .cal-day-head.is-today { background: linear-gradient(180deg, #ecfaff, #f6fdff); }
  .cal-weekday { font-size: 9.5px; color: var(--muted); }
  .cal-day-head strong { font-size: 11.5px; color: var(--navy-800); }
  .cal-day-head small { font-size: 9px; }

  .cal-col { border-inline-start-color: #edf4fa; }
  .cal-col.is-closed { background: repeating-linear-gradient(-45deg, #fbfdff, #fbfdff 6px, #f7fafd 6px, #f7fafd 12px); }

  .cal-event {
    border-radius: 8px;
    padding: 4px 7px;
    border-inline-start-width: 3px;
    box-shadow: 0 5px 12px -10px rgba(21, 59, 91, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }

  .cal-event:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(21, 59, 91, 0.5); }

  .cal-event--scheduled { background: #eaf7ff; border-color: #6cc3e6; color: #146f96; }
  .cal-event--requested { background: #fff6e6; border-color: #f0b85b; color: #94600e; }
  .cal-event--confirmed { background: #e8f9ff; border-color: #2fa9dd; color: #116f96; }
  .cal-event--completed { background: #e9fbf5; border-color: #24a888; color: #0b7d65; }
  .cal-event--canceled, .cal-event--no_show { background: #f4f7fa; border-color: #b6c7d6; color: #74899b; }
  .cal-event-time { font-size: 8.5px; }
  .cal-event-name { font-size: 9.5px; }

  /* Drawer / modal --------------------------------------------- */
  .drawer-layer, .drawer-scrim { backdrop-filter: blur(3px); }

  .drawer {
    border-radius: 22px 0 0 22px;
    box-shadow: -30px 0 80px -30px rgba(16, 46, 73, 0.4);
  }

  .drawer-head { padding: 18px 20px; border-bottom-color: #e9f1f8; }
  .drawer-body { padding: 18px 20px 24px; }

  .modal {
    border-radius: 22px;
    border: 1px solid #e6eff7;
    box-shadow: 0 40px 90px -36px rgba(16, 46, 73, 0.55);
  }

  .modal-head { padding: 18px 20px 14px; border-bottom-color: #e9f1f8; }
  .modal-body { padding: 18px 20px 20px; }

  .detail-identity { gap: 12px; }
  .detail-identity h3 { font-size: 16px; }

  /* Profile / patient ------------------------------------------ */
  .profile-head {
    border-radius: 22px;
    background:
      radial-gradient(500px 200px at 100% 0%, rgba(47, 169, 221, 0.13), transparent 70%),
      linear-gradient(180deg, #ffffff, #f8fcff);
    border: 1px solid #e1eef8;
    padding: 18px 20px;
    box-shadow: 0 18px 40px -42px rgba(21, 59, 91, 0.5);
  }

  .profile-title h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.03em; }

  .profile-tabs {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    border-radius: 14px;
    background: #eaf2f9;
    border: 1px solid #e1ecf5;
    margin: 14px 0 18px;
    overflow-x: auto;
    max-width: 100%;
  }

  .profile-tab {
    padding: 6px 13px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    border: 0;
  }

  .profile-tab.is-active {
    background: #fff;
    color: var(--navy-800);
    box-shadow: 0 5px 14px -8px rgba(21, 59, 91, 0.35);
  }

  .profile-tab .tab-count {
    background: #e8f5fc;
    color: var(--sky-600);
    font-size: 9.5px;
    padding: 1px 6px;
  }

  .mini-stat-grid { gap: 9px; }
  .mini-stat {
    border-radius: 14px;
    border-color: #e8f1f8;
    background: #f9fcfe;
    padding: 11px 13px;
  }

  .mini-stat span { font-size: 9.5px; }
  .mini-stat strong { font-size: 12.5px; }

  /* Settings / reports ----------------------------------------- */
  .settings-layout { gap: 18px; }
  .settings-nav {
    border-radius: 16px;
    border-color: #e4eff7;
    padding: 6px;
    box-shadow: 0 12px 30px -30px rgba(21, 59, 91, 0.4);
  }

  .settings-nav-item {
    border-radius: 10px;
    font-size: 12px;
    padding: 8px 11px;
  }

  .settings-nav-item.is-active {
    background: linear-gradient(135deg, #edfaff, #f2f8ff);
    color: var(--navy-800);
    font-weight: 700;
  }

  .public-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px dashed #c8e7f4;
    background: linear-gradient(135deg, #f3fbff, #f8fdff);
  }

  .public-settings h3 { font-size: 13px; font-weight: 800; margin-top: 3px; }
  .public-settings p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
  .public-settings-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

  .bar-chart { gap: 9px; padding: 4px 20px 18px; }
  .bar-row { gap: 9px; }
  .bar-label { font-size: 10.5px; width: 108px; }
  .bar-track { height: 8px; border-radius: 7px; background: #eef5fa; }
  .bar-fill {
    border-radius: 7px;
    background: linear-gradient(90deg, #3aa9d6, #7bd3ee);
    box-shadow: 0 0 12px rgba(58, 169, 214, 0.28);
  }

  .bar-value { font-size: 10.5px; }

  .report-grid { gap: 14px; }

  /* Dentist workspace ------------------------------------------ */
  .job-list { display: flex; flex-direction: column; }
  .job-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 13px 18px;
    border-bottom: 1px solid #edf4fa;
  }

  .job-card:last-child { border-bottom: 0; }
  .job-card:hover { background: #f8fcff; }

  .job-time {
    width: 58px;
    flex: none;
    text-align: center;
    border-radius: 11px;
    background: linear-gradient(145deg, #eefaff, #f5fbff);
    border: 1px solid #daf0fa;
    padding: 6px 4px;
  }

  .job-time strong { display: block; font-size: 13px; font-weight: 800; color: var(--sky-600); }
  .job-time span { display: block; font-size: 9px; color: var(--muted); }

  .job-main { flex: 1; min-width: 0; }
  .job-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
  .job-title a { font-size: 13px; font-weight: 700; color: var(--navy-800); }
  .job-main small { font-size: 10.5px; color: var(--muted); }
  .job-main p { font-size: 10.5px; color: var(--ink-soft); margin-top: 3px; }
  .job-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

  .day-nav { display: flex; align-items: center; gap: 4px; }

  .split-grid { gap: 14px; }

  /* Calls ------------------------------------------------------- */
  .call-list { display: flex; flex-direction: column; }
  .call-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    border-bottom: 1px solid #edf4fa;
  }
  .call-card:last-child { border-bottom: 0; }
  .call-card:hover { background: #fbfdff; }

  .call-date {
    width: 82px;
    flex: none;
    text-align: center;
    border-radius: 12px;
    border: 1px solid #f6e4c5;
    background: #fff9ed;
    padding: 6px;
  }

  .call-date strong { display: block; font-size: 11px; color: #9a650f; }
  .call-date span { display: block; font-size: 9.5px; color: #b9873a; }

  .call-main { flex: 1; min-width: 0; }
  .call-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
  .call-title a { font-size: 13px; font-weight: 700; color: var(--navy-800); }
  .call-main p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
  .call-main small { font-size: 9.5px; color: var(--muted-2); }
  .call-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

  .confirm-dot {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px dashed #d9e6f1;
    color: #9aabbb;
    font-size: 9px;
  }

  .confirm-dot.is-on {
    border-style: solid;
    border-color: #c9f2e6;
    background: #e9fbf5;
    color: #0a8a6f;
    font-weight: 700;
  }

  .cell-check { color: #0f9d7e; }
  .cell-check .icon { width: 20px; height: 20px; }

  /* Auth -------------------------------------------------------- */
  .auth-page {
    background:
      radial-gradient(900px 500px at 90% -10%, rgba(47, 169, 221, 0.28), transparent 62%),
      radial-gradient(720px 420px at 0% 100%, rgba(15, 157, 126, 0.13), transparent 65%),
      linear-gradient(135deg, #eef8fd, #f6fbff 45%, #eef4fc);
    min-height: 100vh;
  }

  .auth-shell {
    max-width: 1060px;
    min-height: 620px;
    margin: 4vh auto;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 40px 100px -55px rgba(16, 46, 73, 0.65);
    background: #fff;
  }

  .auth-brand {
    background:
      radial-gradient(420px 280px at 10% 0%, rgba(47, 169, 221, 0.42), transparent 65%),
      radial-gradient(420px 300px at 100% 100%, rgba(111, 91, 214, 0.25), transparent 65%),
      linear-gradient(160deg, #1c3a55, #173049 60%, #12283c);
    padding: 46px 40px;
    display: flex;
    align-items: center;
  }

  .auth-brand::before,
  .auth-brand::after {
    opacity: 0.35;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 65%);
  }

  .auth-brand-inner { max-width: 390px; }
  .auth-logo {
    width: 94px;
    height: 94px;
    object-fit: contain;
    padding: 7px;
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.6);
  }

  .auth-brand h1 { font-size: 38px; font-weight: 800; letter-spacing: -0.04em; margin-top: 18px; }
  .auth-brand p { font-size: 13px; color: rgba(255, 255, 255, 0.72); margin-top: 8px; }

  .auth-points { margin-top: 22px; gap: 7px; }
  .auth-points li {
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 8px 11px;
    font-size: 11.5px;
  }

  .auth-points .icon { color: #9cecff; }

  .auth-copy {
    margin-top: 18px;
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
  }

  .auth-panel {
    padding: 40px 38px;
    background:
      radial-gradient(360px 220px at 100% 0%, rgba(47, 169, 221, 0.08), transparent 70%),
      #fff;
  }

  .auth-card {
    width: 100%;
    max-width: 360px;
    border: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  .auth-card-head img {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    border: 1px solid #e4eff7;
    padding: 3px;
    object-fit: contain;
  }

  .auth-card-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
  .auth-card-head p { font-size: 11.5px; color: var(--muted); }
  .auth-card .form { margin-top: 20px; gap: 13px; }
  .auth-card .btn--block { min-height: 44px; margin-top: 3px; }

  .auth-demo {
    margin-top: 18px;
    border-radius: 14px;
    border: 1px dashed #d9e8f3;
    background: #f8fcff;
    padding: 11px 13px;
    font-size: 10.5px;
  }

  .auth-demo strong { font-size: 10.5px; }
  .auth-demo code { font-size: 10px; }

  .auth-public-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 12px;
    border-radius: 11px;
    border: 1px solid #d9eef8;
    background: linear-gradient(135deg, #f1fbff, #f8fdff);
    color: var(--sky-600);
    font-size: 11.5px;
    font-weight: 700;
  }

  .auth-public-link:hover { border-color: #9ed9ef; color: var(--navy-700); }
  .auth-footer { margin-top: 14px; font-size: 10px; }

  /* Public pages ------------------------------------------------ */
  .public-page {
    background:
      radial-gradient(900px 420px at 95% -80px, rgba(47, 169, 221, 0.14), transparent 60%),
      radial-gradient(700px 380px at 0% 30%, rgba(111, 91, 214, 0.06), transparent 65%),
      #f4f9fd;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .public-topbar {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .public-brand { display: flex; align-items: center; gap: 10px; color: var(--navy-900); }
  .public-brand img { width: 46px; height: 46px; object-fit: contain; border-radius: 14px; background: #fff; padding: 3px; box-shadow: 0 12px 26px -20px rgba(21, 59, 91, 0.5); }
  .public-brand strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
  .public-brand small { display: block; font-size: 10px; color: var(--muted); }
  .public-brand:hover { color: var(--navy-900); }

  .public-topbar-actions { display: flex; align-items: center; gap: 8px; }
  .public-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--navy-700);
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e1edf6;
  }

  .public-phone .icon { width: 15px; height: 15px; color: var(--sky-600); }
  .public-main { flex: 1; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 10px 0 36px; }

  .public-footer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 16px 0 24px;
    border-top: 1px solid #e2edf6;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 10px;
    color: var(--muted);
  }

  .booking-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    min-height: 320px;
    padding: 36px 38px;
    border-radius: 28px;
    overflow: hidden;
    color: #fff;
    background:
      radial-gradient(480px 260px at 84% 10%, rgba(91, 208, 245, 0.4), transparent 62%),
      radial-gradient(400px 280px at 8% 100%, rgba(111, 91, 214, 0.3), transparent 65%),
      linear-gradient(135deg, #17344e 0%, #225e83 58%, #2f93bd 100%);
    box-shadow: 0 30px 70px -42px rgba(16, 46, 73, 0.6);
  }

  .booking-hero-copy { position: relative; z-index: 2; max-width: 600px; }
  .booking-hero .eyebrow {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: #bdf0ff;
  }

  .booking-hero h1 {
    font-size: clamp(32px, 4.2vw, 52px);
    line-height: 1.18;
    letter-spacing: -0.045em;
    font-weight: 800;
    margin-top: 8px;
  }

  .booking-hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #9cecff, #d6f7ff 40%, #b9c8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .booking-hero p {
    margin-top: 12px;
    max-width: 500px;
    font-size: 13px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.8);
  }

  .booking-hero-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
  .booking-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.92);
  }

  .booking-pill .icon { width: 14px; height: 14px; color: #a9ecff; }

  .booking-hero-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
  }

  .hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.5;
  }

  .hero-blob--a { width: 230px; height: 230px; background: rgba(88, 214, 255, 0.24); top: 12%; right: 18%; }
  .hero-blob--b { width: 170px; height: 170px; background: rgba(255, 255, 255, 0.12); bottom: 0; left: 8%; }

  .hero-logo-card {
    position: relative;
    z-index: 2;
    width: 190px;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 38px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 60px -26px rgba(0, 0, 0, 0.5);
    transform: rotate(-4deg);
  }

  .hero-logo-card img { width: 82%; height: 82%; object-fit: contain; }

  .hero-float {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--navy-700);
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.6);
  }

  .hero-float .icon { width: 14px; height: 14px; color: var(--sky-600); }
  .hero-float--a { top: 6%; left: 0; animation: floaty 6s ease-in-out infinite; }
  .hero-float--b { bottom: 8%; right: 0; animation: floaty 7s ease-in-out 0.8s infinite; }

  @keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
  }

  .booking-card {
    position: relative;
    margin-top: 18px;
    background: #fff;
    border: 1px solid #e1edf7;
    border-radius: 28px;
    padding: 24px 26px 26px;
    box-shadow: 0 24px 60px -50px rgba(16, 46, 73, 0.5);
  }

  .booking-alert { margin-bottom: 16px; }
  .booking-steps { display: flex; flex-direction: column; gap: 26px; }
  .booking-step { display: flex; flex-direction: column; gap: 12px; }

  .booking-step-head { display: flex; align-items: flex-start; gap: 10px; }
  .booking-step-head h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-900); }
  .booking-step-head p { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
  .booking-step-head--sm h2 { font-size: 13.5px; }

  .step-number {
    width: 27px;
    height: 27px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient(135deg, #eafaff, #eef4ff);
    border: 1px solid #d7eefa;
    color: var(--sky-600);
    font-size: 11px;
    font-weight: 800;
  }

  .choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .choice-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 13px;
    border: 1px solid #e5eff7;
    background: #fbfdff;
    color: var(--ink);
    min-width: 0;
  }

  .choice-card:hover { border-color: #a8dcef; background: #f5fcff; color: var(--ink); }

  .choice-card.is-selected {
    border-color: #74cae8;
    background: linear-gradient(135deg, #f0fbff, #f7fdff);
    box-shadow: 0 0 0 3px rgba(47, 169, 221, 0.09);
  }

  .choice-icon {
    width: 31px;
    height: 31px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eef9fe;
    color: var(--sky-600);
  }

  .choice-icon .icon { width: 17px; height: 17px; }
  .choice-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
  .choice-body strong { font-size: 11.5px; font-weight: 700; color: var(--navy-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .choice-body small { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .choice-check {
    margin-inline-start: auto;
    width: 18px;
    height: 18px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--sky-500);
    color: #fff;
  }

  .choice-check .icon { width: 11px; height: 11px; stroke-width: 3; }

  .date-strip {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 3px 1px 8px;
    scrollbar-width: thin;
    scrollbar-color: #c8e3f0 transparent;
  }

  .date-chip {
    flex: none;
    width: 88px;
    padding: 9px 6px;
    border-radius: 13px;
    border: 1px solid #e5eff7;
    background: #fbfdff;
    text-align: center;
    color: var(--ink-soft);
    line-height: 1.5;
  }

  .date-chip:hover { border-color: #a8dcef; color: var(--ink); background: #f5fcff; }
  .date-chip.is-selected { background: linear-gradient(155deg, #24506f, #2f84ad); border-color: transparent; color: #fff; box-shadow: 0 12px 24px -18px rgba(24, 72, 104, 0.8); }
  .date-chip.is-disabled { opacity: 0.45; background: #f8fbfd; }
  .date-chip span { display: block; font-size: 9px; }
  .date-chip strong { display: block; font-size: 19px; font-weight: 800; line-height: 1.2; }
  .date-chip small { display: block; font-size: 8.5px; }
  .date-chip em { display: block; margin-top: 3px; font-size: 8px; font-style: normal; opacity: 0.72; }

  .slots-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; }
  .slots-head h3 { font-size: 12px; font-weight: 800; color: var(--navy-800); }
  .slots-head span { font-size: 10px; color: var(--muted); }

  .slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .slot-chip { cursor: pointer; }
  .slot-chip input { position: absolute; opacity: 0; pointer-events: none; }
  .slot-chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    border-radius: 10px;
    border: 1px solid #dfeaf3;
    background: #fbfdff;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    transition: all 0.12s ease;
  }

  .slot-chip:hover span { border-color: #a8dcef; color: var(--sky-600); background: #f4fbff; }
  .slot-chip input:checked + span {
    background: linear-gradient(135deg, #2c6288, #3aa9d6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(42, 118, 159, 0.8);
  }

  .booking-patient { margin-top: 16px; border-radius: 18px; border: 1px solid #e3eef7; background: linear-gradient(180deg, #f9fcff, #f6fafd); padding: 16px; }
  .booking-patient .form-grid { margin-top: 10px; }
  .booking-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
  .booking-summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 11px;
    background: #f4fbff;
    border: 1px dashed #cfe9f5;
    color: var(--sky-600);
    font-size: 11px;
    font-weight: 600;
  }

  .booking-summary .icon { width: 15px; height: 15px; }
  .booking-note { font-size: 9.5px; color: var(--muted); line-height: 1.8; margin-top: 2px; }

  .booking-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 24px 16px;
    border-radius: 14px;
    border: 1px dashed #d9e9f3;
    background: #f9fcff;
    color: var(--muted);
    text-align: center;
  }

  .booking-empty > .icon { width: 28px; height: 28px; color: #9ab7c9; }
  .booking-empty h3 { font-size: 12.5px; color: var(--navy-800); }
  .booking-empty p { font-size: 10px; }

  .success-wrap { max-width: 720px; margin: 22px auto 0; }
  .success-card {
    background: #fff;
    border: 1px solid #e2eef7;
    border-radius: 28px;
    padding: 38px 34px;
    text-align: center;
    box-shadow: 0 26px 70px -55px rgba(16, 46, 73, 0.5);
  }

  .success-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 19px;
    background: linear-gradient(135deg, #e8fbf5, #d7f8ee);
    color: #0f9d7e;
    box-shadow: 0 14px 30px -20px rgba(15, 157, 126, 0.55);
  }

  .success-icon .icon { width: 30px; height: 30px; stroke-width: 2.4; }
  .success-icon--amber { background: linear-gradient(135deg, #fff7e8, #fdeccd); color: #b97712; }
  .success-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-900); margin-top: 4px; }
  .success-card > p { font-size: 12px; color: var(--muted); max-width: 520px; margin: 8px auto 0; line-height: 1.9; }
  .success-card--closed { max-width: 560px; }

  .booking-code {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 18px auto;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px dashed #bfe3f2;
    background: #f3fbff;
    color: var(--muted);
    font-size: 10px;
  }

  .booking-code strong { font-size: 16px; letter-spacing: 0.18em; color: var(--sky-600); }

  .success-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 8px 0 18px;
    text-align: right;
  }

  .success-details div { padding: 9px 10px; border-radius: 11px; background: #f8fbfe; border: 1px solid #e8f1f8; }
  .success-details span { display: block; font-size: 9px; color: var(--muted); }
  .success-details strong { display: block; font-size: 11px; color: var(--navy-800); margin-top: 1px; }
  .success-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

  /* Datepicker skin -------------------------------------------- */
  .jdp-overlay { backdrop-filter: none; }
  .jdp-container {
    border-radius: 16px !important;
    border: 1px solid #dbe9f3 !important;
    box-shadow: 0 26px 60px -30px rgba(16, 46, 73, 0.5) !important;
    font-family: var(--font) !important;
    padding: 10px !important;
  }

  .jdp-container .jdp-header { border-radius: 10px; background: #f3fafe; }
  .jdp-container .jdp-day.jdp-selected span,
  .jdp-container .jdp-day.jdp-selected { background: linear-gradient(135deg, #2c6288, #3aa9d6) !important; border-radius: 8px; }
  .jdp-container .jdp-day.jdp-today span { border-color: #3aa9d6 !important; color: #1f8fbe !important; }
}

@media screen and (max-width: 1180px) {
  .content { padding: 20px 20px 40px; }
  .booking-hero { grid-template-columns: 1fr 0.7fr; padding: 30px; }
  .hero-logo-card { width: 160px; height: 160px; border-radius: 32px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 960px) {
  .content { padding: 16px 14px 36px; }
  .sidebar { width: 250px; }
  .topbar { padding: 0 14px; }
  .booking-hero { grid-template-columns: 1fr; }
  .booking-hero-art { display: none; }
  .public-main, .public-topbar, .public-footer { width: calc(100% - 28px); }
  .public-topbar { padding: 14px 0; }
  .public-phone { display: none; }
  .auth-shell { margin: 12px; min-height: 0; }
  .auth-brand { display: none; }
  .auth-panel { padding: 30px; }
  .success-details { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 700px) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .stat-grid, .stat-grid--2, .stat-grid--3, .stat-grid--4 { grid-template-columns: 1fr 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .public-topbar-actions .btn { padding: 6px 9px; font-size: 10px; }
  .public-brand strong { font-size: 16px; }
  .booking-hero { padding: 24px 20px; border-radius: 22px; }
  .booking-hero h1 { font-size: 32px; }
  .booking-card { padding: 20px 16px; border-radius: 22px; }
  .booking-submit { align-items: stretch; flex-direction: column; }
  .booking-summary { justify-content: center; }
  .booking-submit .btn { width: 100%; }
  .public-footer { flex-direction: column; gap: 3px; }
  .success-card { padding: 28px 18px; }
  .success-card h1 { font-size: 21px; }
  .success-details { grid-template-columns: 1fr 1fr; }
  .job-card, .call-card { flex-wrap: wrap; }
  .job-actions, .call-actions { width: 100%; margin-inline-start: 72px; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media screen {
  jdp-container {
    --jdp-primary: #2fa9dd;
    --jdp-color-1: #f5fafd;
    --jdp-color-2: #e2edf6;
    --jdp-color-3: #c4d8e6;
    --jdp-color-4: #6f8397;
    --jdp-color-5: #152b3f;
    font-family: var(--font) !important;
    border: 1px solid #dbe9f3 !important;
    border-radius: 18px !important;
    box-shadow: 0 26px 60px -30px rgba(16, 46, 73, 0.5) !important;
    padding: 8px 0 !important;
    overflow: hidden;
  }

  jdp-container .jdp-day,
  jdp-container .jdp-day-name,
  jdp-container .jdp-year,
  jdp-container .jdp-month {
    font-family: var(--font) !important;
    font-size: 11px;
  }

  jdp-container .jdp-day.selected,
  jdp-container .jdp-day.selected:hover {
    background: linear-gradient(135deg, #2c6288, #3aa9d6) !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 14px -8px rgba(42, 118, 159, 0.7);
  }

  jdp-container .jdp-day.today:not(.selected) {
    border-color: #3aa9d6 !important;
    color: #1f8fbe !important;
  }

  jdp-container .jdp-btn-today,
  jdp-container .jdp-btn-empty,
  jdp-container .jdp-btn-close {
    background: linear-gradient(135deg, #2c6288, #3aa9d6) !important;
    border-radius: 9px !important;
    font-family: var(--font) !important;
    font-size: 10px !important;
    padding: 6px 10px !important;
  }

  jdp-container .jdp-btn-empty { background: #f1f7fb !important; color: #527089 !important; }
  jdp-container .jdp-btn-close { background: #f1f7fb !important; color: #527089 !important; }
  jdp-container .jdp-icon-plus,
  jdp-container .jdp-icon-minus { border-color: #d8e6f1 !important; border-radius: 8px !important; }
}

@media screen {
  .choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .choice-row > div {
    border: 1px solid #e1ecf5;
    border-radius: 999px;
    background: #f8fcff;
    padding: 2px 10px;
    transition: border-color 0.14s ease, background 0.14s ease;
  }

  .choice-row > div:has(input:checked) {
    border-color: #8fd4eb;
    background: #eafaff;
    box-shadow: 0 0 0 2px rgba(47, 169, 221, 0.07);
  }

  .choice-row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    cursor: pointer;
    color: var(--ink-soft);
  }

  .choice-row input { width: 14px; height: 14px; min-height: 0; }
}

@media screen {
  .num { white-space: nowrap; }
  .error-shell img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    padding: 5px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 40px -24px rgba(16, 46, 73, 0.4);
  }
}

@media screen and (max-width: 700px) {
  .hide-sm { display: none !important; }
  .earnings-table td:nth-child(2), .earnings-table td:nth-child(2) strong { white-space: nowrap; }
}

/* Quiet UI: remove explanatory subtext; controls and values carry the page. */
@media screen {
  .page-title p,
  .page-title .eyebrow,
  .panel-sub,
  .hint,
  .quick-head p,
  .callout p,
  .empty-state p,
  .panel-mini-note,
  .booking-note,
  .booking-hero p,
  .booking-step-head p,
  .booking-empty p,
  .success-card > p,
  .success-card .eyebrow,
  .public-settings p,
  .public-settings .eyebrow,
  .auth-brand p,
  .auth-card-head p,
  .stat-body small,
  .alert-text small,
  .topbar-user small,
  .sidebar-user-text small,
  .brand-text small,
  .public-brand small,
  .sidebar-public-hint,
  .toolbar-note,
  .drawer-head p,
  .modal-head p {
    display: none !important;
  }
}

@media screen {
  .report-grid { grid-template-columns: minmax(0, 1fr); }
}

@media screen {
  .form-more {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .form-more summary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 0;
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--navy-700);
  }

  .form-more summary::-webkit-details-marker { display: none; }

  .form-more summary::after {
    content: "+";
    margin-inline-start: auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #eef8fd;
    color: var(--sky-600);
    font-size: 14px;
    font-weight: 500;
  }

  .form-more[open] summary::after { content: "−"; }

  .form-more-body {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding-top: 10px;
  }
}
