/* Hazirat — application styles.
   Layout uses CSS logical properties throughout, so switching dir="rtl"
   mirrors the whole interface without a second stylesheet. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #16191d;
  --text-muted: #5f6672;
  --text-faint: #8b929c;

  --accent: #1f6feb;
  --accent-weak: #eaf1fe;
  --accent-strong: #1858c0;

  --good: #17794a;
  --good-weak: #e6f4ec;
  --warn: #9a6600;
  --warn-weak: #fdf3e0;
  --bad: #b3261e;
  --bad-weak: #fdecec;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 19, 24, .06), 0 1px 3px rgba(16, 19, 24, .04);
  --shadow-lg: 0 4px 16px rgba(16, 19, 24, .1);

  --sidebar-w: 236px;
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Traditional Arabic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

body.rtl { font-family: var(--font-ar); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

p { margin: 0 0 12px; }

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { inset-inline-start: 0; }

/* ---- Shell ---------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding-inline: 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #4b93ff);
  flex: 0 0 auto;
}

.brand-text { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }

.sidebar__nav { padding: 12px 10px 24px; }

.nav-group { margin-top: 18px; }

.nav-group__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 10px 6px;
}

.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--accent-weak); color: var(--accent-strong); font-weight: 600; }

.main-column { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__title { font-size: 15px; font-weight: 600; flex: 1 1 auto; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__menu { display: none; }

.main { padding: 20px; flex: 1 1 auto; }

@media (max-width: 880px) {
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: var(--shadow-lg);
  }
  body.rtl .sidebar { transform: translateX(100%); }
  .sidebar.is-open { transform: translateX(0) !important; }
  .topbar__menu { display: inline-flex; }
  .main { padding: 14px; }
}

/* ---- Page header ---------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head__text { min-width: 0; }
.page-head__sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Cards ---------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__title { font-size: 14px; font-weight: 600; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ---- Stat tiles ----------------------------------------------------- */

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat__label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat__value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.stat--good .stat__value { color: var(--good); }
.stat--warn .stat__value { color: var(--warn); }
.stat--bad .stat__value { color: var(--bad); }

/* ---- Tables --------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th, table.data td {
  padding: 10px 14px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: end; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: end; white-space: nowrap; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty__title { font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* ---- Badges --------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge--neutral { background: #eef0f3; color: #4a515c; }
.badge--good { background: var(--good-weak); color: var(--good); }
.badge--warn { background: var(--warn-weak); color: var(--warn); }
.badge--bad { background: var(--bad-weak); color: var(--bad); }
.badge--info { background: var(--accent-weak); color: var(--accent-strong); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; }
.dot--good { background: var(--good); }
.dot--bad { background: var(--bad); }
.dot--warn { background: var(--warn); }
.dot--idle { background: var(--border-strong); }

/* ---- Forms ---------------------------------------------------------- */

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid--single { grid-template-columns: 1fr; }
.field--wide { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field__hint { font-size: 12px; color: var(--text-muted); }
.field__error { font-size: 12px; color: var(--bad); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], input[type=tel],
select, textarea {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] {
  border-color: var(--bad);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2); color: var(--text-faint); cursor: not-allowed;
}

.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.checkbox input { margin-top: 2px; flex: 0 0 auto; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
legend { font-size: 12.5px; font-weight: 600; padding-inline: 6px; }

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.form-actions--end { justify-content: flex-end; }

/* ---- Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--danger { background: var(--bad); color: #fff; }
.btn--danger:hover { filter: brightness(.94); }
.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }

.link-button {
  background: none; border: 0; padding: 4px 6px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text-muted); border-radius: 6px;
}
.link-button:hover { background: var(--surface-2); color: var(--text); }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius);
  background: transparent; border: 0; cursor: pointer; color: var(--text-muted);
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }

.burger { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
.burger::before, .burger::after {
  content: ''; position: absolute; inset-inline: 0; height: 2px; background: currentColor;
}
.burger::before { top: -5px; }
.burger::after { top: 5px; }

.inline-form { display: inline; }

/* ---- Flash ---------------------------------------------------------- */

.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border: 1px solid transparent;
}
.flash--success { background: var(--good-weak); color: var(--good); border-color: #bfe3ce; }
.flash--error { background: var(--bad-weak); color: var(--bad); border-color: #f4c9c6; }
.flash--warning { background: var(--warn-weak); color: var(--warn); border-color: #f0dcb4; }
.flash--info { background: var(--accent-weak); color: var(--accent-strong); border-color: #c8ddfb; }

.alert-box {
  padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px;
  background: var(--bad-weak); color: var(--bad); border: 1px solid #f4c9c6;
  margin-bottom: 16px;
}
.alert-box ul { margin: 6px 0 0; padding-inline-start: 18px; }

/* ---- User menu ------------------------------------------------------ */

.user-menu { position: relative; }
.user-menu__trigger {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; font: inherit;
  padding: 4px 6px; border-radius: var(--radius); color: var(--text);
}
.user-menu__trigger:hover { background: var(--surface-2); }
.user-menu__name { font-size: 13px; font-weight: 500; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-weak); color: var(--accent-strong);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.user-menu__panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px);
  min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 4px; z-index: 30;
}
.menu-item {
  display: block; width: 100%; text-align: start;
  padding: 8px 10px; border-radius: 6px; font-size: 13.5px;
  background: none; border: 0; cursor: pointer; font: inherit; color: var(--text);
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item--danger { color: var(--bad); }

/* ---- Login ---------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.auth-card__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-card__title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.auth-card__sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.auth-card .field + .field { margin-top: 14px; }
.auth-card .btn { width: 100%; margin-top: 18px; }
.auth-footer { margin-top: 16px; text-align: center; font-size: 13px; }

/* ---- Utility -------------------------------------------------------- */

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }
.text-bad { color: var(--bad); }
.text-good { color: var(--good); }
.text-warn { color: var(--warn); }
.hidden { display: none !important; }

.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.filters .field { flex: 0 1 180px; }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.pagination__pages { display: flex; gap: 4px; }
.page-link {
  padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; background: var(--surface);
}
.page-link.is-current { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link:hover { text-decoration: none; }

@media print {
  .sidebar, .topbar, .page-head__actions, .filters, .pagination { display: none !important; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
  .main { padding: 0; }
}

/* ---- Reports -------------------------------------------------------------
   The register paints late, absent and unclosed days so a month can be
   scanned rather than read. Colour is never the only signal: every marked
   cell also carries the figure or a word, because a printed report is often
   black and white and some readers cannot separate red from green. */

.report-hub { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.report-hub__card {
  display: block; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: inherit;
}
.report-hub__card:hover { border-color: var(--accent); text-decoration: none; }
.report-hub__card h3 { margin: 0 0 6px; font-size: 15px; }
.report-hub__card p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.cell-bad { color: var(--bad); font-weight: 600; }
.cell-warn { color: var(--warn); font-weight: 600; }
.cell-good { color: var(--good); }
table.data tr.row-absent td { background: var(--bad-weak); }
table.data tr.row-missing td { background: var(--warn-weak); }

.report-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline;
  margin-bottom: 12px; font-size: 13px; color: var(--text-muted);
}

/* The monthly sheet: many narrow day columns, with the name column pinned so
   a row stays identifiable while scrolling sideways. */
table.sheet { border-collapse: collapse; font-size: 12px; width: auto; min-width: 100%; }
table.sheet th, table.sheet td {
  border: 1px solid var(--border); padding: 3px 4px; text-align: center; white-space: nowrap;
}
table.sheet th { background: var(--surface-2); font-weight: 600; }
table.sheet td.sheet-name, table.sheet th.sheet-name {
  text-align: start; position: sticky; inset-inline-start: 0;
  background: var(--surface); min-width: 150px; z-index: 1;
}
table.sheet th.sheet-name { background: var(--surface-2); }
table.sheet td.day { width: 26px; font-variant-numeric: tabular-nums; }
table.sheet td.day-rest, table.sheet th.day-rest { background: var(--surface-2); color: var(--text-muted); }
table.sheet td.day-absent { background: var(--bad-weak); color: var(--bad); font-weight: 700; }
table.sheet td.day-leave { background: var(--accent-weak); color: var(--accent-strong); font-weight: 600; }
table.sheet td.day-partial { background: var(--warn-weak); color: var(--warn); font-weight: 700; }
table.sheet td.day-holiday { background: var(--good-weak); color: var(--good); }
table.sheet td.total { font-weight: 600; background: var(--surface-2); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.legend__item { display: inline-flex; gap: 6px; align-items: center; }
.legend__symbol {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  border: 1px solid var(--border); border-radius: 4px; font-weight: 700; font-size: 11px;
  background: var(--surface-2);
}

@media print {
  .report-hub, .export-actions { display: none !important; }
  table.sheet { font-size: 9px; }
  table.sheet td.sheet-name { position: static; }
  table.data { font-size: 10px; }
  /* Print needs the marks without relying on background colour, which most
     browsers drop by default. */
  table.data tr.row-absent td:first-child::before { content: "▲ "; }
  table.data tr.row-missing td:first-child::before { content: "! "; }
  .report-meta { color: #000; }
}

/* ---- The alert bell ------------------------------------------------------- */

.bell {
  position: relative; display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px; text-decoration: none;
  font-size: 16px; line-height: 1;
}
.bell:hover { background: var(--surface-2); text-decoration: none; }
.bell__count {
  position: absolute; top: 1px; inset-inline-end: 1px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--bad); color: #fff;
  border-radius: 8px; font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Visible to a screen reader, not on screen: the count beside the bell is a
   number with no word attached, which reads as nothing out loud. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Payroll -------------------------------------------------------------- */

.payroll-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow-step {
  padding: 4px 10px; border-radius: 20px; font-size: 12px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.flow-step--done { background: var(--good-weak); color: var(--good); border-color: transparent; font-weight: 600; }

/* ---- Payslip -------------------------------------------------------------
   Meant to be read on screen and to print clean on one page. The day-by-day
   table is what makes a disputed figure checkable on the slip itself. */

.print-body { background: var(--surface-2); margin: 0; padding: 20px; }
.payslip {
  max-width: 820px; margin: 0 auto; background: #fff; color: #111;
  border: 1px solid var(--border); border-radius: 10px; padding: 28px;
}
.payslip__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 12px; }
.payslip__company { font-size: 20px; font-weight: 700; }
.payslip__doc { color: #555; margin-top: 2px; }
.payslip__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.payslip__meta {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px;
  margin: 16px 0; font-size: 14px;
}
.payslip__label { color: #777; display: inline-block; min-width: 110px; }
.payslip__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 12px 0; }
.payslip__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.payslip__table th {
  text-align: start; background: #f3f4f6; padding: 7px 10px; font-size: 13px;
  border-bottom: 1px solid #ddd;
}
.payslip__table td { padding: 6px 10px; border-bottom: 1px solid #eee; }
.payslip__table td.num, .payslip__table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.payslip__subtotal td { font-weight: 700; border-top: 2px solid #ccc; border-bottom: none; }
.payslip__net { margin: 16px 0; padding: 14px 16px; background: #f3f4f6; border-radius: 8px; }
.payslip__adjusted { font-size: 13px; color: #9a6600; margin-bottom: 8px; }
.payslip__net-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.payslip__net-row strong { font-size: 22px; }
.payslip__days { margin-top: 20px; }
.payslip__days-title { font-weight: 700; margin-bottom: 8px; }
.payslip__table--days td, .payslip__table--days th { font-size: 12px; padding: 4px 8px; }
.payslip__day--flag td { background: #fdecec; }
.payslip__day--flag td.cell-bad { color: #b3261e; }
.payslip__foot { margin-top: 18px; border-top: 1px solid #eee; padding-top: 10px; }

@media (max-width: 640px) {
  .payslip__cols, .payslip__meta { grid-template-columns: 1fr; }
}

@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; padding: 0; }
  .payslip { border: 0; border-radius: 0; max-width: none; padding: 0; }
  .payslip__day--flag td { background: transparent; }
  .payslip__day--flag td:first-child::before { content: "▲ "; }
}

/* ---- Right-to-left refinements -------------------------------------------
   The layout mirrors by itself (logical properties). What does not mirror
   automatically is content: arrows point the wrong way, and left-to-right
   data — numbers, emails, IBANs, times — gets scrambled when it sits inside
   right-to-left text. */

.arrow { display: inline-block; }
body.rtl .arrow { transform: scaleX(-1); }

/* Arabic letters join; spacing them out or upper-casing breaks the words. */
body.rtl .brand-text,
body.rtl .stat__label,
body.rtl th,
body.rtl .card__title,
body.rtl label,
body.rtl .nav__group { letter-spacing: 0; text-transform: none; }

body.rtl { line-height: 1.7; }

/* Data that is always read left to right, kept together as one unit. */
body.rtl .mono,
body.rtl .ltr,
body.rtl td.num,
body.rtl input[type="email"],
body.rtl input[type="tel"],
body.rtl input[type="url"],
body.rtl input[type="number"],
body.rtl input[type="time"],
body.rtl input[type="date"],
body.rtl input[type="password"],
body.rtl input.mono {
  direction: ltr;
  unicode-bidi: isolate;
}
body.rtl input[type="email"],
body.rtl input[type="tel"],
body.rtl input[type="url"],
body.rtl input[type="number"],
body.rtl input[type="password"],
body.rtl input.mono { text-align: right; }

/* Mixed names ("Ahmed أحمد") take the direction of their first letter. */
body.rtl .person-name { unicode-bidi: plaintext; }

/* Amounts and counts in tables line up on the reading end. */
body.rtl table.data td.num, body.rtl table.data th.num { text-align: end; }

@media print {
  body.rtl { font-size: 12pt; }
}

/* ---- Users, roles, account, two-factor ---- */
.check-grid, .check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.check-list { grid-template-columns: 1fr; }
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--border, #dcdfe4); border-radius: 8px; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.secret { display: inline-block; margin-top: 6px; padding: 6px 10px; background: #f3f4f6; border-radius: 6px; letter-spacing: .08em; word-break: break-all; }
.code-list { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.code-list li { padding: 8px 10px; background: #f3f4f6; border-radius: 6px; font-size: 15px; text-align: center; }
ol.steps { padding-inline-start: 20px; margin: 0 0 8px; }
ol.steps li { margin-bottom: 4px; }
@media print { .sidebar, .topbar, .page-head__actions, form { display: none !important; } }
