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

:root {
  --navy: #272b41;
  --navy-2: #1b1f31;
  --ink: #1c2030;
  --muted: #5d647c;
  --gray: #e6e6e6;
  --paper: #f3f3f4;
  --card: #ffffff;
  --teal: #99cccc;
  --teal-deep: #2f6f6f;
  --line: #d5d6dc;
  --holiday: #f6d4d4;
  --holiday-ink: #7a1f1f;
  --ok: #1d6b45;
  --warn: #8a5a00;
  --gold: #8d6b22;
  --shadow: 0 10px 30px rgba(39, 43, 65, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.3; margin: 0 0 0.4rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.05rem; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px;
  flex: none;
  background: var(--navy);
  color: white;
  padding: 1.2rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.logo { display: block; height: auto; }
.logo-sidebar { width: min(210px, 100%); }
.logo-top-light { height: 36px; width: auto; }
.logo-top-white { display: none; height: 28px; width: auto; }
.logo-login { width: min(150px, 42vw); margin: 0 auto; }
.logo-card { width: min(128px, 40%); margin: 0 auto 0.8rem; }
.tagline { margin: 0; color: #c9cddd; font-size: 0.78rem; }
.login-tagline { color: #d5d8e4; text-align: center; margin: 0.45rem 0 0.9rem; }
.menu { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.4rem; }
.menu a {
  color: #e7e8ee; padding: 0.55rem 0.7rem; border-radius: 8px; text-decoration: none;
}
.menu a.active, .menu a:hover { background: rgba(153, 204, 204, 0.18); color: white; }
.logout { margin-top: auto; }
.logout button, .btn, button.btn {
  font-family: inherit; cursor: pointer; border: 0; border-radius: 8px;
  background: var(--navy); color: white; padding: 0.55rem 0.9rem; font-weight: 500;
}
.sidebar .logout button { background: transparent; color: var(--teal); border: 1px solid rgba(153,204,204,.45); width: 100%; }
.btn.ghost { background: white; color: var(--navy); border: 1px solid var(--line); }
.btn.danger { background: var(--holiday-ink); }
.main { flex: 1; padding: 1rem 1.1rem 2.5rem; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: white; color: var(--navy); border: 1px solid var(--line); border-radius: 12px;
  margin: 0 0 0.9rem; padding: 0.55rem 0.8rem;
}
.topbar-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.85rem; color: var(--muted); }
.topbar-meta strong { color: var(--navy); }
.burger { display: none; color: var(--teal); font-weight: 700; cursor: pointer; }
.muted { color: var(--muted); }
.page-head, .toolbar { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.9rem; }
.view-switch { display: flex; background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.view-switch a { padding: 0.4rem 0.8rem; color: var(--navy); text-decoration: none; }
.view-switch a.on { background: var(--teal); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 0.7rem; }
.flash { padding: 0.6rem 0.8rem; border-radius: 10px; background: #e5f3f3; }
.flash-bad { background: var(--holiday); color: var(--holiday-ink); }
.banner { background: var(--holiday); color: var(--holiday-ink); padding: 0.7rem 0.9rem; border-radius: 10px; }
.banner.closed, .banner.quiet { background: var(--gray); color: var(--navy); }
.scroll-hint { display: none; color: var(--muted); font-size: 0.85rem; }
.sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.sheet { min-width: 980px; }
.sheet-row { display: grid; grid-template-columns: 88px repeat(var(--cols), minmax(130px, 1fr)); }
.sheet-row.head { position: sticky; top: 0; background: var(--navy); color: white; z-index: 1; }
.hour-col, .res-col, .cell { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0.45rem; min-height: 76px; }
.res-col { display: flex; flex-direction: column; }
.res-col em, .cell small { color: var(--teal); font-style: normal; font-size: 0.78rem; }
.sheet-row.head .res-col em { color: var(--teal); }
.sheet-row.shut { background: var(--gray); }
.cell a { display: flex; flex-direction: column; gap: 0.1rem; color: inherit; text-decoration: none; }
.cell.busy { background: #f7fbfb; box-shadow: inset 3px 0 0 var(--teal); }
.cell.ghost { background: #eef2f2; color: var(--muted); }
.free { color: var(--muted); }
.tier, .status, .pill {
  display: inline-block; border-radius: 999px; padding: 0.05rem 0.45rem; font-size: 0.75rem; background: var(--gray); color: var(--navy);
}
.tier-king_prime { background: #f4e7c3; color: var(--gold); }
.tier-vip { background: #d9dee8; color: var(--navy); }
.tier-suspicious { background: #f1e8d6; color: #6b5a3a; }
.tier-blacklist { background: #e4e4e7; color: #4a4e5c; }
.status-done { background: #d9efe4; color: var(--ok); }
.status-no_show, .status-cancelled { background: var(--holiday); color: var(--holiday-ink); }
.status-pending { background: #f8e2b8; color: var(--warn); }
.status-confirmed { background: #d5ecec; color: var(--teal-deep); }
.week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 0.5rem; overflow-x: auto; }
.day-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem; min-width: 140px; }
.day-card.holiday { background: var(--holiday); }
.day-card.closed { background: var(--gray); }
.day-card header { display: flex; flex-direction: column; margin-bottom: 0.4rem; }
.day-card em { color: var(--holiday-ink); font-style: normal; font-size: 0.78rem; }
.day-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.dow { text-align: center; color: var(--muted); font-size: 0.85rem; }
.mcell {
  min-height: 92px; background: white; border-radius: 10px; padding: 0.35rem;
  display: flex; flex-direction: column; gap: 0.15rem; color: inherit; text-decoration: none; border: 1px solid transparent;
}
.mcell.out { opacity: 0.38; }
.mcell.holiday { background: var(--holiday); }
.mcell.closed { background: var(--gray); }
.mcell.today { outline: 2px solid var(--teal); }
.mcell em { font-style: normal; color: var(--holiday-ink); font-size: 0.72rem; }
.mcell .num { font-weight: 700; }
.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1rem; align-items: start; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.92rem; }
input, select, textarea {
  font-family: inherit; font-size: 1rem; padding: 0.5rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--line); background: white; color: var(--ink);
}
.date-set { display: flex; gap: 0.4rem; flex-wrap: wrap; border: 0; padding: 0; }
.check { flex-direction: row; align-items: center; gap: 0.4rem; }
.table-wrap { overflow-x: auto; background: white; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--navy); color: white; font-weight: 500; }
.actions, .actions.inline { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.detail dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0.6rem 0 0; }
.detail dt { color: var(--muted); font-size: 0.82rem; }
.detail dd { margin: 0; }
.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.history li { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; background: var(--paper); border-radius: 8px; padding: 0.45rem 0.6rem; }
.suggest { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.suggest button { width: 100%; text-align: right; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem; font-family: inherit; cursor: pointer; }
.resource-form { margin-bottom: 0.7rem; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 1.2rem; }
.login-wrap { width: min(440px, 100%); }
.login-card { background: white; border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
tr.lunar td:first-child { box-shadow: inset 3px 0 0 var(--teal); }

@media (max-width: 900px) {
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; z-index: 5; width: min(280px, 86vw); }
  .nav-toggle:checked ~ .shell .sidebar { display: flex; }
  .topbar { background: var(--navy); color: white; border: 0; border-radius: 0; margin: -1rem -1.1rem 0.9rem; }
  .topbar-meta, .topbar-meta strong { color: #d5d8e4; }
  .logo-top-light { display: none; }
  .logo-top-white { display: block; }
  .burger { display: inline; }
  .split, .fields, .detail dl, .week { grid-template-columns: 1fr; }
  .scroll-hint { display: block; }
  .month { grid-template-columns: repeat(7, minmax(42px, 1fr)); }
  .mcell { min-height: 68px; padding: 0.2rem; }
  .mcell em { display: none; }
  .mcell.holiday em { display: block; }
}
.dms-box { background: #f4f8fb; border: 1px solid var(--line); border-right: 3px solid var(--teal); border-radius: 10px; padding: 0.55rem 0.7rem; margin: 0.45rem 0; font-size: 0.86rem; line-height: 1.8; }
.dms-box.dms-weak { border-right-color: #c98a00; background: #fffaf0; }
.dms-vehicle + .dms-vehicle { border-top: 1px dashed var(--line); margin-top: 0.35rem; padding-top: 0.35rem; }
.suggest .dms-box { margin: 0.2rem 0 0.4rem; }
.dms-vehicle { display: grid; grid-template-columns: max-content 1fr; gap: 0.1rem 0.6rem; margin: 0.35rem 0 0; }
.dms-vehicle dt { color: var(--muted); font-size: 0.8rem; }
.dms-vehicle dd { margin: 0; }

.status-sms-cancel { background: #f3e4ea; color: #7a2344; }
.sms-cancel-list { margin-top: 1rem; }
.sms-cancel-item a, .sms-week-cancel a { color: #7a2344; text-decoration: none; }
.today-cancel-list, .today-week-cancel { margin-top: 0.75rem; }
.today-cancel-list h2 { font-size: 1rem; font-weight: 600; color: #7a2344; }
.today-cancel-list a, .today-week-cancel a { color: #7a2344; text-decoration: none; }
.today-week-cancel { list-style: none; padding: 0; margin: 0.35rem 0 0; font-size: 0.9rem; }
.cancel-warn { margin: 0.4rem 0; }
.sms-week-cancel { list-style: none; padding: 0; margin: 0.35rem 0 0; }
.sms-preview {
  background: var(--paper); border: 1px dashed var(--line); border-radius: 8px;
  padding: 0.6rem 0.7rem; white-space: pre-wrap; font-family: inherit; font-size: 0.92rem;
}
.sms-counter { color: var(--teal-deep); font-size: 0.9rem; }
tr.sms-unmatched { background: #fffaf0; }
.sms-body { max-width: 280px; white-space: pre-wrap; font-size: 0.86rem; }
#sms-form textarea { min-height: 6rem; }

/* ---- discreet customer status + chassis picker ---- */
.flag-note { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; border: 1px solid; border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0 0 0.7rem; }
.flag-note.flag-blacklist { background: #ececef; border-color: #b9bcc7; color: #2f3345; }
.flag-note.flag-suspicious { background: #f7f0e1; border-color: #dcc9a0; color: #5e4b25; }
.flag-reason { font-size: 0.85rem; opacity: 0.9; }
.flag-ack { background: #f7f0e1; border-radius: 8px; padding: 0.35rem 0.5rem; }
.vehicle-box { display: flex; flex-direction: column; gap: 0.4rem; grid-column: 1 / -1; }
select.pick-vin { outline: 2px solid #dcc9a0; }
.small { font-size: 0.82rem; }

/* ---- day sheet split into two boxes (north jacks | other bays) ---- */
.sheet-wrap.zoned-wrap { background: transparent; border: none; border-radius: 0; }
.sheet.zoned .sheet-row { grid-template-columns: 88px repeat(var(--z1), minmax(130px, 1fr)) 22px repeat(var(--z2), minmax(130px, 1fr)); }
.sheet:not(.zoned) .zone-head { grid-template-columns: 88px repeat(var(--cols), minmax(130px, 1fr)); }
.sheet.zoned .sheet-row.shut { background: transparent; }
.sheet.zoned .hour-col { background: white; }
.sheet.zoned .sheet-row.shut .hour-col, .sheet.zoned .sheet-row.shut .cell { background: var(--gray); }
.sheet.zoned .sheet-row.head { background: transparent; }
.sheet.zoned .sheet-row.head .hour-col, .sheet.zoned .sheet-row.head .res-col { background: var(--navy); color: white; }
.zone-head { display: grid; }
.zone-head .hour-col.blank { background: transparent; border: none; min-height: 0; }
.zone-title { padding: 0.45rem 0.7rem; font-weight: 700; border-radius: 12px 12px 0 0; text-align: center; }
.zone-title.zone-z1 { background: var(--teal); color: var(--navy); }
.zone-title.zone-z2 { background: #c9cbd6; color: var(--navy); }
.zone-gap { background: transparent; border: none !important; }
.sheet.zoned .cell { background: white; }
.sheet.zoned .cell.zone-z1 { background: #f5fafa; }
.sheet.zoned .cell.busy { background: #eef7f7; }
.sheet.zoned .cell.ghost { background: #eef2f2; }
.sheet.zoned .zone-z1.zfirst { border-right: 3px solid var(--teal-deep); }
.sheet.zoned .zone-z1.zlast { border-left: 3px solid var(--teal-deep); }
.sheet.zoned .zone-z2.zfirst { border-right: 3px solid #8e93a8; }
.sheet.zoned .zone-z2.zlast { border-left: 3px solid #8e93a8; }
.sheet.zoned .sheet-row.last .cell.zone-z1 { border-bottom: 3px solid var(--teal-deep); }
.sheet.zoned .sheet-row.last .cell.zone-z2 { border-bottom: 3px solid #8e93a8; }
.sheet.zoned .sheet-row.last .hour-col { border-bottom: 3px solid #8e93a8; }

.crown {
  display: inline-flex;
  width: 1.15em;
  height: 1.15em;
  margin-inline-start: 0.2rem;
  cursor: help;
  user-select: none;
  vertical-align: -0.15em;
}
.crown svg { width: 100%; height: 100%; display: block; }
.crown-king { color: var(--gold); }
.crown-vip { color: var(--navy); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.attendance-table td:first-child { width: 4rem; text-align: center; }
.attendance-table tr.is-cancelled { opacity: 0.72; background: #f7f7f8; }
.confirm-lead { font-size: 1.05rem; }
.visit-counts { display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; align-items: flex-end; margin: 0 0 0.5rem; padding-bottom: 0.45rem; border-bottom: 1px dashed var(--line); }
.visit-counts .period { color: var(--muted); font-size: 0.8rem; margin-inline-start: auto; }
.visit-count { display: flex; flex-direction: column; gap: 0.05rem; min-width: 5.2rem; }
.visit-count span { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.visit-count b { font-size: 1.2rem; color: var(--navy); }
.visit-count.alert span, .visit-count.alert b { color: var(--holiday-ink); }

.survey-box { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; align-items: baseline; background: #fff6c2; border: 1px solid #e0c04a; border-right: 3px solid #c9a227; border-radius: 10px; padding: 0.45rem 0.7rem; margin: 0 0 0.5rem; }
.survey-box span { color: var(--navy); font-size: 0.82rem; }
.survey-box strong { color: var(--navy); font-size: 1.05rem; }

/* ---- compact RTL nav so 9 bays fit on the day sheet ---- */
.sidebar { width: 188px; padding: 0.85rem 0.65rem 1rem; gap: 0.45rem; }
.logo-sidebar { width: min(160px, 100%); }
.tagline { font-size: 0.68rem; line-height: 1.4; }
.menu { gap: 0.08rem; margin-top: 0.2rem; }
.menu a { padding: 0.32rem 0.5rem; font-size: 0.82rem; border-radius: 6px; }
.menu a .count { color: var(--teal); font-size: 0.75rem; margin-right: 0.2rem; }
.main { padding: 0.75rem 0.75rem 2rem; }

.sheet { min-width: 0; }
.sheet-row { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(96px, 1fr)); }
.sheet.zoned .sheet-row { grid-template-columns: 64px repeat(var(--z1), minmax(0, 1fr)) 10px repeat(var(--z2), minmax(0, 1fr)); }
.sheet.zoned.three .sheet-row { grid-template-columns: 56px repeat(var(--z1), minmax(0, 1fr)) 8px repeat(var(--z2), minmax(0, 1fr)) 8px repeat(var(--z3), minmax(0, 1fr)); }
.hour-col { font-size: 0.8rem; }
.res-col { font-size: 0.78rem; padding: 0.3rem 0.35rem; }
.res-col strong { font-size: 0.8rem; display: block; }
.res-col em { font-size: 0.68rem; color: #d0d3de; }
.cell { font-size: 0.75rem; padding: 0.25rem; }
.cell b { font-size: 0.78rem; }
.cell small { display: block; font-size: 0.68rem; }
.zone-title { font-size: 0.85rem; padding: 0.35rem 0.4rem; }
.zone-title.zone-ground { background: var(--teal); color: var(--navy); }
.zone-title.zone-upper_jacks { background: #c9cbd6; color: var(--navy); }
.zone-title.zone-upper_spaces { background: #e4d7b5; color: var(--navy); }
.sheet.zoned .cell.zone-ground { background: #f5fafa; }
.sheet.zoned .cell.zone-upper_jacks { background: #f4f5f8; }
.sheet.zoned .cell.zone-upper_spaces { background: #faf6ee; }
.sheet.zoned .zone-ground.zfirst { border-right: 3px solid var(--teal-deep); }
.sheet.zoned .zone-ground.zlast { border-left: 3px solid var(--teal-deep); }
.sheet.zoned .zone-upper_jacks.zfirst { border-right: 3px solid #8e93a8; }
.sheet.zoned .zone-upper_jacks.zlast { border-left: 3px solid #8e93a8; }
.sheet.zoned .zone-upper_spaces.zfirst { border-right: 3px solid #c9a227; }
.sheet.zoned .zone-upper_spaces.zlast { border-left: 3px solid #c9a227; }

.bay-timer { margin-top: 0.3rem; background: #fff; color: var(--navy); border-radius: 8px; padding: 0.3rem; font-size: 0.72rem; text-align: right; }
.bay-timer.overtime { background: #fdeaea; border: 1px solid #e0a0a0; }
.bay-timer .overtime-label { color: #a11; display: block; }
.bay-timer form { margin: 0.2rem 0 0; }
.btn.tiny { padding: 0.15rem 0.4rem; font-size: 0.72rem; }
.timer-q, .timer-actions { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.timer-actions input, .timer-q input { width: 3.2rem; font: inherit; padding: 0.1rem; }
.yard-archive { margin-top: 0.8rem; }

/* body shop */
.bs-page { display: flex; flex-direction: column; gap: 1rem; }
.bs-spaces { display: flex; flex-direction: column; gap: 0.7rem; }
.bs-row { display: grid; grid-template-columns: 1fr 1.4fr 0.9fr; gap: 0.7rem; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem; }
.bs-row h3 { margin: 0 0 0.3rem; }
.bs-free { color: var(--muted); }
.car-map { position: relative; max-width: 100%; }
.car-map img { width: 100%; height: auto; display: block; }
.hotspot { position: absolute; border: 1px dashed transparent; cursor: pointer; }
.hotspot:hover { border-color: var(--navy); background: rgba(39,43,65,.08); }
.hotspot.marked { border-style: solid; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; font-size: 0.8rem; margin: 0.3rem 0; }
.legend i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; margin-left: 0.25rem; vertical-align: -1px; }
.work-types { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.overflow-block { border-top: 2px dashed #c9a227; padding-top: 0.6rem; }
.wait-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.sunday-q { background: #fff6c2; border: 1px solid #e0c04a; border-radius: 8px; padding: 0.4rem 0.55rem; margin-top: 0.3rem; }
.contract { max-width: 900px; margin: 0 auto; background: white; padding: 1.2rem 1.4rem 2rem; color: #111; }
.contract .hdr { text-align: center; }
.contract .hdr img { max-width: 100%; height: auto; max-height: 140px; }
.contract .work-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0; }
.contract .work-table th, .contract .work-table td { border: 1px solid #333; padding: 0.25rem 0.4rem; }
.contract .tick { text-align: center; }
.contract .sign { display: flex; justify-content: space-between; margin-top: 2rem; }
.contract-map { position: relative; margin: 0.8rem 0; }
.contract-map img { width: 100%; height: auto; }
@media print {
  .sidebar, .topbar, .no-print, .flash, .burger { display: none !important; }
  .shell, .main { display: block; padding: 0; }
  .contract { box-shadow: none; }
}

body.contract-print .sidebar,
body.contract-print .burger,
body.contract-print .topbar { display: none; }
body.contract-print .shell { display: block; }
body.contract-print .main { margin: 0; padding: 1.2rem 1.5rem; }
.contract .hdr img { max-width: 100%; max-height: 120px; height: auto; object-fit: contain; }
.contract table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; }
.contract table th, .contract table td { border: 1px solid #333; padding: 0.3rem 0.5rem; font-size: 0.9rem; }
@media print {
  .sidebar, .topbar, .burger, .no-print, .flash, .logout { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  body { background: white; }
}

.sheet-row.head .res-col { overflow: hidden; min-width: 0; max-width: 100%; }
.bay-timer { width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; gap: 0.18rem; }
.bay-timer span, .bay-timer small, .bay-timer p, .bay-timer strong, .bay-timer label { display: block; overflow-wrap: anywhere; word-break: break-word; }
.bay-timer form { display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem; width: 100%; min-width: 0; margin: 0.15rem 0 0; }
.bay-timer label { width: 100%; min-width: 0; }
.bay-timer input[type=number] { width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; }
.bay-timer .btn, .bay-timer button { width: 100%; box-sizing: border-box; white-space: normal; }
.materia-one { margin: 0.8rem 0 1.2rem; }
.materia-one .contract-map { margin-bottom: 0.6rem; }

.sheet-row > * { min-width: 0; }
.sheet-row.head-names .hour-col,
.sheet-row.head-names .res-col {
  min-height: 3.6rem;
  height: 3.6rem;
  overflow: hidden;
  justify-content: center;
}
.sheet-row.head-names .res-col strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  max-height: 2.5em;
}
.sheet-row.head-names .res-col em {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.sheet-row.head-timers .hour-col,
.sheet-row.head-timers .res-col {
  height: 8.25rem;
  min-height: 8.25rem;
  max-height: 8.25rem;
  overflow: hidden;
}
.sheet-row.head-timers .res-col { overflow-x: hidden; overflow-y: auto; }
.sheet-row.head-timers .hour-col.blank { background: transparent; border-color: transparent; }
.sheet-row.head-timers { z-index: 1; }
.sheet-row:not(.head):not(.zone-head) .cell,
.sheet-row:not(.head):not(.zone-head) .hour-col {
  min-height: 4.6rem;
}

/* booked customer's car and mobile in the calendar */
.cell-car { font-size: 0.74rem; color: var(--navy, #272B41); font-weight: 500; }
.cell-phone { font-size: 0.74rem; color: #4a4f63; letter-spacing: 0.02em; unicode-bidi: isolate; text-align: right; }
.week-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; margin: 0.1rem 0 0.35rem; }
.bay-timer .cell-car, .bay-timer .cell-phone { display: block; }
.repair-box { border: 1px solid var(--teal); border-radius: 10px; padding: 0.6rem 0.75rem; background: #f4fafa; display: grid; gap: 0.5rem; }
.repair-note { margin: 0; font-size: 0.8rem; }
.remaining-label { color: var(--navy); font-size: 0.85rem; }
.cell .past { color: #a3a7b5; }
.repair-box { grid-column: 1 / -1; }
.timer-name { font-weight: 600; color: inherit; text-decoration: underline dotted; }
.timer-links { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.25rem 0; }
.timer-links form { margin: 0; }
.repair-card { display: flex; flex-direction: column; gap: 0.15rem; background: #fff8ec; border: 1px solid #e3c98f; border-radius: 8px; padding: 0.35rem; }
.repair-card.overtime { background: #fff0f0; border-color: #e6a3a3; }
.repair-card .timer-links input[type=number] { width: 3.2rem; }
.repair-card .timer-q { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.repair-cont { display: block; color: #8a6d2f; font-size: 0.72rem; text-decoration: none; padding-top: 0.2rem; }
a.repair-card { color: inherit; text-decoration: none; cursor: pointer; }
a.repair-card:hover { box-shadow: 0 0 0 2px var(--teal); }
.pill.warn { background: #fdecc8; color: #7a5200; font-size: 0.68rem; }
.repair-panel { margin-top: 1rem; border-right: 4px solid #e3c98f; }
.repair-panel.overtime { border-right-color: #c0392b; }
.repair-panel h2 { margin-top: 0; }
.repair-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.repair-actions form { display: flex; gap: 0.5rem; align-items: flex-end; margin: 0; }
.repair-actions input[type=number] { width: 5rem; }
.btn.finish { background: #1f7a4d; border-color: #1f7a4d; color: #fff; }
.timer-box { display: inline-flex; flex-direction: column; gap: 0.05rem; }
.timer-box .timer-clock { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--navy); }
.timer-box.big .timer-clock { font-size: 1.8rem; }
.timer-box.over .timer-clock { color: #c0392b; }
.timer-box.paused .timer-clock { opacity: 0.6; }
.timer-box.paused .timer-caption::after { content: " (خارج از ساعت کاری)"; }
.late-repairs { border-right: 4px solid #c0392b; margin-top: 1rem; }
.late-repairs li { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; }
.table-wrap { overflow-x: auto; }
.price-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.price-table th, .price-table td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.5rem; text-align: right; }
.price-table thead th { background: var(--navy); color: #fff; }
.price-table input { width: 100%; min-width: 9rem; font-variant-numeric: tabular-nums; }
.price-table tfoot td { font-variant-numeric: tabular-nums; }
.price-table tr.grand th, .price-table tr.grand td { font-weight: 700; background: #eef7f7; }
.price-car { margin-bottom: 1rem; }
.price-car h2 { margin-top: 0; }
.price-table td.center { text-align: center; }
.price-table select, .price-table input:not([type=radio]) { width: 100%; min-width: 7rem; }

/* ---- grouped, colour-coded sidebar ---- */
.sidebar { overflow-y: auto; }
.menu-grouped { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.3rem; }
.menu-bottom { margin-top: auto; }
.menu-group { display: flex; flex-direction: column; gap: 0.08rem; padding: 0.35rem 0.3rem 0.4rem; border-radius: 9px; border-right: 3px solid var(--g); background: color-mix(in srgb, var(--g) 12%, transparent); }
.menu-group .menu-title { font-size: 0.7rem; color: var(--g); font-weight: 700; padding: 0 0.45rem 0.15rem; letter-spacing: 0.01em; }
.menu-group a.active, .menu-group a:hover { background: color-mix(in srgb, var(--g) 30%, transparent); color: #fff; }
.g-ops { --g: #4fc3c3; }
.g-base { --g: #e2b65a; }
.g-admin { --g: #9fa8da; }
.sidebar .who { color: #cfd3e0; font-size: 0.75rem; margin: 0.2rem 0.3rem; }
.menu-bottom .logout { margin-top: 0.2rem; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.kpi { background: #fff; border-radius: 12px; padding: 0.8rem 1rem; border-top: 4px solid var(--teal); display: flex; flex-direction: column; gap: 0.2rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.kpi:nth-child(2) { border-top-color: #c0392b; }
.kpi:nth-child(3) { border-top-color: #e2b65a; }
.kpi:nth-child(4) { border-top-color: #9fa8da; }
.kpi b { font-size: 1.6rem; color: var(--navy); }
.kpi small, .kpi span { color: var(--muted, #6b7083); font-size: 0.78rem; }
.report-table tr.current { background: #f4fafa; }
.bar { display: inline-block; width: 70px; height: 8px; background: #e6e6e6; border-radius: 4px; vertical-align: middle; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.conn-card h3 { margin-top: 0; }
.conn-test.ok { color: #1f7a4d; }
.conn-test.bad { color: #c0392b; }
.status.st-ok { background: #dff3e8; color: #1f7a4d; }
.status.st-bad { background: #fbe3e3; color: #a12b2b; }
.user-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0; }
.user-row input:not([type=checkbox]), .user-row select { min-width: 8rem; width: auto; }
.new-user { margin-top: 0.5rem; }
.match-note { color: #8a6d2f; font-size: 0.72rem; display: block; }
.did-you-mean { border-right: 4px solid #e2b65a; }
.did-you-mean h2 { margin-top: 0; font-size: 1rem; }
.did-you-mean li { display: flex; gap: 0.75rem; align-items: baseline; }
.did-you-mean-title { margin: 0.4rem 0 0.15rem; color: #8a6d2f; font-weight: 600; }
.test-banner { background: #e2b65a; color: #272B41; text-align: center; font-weight: 700; padding: 0.3rem; font-size: 0.85rem; }

/* DMS: oil filter / recalls (1405-09-13) */
.dms-warn { color: #b45309; font-weight: 600; }
.dms-recalls .recall-done { color: #15803d; }
.dms-recalls .recall-open { color: #b91c1c; font-weight: 700; }

.dms-schedule .svc-done { color: #15803d; }
.dms-schedule .svc-late { color: #b45309; }
.dms-schedule .svc-overdue { color: #b91c1c; }
.dms-schedule .svc-soon { color: #b45309; }

.svc-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .25rem; }
.svc-table th, .svc-table td { border: 1px solid #e5e7eb; padding: .25rem .4rem; text-align: right; vertical-align: top; }
.svc-table thead th { background: #eef3fb; }
.svc-table tr.svc-overdue td { background: #fde8e8; }
.svc-table tr.svc-soon td { background: #fff4e0; }
.svc-table tr.svc-unknown td:last-child { color: #92400e; }

/* dashboard picture for the Bale staff channel */
body.snapshot .sidebar, body.snapshot .test-banner { display: none !important; }
body.snapshot .main, body.snapshot main { margin-right: 0 !important; max-width: none !important; }
/* Bale channel box: bright yellow so it stands out */
.g-channel { --g: #facc15; background: color-mix(in srgb, #facc15 22%, transparent); }
.g-channel a { color: #fde68a; font-weight: 600; }
.g-channel a.active, .g-channel a:hover { background: #facc15; color: #1f2937; }

/* ---- parts («📦 قطعات») ---- */
.g-parts { --g: #38bdf8; }
.g-parts .parts-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.15rem; padding: 0.1rem 0.3rem; }
.g-parts .parts-kind-name { width: 100%; font-size: 0.72rem; color: #bae6fd; font-weight: 700; padding-right: 0.2rem; }
.g-parts .parts-kind a { font-size: 0.74rem; padding: 0.15rem 0.35rem; }
.g-parts .count.hot { color: #fde68a; font-weight: 700; }
.g-parts .menu-title a { color: #fde68a; padding: 0; display: inline; }
.g-parts a.parts-new { font-size: 0.78rem; }
.parts-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-start; }
.parts-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0; align-items: center; }
.parts-tabs a { padding: 0.3rem 0.7rem; border-radius: 8px; border: 1px solid var(--line); background: white; color: var(--navy); text-decoration: none; font-size: 0.85rem; }
.parts-tabs a.active { background: var(--navy); color: white; }
.parts-tabs .sep { width: 1rem; }
.parts-search { display: flex; gap: 0.4rem; margin-bottom: 0.7rem; }
.parts-search input { flex: 1; }
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; }
.parts-vin { display: flex; gap: 0.6rem; align-items: flex-end; margin-bottom: 0.8rem; }
.parts-rows input[name^="desc_"] { width: 100%; }
.parts-rows td.center { text-align: center; }
.parts-table td { vertical-align: top; }
.parts-table .pline { font-size: 0.85rem; line-height: 1.6; }
.parts-act form, .parts-act details { margin-bottom: 0.3rem; }
.parts-act .stack { gap: 0.3rem; }
form.inline { display: inline-flex; gap: 0.3rem; align-items: center; }
.st-cancelled { opacity: 0.55; text-decoration: line-through; }
.st-cancelled .parts-act, .st-cancelled form { text-decoration: none; }
.st-arrived, .st-installed { color: #166534; }
.age { display: inline-block; padding: 0 0.4rem; border-radius: 6px; font-size: 0.78rem; }
.age.age-green { background: #dcfce7; color: #166534; }
.age.age-yellow { background: #fef3c7; color: #92400e; }
.age.age-red { background: #fee2e2; color: #991b1b; }
.parts-events { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; line-height: 1.9; }
label.check { flex-direction: row; display: flex; gap: 0.4rem; align-items: center; }
.parts-link { font-size: 0.8rem; }
form.inline.wrap { flex-wrap: wrap; }
.sms-switch { border: 2px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sms-switch.off { border-color: #fca5a5; background: #fef2f2; }
.sms-switch.on { border-color: #86efac; background: #f0fdf4; }
.sms-switch legend { font-weight: 700; padding: 0 0.3rem; }
.promise-timer { border-radius: 10px; padding: 0.45rem 0.6rem; margin-bottom: 0.4rem; display: flex; flex-direction: column; gap: 0.15rem; border: 2px solid; }
.promise-timer.ok { background: #f0fdf4; border-color: #86efac; color: #166534; }
.promise-timer.soon { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.promise-timer.late { background: #fef2f2; border-color: #f87171; color: #991b1b; }
.promise-timer strong { font-size: 1.05rem; }
.promise-edit summary { cursor: pointer; font-size: 0.82rem; color: var(--navy); margin-bottom: 0.3rem; }
.promise-set legend { font-weight: 700; }
.btn.walkin-btn { background: #f97316; border-color: #ea580c; color: #fff; }
.btn.walkin-btn:hover { background: #ea580c; }
.head-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.pill.walkin { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.cell a.is-walkin { border-right: 3px solid #f97316; }
.open-days { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0.4rem 0 0.6rem; }
.open-days a { padding: 0.25rem 0.6rem; border-radius: 8px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; text-decoration: none; font-size: 0.85rem; }
.open-days a.on { background: #92400e; color: #fff; }
.att-nav { flex-wrap: wrap; gap: 0.4rem; }
.cell.walkin-cell { background: #fff7ed; }
.cell.walkin-cell a { color: #9a3412; }
.pill.comeback { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.comeback-check { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px; padding: 0.4rem 0.6rem; }
.cell .cell-note { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.72rem; color: #92400e; background: #fffbeb; border-radius: 4px; padding: 0 0.25rem; margin-top: 0.15rem; cursor: help; }
/* ---- internal messages ---- */
.g-msg { --g: #a78bfa; }
.msg-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0.8rem; align-items: start; }
@media (max-width: 900px) { .msg-layout { grid-template-columns: 1fr; } }
.msg-people { display: flex; flex-direction: column; gap: 0.2rem; max-height: 75vh; overflow: auto; }
.msg-people h3 { margin: 0.8rem 0 0.3rem; font-size: 0.9rem; }
.msg-person { display: grid; grid-template-columns: auto 1fr auto; gap: 0.1rem 0.4rem; align-items: center; padding: 0.45rem 0.55rem; border-radius: 8px; text-decoration: none; color: var(--navy); }
.msg-person small { grid-column: 2 / 4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-person.on, .msg-person:hover { background: #eef2ff; }
.msg-person .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.msg-person .dot.live { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.msg-person .dot.none { background: transparent; }
.msg-thread { display: flex; flex-direction: column; gap: 0.5rem; }
.msg-list { display: flex; flex-direction: column; gap: 0.45rem; max-height: 55vh; overflow: auto; padding: 0.3rem; }
.bubble { max-width: 75%; align-self: flex-end; background: #f1f5f9; border-radius: 12px; padding: 0.45rem 0.7rem; }
.bubble.mine { align-self: flex-start; background: #e0e7ff; }
.bubble.urgent { border: 2px solid #ef4444; }
.bubble p { margin: 0.2rem 0 0; white-space: pre-wrap; }
.bubble .who { color: #64748b; font-size: 0.75rem; }
.bubble .ticks { display: block; font-size: 0.72rem; color: #64748b; margin-top: 0.2rem; }
.bubble .ticks .read { color: #2563eb; }
.msg-compose { display: flex; flex-direction: column; gap: 0.4rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.msg-compose textarea { width: 100%; }
.msg-tools { display: flex; justify-content: space-between; align-items: center; }
.urgent-check { color: #b91c1c; font-weight: 700; }
.emoji-bar { display: flex; flex-wrap: wrap; gap: 0.15rem; }
.emoji-bar .emoji { border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; padding: 0.1rem 0.2rem; border-radius: 6px; }
.emoji-bar .emoji:hover { background: #f1f5f9; }
.sticker-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sticker { display: inline-flex; align-items: center; gap: 0.4rem; border: 2px solid var(--c); color: var(--c); background: #fff; border-radius: 14px; padding: 0.4rem 0.8rem; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.sticker span { font-size: 1.6rem; }
.bubble .sticker { cursor: default; }
.msg-toasts { position: fixed; bottom: 1rem; left: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; max-width: 340px; }
.msg-toast { background: #fff; border: 2px solid #a78bfa; border-radius: 12px; padding: 0.6rem 0.8rem; box-shadow: 0 6px 20px rgba(0,0,0,0.18); direction: rtl; }
.msg-toast.urgent { border-color: #ef4444; background: #fef2f2; }
.msg-toast p { margin: 0.3rem 0; white-space: pre-wrap; max-height: 8rem; overflow: auto; }
.msg-toast div { display: flex; gap: 0.4rem; }
.price-updated { margin: 0 0 0.5rem; color: #475569; }
.price-date { display: block; margin-top: 0.15rem; }
.msg-urgent-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(127, 29, 29, 0.72); display: flex; align-items: center; justify-content: center; direction: rtl; }
.msg-urgent-card { background: #fff; border: 4px solid #ef4444; border-radius: 18px; padding: 1.4rem 1.8rem; max-width: 560px; width: 92%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.4); animation: shp-pulse 1s ease-in-out infinite; }
.msg-urgent-card .bell { font-size: 3rem; animation: shp-shake 0.5s ease-in-out infinite; }
.msg-urgent-card h2 { color: #b91c1c; margin: 0.4rem 0; }
.msg-urgent-card p { font-size: 1.15rem; white-space: pre-wrap; max-height: 40vh; overflow: auto; }
.msg-urgent-card .actions { display: flex; gap: 0.6rem; justify-content: center; margin: 0.8rem 0 0.4rem; flex-wrap: wrap; }
.msg-urgent-card .btn.big { font-size: 1.05rem; padding: 0.6rem 1.2rem; }
.msg-urgent-card small { color: #7f1d1d; }
@keyframes shp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); } 50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }
@keyframes shp-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-15deg); } 75% { transform: rotate(15deg); } }
.msg-unlock { position: fixed; top: 0.6rem; left: 50%; transform: translateX(-50%); z-index: 9998; background: #fef3c7; color: #92400e; border: 2px solid #f59e0b; border-radius: 999px; padding: 0.45rem 1.1rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.15); font-family: inherit; }
