/* ==========================================================================
   Nobat24 design system — Persian RTL, clinical blue + emerald accents.
   Tokens follow the source theme's DESIGN.md, rebuilt as plain CSS.
   ========================================================================== */

:root {
  --primary: #006194;
  --primary-600: #007bb9;
  --primary-050: #eaf4fb;
  --primary-100: #cce5ff;
  --secondary: #006c4a;
  --secondary-050: #e8f8f1;
  --accent: #f59e0b;
  --accent-050: #fffbeb;
  --danger: #ba1a1a;
  --danger-050: #ffdad6;
  --info: #0284c7;
  --info-050: #f0f9ff;

  --surface: #f7f9fc;
  --surface-raised: #ffffff;
  --surface-sunken: #eef2f7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  --gutter: 1.25rem;
  --container: 1280px;
  --header-h: 68px;

  --font: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  line-height: 1.85;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.6em;
  line-height: 1.5;
  font-weight: 700;
  color: var(--text);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
img { max-width: 100%; height: auto; }
small { font-size: 0.8rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.u-muted { color: var(--text-subtle); font-weight: 400; }
.u-center { text-align: center; }
.u-nowrap { white-space: nowrap; }
.u-ltr { direction: ltr; unicode-bidi: embed; }
.u-mt { margin-top: 1rem; }
.u-mb { margin-bottom: 1rem; }
.u-hidden { display: none !important; }
.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;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; display: grid; place-items: center; font-size: 1.1rem; font-weight: 800;
}
.brand small { display: block; font-size: 0.68rem; color: var(--text-subtle); font-weight: 500; }

.main-nav { display: flex; gap: 0.35rem; margin-inline-start: 1rem; }
.main-nav a {
  padding: 0.5rem 0.85rem; border-radius: var(--radius-pill);
  color: var(--text-muted); font-size: 0.92rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover, .main-nav a.is-active { background: var(--primary-050); color: var(--primary); }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 0.5rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1.3rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-family: inherit; font-size: 0.92rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s ease;
  text-align: center; white-space: nowrap;
}
.btn:disabled, .btn.is-disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-success { background: var(--secondary); color: #fff; }
.btn-success:hover { background: #005a3e; color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: var(--primary-050); color: var(--primary); }
.btn-soft:hover { background: var(--primary-100); color: var(--primary); }
.btn-danger { background: var(--danger-050); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.45rem; width: 34px; height: 34px; border-radius: 9px; }

/* ---------------------------------------------------------------- forms */
.input, .select, textarea.input, select.input {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-family: inherit; font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 97, 148, 0.12);
}
.input::placeholder { color: #94a3b8; }
.field { margin-bottom: 1rem; }
.field > label { display: block; margin-bottom: 0.4rem; font-size: 0.86rem; font-weight: 600; color: var(--text-muted); }
.field .help { font-size: 0.78rem; color: var(--text-subtle); margin-top: 0.3rem; }
.field .error { font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; }
.checkbox { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; }
.checkbox input { margin-top: 0.35rem; accent-color: var(--secondary); }

/* ---------------------------------------------------------------- layout */
.page { padding: 2rem 0 3.5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.65rem; }
.page-head p { margin: 0.35rem 0 0; color: var(--text-subtle); font-size: 0.92rem; }

.card {
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 1.4rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-body { padding: 1.4rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(0, 108, 74, 0.12), transparent 60%),
    radial-gradient(900px 380px at 10% 0%, rgba(0, 97, 148, 0.16), transparent 65%),
    linear-gradient(180deg, #f4f9fd 0%, #f7f9fc 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.2rem 0 3.6rem;
}
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.45; margin-bottom: 0.8rem; }
.hero p.lead { font-size: 1.05rem; color: var(--text-muted); max-width: 46ch; margin-bottom: 1.8rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem;
  background: var(--secondary-050); color: var(--secondary);
  padding: 0.3rem 0.8rem; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 600;
}

.search-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.search-box .search-field { flex: 1 1 240px; position: relative; }
.search-box .search-field input {
  width: 100%; border: 0; background: transparent; padding: 0.75rem 1rem;
  font-family: inherit; font-size: 0.95rem; color: var(--text);
}
.search-box .search-field input:focus { outline: none; }
.search-box select {
  border: 0; border-inline-start: 1px solid var(--border); background: transparent;
  padding: 0.75rem 1rem; font-family: inherit; font-size: 0.9rem; color: var(--text-muted);
  min-width: 150px;
}
.suggest-list {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 40;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; display: none;
}
.suggest-list.is-open { display: block; }
.suggest-list a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0.9rem; font-size: 0.88rem; color: var(--text);
}
.suggest-list a:hover { background: var(--primary-050); }

/* ---------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: var(--radius-pill);
  background: #fff; border: 1px solid var(--border-strong);
  font-size: 0.85rem; color: var(--text-muted); transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-scroll { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: thin; }

/* ---------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.6rem; border-radius: var(--radius-pill);
  font-size: 0.74rem; font-weight: 600; white-space: nowrap;
}
.pill.is-success { background: var(--secondary-050); color: var(--secondary); }
.pill.is-warning { background: var(--accent-050); color: #b45309; }
.pill.is-danger { background: var(--danger-050); color: var(--danger); }
.pill.is-info { background: var(--info-050); color: var(--info); }
.pill.is-neutral { background: var(--surface-sunken); color: var(--text-subtle); }

/* ---------------------------------------------------------------- doctor card */
.doctor-card {
  display: flex; gap: 1rem; padding: 1.1rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  height: 100%;
}
.doctor-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-2px); }
.doctor-avatar {
  width: 76px; height: 76px; border-radius: 18px; object-fit: cover;
  background: var(--primary-050); color: var(--primary);
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; flex: 0 0 auto;
}
.doctor-body { flex: 1; min-width: 0; }
.doctor-name { font-weight: 700; font-size: 1rem; margin-bottom: 0.15rem; }
.doctor-meta { font-size: 0.82rem; color: var(--text-subtle); margin-bottom: 0.5rem; }
.doctor-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.doctor-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; }
.rating { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.rating .count { color: var(--text-subtle); font-weight: 400; }

.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars .star {
  width: 13px; height: 13px; display: inline-block;
  background: #e2e8f0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.stars .star.is-full { background: var(--accent); }
.stars .star.is-half { background: linear-gradient(90deg, var(--accent) 50%, #e2e8f0 50%); }

/* ---------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 0.8rem; color: var(--text-subtle); margin-bottom: 0.35rem; }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.2; }
.stat-trend { font-size: 0.78rem; margin-top: 0.3rem; color: var(--secondary); }
.stat-trend.is-down { color: var(--danger); }

/* ---------------------------------------------------------------- date strip */
.date-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.25rem 0 0.75rem; }
.date-pill {
  flex: 0 0 auto; min-width: 84px; padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: #fff; text-align: center; cursor: pointer; transition: all 0.15s;
}
.date-pill .dow { font-size: 0.72rem; color: var(--text-subtle); }
.date-pill .day { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.date-pill .mon { font-size: 0.68rem; color: var(--text-subtle); }
.date-pill .free { font-size: 0.68rem; color: var(--secondary); }
.date-pill.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.date-pill.is-active .dow, .date-pill.is-active .mon, .date-pill.is-active .free { color: rgba(255,255,255,0.85); }
.date-pill.is-empty { opacity: 0.45; }

/* ---------------------------------------------------------------- slots */
.shift-group { margin-bottom: 1.2rem; }
.shift-title { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.6rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.5rem; }
.slot {
  padding: 0.5rem 0.4rem; border-radius: var(--radius-sm);
  border: 1px solid var(--secondary); color: var(--secondary);
  background: #fff; font-size: 0.88rem; font-weight: 600;
  text-align: center; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.slot:hover:not(:disabled) { background: var(--secondary-050); }
.slot.is-selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot:disabled, .slot.is-full {
  border-color: var(--border); background: var(--surface-sunken);
  color: #94a3b8; cursor: not-allowed; text-decoration: line-through;
}
.slot.is-low { border-color: var(--accent); color: #b45309; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { padding: 0.75rem 0.9rem; text-align: right; border-bottom: 1px solid var(--border); }
.table th { background: var(--surface-sunken); font-weight: 600; color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.table tbody tr:hover { background: #fbfdff; }
.table td.actions { white-space: nowrap; }

/* ---------------------------------------------------------------- alerts */
.alert {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.85rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; font-size: 0.88rem; margin-bottom: 1rem;
}
.alert-success { background: var(--secondary-050); border-color: #a7e8cd; color: #005137; }
.alert-error, .alert-danger { background: var(--danger-050); border-color: #ffb4ab; color: #93000a; }
.alert-warning { background: var(--accent-050); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-050); border-color: #bae6fd; color: #075985; }

/* ---------------------------------------------------------------- panel */
.panel { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
.sidebar {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem; position: sticky; top: calc(var(--header-h) + 1rem);
}
.sidebar-user { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0.4rem 0.9rem; border-bottom: 1px solid var(--border); margin-bottom: 0.7rem; }
.sidebar-user .avatar {
  width: 44px; height: 44px; border-radius: 14px; background: var(--primary-050);
  color: var(--primary); display: grid; place-items: center; font-weight: 700;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.7rem; border-radius: 9px; font-size: 0.88rem; color: var(--text-muted);
}
.sidebar-nav a:hover { background: var(--surface-sunken); color: var(--text); }
.sidebar-nav a.is-active { background: var(--primary-050); color: var(--primary); font-weight: 600; }
.sidebar-nav .sep { height: 1px; background: var(--border); margin: 0.5rem 0; }

/* ---------------------------------------------------------------- misc */
.empty {
  text-align: center; padding: 2.5rem 1rem; color: var(--text-subtle);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: #fff;
}
.empty strong { display: block; color: var(--text); margin-bottom: 0.3rem; }

.pagination { display: flex; gap: 0.35rem; justify-content: center; margin-top: 1.8rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
  font-size: 0.85rem; color: var(--text-muted); padding-inline: 0.5rem;
}
.pagination .is-current { background: var(--primary); border-color: var(--primary); color: #fff; }

.breadcrumb { display: flex; gap: 0.4rem; font-size: 0.8rem; color: var(--text-subtle); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-subtle); }
.breadcrumb a:hover { color: var(--primary); }

.progress { height: 6px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--secondary); border-radius: 999px; }

.tabs { display: flex; gap: 0.35rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs button, .tabs a {
  padding: 0.6rem 1rem; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; color: var(--text-subtle);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.is-active, .tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.rating-input { display: flex; gap: 0.4rem; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { display: none; }
.rating-input label {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  font-size: 1.3rem; color: #d7dee8; transition: color 0.15s;
}
.rating-input input:checked ~ label,
.rating-input label:hover, .rating-input label:hover ~ label { color: var(--accent); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 0.9rem; }
.site-footer a { color: #94a3b8; font-size: 0.88rem; display: block; padding: 0.2rem 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 2rem; padding-top: 1.2rem; font-size: 0.8rem; color: #64748b; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .split, .panel { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
}
@media (max-width: 720px) {
  html { font-size: 15px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 2rem 0 2.4rem; }
  .search-box { flex-direction: column; }
  .search-box select { border-inline-start: 0; border-top: 1px solid var(--border); width: 100%; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .table th, .table td { padding: 0.6rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn span { display: none; }
}

/* sticky mobile booking bar */
.mobile-book-bar {
  display: none; position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 0.7rem 1rem;
  align-items: center; justify-content: space-between; gap: 1rem;
  box-shadow: 0 -8px 20px rgba(15,23,42,0.08);
}
@media (max-width: 768px) { .mobile-book-bar { display: flex; } .page { padding-bottom: 6rem; } }
