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

:root {
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #12261e;
  --muted: #4d655a;
  --brand: #0b6b4f;
  --brand-2: #0e8a66;
  --line: #d5e3dc;
  --danger: #9b1c1c;
  --warn: #8a5a00;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(12, 40, 28, 0.08);
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #e8f3ee 0%, var(--bg) 220px);
  min-height: 100vh;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #1fb888;
  outline-offset: 2px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: .5rem 1rem;
}
.skip-link:focus { left: 0; z-index: 99; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(244, 247, 245, 0.92);
  border-bottom: 1px solid var(--line);
}
.topbar-inner, .shell, .footer {
  width: min(1100px, calc(100% - 1.5rem));
  margin-inline: auto;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 0;
}
.brand { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.brand strong { font-size: 1.05rem; }
.brand small { color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.lang-switch a[aria-current="true"] { font-weight: 700; }
.shell { padding: 1.25rem 0 3rem; }
.footer { padding: 1rem 0 2rem; color: var(--muted); font-size: .9rem; }
.hero h1 { margin: 0 0 .5rem; font-size: clamp(1.4rem, 3vw, 2rem); }
.demo-banner {
  background: #fff4d6; color: #5c4300; border: 1px solid #f0d48a;
  border-radius: 999px; display: inline-block; padding: .35rem .85rem; font-size: .9rem;
}
.search-panel, .auth-card, .pharmacy-card, .detail, .stats .stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search-panel, .auth-card, .detail { padding: 1rem; margin-bottom: 1rem; }
.search-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-row input[type="search"] { flex: 1 1 220px; }
input, select, textarea, button, .btn {
  font: inherit; border-radius: 10px; border: 1px solid var(--line); padding: .65rem .8rem; background: #fff;
}
.btn, button {
  cursor: pointer; background: #eef6f2; color: var(--ink); border: 1px solid var(--line);
}
.btn.primary, button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.ghost, .linkish { background: transparent; border: none; color: var(--brand); padding: 0; }
.filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-top: .75rem;
}
.near-me { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hint, .muted, .meta { color: var(--muted); }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.chip {
  display: inline-block; padding: .4rem .75rem; border-radius: 999px; background: #e7f5ef;
  border: 1px solid #b9dfce; color: var(--ink); text-decoration: none;
}
.results-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.results-layout {
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .results-layout[data-active-view="list"],
  .results-layout[data-active-view="map"],
  .results-layout { grid-template-columns: 1.1fr 1fr; }
}
.results-layout[data-active-view="list"] .map-pane { display: none; }
.results-layout[data-active-view="map"] .list-pane { display: none; }
@media (min-width: 900px) {
  .results-layout[data-active-view="list"] .map-pane,
  .results-layout[data-active-view="map"] .list-pane { display: block; }
}
.pharmacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.pharmacy-card { padding: .9rem; }
.pharmacy-card.is-active { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(14,138,102,.25); }
.card-head { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.card-head h3 { margin: 0; font-size: 1.05rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.badge {
  background: #e7f5ef; color: var(--brand); border-radius: 999px; padding: .15rem .55rem; font-size: .8rem;
}
.status-out_of_stock { background: #fde8e8; color: var(--danger); }
.status-unknown { background: #f3f3f3; color: #555; }
.map {
  min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: #dfece6;
}
.detail-map { min-height: 280px; margin-top: 1rem; }
.map-degraded {
  background: #fff4d6; border: 1px solid #f0d48a; padding: .5rem .75rem; border-radius: 10px; margin-bottom: .5rem;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 1rem 0; }
.stats .stat { padding: 1rem; text-align: center; }
.stats .stat strong { display: block; font-size: 1.6rem; color: var(--brand); }
.dash-nav, .toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; align-items: center; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); overflow-x: auto; display: block; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: .55rem .45rem; text-align: start; white-space: nowrap; }
.stack-form { display: grid; gap: .75rem; max-width: 640px; }
.stack-form label { display: grid; gap: .3rem; }
.inline-form { display: inline; }
.flash { list-style: none; padding: 0; }
.flash li { background: #e7f5ef; border: 1px solid #b9dfce; padding: .5rem .75rem; border-radius: 10px; margin-bottom: .5rem; }
.flash .error { background: #fde8e8; border-color: #f1b0b0; }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.compact-list { padding-inline-start: 1.1rem; }
.row-error { background: #fff1f1; }
.row-create { background: #f2fff8; }
.empty { color: var(--muted); padding: 1rem 0; }
.proposal-page { max-width: 860px; }
.proposal-page h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.proposal-page section { margin: 1.5rem 0; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.proposal-page .price {
  font-size: 1.4rem; font-weight: 700; color: var(--brand); background: #e7f5ef;
  display: inline-block; padding: .4rem .8rem; border-radius: 10px;
}
.proposal-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.proposal-toc a { background: #eef6f2; padding: .3rem .6rem; border-radius: 999px; text-decoration: none; }
@media print {
  .topbar, .footer, .dash-nav, .lang-switch { display: none !important; }
  body { background: #fff; }
  .proposal-page section { break-inside: avoid; box-shadow: none; }
}
@media (max-width: 480px) {
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
}
