/* Visual layer over site.css (loaded after it): the Vazirmatn font shipped with the site, one colour palette with fixed
   status colours, tables (sticky header, zebra rows, status rows, compact mode), print (A4, page numbers) and the dark
   mode. Pages keep their markup; only classes are styled here. */

/* ---------- Font: Vazirmatn (SIL OFL, wwwroot/lib/vazirmatn) ---------- */
@font-face {
  font-family: Vazirmatn;
  src: url("../lib/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../lib/vazirmatn/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

/* ---------- Palette ---------- */
:root {
  --kw-accent: #2f6db5;
  --kw-accent-soft: #e8f0fa;
  --kw-ok: #2e7d32;
  --kw-ok-soft: #e8f5e9;
  --kw-bad: #c62828;
  --kw-bad-soft: #fdecea;
  --kw-warn: #b26a00;
  --kw-warn-soft: #fff4e0;
  /* Day status: غیبت, مرخصی, ماموریت, تعطیل, اضافه کار */
  --kw-st-absent: #c62828;
  --kw-st-absent-bg: #fdecea;
  --kw-st-leave: #1565c0;
  --kw-st-leave-bg: #e8f1fc;
  --kw-st-mission: #6a1b9a;
  --kw-st-mission-bg: #f3e8f8;
  --kw-st-holiday: #6d6d6d;
  --kw-st-holiday-bg: #f2f2f2;
  --kw-st-over: #2e7d32;
  --kw-st-over-bg: #e8f5e9;
  --kw-row-alt: #fafafa;
  --kw-row-hover: #fff6d6;
  --kw-head-bg: #eef2f7;
  --kw-head-text: #34495e;
}

body {
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}

/* Numbers and times line up in columns. */
table, .kw-num, input[data-time], .kw-rnum, .kw-rtime {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--kw-accent);
}

.btn-success {
  background: var(--kw-ok);
  border-color: var(--kw-ok);
}

.btn-primary {
  background: var(--kw-accent);
  border-color: var(--kw-accent);
}

/* Tiles of the home page */
.kw-tile {
  transition: box-shadow .15s, transform .15s;
}

.kw-tile:hover {
  box-shadow: 0 4px 14px rgba(47, 109, 181, .18);
  transform: translateY(-2px);
}

.kw-tile:hover .kw-tile-icon {
  color: var(--kw-accent);
}

/* ---------- Status colours (classes used by the views) ---------- */
.kw-st-absent, .kw-rbad { color: var(--kw-st-absent); }
.kw-st-leave { color: var(--kw-st-leave); }
.kw-st-mission { color: var(--kw-st-mission); }
.kw-st-holiday { color: var(--kw-st-holiday); }
.kw-st-over { color: var(--kw-st-over); }

tr.kw-row-absent > td { background: var(--kw-st-absent-bg); }
tr.kw-row-leave > td { background: var(--kw-st-leave-bg); }
tr.kw-row-mission > td { background: var(--kw-st-mission-bg); }
tr.kw-row-holiday > td, .kw-rholiday td { background: var(--kw-st-holiday-bg); }

/* ---------- Tables ---------- */
@media screen {
  .kw-list-table thead th,
  .kw-rtable thead th,
  .kw-search-table thead th,
  .kw-self-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .kw-rtable thead th,
  .kw-list-table thead tr:last-child th {
    background: var(--kw-head-bg);
    color: var(--kw-head-text);
  }

  .kw-rtable tbody tr:nth-child(even):not([class*="kw-row-"]):not(.kw-rholiday) > td,
  .kw-list-table tbody tr:nth-child(even) > td,
  .kw-self-table tbody tr:nth-child(even) > td:not(.kw-self-date):not(.kw-self-extra) {
    background-color: var(--kw-row-alt);
  }

  .kw-rtable tbody tr:hover > td,
  .kw-list-table tbody tr:hover > td,
  .kw-self-table tbody tr:hover > td {
    background-color: var(--kw-row-hover);
  }
}

/* «نمایش فشرده» (user menu): smaller rows everywhere. */
body.kw-compact {
  font-size: 12px;
}

body.kw-compact .kw-list-table th,
body.kw-compact .kw-list-table td,
body.kw-compact .kw-rtable th,
body.kw-compact .kw-rtable td,
body.kw-compact .kw-self-table td,
body.kw-compact .table > :not(caption) > * > * {
  padding-top: 1px;
  padding-bottom: 1px;
}

/* ---------- Print: A4 with page numbers ---------- */
@page {
  size: A4;
  margin: 10mm 8mm 12mm;

  @bottom-center {
    content: "صفحه " counter(page) " از " counter(pages);
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 8pt;
    color: var(--kw-text);
  }
}

@page landscape {
  size: A4 landscape;
}

@media print {
  body { background: var(--kw-card) !important; }
  .kw-landscape .kw-rpage { page: landscape; }
  .kw-menu-search, .kw-recent, .kw-dash { display: none !important; }
  tr.kw-row-absent > td, tr.kw-row-leave > td, tr.kw-row-mission > td, tr.kw-row-holiday > td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- Dark mode (user menu): html.kw-dark redefines the colour tokens (end of this file) ---------- */

/* ---------- Menu: icons, «جستجو در منو», «صفحه‌های اخیر» ---------- */
.kw-nav-icon {
  width: 15px;
  height: 15px;
  margin-inline-end: 4px;
  vertical-align: -2px;
  opacity: .7;
}

.kw-navbar .nav-link:hover .kw-nav-icon {
  opacity: 1;
}

.kw-menu-search {
  position: relative;
  margin-inline-start: auto;
  margin-inline-end: 10px;
  width: 210px;
}

.kw-menu-search input {
  border-radius: 14px;
  font-size: 12px;
}

.kw-menu-results {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  margin-top: 4px;
  background: var(--kw-card);
  border: 1px solid var(--kw-line);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  z-index: 1050;
  max-height: 360px;
  overflow-y: auto;
  min-width: 260px;
}

.kw-menu-results-head {
  font-size: 11px;
  color: var(--kw-muted);
  padding: 6px 10px 2px;
}

.kw-menu-result {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  color: var(--kw-ink-text);
  text-decoration: none;
  font-size: 12px;
}

.kw-menu-result small {
  color: var(--kw-muted);
}

.kw-menu-result:hover,
.kw-menu-result.active {
  background: var(--kw-accent-soft);
  color: var(--kw-accent);
}

.kw-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin: 4px auto 14px;
  max-width: 900px;
  font-size: 12px;
}

.kw-recent-label {
  color: var(--kw-muted);
}

.kw-recent-item {
  border: 1px solid var(--kw-line);
  background: var(--kw-accent-soft);
  border-radius: 12px;
  padding: 2px 10px;
  text-decoration: none;
}

@media (max-width: 767px) {
  .kw-menu-search {
    width: 100%;
    margin: 6px 0;
  }

  /* Page head and the tool rows under a grid (e.g. «تردد ماهیانه») wrap instead of pushing the page sideways. */
  .kw-page-head,
  .kw-tradod-title,
  .kw-tradod-foot {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* On a phone the decorative gear sits on the «صفحه‌های اخیر» chips and the tiles. */
  .kw-bg-gear {
    display: none;
  }
}

/* ---------- «داشبورد» of the home page ---------- */
.kw-dash {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  max-width: 980px;
  margin: 14px auto 6px;
  position: relative;
  z-index: 1;
}

.kw-dash-cards {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 10px;
}

.kw-dash-card {
  background: var(--kw-card);
  border: 1px solid var(--kw-line);
  border-top: 3px solid var(--kw-accent);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kw-dash-card b {
  font-size: 22px;
  color: var(--kw-head-text);
}

.kw-dash-card span {
  font-size: 11px;
  color: var(--kw-muted);
}

.kw-dash-ok { border-top-color: var(--kw-ok); }
.kw-dash-warn { border-top-color: var(--kw-warn); }
.kw-dash-leave { border-top-color: var(--kw-st-leave); }
.kw-dash-mission { border-top-color: var(--kw-st-mission); }
.kw-dash-bad { border-top-color: var(--kw-bad); }

.kw-dash-chart {
  background: var(--kw-card);
  border: 1px solid var(--kw-line);
  border-radius: 6px;
  padding: 8px 12px;
  width: 360px;
}

.kw-dash-chart-title {
  font-size: 12px;
  color: var(--kw-text);
  margin-bottom: 4px;
}

.kw-dash-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}

.kw-dash-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  font-size: 10px;
  color: var(--kw-muted);
}

.kw-dash-bar-v {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(var(--kw-accent), #5b8fd0);
  border-radius: 3px 3px 0 0;
}

.kw-dash-bar-n {
  color: var(--kw-head-text);
}

@media (max-width: 767px) {
  .kw-dash-cards {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .kw-dash-chart {
    width: 100%;
  }
}

/* ---------- «نمای تقویمی» (Tradod/Calendar, wrapper .kw-tcal) ---------- */
/* Scoped by .kw-tcal: the official calendar (BaseInfo/Calendar) uses the same kw-cal-* names for its own layout. */
.kw-tcal.kw-cal-page {
  max-width: 980px;
}

.kw-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.kw-cal-head .kw-page-title {
  font-size: 16px;
  margin: 0;
}

.kw-tcal .kw-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  margin-bottom: 8px;
}

.kw-tcal .kw-cal-legend span {
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--kw-line);
}

.kw-tcal .kw-cal-legend .btn {
  margin-inline-start: auto;
}

.kw-tcal .kw-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: none;
  grid-auto-flow: row;
  gap: 6px;
}

.kw-cal-wd {
  text-align: center;
  font-size: 11px;
  color: var(--kw-head-text);
  background: var(--kw-head-bg);
  border-radius: 4px;
  padding: 3px;
}

/* Tradod/Calendar day boxes (links); the official calendar (BaseInfo/Calendar) uses the same class on table cells. */
a.kw-cal-day {
  min-height: 86px;
  border: 1px solid var(--kw-line);
  border-radius: 6px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-decoration: none;
  color: var(--kw-ink-text);
  background: var(--kw-card);
  font-size: 11px;
  transition: box-shadow .15s;
}

a.kw-cal-day:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.kw-cal-date {
  font-weight: 700;
  font-size: 15px;
}

.kw-cal-date small {
  font-weight: 400;
  font-size: 10px;
  color: var(--kw-muted);
  margin-inline-start: 3px;
}

.kw-cal-present, .kw-cal-day.kw-cal-present { background: var(--kw-card); border-color: #cfe3d1; }
.kw-cal-absent, .kw-cal-day.kw-cal-absent { background: var(--kw-st-absent-bg); border-color: #f2b8b5; }
.kw-cal-incomplete, .kw-cal-day.kw-cal-incomplete { background: var(--kw-warn-soft); border-color: #f0cf96; }
.kw-cal-leave, .kw-cal-day.kw-cal-leave { background: var(--kw-st-leave-bg); border-color: #b9d3f2; }
.kw-cal-mission, .kw-cal-day.kw-cal-mission { background: var(--kw-st-mission-bg); border-color: #dcc3ea; }
.kw-cal-holiday, .kw-cal-day.kw-cal-holiday { background: var(--kw-st-holiday-bg); color: var(--kw-st-holiday); }
.kw-cal-day.kw-cal-none { opacity: .6; }

@media (max-width: 767px) {
  a.kw-cal-day {
    min-height: 60px;
    font-size: 9px;
  }
}

/* ---------- Login / license pages ---------- */
.kw-login-body {
  background: radial-gradient(circle at 30% 20%, var(--kw-accent-soft), var(--kw-sunk) 55%, var(--kw-sunk));
}

.kw-login-box {
  width: 330px;
  border: 0;
  border-radius: 12px;
  padding: 26px 26px 22px;
  box-shadow: 0 10px 30px rgba(31, 61, 104, .15);
  text-align: right;
}

.kw-login-box.kw-license-box {
  width: min(460px, calc(100vw - 32px));
}

.kw-login-logo {
  display: block;
  max-height: 84px;
  max-width: 160px;
  margin: 0 auto 8px;
}

.kw-login-company {
  text-align: center;
  font-weight: 700;
  color: var(--kw-head-text);
  margin-bottom: 4px;
}

.kw-login-brand {
  margin-bottom: 0;
}

.kw-login-sub {
  text-align: center;
  font-size: 12px;
  color: var(--kw-muted);
  margin-bottom: 16px;
}

.kw-login-box .btn-success {
  padding: 6px;
  font-size: 13px;
  border-radius: 6px;
}

/* ---------- Forms: panels as cards ---------- */
.kw-panel,
.kw-simple-box {
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

.kw-panel-title,
.kw-simple-head {
  background: var(--kw-head-bg);
  color: var(--kw-head-text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--kw-line-strong);
  box-shadow: 0 0 0 .15rem rgba(47, 109, 181, .18);
}

.kw-validation,
.field-validation-error {
  color: var(--kw-bad);
}

.input-validation-error {
  border-color: var(--kw-bad) !important;
  background: var(--kw-bad-soft);
}

.kw-navbar .nav-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* «حذف مجوز تایید شده از گردش کار» (Services.WfGuard) */
.kw-wfguard { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kw-wfguard-box { background: var(--kw-card); border-radius: 8px; max-width: 520px; padding: 16px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.kw-wfguard-text { margin-bottom: 12px; line-height: 1.9; color: #8a4b00; }
.kw-wfguard form { display: flex; gap: 8px; justify-content: flex-end; }

/* «داشبورد کارکرد» (Dashboard/Index, Services.TodayBoard) */
.kw-dash-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.kw-dash-tile { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 8px 12px; border-radius: 8px; background: var(--kw-sunk); color: var(--kw-ink-text); text-decoration: none; border: 2px solid transparent; }
.kw-dash-tile b { font-size: 22px; line-height: 1.2; }
.kw-dash-tile span { font-size: 12px; }
.kw-dash-tile.active { border-color: #3b78c4; }
.kw-dash-state { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--kw-sunk); }
.kw-dash-present { background: #e3f6e8 !important; color: #1e7a3a; }
.kw-dash-left { background: var(--kw-sunk) !important; color: var(--kw-text); }
.kw-dash-absent { background: var(--kw-bad-soft) !important; color: #b22a2a; }
.kw-dash-notyet { background: var(--kw-row-hover) !important; color: #8a6200; }
.kw-dash-leave { background: var(--kw-accent-soft) !important; color: #2952a3; }
.kw-dash-mission { background: #efe8fb !important; color: #6b3fa0; }
.kw-dash-off { background: var(--kw-sunk) !important; color: var(--kw-muted); }
.kw-dash-late { background: #fff0e6 !important; color: #b45a12; }

/* Digits inside form fields are drawn as Persian (Vazirmatn "ss01") while the value itself stays Latin, so the server
   and the scripts read it as before. */
input, select, textarea, .form-control, .form-select {
  font-feature-settings: "ss01";
}

/* خوانایی و چیدمان صفحه‌های پرتردد */
body {
  font-size: 14px;
}

.kw-navbar {
  background: var(--kw-sunk);
  border-bottom: 3px solid var(--kw-accent);
  box-shadow: 0 2px 6px rgba(28, 52, 82, .08);
}

.kw-navbar .nav-link {
  font-size: 13px;
  border-radius: 5px;
  transition: color .15s, background-color .15s;
}

.kw-navbar .nav-link:hover,
.kw-navbar .nav-link:focus-visible,
.kw-navbar .nav-link[aria-expanded="true"] {
  color: var(--kw-accent);
  background: var(--kw-accent-soft);
}

.kw-navbar .nav-link.kw-route-group {
  color: var(--kw-accent);
  background: var(--kw-accent-soft);
  box-shadow: inset 0 -2px var(--kw-accent);
}

.kw-mega-menu .dropdown-item.kw-route-current {
  color: var(--kw-accent);
  font-weight: 600;
  background: var(--kw-accent-soft);
  border-inline-start: 3px solid var(--kw-accent);
}

.kw-page-head {
  border-bottom: 2px solid var(--kw-line);
}

.kw-page-title {
  font-size: 18px;
}

.kw-nav-tools .kw-nav-btn {
  min-width: 38px;
  min-height: 32px;
  font-size: 20px !important;
}

.kw-nav-tools button svg {
  width: 17px;
  height: 17px;
}

.kw-cal-btn {
  position: relative;
  min-width: 32px;
  font-size: 0;
}

.kw-cal-btn::before {
  content: "";
  display: block;
  width: 16px;
  height: 15px;
  margin: auto;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(var(--kw-accent) 0 4px, transparent 4px);
}

.kw-cal-btn::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 6px;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, currentColor 1px, transparent 1.2px) 0 0 / 5px 5px;
}

.kw-dash {
  max-width: 1240px;
  justify-content: space-between;
  align-items: stretch;
}

.kw-dash-cards {
  flex: 1 1 500px;
  grid-template-columns: repeat(3, minmax(125px, 1fr));
}

.kw-dash-chart {
  flex: 1 1 360px;
  width: auto;
  min-width: 300px;
}

.kw-dash-chart .kw-dash-bars:empty::before {
  content: "اطلاعاتی برای نمایش نمودار وجود ندارد";
  display: grid;
  place-items: center;
  width: 100%;
  height: 120px;
  color: var(--kw-muted);
  font-size: 13px;
}

.kw-dash-card span,
.kw-dash-chart-title {
  font-size: 13px;
}

#kwEmpForm .kw-grid:not(.kw-grid-wide) {
  grid-template-columns: minmax(110px, max-content) minmax(132px, 1fr)
    minmax(110px, max-content) minmax(132px, 1fr);
  column-gap: 12px;
}

#kwEmpForm .kw-lbl {
  font-size: 12px;
  line-height: 1.6;
  text-align: start;
}

#kwEmpForm .kw-in,
#kwEmpForm .kw-in-sm {
  min-width: 0;
  font-size: 12px;
}

@media (max-width: 900px) {
  #kwEmpForm .kw-grid:not(.kw-grid-wide) {
    grid-template-columns: minmax(100px, max-content) minmax(0, 1fr);
  }

  .kw-extra-personal {
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (max-width: 767px) {
  .kw-dash {
    justify-content: stretch;
  }

  .kw-dash-cards {
    flex-basis: 100%;
  }

  .kw-dash-chart {
    min-width: 0;
    flex-basis: 100%;
  }
}

/* صفحه‌ی خانه: آمار و نمودار در بالا، تاریخچه و دسترسی‌ها در سطحی هم‌تراز */
main.kw-main:has(#kwDash) {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .95fr);
  align-content: start;
  gap: 16px 18px;
  width: min(100%, 1480px);
  margin-inline: auto;
  padding: 26px 28px 34px;
}

main.kw-main:has(#kwDash)::before {
  content: "داشبورد حضور و غیاب";
  grid-column: 1 / -1;
  align-self: center;
  margin-bottom: 2px;
  padding-inline-start: 12px;
  border-inline-start: 4px solid var(--kw-amber);
  color: var(--kw-ink-text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}

#kwDash {
  display: contents;
}

.kw-dash-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.kw-dash-card {
  min-height: 94px;
  justify-content: center;
  gap: 5px;
  padding: 12px 10px;
  border: 1px solid var(--kw-line);
  border-top: 3px solid var(--kw-accent);
  border-radius: 12px;
  box-shadow: 0 4px 13px rgba(36, 68, 102, .09);
  transition: transform .18s ease, box-shadow .18s ease;
}

.kw-dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(36, 68, 102, .14);
}

.kw-dash-card b {
  font-size: 26px;
  line-height: 1.2;
}

.kw-dash-card span {
  color: var(--kw-muted);
  font-size: 12.5px;
}

.kw-dash-card.kw-dash-ok { border-top-color: var(--kw-ok); }
.kw-dash-card.kw-dash-warn { border-top-color: var(--kw-warn); }
.kw-dash-card.kw-dash-leave { border-top-color: var(--kw-st-leave); }
.kw-dash-card.kw-dash-mission { border-top-color: var(--kw-st-mission); }
.kw-dash-card.kw-dash-bad { border-top-color: var(--kw-bad); }

.kw-dash-chart {
  grid-column: 1;
  align-self: stretch;
  width: auto;
  min-width: 0;
  padding: 16px 18px 12px;
  border-color: var(--kw-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(36, 68, 102, .09);
}

.kw-dash-chart-title {
  margin-bottom: 10px;
  color: var(--kw-ink-text);
  font-size: 14px;
  font-weight: 700;
}

.kw-dash-bars {
  height: 112px;
}

#kwRecent {
  grid-column: 2;
  align-content: start;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--kw-line);
  border-radius: 12px;
  background: var(--kw-card);
  box-shadow: 0 4px 14px rgba(36, 68, 102, .09);
}

.kw-recent-label {
  flex: 0 0 100%;
  margin-bottom: 4px;
  color: var(--kw-ink-text);
  font-size: 15px;
  font-weight: 700;
}

.kw-recent-item {
  border-color: var(--kw-line);
  background: var(--kw-sunk);
  box-shadow: 0 2px 5px rgba(36, 68, 102, .06);
  transition: border-color .16s, background-color .16s, transform .16s, box-shadow .16s;
}

.kw-recent-item:hover {
  transform: translateY(-1px);
  border-color: var(--kw-line-strong);
  background: var(--kw-accent-soft);
  box-shadow: 0 4px 9px rgba(36, 68, 102, .11);
}

.kw-tiles {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0;
}

.kw-tile {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 78px;
  padding: 10px 14px;
  border: 1px solid var(--kw-line);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--kw-card), var(--kw-card));
  color: var(--kw-ink-text);
  box-shadow: 0 5px 13px rgba(36, 68, 102, .11);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.kw-tile:hover,
.kw-tile:focus-visible {
  transform: translateY(-3px);
  border-color: var(--kw-line-strong);
  color: var(--kw-accent);
  box-shadow: 0 10px 20px rgba(36, 88, 145, .18);
}

.kw-tile:focus-visible {
  outline: 3px solid rgba(47, 109, 181, .22);
  outline-offset: 2px;
}

.kw-tile-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--kw-accent-soft);
  color: #3372b1;
  transition: background-color .18s, color .18s, transform .18s;
}

.kw-tile:nth-child(3n + 2) .kw-tile-icon {
  background: #e9f5ed;
  color: #378053;
}

.kw-tile:nth-child(3n) .kw-tile-icon {
  background: #f3edf8;
  color: #78519a;
}

.kw-tile:hover .kw-tile-icon,
.kw-tile:focus-visible .kw-tile-icon {
  transform: scale(1.04);
  background: var(--kw-accent-soft);
  color: var(--kw-accent);
}

.kw-tile-icon svg {
  width: 24px;
  height: 24px;
}

.kw-tile-title {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  text-align: right;
  white-space: normal;
}

body:has(#kwDash) .kw-bg-gear {
  display: none;
}

@media (max-width: 1100px) {
  .kw-dash-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kw-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  main.kw-main:has(#kwDash) {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 18px 28px;
  }

  .kw-dash-chart,
  #kwRecent {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  main.kw-main:has(#kwDash) {
    gap: 12px;
    padding: 16px 12px 24px;
  }

  main.kw-main:has(#kwDash)::before {
    font-size: 21px;
  }

  .kw-dash-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .kw-dash-card {
    min-height: 82px;
    padding: 8px;
  }

  .kw-dash-card b {
    font-size: 23px;
  }

  .kw-dash-chart,
  #kwRecent {
    padding: 13px;
  }

  .kw-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .kw-tile {
    height: 70px;
    gap: 8px;
    padding: 8px;
  }

  .kw-tile-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .kw-tile-title {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kw-dash-card,
  .kw-tile,
  .kw-tile-icon,
  .kw-recent-item {
    transition: none;
  }
}

/* Home page: the chart takes the whole row while «صفحه‌های اخیر» is hidden (nothing visited yet), and a lone last tile
   is centred instead of hanging on the right. */
main.kw-main:has(#kwRecent[hidden]) .kw-dash-chart {
  grid-column: 1 / -1;
}

@media (min-width: 1101px) {
  .kw-tile:last-child:nth-child(4n + 1) { grid-column: 2 / span 2; }
}

@media (min-width: 561px) and (max-width: 1100px) {
  .kw-tile:last-child:nth-child(3n + 1) { grid-column: 2; }
}

@media (max-width: 560px) {
  .kw-tile:last-child:nth-child(2n + 1) { grid-column: 1 / -1; }
}

/* The state colours of «داشبورد کارکرد» (.kw-dash-leave …) share names with the home cards: only the state badges and
   the count tiles get the coloured background. */
.kw-dash-card.kw-dash-leave,
.kw-dash-card.kw-dash-mission {
  background: var(--kw-card) !important;
  color: inherit;
}

/* Empty lists («موردی نیست», «درخواستی نیست»): a centred note with an empty-tray icon instead of a bare line. */
table td.text-muted[colspan],
.wf-box-body.text-muted {
  text-align: center;
  padding: 22px 12px !important;
}

table td.text-muted[colspan]::before,
.wf-box-body.text-muted::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%2398a2b3%27 stroke-width=%271.6%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M3 13l3-8h12l3 8v6H3zM3 13h5l1 2h6l1-2h5%27/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Dark mode inverts the page: the soft shadows of the home cards would turn into light halos. */
html.kw-dark .kw-dash-card,
html.kw-dark .kw-dash-chart,
html.kw-dark #kwRecent,
html.kw-dark .kw-tile,
html.kw-dark .kw-recent-item {
  box-shadow: none;
}

/* The three login pages (Karaweb, گردش کار, پرتال) share one look: logo, «KaraWeb», a coloured top edge. */
.kw-login-box {
  border-top: 4px solid var(--kw-accent);
}

/* «در حال آماده‌سازی گزارش…» (site.js) */
.kw-busy {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 246, 249, .55);
  animation: kw-busy-in .2s .3s both;
}

.kw-busy-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 10px;
  background: var(--kw-card);
  color: var(--kw-head-text);
  box-shadow: 0 8px 24px rgba(31, 61, 104, .18);
  font-weight: 600;
}

.kw-busy-spin {
  width: 20px;
  height: 20px;
  border: 3px solid var(--kw-accent-soft);
  border-top-color: var(--kw-accent);
  border-radius: 50%;
  animation: kw-spin .8s linear infinite;
}

@keyframes kw-spin { to { transform: rotate(360deg); } }
@keyframes kw-busy-in { from { opacity: 0; } }

@media print {
  .kw-busy { display: none !important; }
}

/* Report header (_ReportHeader): organisation and report title stand out, a double rule under them. */
.kw-rhead {
  align-items: center;
  border-bottom: 3px double #4a5a6e;
}

.kw-rhead-title > div:first-child {
  font-size: 14px;
  font-weight: 700;
}

.kw-rhead-title > div:nth-child(2) {
  font-size: 15px;
  font-weight: 700;
  color: var(--kw-accent);
}

.kw-rhead-brand {
  font: 600 18px/1 Vazirmatn, Tahoma, sans-serif;
  color: var(--kw-muted);
  direction: ltr;
}

.kw-rhead-brand b {
  color: var(--kw-accent);
}

@media print {
  .kw-rhead-title > div:nth-child(2) { color: var(--kw-ink-text); }
}

/* Form errors look the same everywhere: a red-edged field with a light red fill, the message under it with a mark. */
.input-validation-error,
.is-invalid,
.form-control.is-invalid {
  border-color: #c62828 !important;
  background-color: var(--kw-bad-soft) !important;
  box-shadow: 0 0 0 .15rem rgba(198, 40, 40, .15) !important;
}

.field-validation-error,
.invalid-feedback {
  display: block;
  margin-top: 2px;
  color: #c62828;
  font-size: 12px;
}

.field-validation-error::before,
.invalid-feedback::before {
  content: "⚠ ";
}

.validation-summary-errors ul {
  margin: 0 0 8px;
  padding: 8px 28px 8px 10px;
  border: 1px solid #f3c2bd;
  border-radius: 6px;
  background: var(--kw-bad-soft);
  color: #c62828;
}

/* ---------- Phone width: nothing wider than the screen ---------- */
@media (max-width: 767px) {
  /* Label / field grids of the forms: two columns (label, field) instead of four. */
  .kw-grid,
  .kw-mm-grid,
  .kw-adjust-grid,
  .kw-rep-period,
  .kw-apart-grid,
  .kw-grp-form,
  #kwEmpForm .kw-grid:not(.kw-grid-wide) {
    grid-template-columns: minmax(70px, max-content) minmax(0, 1fr) !important;
  }

  :is(.kw-grid, .kw-mm-grid, .kw-rep-period, .kw-apart-grid, .kw-grp-form) > * {
    grid-column: auto !important;
    min-width: 0;
    max-width: 100%;
  }

  :is(.kw-grid, .kw-mm-grid, .kw-rep-period, .kw-apart-grid, .kw-grp-form) :is(input, select, .kw-date, .kw-in, .kw-in-sm) {
    max-width: 100%;
  }

  .kw-rep-period .kw-date,
  .kw-mm-grid .kw-date {
    display: flex;
    width: 100%;
  }

  .kw-rep-period .kw-date .kw-in,
  .kw-mm-grid .kw-date .kw-in {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  /* Rows of side-by-side blocks stack. */
  .kw-group-row,
  .kw-autoinc-amount,
  .kw-params-row,
  .kw-shift-layout {
    flex-wrap: wrap;
  }

  .kw-cut-body,
  .kw-notif-body {
    flex-direction: column;
  }

  .kw-shift-form,
  .kw-notif-form,
  .kw-notif-list,
  .kw-cut-info {
    width: 100% !important;
    max-width: 100%;
  }

  .kw-params-months {
    max-width: 100%;
    overflow-x: auto;
  }

  /* Wide tables scroll inside their own box instead of widening the page. */
  .kw-list-table:not(.table-responsive .kw-list-table),
  .kw-rtable:not(.table-responsive .kw-rtable) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 767px) {
  .kw-notif-grid,
  .kw-user-grid {
    grid-template-columns: minmax(70px, max-content) minmax(0, 1fr) !important;
  }

  :is(.kw-notif-grid, .kw-user-grid) > * {
    grid-column: auto !important;
    min-width: 0;
    max-width: 100%;
  }

  .kw-cut-info {
    grid-template-columns: minmax(90px, max-content) minmax(0, 1fr) !important;
  }

  .kw-cut-info dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .kw-range {
    flex-wrap: wrap;
  }

  /* Side-by-side panels (devices, groups, shifts) take the whole width; their inner grids scroll. */
  .kw-dev-list,
  .kw-spc-form,
  .kw-grp-form,
  .kw-shift-form {
    flex: 1 1 100% !important;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
  }

  .kw-lic-table,
  .kw-uag-grid,
  .kw-shift-grid {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 767px) {
  /* «مشخصات پرسنلی»: the photo goes under the fields, which get the whole width. */
  .kw-basic {
    flex-wrap: wrap;
  }

  .kw-basic-fields {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* =====================================================================================================================
   «کارت ساعت» (1405/08/19): the look of a paper time card. A dark ink band for the menu, the open section marked with
   the amber of a time-clock stamp, light grey paper under white cards, darker text. Every colour above and in site.css
   comes from these tokens, so html.kw-dark (user menu «حالت تاریک») is the same page with the dark set.
   ===================================================================================================================== */
:root {
  --kw-paper: #e9edf2;
  --kw-card: #ffffff;
  --kw-sunk: #f3f5f8;
  --kw-line: #d6dde6;
  --kw-line-strong: #b4bfcc;
  --kw-ink: #1c2a38;
  --kw-ink-2: #2a3d50;
  --kw-ink-text: #1f2d3b;
  --kw-text: #3b4958;
  --kw-muted: #6c7987;
  --kw-on-ink: #c8d3de;
  --kw-amber: #e0a22a;
  --kw-amber-soft: #fbf0d6;
  --kw-amber-ink: #6a4700;
  --kw-accent: #1f5f8b;
  --kw-accent-soft: #e3eef7;
  --kw-head-bg: #e4e9ef;
  --kw-head-text: #263646;
  --kw-row-alt: #f7f9fb;
  --kw-row-hover: #fbf0d6;
  --kw-shadow: 0 1px 2px rgba(28, 42, 56, .06), 0 2px 8px rgba(28, 42, 56, .05);
  /* the names site.css used before */
  --kw-bg: var(--kw-paper);
  --kw-surface: var(--kw-sunk);
  --kw-border: var(--kw-line-strong);
  --kw-icon: var(--kw-muted);
}

@media screen {
  html.kw-dark {
    color-scheme: dark;
  --kw-paper: #11171e;
  --kw-card: #19212b;
  --kw-sunk: #212b37;
  --kw-line: #2e3a48;
  --kw-line-strong: #46566a;
  --kw-ink: #0b1016;
  --kw-ink-2: #1c2734;
  --kw-ink-text: #e9eef3;
  --kw-text: #c9d3dd;
  --kw-muted: #8b98a6;
  --kw-on-ink: #b7c3cf;
  --kw-amber: #e8b04a;
  --kw-amber-soft: #3a2f17;
  --kw-amber-ink: #f3d48f;
  --kw-accent: #7db7e3;
  --kw-accent-soft: #1d3346;
  --kw-head-bg: #243040;
  --kw-head-text: #dbe3eb;
  --kw-row-alt: #1c2530;
  --kw-row-hover: #33301f;
  --kw-ok: #66bb6a;
  --kw-ok-soft: #1c3320;
  --kw-bad: #ef6b6b;
  --kw-bad-soft: #3a1d1f;
  --kw-warn: #e0a53a;
  --kw-warn-soft: #3a2d14;
  --kw-st-absent: #ef6b6b;
  --kw-st-absent-bg: #3a1d1f;
  --kw-st-leave: #7db7e3;
  --kw-st-leave-bg: #1b2f42;
  --kw-st-mission: #c39be0;
  --kw-st-mission-bg: #2e2140;
  --kw-st-holiday: #a5adb6;
  --kw-st-holiday-bg: #262d35;
  --kw-st-over: #66bb6a;
  --kw-st-over-bg: #1c3320;
  --kw-shadow: none;
  }
}

body {
  background: var(--kw-paper);
  color: var(--kw-text);
}

/* ---------- The menu band ---------- */
@media screen {
  .kw-navbar {
    background: var(--kw-ink);
    border-bottom: 0;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
    padding-block: 0;
  }

  .kw-navbar .kw-logo-main {
    color: #fff;
  }

  .kw-navbar .kw-logo-sub {
    color: var(--kw-amber);
  }

  .kw-navbar .nav-link,
  .kw-navbar .kw-user {
    color: var(--kw-on-ink);
    border-radius: 0;
    padding-block: 15px;
  }

  .kw-navbar .nav-link:hover,
  .kw-navbar .nav-link:focus-visible,
  .kw-navbar .nav-link[aria-expanded="true"] {
    color: #fff;
    background: var(--kw-ink-2);
  }

  /* The section of the open page: the stamp under it. */
  .kw-navbar .nav-link.kw-route-group {
    color: #fff;
    background: transparent;
    box-shadow: inset 0 -3px var(--kw-amber);
  }

  .kw-navbar .nav-link:hover .kw-nav-icon,
  .kw-navbar .nav-link.kw-route-group .kw-nav-icon {
    color: var(--kw-amber);
  }

  .kw-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, .25);
  }

  .kw-navbar .navbar-toggler-icon {
    filter: invert(1);
  }

  .kw-menu-search input {
    background: rgba(255, 255, 255, .08);
    border-color: transparent;
    color: #fff;
  }

  .kw-menu-search input::placeholder {
    color: #94a4b4;
  }

  .kw-menu-search input:focus {
    background: var(--kw-card);
    color: var(--kw-ink-text);
    border-color: var(--kw-amber);
    box-shadow: 0 0 0 3px rgba(224, 162, 42, .25);
  }
}

.kw-mega-menu,
.kw-navbar .dropdown-menu,
.kw-menu-results {
  background: var(--kw-card);
  border-color: var(--kw-line);
  box-shadow: 0 8px 24px rgba(15, 25, 35, .18);
}

.kw-mega-menu .dropdown-item.kw-route-current {
  color: var(--kw-amber-ink);
  background: var(--kw-amber-soft);
  border-inline-start-color: var(--kw-amber);
}

.dropdown-item {
  color: var(--kw-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--kw-ink-text);
  background: var(--kw-sunk);
}

/* ---------- Page title ---------- */
.kw-page-head {
  border-bottom: 1px solid var(--kw-line);
  margin-bottom: 14px;
}

.kw-page-title {
  color: var(--kw-ink-text);
  font-size: 19px;
  font-weight: 700;
  padding-inline-start: 11px;
  border-inline-start: 4px solid var(--kw-amber);
  line-height: 1.35;
}

/* ---------- Cards and panels ---------- */
.kw-panel,
.kw-simple-box,
.kw-tile,
.kw-dash-card,
.kw-dash-chart {
  border-color: var(--kw-line);
  border-radius: 8px;
  box-shadow: var(--kw-shadow);
}

.kw-simple-head {
  color: var(--kw-ink-text);
  background: var(--kw-sunk);
  border-radius: 8px 8px 0 0;
}

/* ---------- Buttons ---------- */
.kw-btn,
.btn-light {
  color: var(--kw-ink-text);
  background: var(--kw-card);
  border-color: var(--kw-line-strong);
}

.kw-btn:hover,
.btn-light:hover {
  color: var(--kw-ink-text);
  background: var(--kw-sunk);
  border-color: var(--kw-muted);
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(224, 162, 42, .45);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
  color: var(--kw-ink-text);
  background-color: var(--kw-card);
  border-color: var(--kw-line-strong);
}

.form-control:focus,
.form-select:focus {
  color: var(--kw-ink-text);
  background-color: var(--kw-card);
  border-color: var(--kw-accent);
  box-shadow: 0 0 0 3px var(--kw-accent-soft);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background-color: var(--kw-sunk);
  color: var(--kw-muted);
}

.form-control::placeholder {
  color: var(--kw-muted);
}

/* ---------- Tables ---------- */
.table {
  --bs-table-color: var(--kw-text);
  --bs-table-bg: var(--kw-card);
  --bs-table-border-color: var(--kw-line);
  --bs-table-striped-bg: var(--kw-row-alt);
  --bs-table-hover-bg: var(--kw-row-hover);
}

.table-light {
  --bs-table-color: var(--kw-head-text);
  --bs-table-bg: var(--kw-head-bg);
  --bs-table-border-color: var(--kw-line);
}

.kw-list-table thead tr:last-child th,
.kw-rtable th {
  background: var(--kw-head-bg);
  color: var(--kw-head-text);
}

.kw-list-table tbody tr:hover,
.kw-list-table tr.kw-selected,
.kw-simple-list tr.kw-selected {
  background: var(--kw-row-hover);
}

/* ---------- Footer ---------- */
.kw-footer {
  background: transparent;
  border-top: 1px solid var(--kw-line);
  color: var(--kw-muted);
}

/* ---------- Dark mode: what Bootstrap and the tokens do not reach ---------- */
html.kw-dark .bg-white,
html.kw-dark .modal-content,
html.kw-dark .card,
html.kw-dark .list-group-item {
  background-color: var(--kw-card) !important;
  color: var(--kw-text);
  border-color: var(--kw-line);
}

html.kw-dark .text-muted {
  color: var(--kw-muted) !important;
}

html.kw-dark .text-dark {
  color: var(--kw-ink-text) !important;
}

html.kw-dark .alert-warning {
  background: var(--kw-warn-soft);
  border-color: #5c4718;
  color: var(--kw-amber-ink);
}

html.kw-dark .alert-danger {
  background: var(--kw-bad-soft);
  border-color: #5c2a2d;
  color: #f5b5b5;
}

html.kw-dark .alert-success {
  background: var(--kw-ok-soft);
  border-color: #2c5130;
  color: #a6dba9;
}

html.kw-dark .alert-info {
  background: var(--kw-accent-soft);
  border-color: #2b4b66;
  color: #b8d8f0;
}

/* ---------- Tabbed forms (مشخصات پرسنلی and the like): the form is the card ---------- */
.kw-page > form:has(> .kw-tabs) {
  margin-top: 12px;
  padding: 4px 16px 14px;
  background: var(--kw-card);
  border: 1px solid var(--kw-line);
  border-radius: 8px;
  box-shadow: var(--kw-shadow);
}

.kw-tabs .nav-link {
  color: var(--kw-muted);
  font-size: 12.5px;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
}

.kw-tabs .nav-link:hover {
  color: var(--kw-ink-text);
}

.kw-tabs .nav-link.active {
  color: var(--kw-ink-text);
  font-weight: 600;
  background: transparent;
  border: 0;
  border-bottom: 3px solid var(--kw-amber);
}

/* Dark mode: the coloured icon chips of the home tiles as tints. */
html.kw-dark .kw-tile-icon { background: rgba(125, 183, 227, .14); color: #8fc2ea; }
html.kw-dark .kw-tile:nth-child(3n + 2) .kw-tile-icon { background: rgba(102, 187, 106, .14); color: #86cc8a; }
html.kw-dark .kw-tile:nth-child(3n) .kw-tile-icon { background: rgba(195, 155, 224, .14); color: #c9a6e6; }

/* ---------- Login: the time clock on the ink band, the card under it ---------- */
.kw-login-body {
  flex-direction: column;
  gap: 18px;
  padding: 24px 16px;
  background: var(--kw-ink);
}

.kw-login-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--kw-on-ink);
  line-height: 1.1;
}

.kw-login-time {
  font-size: 64px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--kw-amber);
}

.kw-login-date {
  margin-top: 8px;
  font-size: 14px;
}

.kw-login-box {
  width: min(340px, 100%);
  border-top: 0;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

.kw-login-brand b {
  color: var(--kw-ink-text);
}

.kw-login-brand {
  color: var(--kw-amber);
}

.kw-login-box .btn-success {
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 420px) {
  .kw-login-time { font-size: 48px; }
}

/* Dark mode: the state tiles of «داشبورد امروز» as tints with light text. */
html.kw-dark .kw-dash-present:not(.kw-dash-card) { background: rgba(102, 187, 106, .16) !important; color: #8fd493; }
html.kw-dark .kw-dash-absent:not(.kw-dash-card) { background: rgba(239, 107, 107, .16) !important; color: #f29b9b; }
html.kw-dark .kw-dash-notyet:not(.kw-dash-card) { background: rgba(232, 176, 74, .16) !important; color: #f0c674; }
html.kw-dark .kw-dash-leave:not(.kw-dash-card) { background: rgba(125, 183, 227, .16) !important; color: #9cc8ec; }
html.kw-dark .kw-dash-mission:not(.kw-dash-card) { background: rgba(195, 155, 224, .16) !important; color: #cfaeea; }
html.kw-dark .kw-dash-late:not(.kw-dash-card) { background: rgba(232, 140, 74, .16) !important; color: #f0a874; }

/* Device form: the heading of a maker's own settings (Device/Index, Services.DeviceOptions). */
.kw-dev-opt-head {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--kw-line);
  color: var(--kw-muted);
  font-size: 12px;
  font-weight: 600;
}

/* Device page: the tools of the open device, the state of its real-time monitoring, and the device users / PW files pages. */
.kw-dev-tools {
  margin-top: 10px;
}

.kw-dev-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.kw-dev-tools-row form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.kw-dev-restore input[type="file"] {
  max-width: 220px;
}

.kw-dev-monitor-state {
  color: var(--kw-muted);
  font-size: 12px;
  padding-inline-start: 22px;
}

.kw-dev-result div {
  white-space: pre-wrap;
}

/* «گزارش کارکرد» popup of the monthly traffic page: the summary boxes of the daily report, as many as fit. */
.kw-tk-rsum {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  font-size: 11px;
}

.kw-tk-rsum .kw-rsum-col {
  min-height: 0;
}

/* =====================================================================================================================
   Design system (DESIGN, 1405/08/21): fixed text / surface / status colours, and four organization themes that change
   only four colours (menu band --kw-ink, main colour --kw-accent, its soft tint, the amber of the stamp). The theme is
   html[data-kw-theme] (Kara:Theme in the settings; empty = «کاراوب»). Status colours are never themed and always shown
   with a letter code (ح م ما غ). Dark mode (html.kw-dark) keeps its own set above and is not touched by the themes.
   ===================================================================================================================== */
:root {
  --kw-paper: #f4f6fa;
  --kw-card: #ffffff;
  --kw-line: #dde3ec;
  --kw-ink-text: #172033;
  --kw-text: #172033;
  --kw-muted: #556070;
  --kw-bad: #b91c1c;
  --kw-error: #b91c1c;
  /* Status (fixed): present, leave, mission, absent */
  --kw-s-present: #15803d;
  --kw-s-leave: #6d28d9;
  --kw-s-mission: #0e7490;
  --kw-s-absent: #b91c1c;
  --kw-st-absent: var(--kw-s-absent);
  --kw-st-leave: var(--kw-s-leave);
  --kw-st-mission: var(--kw-s-mission);
  --kw-st-over: var(--kw-s-present);
  --kw-st-absent-bg: #fdecec;
  --kw-st-leave-bg: #f1ebfc;
  --kw-st-mission-bg: #e3f3f7;
  --kw-st-over-bg: #e6f4ea;
  /* The default theme «کاراوب» */
  --kw-ink: #14284a;
  --kw-ink-2: #1f3a66;
  --kw-accent: #1e5fd0;
  --kw-accent-soft: #e6edfb;
  --kw-amber: #f0b429;
  --kw-amber-soft: #fcf1d3;
  --kw-focus: #1e5fd0;
  --kw-tap: 44px;
  --kw-radius: 8px;
  --kw-radius-lg: 12px;
}

html:not(.kw-dark)[data-kw-theme="parsgreen"] {
  --kw-ink: #12352d; --kw-ink-2: #1c4a40; --kw-accent: #0e7c5c; --kw-accent-soft: #e3f2ec;
  --kw-amber: #e0b04a; --kw-amber-soft: #f7ecd2; --kw-focus: #0e7c5c;
}

html:not(.kw-dark)[data-kw-theme="arghavan"] {
  --kw-ink: #2e1a47; --kw-ink-2: #43285f; --kw-accent: #7b42b8; --kw-accent-soft: #efe4f5;
  --kw-amber: #f08c6b; --kw-amber-soft: #fbe3da; --kw-focus: #7b42b8;
}

html:not(.kw-dark)[data-kw-theme="aftab"] {
  --kw-ink: #3a1d11; --kw-ink-2: #532b1a; --kw-accent: #b03a0a; --kw-accent-soft: #fce9dc;
  --kw-amber: #2db1cc; --kw-amber-soft: #d9f1f6; --kw-focus: #b03a0a;
}

@media screen {
  html.kw-dark {
    --kw-focus: #7db7e3;
  }
}

/* ---------- Components of the design system: buttons, field states, filter chip, card, stat card, empty state, status cell ---------- */
.btn, .kw-btn {
  min-height: var(--kw-tap);
  border-radius: var(--kw-radius);
  font-weight: 600;
}

.btn-sm {
  min-height: 36px;
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: color-mix(in srgb, var(--kw-accent) 88%, #000);
  border-color: color-mix(in srgb, var(--kw-accent) 88%, #000);
}

.btn-danger {
  background: var(--kw-error);
  border-color: var(--kw-error);
}

.btn:focus-visible, a:focus-visible, button:focus-visible, .form-check-input:focus-visible, .kw-chip:focus-visible {
  outline: 3px solid var(--kw-focus);
  outline-offset: 2px;
  box-shadow: none;
}

/* Field: normal, focus (a 3 px ring), error with its message under it. */
.form-control, .form-select {
  min-height: var(--kw-tap);
  border-radius: var(--kw-radius);
}

.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kw-focus) 35%, transparent);
}

.form-control[aria-invalid="true"], .form-select[aria-invalid="true"], .form-control.is-invalid {
  border-color: var(--kw-error);
  border-width: 2px;
}

.kw-field-error {
  color: var(--kw-error);
  font-size: .875rem;
  margin-top: 4px;
}

/* Filter chip: a real button; pressed = filled with the soft main colour. */
.kw-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--kw-tap);
  padding: 0 18px;
  border: 1px solid var(--kw-line-strong);
  border-radius: 999px;
  background: var(--kw-card);
  color: var(--kw-ink-text);
  font: inherit;
  cursor: pointer;
}

.kw-chip[aria-pressed="true"] {
  background: var(--kw-accent-soft);
  border-color: var(--kw-accent);
  color: var(--kw-accent);
  font-weight: 600;
}

/* Card and stat card. */
.kw-card {
  background: var(--kw-card);
  border: 1px solid var(--kw-line);
  border-radius: var(--kw-radius-lg);
  box-shadow: var(--kw-shadow);
  padding: 20px;
}

.kw-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kw-stat-label, .kw-stat-note {
  color: var(--kw-muted);
  font-size: .875rem;
}

.kw-stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--kw-ink-text);
}

.kw-stat-value[data-tone="present"] { color: var(--kw-s-present); }
.kw-stat-value[data-tone="leave"] { color: var(--kw-s-leave); }
.kw-stat-value[data-tone="mission"] { color: var(--kw-s-mission); }
.kw-stat-value[data-tone="absent"] { color: var(--kw-s-absent); }

/* Empty state: why it is empty, and the next action. */
.kw-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--kw-muted);
}

.kw-empty strong {
  display: block;
  color: var(--kw-ink-text);
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.kw-empty .btn {
  margin-top: 16px;
}

/* Status cell: the letter is always there, the colour only helps (ح م ما غ). */
.kw-s {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
}

.kw-s[data-s="present"] { background: var(--kw-s-present); }
.kw-s[data-s="leave"] { background: var(--kw-s-leave); }
.kw-s[data-s="mission"] { background: var(--kw-s-mission); }
.kw-s[data-s="absent"] { background: var(--kw-s-absent); }

/* ---------- Dashboard of the home page (design: needs, today, 7 days, recent, quick access) ---------- */
.kw-home {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.kw-home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.kw-home-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--kw-ink-text);
  margin: 0;
}

.kw-home-sub {
  margin: 4px 0 0;
  color: var(--kw-muted);
}

.kw-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kw-home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.kw-home-grid-2 {
  grid-template-columns: 1.4fr 1fr;
}

.kw-quick {
  grid-template-columns: repeat(3, 1fr);
}

.kw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kw-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--kw-ink-text);
  margin: 0 0 12px;
}

.kw-card-head .kw-card-title {
  margin-bottom: 12px;
}

.kw-card-sub, .kw-today-note {
  color: var(--kw-muted);
  margin: -6px 0 12px;
  font-size: .9375rem;
}

.kw-badge {
  background: var(--kw-accent-soft);
  color: var(--kw-accent);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: .875rem;
  font-weight: 600;
}

.kw-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--kw-ink-text);
}

.kw-muted-line {
  color: var(--kw-muted);
  padding: 8px 0;
}

/* Today */
.kw-today-main {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--kw-ink-text);
  margin: 0 0 4px;
}

.kw-stack {
  display: flex;
  gap: 2px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--kw-sunk);
  margin: 12px 0 16px;
}

.kw-stack > span { min-width: 6px; }
.kw-stack > [data-tone="present"] { background: var(--kw-s-present); order: 0; }
.kw-stack > [data-tone="leave"] { background: var(--kw-s-leave); order: 1; }
.kw-stack > [data-tone="mission"] { background: var(--kw-s-mission); order: 2; }
.kw-stack > [data-tone="absent"] { background: var(--kw-s-absent); order: 3; }

.kw-today-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
}

.kw-today-stats > div {
  border-top: 3px solid var(--kw-line-strong);
  padding-top: 8px;
}

.kw-today-stats dd {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--kw-ink-text);
}

.kw-today-stats dt {
  color: var(--kw-muted);
  font-weight: 400;
}

.kw-today-stats [data-tone="present"] { border-top-color: var(--kw-s-present); }
.kw-today-stats [data-tone="leave"] { border-top-color: var(--kw-s-leave); }
.kw-today-stats [data-tone="mission"] { border-top-color: var(--kw-s-mission); }
.kw-today-stats [data-tone="absent"] { border-top-color: var(--kw-s-absent); }

/* Needs and recent lists */
.kw-needs-list, .kw-recent-list, .kw-quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kw-needs-list li + li, .kw-recent-list li + li {
  border-top: 1px solid var(--kw-line);
}

.kw-needs-list a, .kw-recent-list li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--kw-tap);
  padding: 10px 0;
  color: var(--kw-ink-text);
  text-decoration: none;
}

.kw-needs-list a:hover, .kw-recent-list a:hover { color: var(--kw-accent); }
.kw-need-text b { font-size: 1.25rem; }
.kw-needs-list small, .kw-recent-list small { color: var(--kw-accent); }
.kw-recent-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kw-recent-list small { color: var(--kw-muted); }

/* Last 7 days: the oldest on the right, today on the left (RTL), the numbers above the bars */
.kw-week {
  display: flex;
  gap: 10px;
  align-items: stretch;
  height: 220px;
}

.kw-week-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.kw-week-track {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--kw-line);
}

.kw-week-bar {
  display: block;
  width: 100%;
  background: var(--kw-line-strong);
  border-radius: 6px 6px 0 0;
}

.is-today .kw-week-bar { background: var(--kw-accent); }
.kw-week-n { font-weight: 700; font-size: .875rem; }
.kw-week-d { font-size: .8125rem; }
.kw-week-col small { color: var(--kw-muted); font-size: .75rem; }

/* Quick access */
.kw-quick-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--kw-muted);
  margin: 0 0 8px;
}

.kw-quick-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--kw-tap);
  padding: 6px 0;
  color: var(--kw-ink-text);
  text-decoration: none;
}

.kw-quick-list a:hover { color: var(--kw-accent); }
.kw-quick-list svg { width: 22px; height: 22px; flex: none; color: var(--kw-accent); }

/* Bottom bar of the phone: four tabs and «منو» (opens the whole menu) */
.kw-tabbar { display: none; }

@media screen and (max-width: 991.98px) {
  .kw-home-grid, .kw-home-grid-2, .kw-quick { grid-template-columns: 1fr; }
}

@media screen and (max-width: 767.98px) {
  .kw-home { padding: 16px 12px 88px; }
  .kw-home-title { font-size: 1.5rem; }
  .kw-today-stats { grid-template-columns: repeat(2, 1fr); }
  .kw-week { height: 180px; gap: 6px; }
  .kw-week-col small { display: none; }
  .kw-navbar .navbar-toggler { display: none; }
  body { padding-bottom: 72px; }
  .kw-tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1040;
    display: flex;
    background: var(--kw-card);
    border-top: 1px solid var(--kw-line);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .kw-tabbar a, .kw-tabbar button {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    background: none;
    border: 0;
    color: var(--kw-muted);
    font: inherit;
    font-size: .8125rem;
    text-decoration: none;
  }

  .kw-tabbar svg { width: 24px; height: 24px; }
  .kw-tabbar [aria-current="page"] { color: var(--kw-accent); font-weight: 700; }
}

@media print {
  .kw-tabbar { display: none !important; }
}

.btn, .kw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media screen and (max-width: 767.98px) {
  .kw-tabbar a, .kw-tabbar a:visited, .kw-tabbar a:hover, .kw-tabbar button {
    color: var(--kw-muted);
  }

  .kw-tabbar a[aria-current="page"] {
    color: var(--kw-accent);
  }
}

/* ---------- «جدول حضور و غیاب» screen ---------- */
.kw-presence {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.kw-crumbs {
  color: var(--kw-muted);
  font-size: .9375rem;
  margin-bottom: 12px;
}

.kw-crumbs a { color: var(--kw-muted); }
.kw-crumbs [aria-current] { color: var(--kw-ink-text); font-weight: 600; }

.kw-monthbox {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--kw-line-strong);
  border-radius: var(--kw-radius);
  background: var(--kw-card);
}

.kw-monthbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--kw-tap);
  min-height: var(--kw-tap);
  font-size: 1.5rem;
  color: var(--kw-ink-text);
  text-decoration: none;
}

.kw-monthname { min-width: 120px; text-align: center; font-weight: 600; }

.kw-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.kw-filter-search { flex: 1 1 280px; }
.kw-filter-search label, .kw-filter-label { display: block; font-weight: 600; margin-bottom: 6px; }
.kw-filter-units { flex: 2 1 320px; }
.kw-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.kw-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--kw-muted);
  margin: 0 0 12px;
}

.kw-legend .kw-s { font-style: normal; min-width: 32px; height: 28px; font-size: .875rem; }

.kw-s[data-s="incomplete"] { background: var(--kw-warn); color: #fff; }
.kw-s[data-s="holiday"] { background: var(--kw-st-holiday); color: #fff; }

.kw-presence-card { padding: 0; overflow: hidden; }

.kw-presence-scroll {
  overflow: auto;
  max-height: 70vh;
}

.kw-presence-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

.kw-presence-table th, .kw-presence-table td {
  border-bottom: 1px solid var(--kw-line);
  border-inline-start: 1px solid var(--kw-line);
  text-align: center;
  padding: 0;
  height: 48px;
  min-width: 44px;
  background: var(--kw-card);
}

.kw-presence-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--kw-head-bg);
  color: var(--kw-head-text);
  font-weight: 600;
  height: 52px;
}

.kw-presence-table th.kw-pt-name {
  position: sticky;
  inset-inline-start: 0;
  z-index: 3;
  min-width: 190px;
  max-width: 240px;
  text-align: start;
  padding: 6px 14px;
  background: var(--kw-card);
  border-inline-start: 0;
  box-shadow: -1px 0 0 var(--kw-line);
}

.kw-presence-table thead th.kw-pt-name { background: var(--kw-head-bg); z-index: 4; }
.kw-pt-fullname { display: block; font-weight: 600; color: var(--kw-ink-text); }
.kw-pt-name small { display: block; color: var(--kw-muted); font-weight: 400; }
.kw-pt-day span, .kw-pt-day small { display: block; line-height: 1.3; }
.kw-pt-day small { color: var(--kw-muted); font-weight: 400; }
.kw-pt-day.is-off, .kw-pt-cell.is-off { background-color: var(--kw-sunk); }
.kw-pt-sum { min-width: 64px !important; font-weight: 600; color: var(--kw-ink-text); }

.kw-pt-cell { font-weight: 700; }
.kw-pt-cell[data-kind="present"] { color: var(--kw-s-present); background-color: var(--kw-st-over-bg); }
.kw-pt-cell[data-kind="leave"] { color: var(--kw-s-leave); background-color: var(--kw-st-leave-bg); }
.kw-pt-cell[data-kind="mission"] { color: var(--kw-s-mission); background-color: var(--kw-st-mission-bg); }
.kw-pt-cell[data-kind="absent"] { color: var(--kw-s-absent); background-color: var(--kw-st-absent-bg); }
.kw-pt-cell[data-kind="incomplete"] { color: var(--kw-warn); background-color: var(--kw-warn-soft); }
.kw-pt-cell[data-kind="holiday"] { color: var(--kw-muted); }

.kw-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--kw-line);
}

.kw-pager-btns { display: inline-flex; align-items: center; gap: 12px; }

@media (max-width: 767.98px) {
  .kw-presence { padding: 12px 8px 88px; }
  .kw-presence-table th.kw-pt-name { min-width: 130px; max-width: 150px; padding: 6px 8px; }
  .kw-monthbox { width: 100%; justify-content: space-between; }
}

/* ---------- «ورود مجوز روزانه»: form card, live summary, steps ---------- */
.kw-permit { max-width: 1180px; margin: 0 auto; padding: 20px 16px 32px; }

.kw-permit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.kw-permit-form { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.kw-permit-side { display: flex; flex-direction: column; gap: 16px; }

.kw-permit-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.kw-permit-field > label, .kw-permit-field > legend {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--kw-ink-text);
  float: none;
  width: auto;
}

.kw-permit-emp { display: flex; gap: 8px; }
.kw-permit-emp .form-control { flex: 1 1 auto; }
.kw-permit-empname { display: block; margin-top: 6px; color: var(--kw-muted); min-height: 1.5em; }
.kw-permit-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kw-permit-days { color: var(--kw-accent); font-weight: 600; margin-top: -8px; }
.kw-permit-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Radio chips: the radio is the real control, the chip only draws it. */
.kw-chip-radio { position: relative; display: inline-flex; }
.kw-chip-radio input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.kw-chip-radio input:checked + .kw-chip {
  background: var(--kw-accent-soft);
  border-color: var(--kw-accent);
  color: var(--kw-accent);
  font-weight: 600;
}

.kw-chip-radio input:focus-visible + .kw-chip { outline: 3px solid var(--kw-focus); outline-offset: 2px; }

.kw-summary { margin: 0 0 12px; }
.kw-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--kw-line); }
.kw-summary dt { color: var(--kw-muted); font-weight: 400; }
.kw-summary dd { margin: 0; font-weight: 600; color: var(--kw-ink-text); text-align: end; }
.kw-summary-note { background: var(--kw-accent-soft); border-radius: var(--kw-radius); padding: 12px 14px; margin: 0; color: var(--kw-ink-text); }

.kw-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.kw-steps li { display: flex; align-items: center; gap: 12px; padding: 8px 0; counter-increment: step; }
.kw-steps li::before {
  content: counter(step, persian);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--kw-line);
  font-weight: 700;
}
.kw-steps span { color: var(--kw-muted); }
.kw-steps span::before { content: "· "; }

@media (max-width: 991.98px) {
  .kw-permit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .kw-permit { padding: 12px 12px 88px; }
  .kw-permit-form { padding: 16px; }
  .kw-permit-dates { grid-template-columns: 1fr; }
}

/* ---------- Login: the form on one side, the brand panel (menu-band colour of the theme) on the other ---------- */
.kw-auth {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--kw-card);
  overflow: auto;
}

.kw-auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(24px, 8vw, 120px);
}

.kw-auth-form form { width: 100%; max-width: 440px; margin: 0 auto; }
.kw-auth-logo { font-size: 1.75rem; font-weight: 700; color: var(--kw-ink-text); margin-bottom: 40px; direction: ltr; text-align: right; }
.kw-auth-logo b { color: var(--kw-ink-text); }
.kw-auth-logo span { color: var(--kw-accent); }
.kw-auth-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 8px; color: var(--kw-ink-text); }
.kw-auth-lead { color: var(--kw-muted); margin: 0 0 28px; }
.kw-auth-field { margin-bottom: 18px; }
.kw-auth-field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--kw-ink-text); }
.kw-auth-field .form-control { text-align: right; }
.kw-auth-hint { color: var(--kw-muted); font-size: .875rem; margin-top: 4px; }
.kw-auth-pass { display: flex; gap: 8px; }
.kw-auth-pass .form-control { flex: 1 1 auto; }
.kw-auth-submit { width: 100%; margin-top: 8px; }
.kw-auth-foot { color: var(--kw-muted); margin: 24px 0 0; font-size: .9375rem; }

/* «برنامه‌های مرتبط»: login-page switch between Karaweb and Selfweb (two halves, the current one filled). */
.kw-auth-switch { display: flex; border: 1px solid var(--kw-line); border-radius: 8px; overflow: hidden; margin: 0 0 24px; }
.kw-auth-switch > * { flex: 1 1 50%; text-align: center; padding: 10px 12px; font-weight: 600; font-size: .9375rem; text-decoration: none; }
.kw-auth-switch-on { background: var(--kw-accent-soft); color: var(--kw-accent); }
.kw-auth-switch > a { color: var(--kw-ink-text); }
.kw-auth-switch > a:hover, .kw-auth-switch > a:focus-visible { background: var(--kw-sunk, var(--kw-row-alt)); color: var(--kw-accent); }
/* Menu bar link to the other product. */
.kw-switch-app { white-space: nowrap; font-weight: 600; }

.kw-auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 48px clamp(24px, 6vw, 96px);
  background: var(--kw-ink);
  color: var(--kw-on-ink);
}

.kw-auth-brand-top { display: flex; align-items: center; gap: 12px; }
.kw-auth-brand-name { font-size: clamp(2.25rem, 4vw, 3.25rem); font-weight: 700; color: #fff; direction: ltr; text-align: right; line-height: 1.1; }
.kw-auth-brand-name span { color: var(--kw-amber); }
.kw-auth-tagline { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 16px 0 28px; }
.kw-auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.kw-auth-features li { display: flex; gap: 16px; align-items: flex-start; }
.kw-auth-features svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: 10px; background: var(--kw-ink-2); color: var(--kw-amber); }
.kw-auth-features b { display: block; color: #fff; }
.kw-auth-features span { color: var(--kw-on-ink); }
.kw-auth-clock { display: flex; align-items: baseline; gap: 12px; color: var(--kw-on-ink); }
.kw-auth-clock .kw-login-time { color: #fff; font-size: 2rem; }
.kw-auth-note { margin: 0; font-size: .9375rem; }

@media (max-width: 767.98px) {
  .kw-auth { grid-template-columns: 1fr; }
  .kw-auth-form { padding: 32px 20px; }
  .kw-auth-logo { margin-bottom: 24px; }
  .kw-auth-brand { padding: 32px 20px; }
}

/* وب کارا — logo mark (clock ring + check, gold dot) before the wordmark "Web" + "Kara"; Web light, Kara bold. */
.kw-logo::before,
.wf-logo::before,
.p-brand::before,
.kw-auth-logo::before,
.kw-auth-brand-name::before {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-inline-end: .32em;
  align-self: center;
  flex: none;
  vertical-align: -.12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Crect width='512' height='512' rx='112' fill='%232f6db5'/%3E%3Ccircle cx='256' cy='256' r='150' fill='none' stroke='%23fff' stroke-width='34'/%3E%3Cpath d='M188 262l50 50 96-112' fill='none' stroke='%23fff' stroke-width='40' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='256' cy='106' r='30' fill='%23e0a22a'/%3E%3C/svg%3E") center / contain no-repeat;
}
.kw-logo-sub { font-size: inherit; font-weight: 800; margin-left: 0; }
.kw-logo-sm .kw-logo-sub { font-size: 20px; }
.wf-logo .kw-logo-sub { font-size: 26px; font-weight: 800; }
.p-brand span { font-size: inherit; margin-left: 0; font-weight: 800; }
