/* Self-hosted Vazirmatn — no external CDN (must work behind filtering).
   font-display: swap → text renders immediately in Tahoma, swaps to Vazir when ready. */
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 400;
  src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 500;
  src: url("/fonts/Vazirmatn-Medium.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 600;
  src: url("/fonts/Vazirmatn-SemiBold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 700;
  src: url("/fonts/Vazirmatn-Bold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 800 900;
  src: url("/fonts/Vazirmatn-Black.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #16242e;
  --muted: #6b7c88;
  --line: #e4eaee;
  --primary: #0e8f8a;        /* medical teal */
  --primary-dark: #0a6f6b;
  --primary-soft: #e3f4f3;
  --accent: #f0843e;
  --danger: #d65745;
  --night: #3d4f9e;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(16, 40, 50, .06);
  --shadow-lg: 0 8px 28px rgba(16, 40, 50, .10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff; font-weight: 900; font-size: 22px;
}
.brand-mark.sm { width: 24px; height: 24px; font-size: 17px; border-radius: 7px; }
.main-nav { display: flex; gap: 22px; margin-inline-start: 8px; flex: 1; }
.main-nav a { color: var(--muted); font-weight: 600; transition: color .15s; }
.main-nav a:hover { color: var(--primary); }
.header-actions { margin-inline-start: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d96f28; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 13px 26px; font-size: 16px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #0e8f8a 0%, #0a6f6b 100%);
  color: #fff; padding: clamp(40px, 8vw, 64px) 0 clamp(48px, 9vw, 80px); text-align: center;
}
.hero h1 { font-size: clamp(23px, 5.5vw, 34px); font-weight: 900; margin: 0 0 14px; line-height: 1.45; }
.hero p { font-size: clamp(15px, 3.2vw, 17px); opacity: .92; max-width: 620px; margin: 0 auto 30px; }

/* search box on hero */
.search-card {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 18px; max-width: 860px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; align-items: end;
}
.search-card .field { display: flex; flex-direction: column; gap: 5px; text-align: start; }
.search-card label { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- Forms ---------- */
select, input[type="text"], input[type="tel"], input[type="number"], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); }
label { font-size: 13px; }

/* ---------- Sections / grid ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(19px, 4.2vw, 23px); font-weight: 800; margin: 0; }
.section-head a { color: var(--primary); font-weight: 700; font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-pad { padding: 18px; }

.shift-card { display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.shift-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.shift-card .facility { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.shift-card .row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; color: var(--muted); font-size: 13.5px; }
.shift-card .pay { font-weight: 800; color: var(--primary-dark); font-size: 14px; overflow-wrap: anywhere; }
.shift-card .foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.shift-card .foot .pay { flex: 1; min-width: 0; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-day { background: #fff4e8; color: #c5670f; }
.badge-evening { background: #fdeede; color: #b25c12; }
.badge-night { background: #e9ecfb; color: var(--night); }
.badge-oncall { background: #f0eaf6; color: #6b3fa0; }
.badge-verified { background: var(--primary-soft); color: var(--primary-dark); }
.badge-type { background: #eef3f6; color: var(--muted); }
.badge-distance { background: #fff1e8; color: #c5670f; }
.badge-job { background: #eaf3ff; color: #2563eb; }
.badge-gender { background: #f3eefb; color: #6b3fa0; }

/* ---------- Filters layout ---------- */
.layout-2 { display: grid; grid-template-columns: 270px 1fr; gap: 24px; align-items: start; }
.filter-card { position: sticky; top: 84px; }
.filter-card h3 { font-size: 15px; margin: 0 0 14px; }
.filter-group { margin-bottom: 16px; }
.filter-group > label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }

/* ---------- Calendar ---------- */
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal { width: 100%; min-width: 660px; border-collapse: separate; border-spacing: 8px; }
.cal th { font-size: 13px; color: var(--muted); font-weight: 700; padding-bottom: 6px; }
.cal td {
  vertical-align: top; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; height: 130px; width: 14.28%;
}
.cal .day-num { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.cal td.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal td.empty { background: #fafcfc; }
.cal-chip {
  display: block; font-size: 12px; padding: 4px 7px; border-radius: 7px;
  margin-bottom: 5px; font-weight: 700; border: 1px solid transparent;
}
.cal-chip.day { background: #fff4e8; color: #c5670f; }
.cal-chip.evening { background: #fdeede; color: #b25c12; }
.cal-chip.night { background: #e9ecfb; color: var(--night); }
.cal-chip.oncall { background: #f0eaf6; color: #6b3fa0; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ---------- Misc ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: clamp(20px, 5vw, 28px) 0; }
.page-head h1 { margin: 0; font-size: clamp(20px, 4.6vw, 26px); line-height: 1.4; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.info-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--muted); }
.info-row .v { font-weight: 700; }
.stat-pills { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.stat-pill { background: rgba(255,255,255,.14); border-radius: 12px; padding: 12px 20px; }
.stat-pill .n { font-size: 24px; font-weight: 900; display: block; }
.stat-pill .l { font-size: 13px; opacity: .9; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-inner p { margin: 4px 0 0; font-size: 13px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert-success { background: var(--primary-soft); color: var(--primary-dark); }

/* account-type chooser on login */
.acct-toggle { display: flex; gap: 10px; }
.acct-opt { flex: 1; display: block; cursor: pointer; }
.acct-opt input { position: absolute; opacity: 0; }
.acct-opt span { display: block; text-align: center; padding: 12px 8px; border: 1.5px solid var(--line);
  border-radius: 12px; font-weight: 700; font-size: 14px; transition: all .15s; }
.acct-opt span small { font-weight: 400; color: var(--muted); font-size: 11px; }
.acct-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }

/* hour-range timeline bar */
.hourbar-wrap { direction: ltr; margin: 6px 0 2px; }
.hourbar {
  position: relative; height: 9px; background: #eef3f6;
  border-radius: 999px; overflow: hidden;
}
.hourbar-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.06); }
.hourbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.hourbar-fill.day { background: #f0a052; }
.hourbar-fill.evening { background: #e07b3a; }
.hourbar-fill.night { background: #5566c4; }
.hourbar-fill.oncall { background: linear-gradient(90deg, #8a5cc0 25%, #b79be0 50%, #8a5cc0 75%); }
.hourbar-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 3px; }

/* recommendation reason chips */
.rec-reasons { display: flex; flex-direction: column; gap: 4px; margin: 2px 0; }
.rec-reason { font-size: 12px; color: var(--primary-dark); font-weight: 600; }
.rec-banner { background: linear-gradient(135deg,#0e8f8a 0%,#0a6f6b 100%); color:#fff;
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; display:flex;
  align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.rec-banner .btn-outline { border-color:#fff; color:#fff; }
.rec-banner .btn-outline:hover { background: rgba(255,255,255,.15); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .search-card { grid-template-columns: 1fr 1fr; }
  .layout-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-card { position: static; }

  /* Header wraps to two rows; nav becomes a scrollable strip (NOT hidden). */
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px 16px; }
  .main-nav {
    order: 3; flex: 1 0 100%; margin-inline-start: 0; gap: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .main-nav a { white-space: nowrap; font-size: 14px; }
  .header-actions { margin-inline-start: auto; }
  .header-actions a { font-size: 14px; }

  .cal { border-spacing: 4px; }
  .cal td { height: auto; min-height: 80px; padding: 6px; }
}
@media (max-width: 520px) {
  .container { padding: 0 14px; }
  .grid-3, .grid-4, .search-card { grid-template-columns: 1fr; }
  .section { padding: 32px 0; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  .stat-pill { padding: 10px 16px; }
  .stat-pill .n { font-size: 20px; }
  /* Tighten in-card action rows so buttons don't overflow */
  .rec-banner { padding: 16px; }
}
