/* أبو حالوب — design system
   Brand: teal and gold from the logo, on warm cream. One accent (teal) for actions, gold for highlights.
   Type: IBM Plex Sans Arabic. Radius 12 (controls) / 16 (cards). Spacing on a 4px grid. */
:root {
  --teal: #0f7b7d; --teal-600: #0c6668; --teal-700: #0a5254; --teal-50: #ecf6f5; --teal-100: #d3ebe9;
  --gold: #c4913a; --gold-600: #a77a2c; --gold-50: #fbf3e4; --gold-100: #f3e2c2;
  --bg: #f7f3eb; --surface: #ffffff; --surface-2: #fbf9f4;
  --ink: #142727; --ink-2: #3c5050; --muted: #738181; --faint: #a3adad;
  --line: #ebe5d8; --line-2: #f3efe6;
  --ok: #1b8a52; --ok-50: #e7f5ed; --danger: #c2412d; --danger-50: #fcebe7; --warn: #b07418; --warn-50: #fdf3df; --info: #2e6bb0; --info-50: #e9f1fb;
  --r: 16px; --r-sm: 12px; --r-xs: 9px;
  --sh-1: 0 1px 2px rgba(20, 45, 45, .05);
  --sh-2: 0 1px 2px rgba(20, 45, 45, .04), 0 6px 20px -8px rgba(20, 45, 45, .12);
  --sh-3: 0 20px 50px -12px rgba(15, 40, 40, .28);
  --top: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --c-teal: #0f7b7d; --theme-teal: #0f7b7d; /* kept for older inline styles */
  /* older names still used by a few inline styles */
  --teal-l: var(--teal-50); --teal-d: var(--teal-700); --gold-l: var(--gold-50); --cream: var(--bg); --paper: var(--surface);
  --ok-l: var(--ok-50); --danger-l: var(--danger-50); --warn-l: var(--warn-50); --info-l: var(--info-50);
  --shadow: var(--sh-2);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; overflow-x: clip; }
body { overflow-x: clip; }
body { font-family: "IBM Plex Sans Arabic", "Tajawal", system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 15.5px; line-height: 1.6;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-600); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.35; letter-spacing: -.005em; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
h4 { font-size: .95rem; font-weight: 600; color: var(--ink-2); margin-top: 14px; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--teal) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--teal-100); }
svg.i { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- boot & login ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: 150px; mix-blend-mode: multiply; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; transform: scale(.97); } }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px;
  background: radial-gradient(900px 500px at 50% -10%, var(--teal-100), transparent 70%), radial-gradient(600px 400px at 100% 110%, var(--gold-50), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 24px; padding: 30px 28px 26px; box-shadow: var(--sh-3); border: 1px solid var(--line); position: relative; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; border-radius: 24px 24px 0 0; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.auth-logo { display: block; width: 190px; max-width: 64%; margin: 0 auto 8px; mix-blend-mode: multiply; }
.auth h1 { text-align: center; font-size: 1.3rem; margin-bottom: 18px; }
.auth .btn.block { margin-top: 4px; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.topbar::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: .55; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.brand:hover { color: var(--ink); }
.brand img { height: 42px; mix-blend-mode: multiply; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; transition: background .15s; }
.icon-btn:hover, .icon-btn.on { background: var(--teal-50); color: var(--teal-700); }
.icon-btn svg.i { width: 22px; height: 22px; }
.bell span { position: absolute; top: 4px; inset-inline-start: 3px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); line-height: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 14px; color: var(--ink); transition: background .15s; }
.me:hover, .me.on { background: var(--teal-50); color: var(--ink); }
.me-text { display: flex; flex-direction: column; line-height: 1.25; }
.me-text b { font-weight: 600; font-size: .92rem; }
.me-text small { color: var(--muted); font-size: .76rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; font-weight: 700; font-size: .86rem; letter-spacing: .5px;
  color: var(--teal-700); background: linear-gradient(140deg, var(--teal-50), var(--teal-100)); border: 1.5px solid var(--surface); box-shadow: 0 0 0 1.5px var(--gold-100); }
.avatar.xl { width: 76px; height: 76px; font-size: 1.5rem; border-width: 3px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); background: #fff; }
.menu-btn { display: none; }

.layout { display: flex; min-height: calc(100vh - var(--top)); }
.sidebar { width: 252px; flex-shrink: 0; background: var(--surface); border-inline-end: 1px solid var(--line); position: sticky; top: var(--top); height: calc(100vh - var(--top));
  display: flex; flex-direction: column; }
.side-scroll { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 500; font-size: .93rem; position: relative; transition: background .15s, color .15s; }
.sidebar a svg.i { color: var(--faint); transition: color .15s; }
.sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar a:hover svg.i { color: var(--teal); }
.sidebar a.active { background: var(--teal-50); color: var(--teal-700); font-weight: 600; }
.sidebar a.active svg.i { color: var(--teal); }
.sidebar a.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
.nav-sep { margin: 16px 12px 6px; font-size: .72rem; font-weight: 600; color: var(--gold-600); letter-spacing: .04em; }
.side-logout { display: flex; align-items: center; gap: 12px; margin: 0 12px 12px; padding: 10px 12px; border-radius: 11px; border: 0; border-top: 1px solid var(--line-2);
  background: none; font: inherit; color: var(--muted); cursor: pointer; text-align: start; }
.side-logout:hover { background: var(--danger-50); color: var(--danger); }
.side-shade { display: none; }
.view { flex: 1; min-width: 0; padding: 26px 30px 96px; max-width: 1180px; margin: 0 auto; animation: rise .25s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.bottombar { display: none; }
.btn.logout-m { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: .92rem; min-height: 40px; padding: 8px 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; box-shadow: var(--sh-1); }
.btn svg.i { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); border-color: #ddd5c4; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 1px 2px rgba(12, 90, 92, .25), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #a93725; color: #fff; }
.btn.danger-o { color: var(--danger); border-color: #f0cdc6; background: var(--surface); box-shadow: none; }
.btn.danger-o:hover { background: var(--danger-50); color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: .84rem; border-radius: 10px; }
.btn.block { width: 100%; min-height: 48px; font-size: 1rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link svg.i { width: 16px; height: 16px; }
.link:hover { color: var(--teal-700); }
.link.danger, .danger { color: var(--danger); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .9rem; color: var(--ink-2); }
.form label small { color: var(--muted); font-weight: 400; }
input, select, textarea { font: inherit; font-size: .95rem; min-height: 42px; padding: 9px 13px; border: 1px solid #ddd5c5; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%;
  transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 80px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-inline-start: 13px; padding-inline-end: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23738181' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 12px center; }
input:hover, select:hover, textarea:hover { border-color: #cbc1ad; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--teal) 16%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); flex-shrink: 0; padding: 0; box-shadow: none; cursor: pointer; }
input[type=file] { padding: 7px; font-size: .86rem; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 6px 12px; margin-inline-end: 10px; background: var(--teal-50); color: var(--teal-700); cursor: pointer; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 11px; font-weight: 500; color: var(--ink); cursor: pointer; padding: 2px 0; }
.form label.check input { margin-top: 3px; }
.form label.check span { display: flex; flex-direction: column; gap: 2px; }
.form label.check small { color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-upload { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.inline-upload > input, .inline-upload > label { flex: 1 1 170px; }
fieldset.days, fieldset.custom-fields { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px 14px; margin: 0; background: var(--surface-2); }
fieldset.days legend, fieldset.custom-fields legend { padding: 0 8px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.chip { display: inline-flex !important; flex-direction: row !important; margin: 4px 0 4px 6px; cursor: pointer; position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .86rem; font-weight: 500; transition: .15s; }
.chip:hover span { border-color: var(--teal-100); }
.chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip input:focus-visible + span { outline: 2.5px solid var(--gold); outline-offset: 2px; }
.seg { display: flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { flex: 1; flex-direction: row !important; }
.seg input { position: absolute; opacity: 0; }
.seg span { flex: 1; text-align: center; padding: 8px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--teal-700); box-shadow: var(--sh-1); }

/* filter bar */
.filters { display: flex; gap: 10px 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: flex-end; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.filters label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: .76rem; color: var(--muted); }
.filters select, .filters input { width: auto; min-height: 38px; font-size: .9rem; }
.filters > select { align-self: flex-end; }
.filters label.grow { flex: 1; min-width: 200px; }
.filters label.grow input { width: 100%; }
.filters .link { align-self: center; padding-top: 16px; font-size: .86rem; }

/* ---------- page structure ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head > .muted { font-size: .92rem; }
.page-head input, .page-head select { width: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; box-shadow: var(--sh-2); }
.card > h3:first-child { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cards .card { margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.req { display: flex; flex-direction: column; gap: 6px; transition: box-shadow .2s, transform .2s; }
.req:hover { box-shadow: var(--sh-3); transform: translateY(-1px); }
.req .row b { font-weight: 600; }
.req .actions { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.alert-card { border-color: var(--gold-100); background: var(--gold-50); }
.alert-card .row { padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.grid-main .card { margin: 0; }
.scroll-x { overflow-x: auto; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }

/* tables */
.card:has(> .tbl:only-child), .card.scroll-x:has(> .tbl) { padding: 6px 6px 4px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.tbl th { text-align: start; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td a { font-weight: 600; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); padding: 12px 14px; }
.card .tbl:not(:only-child) th:first-child, .card .tbl:not(:only-child) td:first-child { padding-inline-start: 4px; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--sh-2); color: var(--ink); overflow: hidden; }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
a.stat { transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-3); color: var(--ink); }
.stat span { color: var(--muted); font-size: .84rem; font-weight: 500; }
.stat b { font-size: 1.65rem; font-weight: 700; line-height: 1.2; }
.stat.ok::before { background: var(--ok); } .stat.danger::before { background: var(--danger); } .stat.info::before { background: var(--info); } .stat.warn::before { background: var(--gold); }

/* badges & small things */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.ok, .badge.approved { background: var(--ok-50); color: var(--ok); }
.badge.danger, .badge.rejected { background: var(--danger-50); color: var(--danger); }
.badge.warn, .badge.pending { background: var(--warn-50); color: var(--warn); }
.badge.info { background: var(--info-50); color: var(--info); }
.badge.cancelled { background: var(--line-2); color: var(--muted); }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; }
dl.info dt, dl.info dd { padding: 9px 0; border-bottom: 1px solid var(--line-2); margin: 0; }
dl.info dt { color: var(--muted); font-size: .88rem; padding-inline-end: 22px; }
dl.info dd { font-weight: 500; }
dl.info dt:nth-last-of-type(1), dl.info dd:last-child { border-bottom: 0; }
.notes { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line-2); padding: 12px 14px; border-radius: var(--r-sm); margin: 0; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.files li:last-child { border-bottom: 0; }
.files li a { font-weight: 600; }
.files li .link { margin-inline-start: auto; }
.alert { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: .92rem; border: 1px solid transparent; }
.alert.warn { background: var(--warn-50); color: #8a5a12; border-color: #f4dfb5; }
.alert.info { background: var(--info-50); color: #24578f; border-color: #d2e2f5; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 38px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }
.card .empty { border: 0; padding: 22px 10px; background: transparent; }
.empty b { color: var(--ink-2); font-weight: 600; }
.empty span { font-size: .88rem; }
.empty .empty-i { width: 40px; height: 40px; color: var(--faint); padding: 8px; background: var(--line-2); border-radius: 12px; margin-bottom: 4px; }
.empty.err { color: var(--danger); }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--teal-100); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
pre { background: #0f2a2a; color: #d9f0ee; padding: 14px 16px; border-radius: var(--r-sm); overflow-x: auto; font-size: .84rem; text-align: left; line-height: 1.6; }
pre.key { font-size: .95rem; user-select: all; }
.code, .emp-code { color: var(--muted); font-weight: 500; font-size: .8em; direction: ltr; unicode-bidi: isolate; }
.emp-code { font-size: .62em; background: var(--teal-50); color: var(--teal-700); padding: 3px 10px; border-radius: 99px; vertical-align: middle; font-weight: 600; }
.code-cell { color: var(--teal-700); font-weight: 600; }
.type-name { color: var(--teal-700); font-weight: 600; }

/* ---------- punch (home) ---------- */
.punch-card { text-align: center; color: #fff; border-radius: 28px; padding: 28px 18px 24px; margin-bottom: 18px; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #15908f 0%, var(--teal) 45%, var(--teal-700) 100%); box-shadow: 0 18px 40px -18px rgba(10, 82, 84, .6); }
.punch-card::before { content: ""; position: absolute; inset: 10px; border: 1.5px solid rgba(232, 196, 128, .45); border-radius: 21px; pointer-events: none; }
.punch-card::after { content: ""; position: absolute; width: 340px; height: 340px; inset-inline-end: -120px; top: -160px; border-radius: 50%; background: radial-gradient(rgba(255,255,255,.12), transparent 65%); pointer-events: none; }
.punch-card.is-in { background: radial-gradient(120% 90% at 50% 0%, #1d8f6a 0%, #137156 45%, #0b4b3f 100%); }
.greet { font-weight: 600; opacity: .92; }
.clock { font-size: 2.8rem; font-weight: 700; letter-spacing: .01em; margin-top: 2px; line-height: 1.2; }
.date { opacity: .82; margin-bottom: 22px; font-size: .95rem; }
.punch-btn { position: relative; width: 196px; height: 196px; border-radius: 50%; border: 0; cursor: pointer; background: #fff; color: var(--teal-700); display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 700; font-size: 1.08rem;
  box-shadow: 0 0 0 10px rgba(255,255,255,.12), 0 0 0 20px rgba(232,196,128,.18), 0 16px 36px rgba(0,0,0,.25); transition: transform .12s var(--ease); }
.punch-btn::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); animation: ripple 2.4s ease-out infinite; }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(1.28); opacity: 0; } }
.punch-btn:active { transform: scale(.96); }
.punch-btn .fp svg { width: 64px; height: 64px; }
.punch-btn .lbl { font-size: 1.28rem; line-height: 1.1; }
.punch-btn .sub { font-size: .78rem; font-weight: 500; opacity: .7; margin-top: -4px; }
.punch-btn.in { color: #127a55; }
.punch-btn.out { color: #c2412d; box-shadow: 0 0 0 10px rgba(255,255,255,.12), 0 0 0 20px rgba(255,140,120,.22), 0 16px 36px rgba(0,0,0,.25); }
.punch-btn.out::after { border-color: rgba(255,170,150,.55); }
.duty { display: flex; width: fit-content; align-items: center; gap: 8px; margin: -8px auto 22px; padding: 5px 14px; border-radius: 99px; font-size: .88rem; font-weight: 600;
  background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.16); }
.duty i { width: 9px; height: 9px; border-radius: 50%; background: #cbd5d5; }
.duty.on i { background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: dot 1.8s infinite; }
@keyframes dot { 70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.punch-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 30px auto 0; max-width: 330px; }
.punch-steps .st { flex: 1; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.punch-steps .st small { font-size: .74rem; opacity: .8; }
.punch-steps .st b { font-size: 1.05rem; }
.punch-steps .st.done { background: rgba(255,255,255,.2); }
.punch-steps .st.done small::after { content: " ✓"; }
.punch-steps .st.next { border-style: dashed; border-color: rgba(255,255,255,.5); }
.punch-steps .st-arrow { opacity: .6; }
.punch-done { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(6, 40, 38, .55); backdrop-filter: blur(6px); animation: fadeIn .2s; }
.punch-done.out { animation: fadeOut .3s forwards; }
.punch-done .pd-box { background: var(--surface, #fff); color: var(--ink); border-radius: 28px; padding: 30px 34px 26px; text-align: center; min-width: 260px; box-shadow: 0 30px 60px rgba(0,0,0,.3); animation: pop .35s var(--ease); }
.punch-done h2 { margin: 14px 0 4px; font-size: 1.35rem; }
.punch-done p { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--teal-700); }
.punch-done small { display: block; margin-top: 8px; color: var(--muted); }
.punch-done .pd-check svg { width: 84px; height: 84px; fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.punch-done.in .pd-check svg { stroke: #16a34a; } .punch-done:not(.in) .pd-check svg { stroke: #c2412d; }
.punch-done .pd-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .5s forwards; }
.punch-done .pd-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.punch-btn.busy .fp svg { animation: breathe 1s infinite; }
.status-line { margin-top: 26px; font-size: 1rem; }
.status-line b { font-weight: 700; }
.shift-pill { display: inline-block; margin-top: 10px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); padding: 4px 14px; border-radius: 99px; font-size: .86rem; }
.hint { margin-top: 12px; font-size: .8rem; opacity: .78; }
.punch-card .alert { margin: 12px auto 0; max-width: 340px; }

/* ---------- profile ---------- */
.profile-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: #fff;
  padding: 26px 26px; border-radius: 24px; margin-bottom: 18px;
  background: radial-gradient(90% 140% at 100% 0%, #16918f 0%, var(--teal) 40%, var(--teal-700) 100%); box-shadow: 0 18px 40px -20px rgba(10, 82, 84, .55); }
.profile-hero::before { content: ""; position: absolute; inset: 9px; border: 1.5px solid rgba(232, 196, 128, .4); border-radius: 17px; pointer-events: none; }
.profile-hero::after { content: ""; position: absolute; width: 300px; height: 300px; inset-inline-start: -90px; bottom: -190px; border-radius: 50%; background: radial-gradient(rgba(232,196,128,.25), transparent 65%); pointer-events: none; }
.ph-main { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; min-width: 0; }
.ph-main .avatar { color: var(--teal-700); }
.ph-name h2 { margin: 0; font-size: 1.45rem; color: #fff; }
.ph-name > span { opacity: .85; font-size: .95rem; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ph-chips span { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16); padding: 3px 11px; border-radius: 99px; }
.ph-chips svg.i { width: 15px; height: 15px; opacity: .9; }
.ph-id { position: relative; z-index: 1; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 12px; text-align: start; font: inherit; color: var(--ink); cursor: pointer;
  background: #fff; border: 0; border-radius: 16px; padding: 10px 18px; box-shadow: 0 8px 20px -8px rgba(0,0,0,.35); transition: transform .15s; }
.ph-id:hover { transform: translateY(-1px); }
.ph-id small { grid-column: 1; color: var(--muted); font-size: .74rem; font-weight: 500; }
.ph-id b { grid-column: 1; font-size: 1.55rem; font-weight: 700; color: var(--teal-700); letter-spacing: 2px; line-height: 1.15; }
.ph-id svg.i { grid-column: 2; grid-row: 1 / 3; color: var(--faint); width: 18px; height: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-2); color: var(--ink); transition: transform .15s, box-shadow .15s; min-width: 0; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-3); color: var(--ink); }
.kpi > svg.i { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--teal-50); color: var(--teal); margin-bottom: 8px; }
.kpi.gold > svg.i { background: var(--gold-50); color: var(--gold-600); }
.kpi span { color: var(--muted); font-size: .82rem; font-weight: 500; }
.kpi b { font-size: 1.45rem; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--faint); font-size: .76rem; }

/* leave balances (rings) */
.balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card .balances { margin-bottom: 0; }
.bal { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; }
.page-head + .balances .bal, .balances:not(.card .balances) .bal { background: var(--surface); border-color: var(--line); box-shadow: var(--sh-1); }
.ring { position: relative; width: 70px; height: 70px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .trk { stroke: var(--teal-50); }
.ring .val { stroke: var(--teal); stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }
.bal.low .ring .val { stroke: var(--gold); }
.bal.empty .ring .trk { stroke: var(--danger-50); }
.ring > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring b { font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.ring small { font-size: .66rem; color: var(--muted); margin-top: 2px; }
.bal-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bal-text strong { font-weight: 600; }
.bal-text span { font-size: .86rem; color: var(--ink-2); }
.bal-text small { color: var(--muted); font-size: .76rem; }
.bal-others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bal-others span { font-size: .82rem; background: var(--line-2); border-radius: 99px; padding: 4px 12px; color: var(--ink-2); }

/* key-value rows, recent requests, setting rows */
.kvs { display: flex; flex-direction: column; }
.kv { display: grid; grid-template-columns: 22px auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.kv b { overflow-wrap: anywhere; }
.kv:last-child { border-bottom: 0; }
.kv svg.i { width: 18px; height: 18px; color: var(--faint); }
.kv span { color: var(--muted); font-size: .88rem; }
.kv b { font-weight: 500; text-align: end; }
.mini-reqs { display: flex; flex-direction: column; }
.mini-req { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; min-width: 0; border-radius: 12px; color: var(--ink); transition: background .12s; }
.mini-req:hover { background: var(--surface-2); color: var(--ink); }
.mini-req + .mini-req { border-top: 1px solid var(--line-2); }
.mr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mr-main b { font-weight: 600; }
.mr-main small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex-shrink: 0; box-shadow: 0 0 0 4px var(--line-2); }
.dot.approved { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-50); }
.dot.pending { background: var(--gold); box-shadow: 0 0 0 4px var(--warn-50); }
.dot.rejected { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-50); }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.set-row + .set-row { border-top: 1px solid var(--line-2); }
.set-row > svg.i { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--teal-50); color: var(--teal); }
.set-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.set-row > div b { font-weight: 600; }
.set-row > div span { color: var(--muted); font-size: .85rem; }
details.fold { padding: 0; }
details.fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; font-weight: 600; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary > span { display: flex; align-items: center; gap: 10px; }
details.fold summary svg.i { color: var(--muted); }
details.fold .fold-i { transition: transform .2s; transform: rotate(-90deg); }
details.fold[open] .fold-i { transform: rotate(90deg); }
details.fold > .form { padding: 0 20px 20px; }
.profile-head { display: flex; align-items: center; gap: 14px; }

/* ---------- notifications ---------- */
.notif-list { padding: 6px; overflow: hidden; }
.notif { display: flex; gap: 14px; padding: 12px 14px; border-radius: 12px; color: var(--ink); transition: background .12s; }
.notif:hover { background: var(--surface-2); color: var(--ink); }
.notif + .notif { margin-top: 2px; }
.notif.unread { background: var(--teal-50); }
.notif .ni { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; color: var(--teal); }
.notif.unread .ni { border-color: var(--teal-100); }
.notif .nb { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif .nb b { font-weight: 600; }
.notif .nb span { color: var(--ink-2); font-size: .92rem; }
.notif .nb small { color: var(--muted); font-size: .76rem; }
.pick-users { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 12px; }

/* ---------- settings, roles, types ---------- */
.settings .card { margin-bottom: 16px; }
.settings .card h3 { margin-bottom: 14px; }
.settings .card > * + * { margin-top: 14px; }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0 6px; background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.sticky-save .btn { min-width: 220px; }
.role-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.role-tab { font: inherit; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; min-width: 120px; box-shadow: var(--sh-1); transition: .15s; }
.role-tab small { font-weight: 400; color: var(--muted); }
.role-tab:hover { border-color: var(--teal-100); }
.role-tab.active { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 6px 16px -8px rgba(10, 82, 84, .6); }
.role-tab.active small { color: rgba(255,255,255,.8); }
.role-head { align-items: flex-end; flex-wrap: wrap; }
.role-head .grow { flex: 1 1 260px; max-width: 360px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.perm-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.perm-group legend { font-weight: 700; color: var(--teal-700); padding: 0 8px; }
.perm-group .check { font-weight: 400 !important; }
.type-card { gap: 8px; }
.type-card.off { opacity: .6; }
.type-card .actions { margin-top: 6px; }
.print-title { display: none; }

/* ---------- payslip ---------- */
.slip { position: relative; background: var(--surface); color: var(--ink); }
.slip-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 2px solid var(--gold); }
.slip-head img { height: 58px; mix-blend-mode: multiply; }
.sh-title { display: flex; flex-direction: column; flex: 1; }
.sh-title b { font-size: 1.15rem; }
.sh-title span { color: var(--teal-700); font-weight: 600; }
.sh-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sh-meta small { color: var(--muted); }
.slip-who { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 14px; }
.slip-who div { display: flex; flex-direction: column; min-width: 0; }
.slip-who span { color: var(--muted); font-size: .76rem; }
.slip-who b { font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.slip-figs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.fig { text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; }
.fig b { display: block; font-size: 1.1rem; font-weight: 700; }
.fig span { display: block; font-size: .7rem; color: var(--muted); line-height: 1.3; }
.fig.warn { background: var(--warn-50); border-color: #f2dfb8; }
.fig.warn b { color: var(--warn); }
.slip-leaves { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.slip-leaves span { font-size: .8rem; background: var(--info-50); color: var(--info); padding: 3px 10px; border-radius: 99px; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slip-t { width: 100%; border-collapse: collapse; font-size: .9rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; border-style: hidden; box-shadow: 0 0 0 1px var(--line); }
.slip-t th { text-align: start; padding: 9px 12px; font-size: .84rem; }
.slip-t.earn th { background: var(--ok-50); color: var(--ok); }
.slip-t.ded th { background: var(--danger-50); color: var(--danger); }
.slip-t td { padding: 8px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
.slip-t td small { display: block; color: var(--muted); font-size: .74rem; }
.slip-t td:last-child { text-align: left; white-space: nowrap; font-weight: 600; }
.slip-t tfoot td { font-weight: 700; border-top: 1.5px solid var(--line); background: var(--surface-2); }
.slip-net { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 14px 18px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-700)); }
.slip-net span { font-weight: 600; }
.slip-net b { font-size: 1.5rem; font-weight: 700; }
.slip-sign { display: none; }
.slip-foot { display: none; }
.slip.is-draft::after { content: "مسودة"; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 5rem; font-weight: 800;
  color: rgba(176, 116, 24, .1); pointer-events: none; }
.slip-wrap summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 1.02rem; list-style: none; }
.slip-wrap summary::-webkit-details-marker { display: none; }
.slip-wrap .net { color: var(--teal-700); font-weight: 700; }
.slip-wrap[open] summary { margin-bottom: 14px; }
.slip-print { margin-top: 14px; }
.print-only { display: none; }
.workers { max-height: 300px; overflow-y: auto; }
.workers input[type=number] { width: 130px; min-height: 34px; padding: 4px 8px; }
@media (max-width: 900px) {
  .slip-who { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slip-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slip-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- modal, dialogs, toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(12, 30, 30, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: 22px; width: 100%; max-width: 500px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: var(--sh-3); animation: pop .2s var(--ease); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 14px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 1.08rem; }
.modal-head .x { width: 36px; height: 36px; color: var(--muted); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal.dialog { max-width: 420px; }
.dialog .dialog-msg { margin: 0; line-height: 1.75; font-size: 1rem; color: var(--ink-2); }
.dialog .dialog-actions { display: flex; gap: 10px; margin-top: 4px; }
.dialog .dialog-actions .btn { flex: 1; min-height: 44px; }
#toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; opacity: 0; pointer-events: none;
  transition: .25s var(--ease); z-index: 200; max-width: calc(100% - 32px); font-weight: 500; box-shadow: var(--sh-3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); }

/* install card */
#installBanner { position: fixed; z-index: 90; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 520px;
  display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--sh-3); animation: pop .3s var(--ease); }
#installBanner::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: 20px 20px 0 0; background: linear-gradient(90deg, var(--teal), var(--gold)); }
#installBanner img { width: 50px; height: 50px; border-radius: 14px; border: 1px solid var(--line); flex-shrink: 0; }
#installBanner .ib-text { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: .92rem; }
#installBanner .ib-text b { font-weight: 600; }
#installBanner .ib-text span { color: var(--muted); font-size: .8rem; }
#installBanner .ib-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---------- tablet & phone ---------- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  :root { --top: 58px; }
  .menu-btn { display: none; }
  .topbar { padding: 0 10px; }
  .brand img { height: 36px; }
  .brand span, .me-text { display: none; }
  .me { padding: 3px; }
  .sidebar { position: fixed; top: 0; right: 0; bottom: 0; height: auto; z-index: 60; width: min(300px, 84vw); transform: translateX(105%); visibility: hidden;
    transition: transform .28s var(--ease), visibility 0s .28s; box-shadow: var(--sh-3); padding-top: 8px; }
  .sidebar.open { transform: none; visibility: visible; transition: transform .28s var(--ease); }
  .side-shade { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(12, 30, 30, .35); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .side-shade.open { opacity: 1; pointer-events: auto; }
  .view { padding: 18px 14px calc(100px + env(safe-area-inset-bottom)); }
  .bottombar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .7rem; font-weight: 500; color: var(--muted); padding: 5px 0 3px; border-radius: 14px; }
  .bottombar a svg.i { width: 24px; height: 24px; padding: 2px 12px; box-sizing: content-box; border-radius: 99px; transition: background .2s; }
  .bottombar a.active { color: var(--teal-700); font-weight: 600; }
  .bottombar a.active svg.i { background: var(--teal-50); color: var(--teal); }
  .grid2, .grid3, .grid-main { grid-template-columns: minmax(0, 1fr); }
  h2 { font-size: 1.3rem; }
  .card { padding: 16px; border-radius: 18px; }
  .card.scroll-x, .card:has(> .tbl) { overflow-x: auto; }
  .tbl { font-size: .88rem; }
  .tbl th, .tbl td { padding: 10px 10px; }
  .filters { padding: 10px; }
  .filters label { flex: 1 1 44%; }
  .filters label select, .filters label input { width: 100%; }
  .filters > select { flex: 1 1 100%; }
  input, select, textarea { min-height: 46px; font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 36px; }
  .page-head { margin-bottom: 16px; }
  .page-head .actions .btn { flex: 1 1 auto; }
  #toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  #installBanner.with-nav { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .modal-back { align-items: end; padding: 0; }
  .modal, .modal.wide, .modal.dialog { max-width: none; border-radius: 24px 24px 0 0; max-height: 92dvh; animation: sheet .28s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .modal-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
  .modal-head { position: relative; padding-top: 20px; }
  .profile-hero { padding: 22px 20px; border-radius: 22px; }
  .ph-main { gap: 14px; }
  .avatar.xl { width: 64px; height: 64px; font-size: 1.25rem; }
  .ph-id { width: 100%; grid-template-columns: 1fr auto; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 1.2rem; }
  .btn.logout-m { display: flex; color: var(--danger); margin-top: 6px; }
  .punch-btn { width: 180px; height: 180px; }
  .clock { font-size: 2.4rem; }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- print ---------- */
@page { size: A4; margin: 12mm; }
@media print {
  html, body { background: #fff !important; overflow: visible !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; }
  .topbar, .sidebar, .side-shade, .bottombar, .no-print, #toast, .page-head .actions, #installBanner, .filters, .role-tabs, .bulkbar { display: none !important; }
  .layout { display: block; min-height: 0; }
  .view { padding: 0; max-width: none; margin: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .print-title { display: block; }
  /* the payslip as an A4 document */
  .slip { width: 100%; max-width: 186mm; margin: 0 auto; font-size: 10.5pt; }
  .print-only .slip { break-after: page; }
  .print-only .slip:last-child { break-after: auto; }
  .slip-who { grid-template-columns: repeat(3, 1fr) !important; }
  .slip-figs { grid-template-columns: repeat(8, 1fr) !important; }
  .slip-cols { grid-template-columns: 1fr 1fr !important; }
  .slip-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 34px; }
  .slip-sign div { border-top: 1px solid #999; padding-top: 6px; text-align: center; color: #555; font-size: 9.5pt; }
  .slip-foot { display: block; margin-top: 18px; text-align: center; color: #888; font-size: 8.5pt; }
  /* printing one payslip from its window: only the window's content, laid out as a page */
  body.print-modal .layout, body.print-modal #installBanner { display: none !important; }
  body.print-modal .modal-back { position: static !important; display: block !important; background: none !important; padding: 0 !important; backdrop-filter: none !important; inset: auto; }
  body.print-modal .modal { max-width: none !important; max-height: none !important; width: auto; border-radius: 0 !important; box-shadow: none !important; display: block; }
  body.print-modal .modal-head { display: none !important; }
  body.print-modal .modal-body { padding: 0 !important; overflow: visible !important; }
  body:not(.print-modal) .modal-back { display: none !important; }
}

/* employee page header */
.emp-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.emp-head h2 { margin: 0; }
.emp-head .muted { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; border-width: 2px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat b { font-size: 1.35rem; } }

/* searchable select */
.combo-native { display: none !important; }
.combo { position: relative; min-width: 220px; }
.filters .combo { min-width: 240px; }
.combo-btn { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font: inherit; font-size: .95rem; padding: 8px 13px;
  border: 1px solid #ddd5c5; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; text-align: start; transition: border-color .15s, box-shadow .15s; }
.filters .combo-btn { min-height: 38px; font-size: .9rem; }
.combo-btn:hover { border-color: #cbc1ad; }
.combo-btn[aria-expanded="true"] { border-color: var(--teal); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--teal) 16%, transparent); }
.combo-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-chev { width: 15px; height: 15px; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; }
.combo-btn[aria-expanded="true"] .combo-chev { transform: rotate(90deg); }
.combo-pop { position: absolute; z-index: 80; top: calc(100% + 6px); inset-inline: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--sh-3); padding: 8px; animation: pop .15s var(--ease); }
.combo-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.combo-search svg.i { width: 18px; height: 18px; color: var(--muted); }
.combo-search input { border: 0; background: transparent; min-height: 38px; padding: 6px 0; box-shadow: none !important; }
.combo-search.standalone { margin-bottom: 8px; background: var(--surface); }
.combo-list { max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.combo-opt { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: .93rem; }
.combo-opt span { flex: 1; }
.combo-opt small { color: var(--muted); direction: ltr; font-size: .8rem; }
.combo-opt svg.i { width: 16px; height: 16px; color: var(--teal); }
.combo-opt.act { background: var(--teal-50); }
.combo-opt.sel { font-weight: 600; color: var(--teal-700); }
.combo-none { padding: 14px 10px; text-align: center; color: var(--muted); font-size: .88rem; }
@media (max-width: 900px) {
  .combo, .filters .combo { min-width: 0; width: 100%; }
  .combo-btn { min-height: 46px; }
  .combo-pop { min-width: 0; }
  .combo-search input { font-size: 16px; }
}

/* photos */
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--surface); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar.sm { width: 34px; height: 34px; font-size: .78rem; }
.avatar-edit { position: relative; flex-shrink: 0; }
.avatar-edit .cam { position: absolute; bottom: -2px; inset-inline-end: -4px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--gold); color: #fff; border: 3px solid var(--surface); box-shadow: var(--sh-2); transition: transform .15s; padding: 0; }
.avatar-edit .cam:hover { transform: scale(1.08); }
.avatar-edit .cam svg.i { width: 16px; height: 16px; }
.profile-hero .avatar-edit .cam { border-color: var(--teal-600); }
.avatar.lg + .cam { width: 28px; height: 28px; }
.person { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.person > span { display: flex; flex-direction: column; line-height: 1.3; }
.person b { font-weight: 600; color: var(--teal-700); }
.person small { color: var(--muted); font-size: .76rem; }
a.person:hover b { text-decoration: underline; }
.file-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.file-link svg.i { width: 16px; height: 16px; }

/* on/off switch (account status) */
.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #d9d2c3; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(-18px); }
[dir="ltr"] .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2.5px solid color-mix(in srgb, var(--teal) 55%, transparent); outline-offset: 2px; }
.switch input:disabled + i { opacity: .6; }
.sw-text { font-size: .84rem; font-weight: 600; }
.sw-text.active { color: var(--ok); } .sw-text.disabled { color: var(--danger); } .sw-text.pending { color: var(--warn); }
.status-box { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--sh-1); }

/* phone: the bottom bar's «الإدارة» sheet */
.bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-size: .7rem; font-weight: 500; color: var(--muted);
  padding: 5px 0 3px; border: 0; background: none; cursor: pointer; border-radius: 14px; }
.bottombar button svg.i { width: 24px; height: 24px; padding: 2px 12px; box-sizing: content-box; border-radius: 99px; transition: background .2s; }
.bottombar button.active { color: var(--teal-700); font-weight: 600; }
.bottombar button.active svg.i { background: var(--teal-50); color: var(--teal); }
.nav-sheet .modal-body { padding-top: 8px; }
.sheet-group + .sheet-group { margin-top: 16px; }
.sheet-group h4 { margin: 0 0 8px; font-size: .78rem; color: var(--gold-600); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 84px; padding: 10px 6px;
  border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font-size: .8rem; font-weight: 500; line-height: 1.3; }
.tile svg.i { width: 26px; height: 26px; color: var(--teal); }
.tile:active { transform: scale(.97); }
.tile.active { background: var(--teal-50); border-color: var(--teal-100); color: var(--teal-700); font-weight: 600; }
.sheet-logout { margin-top: 18px; color: var(--danger); }

/* row selection + action bar */
.bk { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; cursor: pointer; flex-shrink: 0; }
.bk input { position: absolute; inset: -6px; opacity: 0; margin: 0; cursor: pointer; width: auto; height: auto; min-height: 0; z-index: 1; }
.bk i { width: 20px; height: 20px; border-radius: 6px; border: 1.8px solid #cbc1ad; background: var(--surface); transition: .15s; display: grid; place-items: center; }
.bk:hover i { border-color: var(--teal); }
.bk input:checked + i, .bk input:indeterminate + i { background: var(--teal); border-color: var(--teal); }
.bk input:checked + i::after { content: ""; width: 10px; height: 5px; border: 2.2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.bk input:indeterminate + i::after { content: ""; width: 10px; height: 2.4px; border-radius: 2px; background: #fff; }
.bk input:focus-visible + i { outline: 2.5px solid color-mix(in srgb, var(--teal) 55%, transparent); outline-offset: 2px; }
.tbl th.bk-col, .tbl td.bk-col { width: 44px; padding-inline-end: 0; }
.tbl tr.bk-on td { background: var(--teal-50); }
.card.has-bk { position: relative; padding-inline-start: 52px; }
.bk.bk-card { position: absolute; top: 20px; inset-inline-start: 18px; }
.card.bk-on { border-color: var(--teal-100); background: color-mix(in srgb, var(--teal-50) 55%, var(--surface)); }
.bk-all-row { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 0 4px; font-size: .88rem; color: var(--muted); font-weight: 500; }
.bulkbar { position: fixed; z-index: 95; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: calc(100% - 24px); padding: 8px 10px 8px 14px; border-radius: 18px; background: var(--ink); color: #fff; box-shadow: var(--sh-3); animation: pop .2s var(--ease); }
.bulkbar .icon-btn { width: 34px; height: 34px; color: #fff; }
.bulkbar .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.bulkbar .bk-count { font-weight: 600; white-space: nowrap; padding-inline-end: 6px; }
.bk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bulkbar .btn { box-shadow: none; }
.bulkbar .btn:not(.primary):not(.danger) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.bulkbar .btn:not(.primary):not(.danger):hover { background: rgba(255,255,255,.2); }
body.has-bulkbar .view { padding-bottom: 150px; }
body.has-bulkbar #installBanner { display: none; }
.notif.has-bk { position: relative; padding-inline-start: 50px; }
.notif .bk.bk-card { top: 50%; margin-top: -11px; inset-inline-start: 14px; }
.notif.bk-on { background: var(--teal-50); }
@media (max-width: 900px) {
  .bulkbar { bottom: calc(78px + env(safe-area-inset-bottom)); width: calc(100% - 20px); border-radius: 16px; }
  .bk-actions { width: 100%; }
  .bk-actions .btn { flex: 1 1 auto; }
}
@media print { .bulkbar, .bk-col, .bk, .bk-all-row { display: none !important; } }

/* payslip download buttons, and the payslip as drawn into a downloaded file */
.slip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.slip-actions .btn { flex: 1 1 140px; }
.export-root { width: 794px; padding: 44px 46px 36px; background: #fff; color: #142727; direction: rtl; font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 15px; line-height: 1.6; box-sizing: border-box; }
.export-root .slip { max-width: none; }
.export-root .slip-who { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.export-root .slip-figs { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
.export-root .slip-cols { grid-template-columns: 1fr 1fr !important; }
.export-root .slip-sign { display: grid !important; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.export-root .slip-sign div { border-top: 1px solid #999; padding-top: 6px; text-align: center; color: #555; font-size: 13px; }
.export-root .slip-foot { display: block !important; margin: 18px 0 0; text-align: center; color: #888; font-size: 12px; }
.export-root .slip.is-draft::after { font-size: 6rem; }
.slip-who b[dir="ltr"] { text-align: right; }
.need-card { border-color: #f2dfb8; background: linear-gradient(180deg, var(--warn-50), var(--surface) 70px); }
.need-card h3 { display: flex; align-items: center; gap: 8px; }
.need-card h3 svg.i { color: var(--warn); }
.kv b .link.small { font-size: .8rem; margin-inline-start: 6px; }

/* transparent logo: no blending needed (Safari does not blend over the blurred bar) */
.brand img, .auth-logo, .slip-head img, .boot img { mix-blend-mode: normal; }
/* install card: clean top edge, an inline Safari share icon, and room so it never covers the page */
#installBanner { overflow: hidden; }
#installBanner .ib-text span { line-height: 1.7; }
svg.i.ib-i { width: 17px; height: 17px; vertical-align: -3px; color: var(--info); margin: 0 1px; }
body.has-install .view { padding-bottom: 210px; }
@media (max-width: 900px) { body.has-install .view { padding-bottom: calc(240px + env(safe-area-inset-bottom)); } }
.auth-card { overflow: hidden; }

/* user guide: «؟» buttons, guide page */
.help-body { line-height: 1.9; color: var(--ink-2); }
.help-body p { margin: 0 0 8px; }
.help-body ul, .help-body ol { margin: 4px 0 0; padding-inline-start: 20px; }
.help-body li { margin-bottom: 6px; }
.help-body b { color: var(--ink); }
.help-search { display: flex; align-items: center; gap: 8px; padding: 0 14px; margin: 6px 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.help-search svg.i { color: var(--muted); }
.help-search input { border: 0; box-shadow: none !important; background: transparent; }
.help-group { margin: 22px 0 10px; font-size: .82rem; color: var(--gold-600); font-weight: 600; }
details.help-sec { padding: 0; margin-bottom: 10px; }
details.help-sec summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-weight: 600; }
details.help-sec summary::-webkit-details-marker { display: none; }
details.help-sec summary > svg.i:first-child { color: var(--teal); }
details.help-sec summary > span { flex: 1; }
details.help-sec .fold-i { transform: rotate(-90deg); transition: transform .2s; color: var(--muted); }
details.help-sec[open] .fold-i { transform: rotate(90deg); }
details.help-sec .help-body { padding: 0 18px 16px 18px; }

/* ---------- in-app notification pop-up ---------- */
#notePop { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 450; width: min(440px, calc(100vw - 20px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.note-pop { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 20px; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 97%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border: 1px solid var(--line); box-shadow: 0 14px 34px -10px rgba(10, 40, 40, .35); animation: npIn .38s cubic-bezier(.2, .9, .3, 1.2); transition: transform .25s, opacity .25s; touch-action: pan-x; }
.note-pop.gone { transform: translateY(-120%) !important; opacity: 0 !important; }
@keyframes npIn { from { transform: translateY(-120%); opacity: 0; } }
.note-pop .np-ic { flex: 0 0 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; background: var(--teal-50); }
.note-pop.k-warn .np-ic, .note-pop.k-request .np-ic { background: #fff4dc; } .note-pop.k-rejected .np-ic, .note-pop.k-deduction .np-ic { background: #fde8e6; }
.note-pop.k-approved .np-ic, .note-pop.k-payroll .np-ic, .note-pop.k-tip .np-ic, .note-pop.k-bonus .np-ic { background: #e3f6ec; }
.note-pop .np-tx { flex: 1; min-width: 0; }
.note-pop .np-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.note-pop .np-top b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-pop .np-top small { color: var(--muted); font-size: .75rem; flex-shrink: 0; }
.note-pop p { margin: 2px 0 0; color: var(--ink-2); font-size: .86rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-pop .np-x { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 0 2px; cursor: pointer; }
@media print { #notePop { display: none !important; } }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.help-toc a { padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; text-decoration: none; }
.help-toc a:hover { border-color: var(--teal); color: var(--teal-700); }
details.help-sec { scroll-margin-top: calc(var(--top, 64px) + 12px); }
.help-body ul ul { margin-top: 6px; }

/* ---------- show / hide password ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-inline-end: 44px; }
.pw-wrap input[dir="ltr"] { padding-inline-end: 12px; padding-left: 44px; }
.pw-eye { position: absolute; top: 50%; left: 6px; transform: translateY(-50%); width: 34px; height: 34px; min-height: 0; padding: 6px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--teal-700); background: var(--teal-50); }
.pw-eye svg { width: 20px; height: 20px; }
