/* Layout: right-to-left. Admin = sidebar (right) + work area; employee = single phone column. */
:root {
  /* Shishbarak brand: logo orange #F09221 with white lettering.
     Pressable things use a deeper orange so white text stays readable. */
  --bg: #FAF6F1; --surface: #FFFFFF; --sunk: #FCF9F5; --ink: #24180E; --muted: #6E6055; --line: #EDE2D6;
  --pine: #B65A08; --pine-ink: #FFFFFF; --pine-soft: #FDEBD6; --saffron: #F09221; --saffron-soft: #FEF2E2;
  --panel: #F09221; --panel-ink: #24180E;
  --ok: #2B7A4B; --ok-soft: #E2F2E8; --bad: #B23C34; --bad-soft: #F9E4E2; --warn: #94640A; --warn-soft: #FCF1DA;
  --f-display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --r: 10px; --shadow: 0 1px 2px rgb(60 30 5 / .06), 0 4px 16px rgb(60 30 5 / .07);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15110D; --surface: #1E1915; --sunk: #191410; --ink: #F3EBE3; --muted: #AB9C90; --line: #352B23;
  --pine: #F5A23C; --pine-ink: #1E1206; --pine-soft: #3A2512; --saffron: #F09221; --saffron-soft: #33230F;
  --panel: #F09221; --panel-ink: #24180E;
  --ok: #5CC287; --ok-soft: #16301F; --bad: #EC7F76; --bad-soft: #3A1B19; --warn: #E7B451; --warn-soft: #33270E; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #15110D; --surface: #1E1915; --sunk: #191410; --ink: #F3EBE3; --muted: #AB9C90; --line: #352B23;
  --pine: #F5A23C; --pine-ink: #1E1206; --pine-soft: #3A2512; --saffron: #F09221; --saffron-soft: #33230F;
  --panel: #F09221; --panel-ink: #24180E;
  --ok: #5CC287; --ok-soft: #16301F; --bad: #EC7F76; --bad-soft: #3A1B19; --warn: #E7B451; --warn-soft: #33270E; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--f-body); font-size: 15px; line-height: 1.6; margin: 0; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; margin: 0; text-wrap: balance; line-height: 1.35; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; min-height: 42px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: .2rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .78rem; color: var(--muted); }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.amt { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }
.hint { font-size: .8rem; color: var(--muted); margin: .2rem 0 0; }
.err { color: var(--bad); background: var(--bad-soft); padding: .5rem .7rem; border-radius: 8px; margin: 0; }
.info { background: var(--pine-soft); padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; font-size: .9rem; }
.calc { font-size: .88rem; color: var(--muted); margin: .3rem 0; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 2.5rem 1rem; text-align: center; display: flex; gap: .5rem; justify-content: center; align-items: center; }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.stack > label { margin-bottom: -.5rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.w-sm { max-width: 110px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--pine); color: var(--pine-ink); border: 0; border-radius: 8px; padding: .55rem 1rem; min-height: 42px; cursor: pointer; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.btn-big { width: 100%; min-height: 50px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--pine); border: 1px solid var(--line); }
.btn-ok { background: var(--ok); color: var(--pine-ink); }
.btn-bad { background: var(--bad); color: #fff; }
.iconbtn { background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; }
.iconbtn.flip .ic { transform: scaleX(-1); }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: .2rem; display: inline-grid; }
.linkbtn:hover { color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .76rem; padding: .1rem .55rem; border-radius: 99px; background: var(--sunk); color: var(--muted); white-space: nowrap; font-weight: 600; }
.chip .ic { width: 1em; height: 1em; }
.st-pending { background: var(--warn-soft); color: var(--warn); } .st-ok { background: var(--ok-soft); color: var(--ok); } .st-bad { background: var(--bad-soft); color: var(--bad); }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: .6rem .8rem; margin: .6rem 0; font-size: .88rem; }
.warnbox p { margin: 0; display: flex; gap: .4rem; align-items: flex-start; } .warnbox .ic { margin-top: .2rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg legend { width: 100%; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: .4rem .9rem; color: var(--ink); background: var(--surface); font-size: .9rem; }
.seg input:checked + span { background: var(--pine); color: var(--pine-ink); border-color: var(--pine); }
.seg input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-size: .95rem; cursor: pointer; }
.check input { width: auto; min-height: 0; accent-color: var(--pine); }
.check.big { padding: .5rem 0; border-bottom: 1px solid var(--line); }

/* demo bar */
.demobar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--ink); color: var(--bg); padding-block: .45rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: .85rem; }
.switch { display: flex; background: rgb(255 255 255 / .1); border-radius: 99px; padding: 3px; }
.switch a { color: inherit; text-decoration: none; padding: .25rem .9rem; border-radius: 99px; opacity: .75; }
.switch a.on { background: var(--saffron); color: #24180E; opacity: 1; font-weight: 600; }

.brand { display: flex; gap: .7rem; align-items: center; }
.brand b { display: block; font-family: var(--f-display); font-size: .95rem; line-height: 1.3; }
.brand small { color: var(--muted); font-size: .8rem; }
.brand-mark { width: 84px; height: 48px; border-radius: 50%; background: #E9731C; border: 3px solid #F2B411; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 1.5px #1F1A16; }
.brand-mark span { font-family: "Brush Script MT", "Segoe Script", cursive; font-style: italic; font-weight: 700; color: #1F1A16; font-size: .82rem; transform: rotate(-6deg); direction: ltr; }
.brand-logo { height: 58px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .6rem 0; }
.slip-brand { display: flex; gap: .8rem; align-items: center; } .slip-brand .brand-logo { height: 46px; }
.cert-co .brand-logo { height: 50px; }
.codebox { background: var(--saffron-soft); border: 1px dashed var(--saffron); border-radius: 10px; padding: .7rem .9rem; margin: .6rem 0; }
.codebox p { margin: .3rem 0 .5rem; } .code { font-size: 1.4rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; }
.hello-link { display: block; background: none; border: 0; color: var(--panel-ink); padding: .3rem 0 0; cursor: pointer; font-size: .85rem; text-decoration: underline; text-underline-offset: 4px; }
.linkbtn.center { justify-content: center; color: var(--pine); font-weight: 600; padding: .4rem; }

/* toast */
.toast { display: flex; gap: .4rem; align-items: center; background: var(--ok); color: var(--pine-ink); padding: .6rem 1rem; border-radius: 10px; font-weight: 600; margin: .5rem 0; }
.toast.fixed { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 50; box-shadow: var(--shadow); }

/* ===== Employee phone ===== */
.phone { max-width: 460px; margin: 0 auto; min-height: calc(100vh - 40px); background: var(--bg); display: flex; flex-direction: column; position: relative; }
.e-main { flex: 1; padding-block: 1rem 6rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.e-login { display: flex; flex-direction: column; gap: 1.5rem; justify-content: center; }
.e-hello { background: var(--panel); color: var(--panel-ink); border-radius: 14px; padding: 1.1rem 1.2rem; margin-bottom: .8rem; }
.e-hello h1 { font-size: 1.6rem; } .e-hello small, .e-hello span { opacity: .85; font-size: .88rem; }
.bal { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.2rem; }
.bal div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .5rem; text-align: center; min-width: 0; }
.bal b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; font-family: var(--f-display); }
.bal span { font-size: .74rem; color: var(--muted); line-height: 1.3; display: block; }
.sec-t { font-size: .95rem; margin: 1rem 0 .5rem; color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .9rem .8rem; text-align: right; cursor: pointer; display: flex; flex-direction: column; gap: .15rem; min-height: 110px; }
.tile:hover { border-color: var(--pine); }
.tile-ic { width: 30px; height: 30px; color: var(--pine); margin-bottom: .3rem; }
.tile b { font-family: var(--f-display); font-size: .98rem; } .tile small { color: var(--muted); font-size: .78rem; }
.reqcard { display: flex; flex-direction: column; gap: .25rem; width: 100%; text-align: right; margin-bottom: .6rem; cursor: default; }
button.reqcard { cursor: pointer; }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.note { background: var(--sunk); border-radius: 8px; padding: .4rem .6rem; font-size: .86rem; }
.e-top { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.e-top h2 { flex: 1; } .e-top select { width: auto; }
.e-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 460px; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 20; }
.e-nav button { background: none; border: 0; padding: .55rem 0 .45rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .78rem; color: var(--muted); cursor: pointer; }
.e-nav button.on { color: var(--pine); font-weight: 600; }
.e-nav .ic { width: 22px; height: 22px; }
.dot { font-style: normal; background: var(--saffron); color: #1a1205; border-radius: 99px; padding: 0 .4rem; font-size: .7rem; }

/* ===== Admin ===== */
.adm { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 38px); }
.side { background: var(--surface); border-left: 1px solid var(--line); padding: 1rem .8rem; display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 0; height: calc(100vh - 38px); }
.side nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.side nav button, .side-out { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .6rem .7rem; border-radius: 8px; cursor: pointer; text-align: right; color: var(--ink); }
.side nav button:hover { background: var(--sunk); }
.side nav button.on { background: var(--pine-soft); color: var(--pine); font-weight: 600; }
.side nav span { flex: 1; }
.badge { font-style: normal; background: var(--saffron); color: #1a1205; border-radius: 99px; padding: 0 .5rem; font-size: .78rem; font-weight: 700; }
.side-out { color: var(--muted); }
.a-main { padding-block: 1.2rem 3rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 1.5rem; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.a-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hgroup { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.search { width: 240px; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs button { background: none; border: 1px solid var(--line); padding: .4rem .9rem; border-radius: 99px; cursor: pointer; font-size: .9rem; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.a-login { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 1rem; }
.a-login form { width: min(420px, 100%); }

.split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 1rem; align-items: start; }
.qlist { display: flex; flex-direction: column; gap: .4rem; }
.qitem { display: flex; gap: .7rem; text-align: right; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; cursor: pointer; }
.qitem.on { border-color: var(--pine); box-shadow: inset -4px 0 0 var(--pine); }
.q-ic { color: var(--pine); width: 26px; height: 26px; margin-top: .2rem; }
.q-body { flex: 1; min-width: 0; } .q-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.q-type { font-size: .88rem; color: var(--pine); font-weight: 600; }
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; min-width: 0; position: sticky; top: 1rem; }
.d-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.d-sum { font-size: 1.05rem; font-weight: 600; margin: .8rem 0 .2rem; }
.quote { margin: .2rem 0; color: var(--muted); }
.sub { font-size: .9rem; margin: 1rem 0 .4rem; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: .8rem 0; }
.facts div { background: var(--sunk); border-radius: 8px; padding: .5rem .7rem; }
.facts span { display: block; font-size: .78rem; color: var(--muted); } .facts b { font-variant-numeric: tabular-nums; } .facts small { display: block; font-size: .74rem; color: var(--muted); }
.decide { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.d-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.d-btns .btn { min-width: 120px; }
.decided { background: var(--sunk); border-radius: 8px; padding: .7rem .9rem; margin-top: 1rem; font-size: .9rem; }
.att { margin: .6rem 0; } .att img { max-height: 260px; border-radius: 8px; border: 1px solid var(--line); } .att figcaption { font-size: .8rem; color: var(--muted); }
.punches { display: flex; flex-direction: column; gap: .3rem; }
.prow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.pday { min-width: 110px; color: var(--muted); }
.pt { background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding: .1rem .5rem; font-variant-numeric: tabular-nums; }
.pt-miss { background: var(--bad-soft); color: var(--bad); } .pt-fix { background: var(--saffron-soft); color: var(--saffron); } .pt-off { background: var(--sunk); color: var(--muted); }
.builder { border: 1px dashed var(--line); border-radius: 10px; padding: .9rem; display: flex; flex-direction: column; gap: .7rem; }
.sched { display: flex; flex-wrap: wrap; gap: .4rem; align-items: stretch; }
.sc { background: var(--sunk); border-radius: 8px; padding: .4rem .6rem; display: flex; flex-direction: column; min-width: 120px; margin: 0; color: var(--ink); }
.sc span { font-size: .78rem; color: var(--muted); } .sc b { font-variant-numeric: tabular-nums; }
.sc input { min-height: 34px; padding: .2rem .4rem; }
.sc.over, tr.over td { background: var(--warn-soft); }
.sc-add { min-height: auto; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tb { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tb th { text-align: right; font-weight: 600; color: var(--muted); font-size: .8rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
.tb td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tb tfoot td { font-weight: 600; background: var(--sunk); border-bottom: 0; }
.tb tr.click { cursor: pointer; } .tb tr.click:hover td, .tb tr.on td { background: var(--pine-soft); }
.tb tr.inactive td { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.kpis div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.kpis span { font-size: .8rem; color: var(--muted); display: block; } .kpis b { font-size: 1.2rem; font-variant-numeric: tabular-nums; font-family: var(--f-display); }
.kpis .hi { background: var(--panel); color: var(--panel-ink); border-color: var(--panel); } .kpis .hi span { color: inherit; opacity: .85; }
.monthpick b { min-width: 130px; text-align: center; font-family: var(--f-display); }
.confirm { background: var(--warn-soft); border-radius: 10px; padding: .8rem 1rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.txform { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.txform select, .txform input { width: auto; flex: 1 1 150px; }
.txform .check { flex: none; }
.inline { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; } .inline input, .inline select { width: auto; flex: 1 1 120px; }
.mini { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; }
.mini li { display: flex; gap: .8rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
.mini li > span:first-child { flex: 1; min-width: 120px; }
.profile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stackcol { display: flex; flex-direction: column; gap: 1rem; }
.allow { display: flex; flex-direction: column; gap: .5rem; }
.overlay { position: fixed; inset: 0; background: rgb(10 20 16 / .55); display: grid; place-items: center; z-index: 40; padding: 1rem; overflow: auto; }
.modal { background: var(--bg); border-radius: 14px; padding: 1rem; width: min(820px, 100%); position: relative; max-height: 92vh; overflow: auto; }
.modal .close { position: absolute; top: .6rem; left: .6rem; background: var(--surface); z-index: 2; }
.modal { padding-top: 3.4rem; }

/* payslip */
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; display: flex; flex-direction: column; gap: .9rem; }
.slip-h { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: .7rem; }
.slip-co { font-family: var(--f-display); font-weight: 700; color: var(--pine); }
.slip-t { font-size: .9rem; color: var(--muted); }
.slip-net { display: flex; flex-direction: column; align-items: flex-start; }
.slip-net span { font-size: .78rem; color: var(--muted); } .slip-net strong { font-size: 1.6rem; font-family: var(--f-display); font-variant-numeric: tabular-nums; direction: ltr; } .slip-net small { font-size: .75rem; color: var(--muted); }
.slip-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .4rem .8rem; margin: 0; }
.slip-info dt { font-size: .76rem; color: var(--muted); } .slip-info dd { margin: 0; font-weight: 600; }
.slip-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.slip-tb { width: 100%; border-collapse: collapse; font-size: .9rem; }
.slip-tb th { text-align: right; background: var(--sunk); padding: .45rem .6rem; font-size: .82rem; }
.slip-tb td { padding: .4rem .6rem; border-bottom: 1px dotted var(--line); vertical-align: top; }
.slip-tb tfoot td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 0; }
.how { font-size: .74rem; color: var(--muted); }
.slip-f { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .86rem; color: var(--muted); }
.slip-f b { color: var(--ink); }
.slip-sign { font-size: .8rem; color: var(--muted); margin: 0; border-top: 1px dashed var(--line); padding-top: .6rem; }

/* certificate */
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem 1.3rem; line-height: 2; }
.cert-co { font-family: var(--f-display); font-weight: 700; color: var(--pine); font-size: 1.1rem; border-bottom: 2px solid var(--ink); padding-bottom: .4rem; display: flex; align-items: center; gap: .8rem; }
.cert-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); flex-wrap: wrap; gap: .5rem; }
.cert-to { font-weight: 600; margin: .6rem 0 0; }
.cert h3 { text-align: center; margin: .6rem 0; font-size: 1.2rem; text-decoration: underline; text-underline-offset: 8px; }
.cert p { margin: .3rem 0; }
.cert-sign { display: flex; justify-content: space-between; margin-top: 1.6rem; font-weight: 600; }

@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-left: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; order: 3; }
  .side nav span { flex: none; }
  .a-main { padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .split, .profile { grid-template-columns: 1fr; }
  .detail { position: static; }
  .row3 { grid-template-columns: 1fr; }
  .search { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .25s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } } .toast:not(.fixed) { animation: none; } }

.e-login .brand { flex-direction: column; text-align: center; gap: .4rem; } .e-login .brand-logo { height: 120px; max-width: 220px; }
.a-login .brand { flex-direction: column; text-align: center; } .a-login .brand-logo { height: 110px; max-width: 200px; }
.side .brand-logo { height: 46px; }
.toast.bad { background: var(--bad); color: #fff; }

.slip-acts h4 { font-family: var(--f-display); font-size: .92rem; margin: 0 0 .4rem; color: var(--pine); }
.acts-wrap { overflow-x: auto; }
.slip-tb.acts { min-width: 560px; font-size: .85rem; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }

.entryform { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-top: .5rem; }
.entryform > div { flex: 1 1 130px; } .entryform > div.grow { flex: 2 1 200px; } .entryform .w-sm { max-width: none; }
.noshow { background: var(--bad-soft); border-radius: 10px; padding: .7rem .9rem; margin-top: 1rem; }
.noshow p { margin: 0 0 .5rem; } .noshow.done { background: var(--sunk); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.noshow.done p { margin: 0; }
.btn-sm { min-height: 32px; padding: .2rem .7rem; font-size: .85rem; }

.access { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; border-radius: 10px; padding: .7rem .9rem; margin: .6rem 0; }
.access.on { background: var(--ok-soft); } .access.off { background: var(--bad-soft); }
.access small { display: block; color: var(--muted); font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.settle { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .4rem; margin: .6rem 0; }
.settle h4 { margin: 0; font-family: var(--f-display); font-size: .92rem; color: var(--pine); }
.settle-net { margin: 0; font-size: 1rem; } .settle-net b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.w-md { max-width: 220px; }

/* documents */
.docs { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 1rem; align-items: start; }
.docs-form { position: sticky; top: 1rem; } .lbl { font-size: .85rem; color: var(--muted); margin-bottom: -.4rem; }
.doc-types { display: flex; flex-wrap: wrap; gap: .4rem; }
.doc-types button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .35rem .85rem; cursor: pointer; font-size: .9rem; }
.doc-types button.on { background: var(--pine); color: var(--pine-ink); border-color: var(--pine); }
.docs-preview { min-width: 0; overflow-x: auto; }
/* A4 paper: everything inside is sized in container units, so preview and print match */
.a4 { width: 210mm; max-width: 100%; aspect-ratio: 210 / 297; background: #fff; background-size: 100% 100%; color: #1b1b1b; box-shadow: var(--shadow); margin: 0 auto; position: relative; container-type: inline-size; color-scheme: light; --doc-accent: #E8861A; }
.a4-in { position: absolute; inset: 16.5% 10.5% 12.5% 10.5%; display: flex; flex-direction: column; font-family: "Noto Naskh Arabic", "Traditional Arabic", "IBM Plex Sans Arabic", serif; font-size: 1.85cqw; line-height: 2; overflow: hidden; }
.doc-meta { display: flex; justify-content: space-between; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .82em; color: #444; border-bottom: .12cqw solid #d8d8d8; padding-bottom: .3em; }
.doc-title { text-align: center; margin: 1.1em 0 .9em; font-family: "Noto Kufi Arabic", sans-serif; font-size: 1.55em; color: #111; }
.doc-title span { display: inline-block; padding: 0 1.2em .25em; border-bottom: .35cqw solid var(--doc-accent); position: relative; }
.doc-title span::after { content: ""; position: absolute; left: 50%; bottom: -.75cqw; width: 1.1cqw; height: 1.1cqw; background: var(--doc-accent); transform: translateX(-50%) rotate(45deg); }
.doc-to { margin: 0; font-weight: 700; }
.doc-greet { margin: .1em 0 .3em; }
.doc-body p { margin: 0 0 .55em; text-align: justify; text-indent: 1.5em; }
.doc-body:focus { outline: .25cqw dashed var(--doc-accent); outline-offset: 1cqw; }
.doc-lines { margin: .2em 0 .4em; padding-inline-start: 1.6em; }
.doc-lines li { border-bottom: .12cqw dotted #999; min-height: 2em; }
.doc-tb { width: 100%; border-collapse: collapse; margin: .5em 0 .7em; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .86em; line-height: 1.6; }
.doc-tb th, .doc-tb td { border: .12cqw solid #cfcfcf; padding: .35em .8em; text-align: right; }
.doc-tb th { width: 34%; background: #f6f1ea; font-weight: 600; color: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-close { margin: .2em 0 0; }
.doc-sign { margin-top: auto; padding-top: 1em; display: flex; justify-content: flex-end; align-items: flex-end; gap: 2.5em; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .88em; line-height: 1.7; }
.doc-sign .sg { display: flex; flex-direction: column; gap: .3em; min-width: 30%; }
.doc-sign .ln { border-top: .12cqw solid #555; padding-top: .2em; margin-top: 1.6em; color: #555; font-size: .9em; }
.doc-sign .chk { color: #333; }
.doc-sign .stamp { width: 13cqw; height: 13cqw; border: .2cqw dashed #b9b9b9; border-radius: 50%; display: grid; place-items: center; color: #aaa; font-size: .85em; }
.doc-sign.person { justify-content: space-between; }
.doc-sign .thumb { width: 12cqw; height: 15cqw; border: .2cqw solid #b9b9b9; border-radius: 1cqw; display: flex; align-items: flex-end; justify-content: center; text-align: center; padding: .3em; color: #888; font-size: .72em; line-height: 1.3; }
.doc-foot { margin: .8em 0 0; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .62em; color: #9a9a9a; text-align: center; }
.a4-wrap { margin: .5rem 0; }
.tb.vars input { max-width: 140px; min-height: 36px; padding: .25rem .5rem; }
.kpis small { display: block; font-size: .74rem; color: var(--muted); } .kpis .hi small { color: inherit; opacity: .8; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; } .docs-form { position: static; } }
@media print {
  @page { size: A4; margin: 0; }
  body.print-doc .demobar, body.print-doc .side, body.print-doc .a-head, body.print-doc .docs-form, body.print-doc .toast { display: none !important; }
  body.print-doc .adm, body.print-doc .docs, body.print-doc .a-main { display: block; padding: 0; margin: 0; }
  body.print-doc .a4 { width: 210mm; height: 297mm; max-width: none; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-report .demobar, body.print-report .side, body.print-report .tabs, body.print-report .d-btns, body.print-report .iconbtn, body.print-report .toast { display: none !important; }
  body.print-report .adm { display: block; } body.print-report .tablewrap { overflow: visible; border: 0; }
}

/* ===== payslip (Magic Payroll order, modern treatment) ===== */
.ps { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; font-size: .92rem; }
.ps > * { padding-inline: 1.1rem; }
.ps-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 1rem .9rem; border-bottom: 3px solid var(--saffron); }
.ps-brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.ps-brand img { height: 54px; width: auto; }
.ps-brand b { display: block; font-family: var(--f-display); font-size: 1rem; }
.ps-brand small { color: var(--muted); font-size: .76rem; }
.ps-tbox { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; text-align: left; }
.ps-tbox h3 { font-size: 1.25rem; }
.ps-tbox span { background: var(--saffron); color: #24180E; font-weight: 700; padding: .1rem .7rem; border-radius: 99px; font-size: .88rem; }
.ps-tbox small { color: var(--muted); font-size: .74rem; }
.ps-info, .ps-bank { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding-block: .2rem; background: var(--sunk); border-bottom: 1px solid var(--line); }
.ps-info > div, .ps-bank > div { padding: .55rem .7rem; border-inline-start: 1px solid var(--line); min-width: 0; }
.ps-info .wide, .ps-bank .wide { grid-column: span 2; }
.ps-info dt, .ps-bank dt { font-size: .74rem; color: var(--muted); }
.ps-info dd, .ps-bank dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ps-info em { font-style: normal; font-weight: 400; color: var(--bad); font-size: .8rem; }
.ltr { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ps-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; padding-block: 1rem; }
.ps-col { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.ps-col h4 { margin: 0; padding: .5rem .8rem; font-family: var(--f-display); font-size: .88rem; }
.ps-col.earn h4 { background: var(--ok-soft); color: var(--ok); } .ps-col.ded h4 { background: var(--bad-soft); color: var(--bad); }
.ps-col table { width: 100%; border-collapse: collapse; flex: 1; }
.ps-col td { padding: .45rem .8rem; border-bottom: 1px dashed var(--line); vertical-align: top; }
.ps-col tr:last-child td { border-bottom: 0; }
.ps-l { display: block; } .ps-how { display: block; font-size: .72rem; color: var(--muted); line-height: 1.5; }
.ps-tot { display: flex; justify-content: space-between; padding: .55rem .8rem; border-top: 2px solid var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-net { margin-inline: 1.1rem; padding: .8rem 1rem !important; background: var(--panel); color: var(--panel-ink); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ps-net-n { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.ps-net-n span { font-weight: 600; } .ps-net-n strong { font-family: var(--f-display); font-size: 1.9rem; font-variant-numeric: tabular-nums; direction: ltr; }
.ps-net-n small { font-size: .8rem; }
.ps-net p { margin: 0; font-weight: 600; font-size: .9rem; flex: 1 1 260px; text-align: left; }
.ps-bank { margin-top: 1rem; border-top: 1px solid var(--line); }
.ps-sec { padding-block: 1rem 0; }
.ps-sec h4 { margin: 0 0 .4rem; font-family: var(--f-display); font-size: .9rem; color: var(--pine); }
.ps-tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.ps-tb { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 480px; }
.ps-tb th { background: var(--sunk); text-align: right; font-weight: 600; color: var(--muted); padding: .4rem .6rem; font-size: .76rem; white-space: nowrap; }
.ps-tb td { padding: .4rem .6rem; border-top: 1px solid var(--line); }
.dot-add, .dot-ded { display: inline-block; width: .5em; height: .5em; border-radius: 50%; margin-inline-end: .4em; background: var(--ok); } .dot-ded { background: var(--bad); }
.ps-bal { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; padding-block: 1rem; }
.ps-bal div { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; }
.ps-bal span { display: block; font-size: .74rem; color: var(--muted); } .ps-bal b { font-family: var(--f-display); font-size: 1.15rem; font-variant-numeric: tabular-nums; } .ps-bal small { font-size: .74rem; color: var(--muted); font-weight: 400; }
.ps-admin { font-size: .8rem; color: var(--muted); margin: 0; padding-bottom: .6rem; }
.ps > .warnbox { margin-inline: 1.1rem; }
.ps-sign { border-top: 1px dashed var(--line); padding-block: .8rem 1rem; font-size: .82rem; color: var(--muted); }
.ps-sign p { margin: 0 0 .8rem; } .ps-sign div { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--ink); }
@media (max-width: 700px) { .ps-info, .ps-bank { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ps > * { padding-inline: .8rem; } .ps-net { margin-inline: .8rem; } .ps-tbox { align-items: flex-start; text-align: right; } .ps-net-n strong { font-size: 1.6rem; } }
@media print {
  body.print-slip .demobar, body.print-slip .side, body.print-slip .a-main > :not(.overlay), body.print-slip .modal .close, body.print-slip .slip-tools, body.print-slip .toast { display: none !important; }
  body.print-slip .overlay { position: static; background: none; padding: 0; display: block; }
  body.print-slip .modal { max-height: none; overflow: visible; width: auto; padding: 0; background: #fff; }
  body.print-slip .adm { display: block; }
  body.print-slip .ps { border: 0; font-size: 11px; color: #111; --surface: #fff; --sunk: #f6f3ef; --line: #ddd; --ink: #111; --muted: #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-slip .ps-sec, body.print-slip .ps-bal { break-inside: avoid; }
  body.print-slip .allslips .ps { break-after: page; }
}
.slip-tools { display: flex; gap: .5rem; justify-content: flex-start; margin-bottom: .6rem; padding-inline-end: 3rem; }
@media print {
  html, body { background: #fff !important; }
  body.print-slip .modal { padding: 9mm 10mm !important; }
  body.print-slip .ps { border-radius: 0; box-shadow: none; }
  body.print-slip .ps-admin, body.print-slip .ps > .warnbox { display: none !important; }
  body.print-slip .allslips .ps { margin-bottom: 0; }
  body.print-report .a-main { padding: 12mm !important; background: #fff; }
  body.print-report .kpis div { break-inside: avoid; }
  body.print-report, body.print-slip { --bg: #fff; --sunk: #f6f3ef; --surface: #fff; color-scheme: light; }
}
@media print { body.print-slip .overlay, body.print-slip .modal, body.print-slip .a-main, body.print-slip .adm { overflow: visible !important; height: auto !important; min-height: 0 !important; } body.print-slip .side { position: static; } }
@media print { body.print-slip .ps { overflow: visible !important; } }
@media print {
  body.print-slip .modal { padding: 7mm 9mm !important; }
  body.print-slip .ps { font-size: 10px; }
  body.print-slip .ps > * { padding-inline: 4mm; }
  body.print-slip .ps-head { padding-block: 3mm 2.5mm; }
  body.print-slip .ps-brand img { height: 40px; }
  body.print-slip .ps-info > div, body.print-slip .ps-bank > div { padding: 1.4mm 2.5mm; }
  body.print-slip .ps-cols { padding-block: 3mm; gap: 3mm; }
  body.print-slip .ps-col td { padding: 1.1mm 2.5mm; }
  body.print-slip .ps-col h4, body.print-slip .ps-tot { padding: 1.4mm 2.5mm; }
  body.print-slip .ps-net { margin-inline: 4mm; padding: 2.5mm 4mm !important; }
  body.print-slip .ps-net-n strong { font-size: 20px; }
  body.print-slip .ps-sec { padding-block: 2.5mm 0; }
  body.print-slip .ps-tb td, body.print-slip .ps-tb th { padding: 1mm 2mm; }
  body.print-slip .ps-bal { padding-block: 3mm; gap: 2.5mm; }
  body.print-slip .ps-bal div { padding: 1.4mm 2.5mm; }
  body.print-slip .ps-bank { margin-top: 3mm; }
  body.print-slip .ps-sign { padding-block: 2.5mm 0; }
  body.print-slip .ps-sign p { margin-bottom: 4mm; }
}

/* payment voucher */
.vsplit { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.3fr); }
.vpanel { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.vform { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; } .vform > div { flex: 1 1 120px; } .vform .grow { flex: 3 1 240px; }
.btn.neg { color: var(--bad); }
.voucher .vno { font-size: 1.15em; letter-spacing: .08em; color: #b8560a; }
.v-amount { display: flex; align-items: center; justify-content: flex-start; gap: 1em; margin: .2em 0 .8em; font-family: "IBM Plex Sans Arabic", sans-serif; }
.v-amount span { font-weight: 700; }
.v-amount table { border-collapse: collapse; font-size: 1.15em; direction: rtl; }
.v-amount th { font-size: .7em; font-weight: 600; color: #555; background: #f6f1ea; padding: .1em 1em; border: .15cqw solid #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.v-amount td { border: .15cqw solid #333; padding: .2em 1.2em; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; min-width: 5em; }
.v-lines { width: 100%; border-collapse: collapse; line-height: 1.7; }
.v-lines th { width: 24%; text-align: right; font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 600; font-size: .9em; color: #444; padding: .55em .2em; vertical-align: top; }
.v-lines td { border-bottom: .14cqw dotted #888; padding: .55em .4em; }
.v-lines small { color: #666; }
.v-sign { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .86em; line-height: 1.6; }
.v-sign .sg { display: flex; flex-direction: column; gap: .2em; flex: 1; }
.v-sign .ln { border-top: .12cqw solid #555; padding-top: .2em; margin-top: 1.6em; color: #555; font-size: .9em; }
.v-sign .thumb { width: 11cqw; height: 13cqw; border: .2cqw solid #b9b9b9; border-radius: 1cqw; display: flex; align-items: flex-end; justify-content: center; text-align: center; padding: .3em; color: #888; font-size: .7em; line-height: 1.3; }
.voucher.cancelled::after { content: "ملغى"; position: absolute; inset: 40% 0 auto; text-align: center; font: 700 14cqw "Noto Kufi Arabic", sans-serif; color: rgb(178 60 52 / .25); transform: rotate(-18deg); pointer-events: none; }
@media (max-width: 1100px) { .vsplit { grid-template-columns: 1fr; } }
@media print { body.print-doc .vsplit > .tablewrap, body.print-doc .vform { display: none !important; } body.print-doc .vsplit, body.print-doc .vpanel { display: block; } }

.boot { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--pine-soft); border-top-color: var(--pine); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.sanad-row { margin-top: .6rem; display: flex; justify-content: center; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
