/* آوند — brand tokens from CLAUDE.md. Plain cards, room to breathe, no gradients, no decorative icons. */
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Estedad; src: url(/fonts/Estedad-ExtraBold.ttf) format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: Estedad; src: url(/fonts/Estedad-Black.ttf) format("truetype"); font-weight: 900; font-display: swap; }

:root {
  --forest: #0C2E27;   /* سبز جنگلی تیره */
  --green: #127A5E;    /* سبز آوند */
  --sap: #C9F25D;      /* سبز شیره، فقط برای تأکید */
  --paper: #F4F6F1;    /* کاغذی */
  --stone: #5E716A;    /* متن دوم */
  --rust: #B4532A;     /* هشدار */
  --card: #FFFFFF;
  --line: #DCE3DD;
  --soft: #E8EDE8;
  --rust-soft: #F7E9E2;
  --sap-soft: #F0FAD8;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--forest); font: 400 15px/1.75 Vazirmatn, Tahoma, sans-serif; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: Estedad, Vazirmatn, sans-serif; font-weight: 800; line-height: 1.4; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--stone); }
.small { font-size: .85rem; }
.num { font-feature-settings: "tnum"; }

/* top bar */
.top { background: var(--forest); color: var(--paper); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--paper); font: 900 1.35rem Estedad, sans-serif; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { color: #C8D3CE; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.top nav a:hover { color: var(--paper); text-decoration: none; background: rgba(255,255,255,.06); }
.top nav a.on { color: var(--forest); background: var(--sap); }
.sim { border: 1px solid var(--sap); color: var(--sap); border-radius: 999px; padding: 2px 10px; font-size: .8rem; white-space: nowrap; }
.logout { color: #C8D3CE; font-size: .85rem; white-space: nowrap; }
.logout:hover { color: var(--paper); }

/* phone: the sections live in a bar at the bottom, always in reach of the thumb */
.bottomnav { display: none; }

main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }
footer { max-width: 1120px; margin: 0 auto; padding: 0 16px 28px; color: var(--stone); font-size: .82rem; }

/* cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { margin: 0; }
.crumb { color: var(--stone); font-size: .9rem; }

/* forms */
select, input[type=password], input[type=number] { font: inherit; color: var(--forest); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; }
button, .btn { font: 600 .9rem Vazirmatn, sans-serif; border-radius: 8px; padding: 6px 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--forest); cursor: pointer; display: inline-block; }
button:hover, .btn:hover { border-color: var(--stone); text-decoration: none; }
.btn-main { background: var(--forest); color: var(--paper); border-color: var(--forest); }
.btn-main:hover { background: var(--green); border-color: var(--green); }
label { font-weight: 500; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font: 800 1.45rem Estedad, sans-serif; }
.kpi span { color: var(--stone); font-size: .85rem; }

/* «ده‌تای صبح» */
.ten { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.ten-head { background: var(--forest); color: var(--paper); padding: 14px 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ten-head h1 { font-size: 1.2rem; margin: 0; color: var(--paper); }
.ten-head .muted { color: #A9BAB3; }
.item { display: grid; grid-template-columns: 92px 1fr 190px; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: center; }
.item:first-of-type { border-top: 0; }
.metric { border-radius: 8px; color: #fff; text-align: center; padding: 10px 4px; background: var(--forest); }
.metric b { display: block; font: 800 1.5rem/1.2 Estedad, sans-serif; }
.metric span { font-size: .8rem; opacity: .9; }
.metric.warn { background: var(--rust); }
.metric.quiet { background: var(--stone); }
.item h3 { font: 500 1rem/1.8 Vazirmatn, sans-serif; margin: 0 0 4px; }
.item h3 a { color: var(--forest); }
.meta { color: var(--stone); font-size: .82rem; }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: .78rem; color: var(--stone); margin-left: 6px; }
.act { display: flex; flex-direction: column; gap: 8px; }
.action { background: var(--sap-soft); border: 1px solid #DDEFAE; border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: .88rem; text-align: center; }
.verdicts { display: flex; gap: 6px; justify-content: center; }
.verdicts button { padding: 3px 10px; font-size: .82rem; }
.verdicts .yes:hover { border-color: var(--green); color: var(--green); }
.verdicts .no:hover { border-color: var(--rust); color: var(--rust); }
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 600; }
.badge.approve { background: var(--sap-soft); color: var(--green); border: 1px solid #DDEFAE; }
.badge.reject { background: var(--rust-soft); color: var(--rust); border: 1px solid #EDCDBE; }
.ten-foot { padding: 12px 20px; border-top: 1px solid var(--line); color: var(--stone); font-size: .88rem; }
.note { background: var(--sap-soft); border: 1px solid #DDEFAE; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 14px; font-size: .9rem; }
.note.reject { background: var(--rust-soft); border-color: #EDCDBE; }
.info { background: var(--card); border: 1px solid var(--line); border-right: 4px solid var(--green); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.info b { color: var(--green); }
.warnbox { border-right-color: var(--rust); }
.warnbox b { color: var(--rust); }

/* reasons */
.reasons { list-style: none; padding: 0; margin: 0; }
.reasons li { padding: 8px 0; border-top: 1px dashed var(--line); display: flex; gap: 10px; }
.reasons li:first-child { border-top: 0; }
.reasons .pts { flex: 0 0 64px; text-align: center; font-weight: 700; color: var(--rust); font-size: .85rem; background: var(--rust-soft); border-radius: 6px; padding: 2px 0; height: fit-content; }
.reasons .pts.zero { color: var(--green); background: var(--sap-soft); }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: right; color: var(--stone); font-weight: 500; font-size: .82rem; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--soft); vertical-align: top; }
tr.flag td { background: var(--rust-soft); }
tr.flag td:first-child { box-shadow: inset -3px 0 0 var(--rust); }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--paper); }
tr.flag.link:hover td { background: #F2DDD3; }

/* meters (single series: brand green on a light track) */
.meter { position: relative; height: 12px; background: var(--soft); border-radius: 4px; min-width: 120px; }
.meter i { position: absolute; top: 0; bottom: 0; right: 0; background: var(--green); border-radius: 4px; }
.meter u { position: absolute; top: 3px; bottom: 3px; border-left: 2px solid var(--forest); border-right: 2px solid var(--forest); text-decoration: none; }
.meter s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--forest); }

/* 14-day strip on the visitors page (status colours, each cell carries a tooltip and a text count) */
.strip { display: flex; gap: 2px; }
.strip i { width: 12px; height: 18px; border-radius: 3px; background: var(--soft); }
.strip i.ok { background: #A8CDBF; }
.strip i.mid { background: #E3C2B2; }
.strip i.low { background: var(--rust); }

/* map */
.map { height: 380px; border-radius: 8px; border: 1px solid var(--line); background: #FAFBF8; }
.map.tall { height: 460px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--stone); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; }
.lg-fix, .lg-dot { border-radius: 50%; background: var(--green); width: 9px; height: 9px; }
.lg-flag { border-radius: 50%; border: 3px solid var(--rust); background: #fff; }
.lg-shop, .lg-other { border: 2px solid var(--forest); background: #fff; }
.lg-other { border-color: var(--stone); }
.lg-poi { border-radius: 50%; border: 2px solid var(--stone); background: transparent; }
.lg-link { height: 0; border-top: 2px dashed var(--rust); width: 18px; }
.lg-stop { border-radius: 50%; background: var(--forest); }
.leaflet-container { font-family: Vazirmatn, sans-serif; background: #FAFBF8; }
.leaflet-tooltip { direction: rtl; font: 500 .82rem Vazirmatn, sans-serif; }
.shop-ic { width: 10px; height: 10px; border: 2px solid var(--forest); background: #fff; }
.other-ic { width: 10px; height: 10px; border: 2px solid var(--stone); background: #fff; }
.stop-ic { width: 22px; height: 22px; border-radius: 50%; background: var(--forest); color: var(--paper); font: 700 11px/22px Vazirmatn; text-align: center; }
.nb-label { color: #8A9A93; font: 700 13px Estedad, sans-serif; white-space: nowrap; text-align: center; }

/* tomorrow sheet (phone first) */
.sheet-head { background: var(--forest); color: var(--paper); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.sheet-head h1 { color: var(--paper); font-size: 1.25rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 2px 12px; font-size: .88rem; }
.chip b { color: var(--sap); }
.task { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--soft); align-items: start; }
.task:first-of-type { border-top: 0; }
.task .n { width: 30px; height: 30px; border-radius: 50%; background: var(--forest); color: var(--paper); text-align: center; font: 700 .85rem/30px Vazirmatn; }
.task .n.o { background: var(--soft); color: var(--stone); }
.task b { font-weight: 600; }
.task .ev { color: var(--forest); font-size: .82rem; font-weight: 600; white-space: nowrap; text-align: left; }
.task .ev span { display: block; color: var(--stone); font-size: .72rem; font-weight: 400; }

/* login */
.login { max-width: 380px; margin: 8vh auto; text-align: center; }
.login img { margin-bottom: 8px; }
.login input { width: 100%; margin: 12px 0; padding: 10px 12px; text-align: center; }
.login button { width: 100%; padding: 10px; }
.err { color: var(--rust); }
.demo-pw { background: var(--sap-soft); border-color: #DDEFAE; }
.demo-pw .pw { font: 700 1.6rem/1.6 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--forest);
  user-select: all; margin: 4px 0; }

@media (max-width: 860px) {
  .top-in { gap: 8px 12px; }
  .top nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
  .sim { margin-right: auto; }
  .item { grid-template-columns: 74px 1fr; }
  .item .act { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .action { text-align: right; }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .top .topnav, .top .logout { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0;
    background: var(--forest); border-top: 1px solid rgba(255,255,255,.08); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav > a, .bottomnav summary { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 56px;
    padding: 6px 2px; color: #C8D3CE; font: 600 .78rem/1.3 Vazirmatn, sans-serif; border-top: 3px solid transparent; cursor: pointer; }
  .bottomnav > a:hover, .bottomnav summary:hover { text-decoration: none; color: var(--paper); }
  .bottomnav .on { color: var(--sap); border-top-color: var(--sap); }
  .bottomnav summary { list-style: none; }
  .bottomnav summary::-webkit-details-marker { display: none; }
  .more { position: relative; }
  .more-panel { position: absolute; bottom: calc(100% + 6px); left: 6px; min-width: 190px; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(12,46,39,.18); padding: 6px; }
  .more-panel a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--forest); font-weight: 600; }
  .more-panel a.on { background: var(--sap-soft); color: var(--green); }
  .more-panel a:hover { background: var(--paper); text-decoration: none; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  main { padding: 14px 12px 32px; }
  .card { padding: 14px; }
  .item { padding: 14px; gap: 12px; }
  .metric b { font-size: 1.25rem; }
  .item .act { flex-direction: column; align-items: stretch; }
  .map { height: 300px; }
  h1 { font-size: 1.3rem; }
}

/* guided tour (Driver.js), right to left and in the brand */
.tour-btn { background: transparent; color: var(--paper); border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  padding: 2px 12px; font-size: .82rem; }
.tour-btn:hover { border-color: var(--sap); color: var(--sap); }
.driver-popover.avand-tour { direction: rtl; text-align: right; font-family: Vazirmatn, sans-serif; max-width: 360px;
  border-radius: var(--radius); padding: 16px 18px; color: var(--forest); }
.avand-tour .driver-popover-title { font: 800 1.02rem/1.6 Estedad, Vazirmatn, sans-serif; color: var(--forest); }
.avand-tour .driver-popover-description { font: 400 .9rem/1.9 Vazirmatn, sans-serif; color: #2B3D37; }
.avand-tour .driver-popover-description b { font-weight: 700; }
.avand-tour .driver-popover-close-btn { left: 6px; right: auto; color: var(--stone); }
.avand-tour .driver-popover-footer { flex-wrap: wrap; gap: 6px; align-items: center; }
.avand-tour .driver-popover-progress-text { color: var(--stone); font-size: .8rem; }
.avand-tour .driver-popover-navigation-btns { gap: 6px; margin-right: auto; margin-left: 0; }
.avand-tour .driver-popover-footer button { font: 600 .85rem Vazirmatn, sans-serif; text-shadow: none; border-radius: 8px;
  padding: 4px 12px; border: 1px solid var(--line); background: #fff; color: var(--forest); }
.avand-tour .driver-popover-footer .driver-popover-next-btn { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.avand-tour .tour-skip { background: transparent !important; border-color: transparent !important; color: var(--stone) !important; padding-right: 0 !important; }
.avand-tour .tour-next { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--green); }
.glossary dt { font-weight: 700; margin-top: 10px; }
.glossary dd { margin: 2px 0 0; color: #2B3D37; }

/* the other side of the coin: honest work is shown too */
.card.good { border-right: 4px solid var(--green); }
.good-tag { background: var(--sap-soft); color: var(--green); border-color: #DDEFAE; }

/* messenger preview (generic, no brand imitation) */
.phone-chat { background: #E7EEE6; border-radius: 14px; padding: 14px; max-width: 460px; }
.chat-head { font-size: .8rem; color: var(--stone); margin-bottom: 8px; }
.bubble { background: #fff; border-radius: 12px 12px 4px 12px; padding: 12px 14px; white-space: pre-wrap; font-size: .9rem; line-height: 1.9;
  box-shadow: 0 1px 1px rgba(12,46,39,.08); }
.chat-time { font-size: .72rem; color: var(--stone); text-align: left; margin-top: 4px; }
