/* StaffHive — base styles. Brand, homepage, pricing and new parts are in hive.css.
   Colors are tokens so light/dark both work (all text pairs checked ≥ 4.5:1). */
/* Honey & Ink — warm honey, deep teal-ink, creamy backgrounds, coral for alerts */
:root {
  --font: 'Readex Pro', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bg: #fbf7ef;
  --surface: #ffffff;
  --surface-2: #fbf5ea;
  --ink: #1f1a14;
  --muted: #6b604f;
  --line: #ece2cf;
  --grid: #f1e8d6;
  --accent: #a85400;           /* deep honey — links, focus, charts (readable on white) */
  --accent-ink: #ffffff;
  --accent-soft: #fff1d6;
  --honey: #ffb627;            /* the brand colour — big buttons, highlights */
  --honey-2: #f59e0b;
  --honey-ink: #2a1f12;
  --honey-soft: #fff4dc;
  --saffron: var(--honey); --saffron-ink: var(--honey-ink); --saffron-soft: var(--honey-soft);
  --teal: #0f6b66;
  --side: #10302f;             /* deep teal-ink sidebar */
  --side-2: #1a4342;
  --side-ink: #e7f3f0;
  --side-muted: #a3c4bf;
  --good: #187a43; --good-bg: #e3f5ea;
  --mid: #9a4f00;  --mid-bg: #fff0d4;
  --bad: #c03a26;  --bad-bg: #fde8e3;
  --shadow: 0 1px 2px rgba(42, 31, 18, .05), 0 8px 24px rgba(42, 31, 18, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13110d; --surface: #1d1a15; --surface-2: #25211a; --ink: #f5eee2; --muted: #b5a993;
    --line: #3a3226; --grid: #2e281f; --accent: #ffc04d; --accent-ink: #1f1a14; --accent-soft: #3a2c12;
    --honey-soft: #3a2c12; --side: #0a1f20; --side-2: #143534; --teal: #5fc4bb;
    --good: #6fd69a; --good-bg: #1b3326; --mid: #ffc04d; --mid-bg: #3a2c12; --bad: #ff9a85; --bad-bg: #3d1e18;
    --shadow: 0 1px 2px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13110d; --surface: #1d1a15; --surface-2: #25211a; --ink: #f5eee2; --muted: #b5a993;
  --line: #3a3226; --grid: #2e281f; --accent: #ffc04d; --accent-ink: #1f1a14; --accent-soft: #3a2c12;
  --honey-soft: #3a2c12; --side: #0a1f20; --side-2: #143534; --teal: #5fc4bb;
  --good: #6fd69a; --good-bg: #1b3326; --mid: #ffc04d; --mid-bg: #3a2c12; --bad: #ff9a85; --bad-bg: #3d1e18;
  --shadow: 0 1px 2px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; }
p, .empty, .muted { text-wrap: pretty; }
h1 { font-size: 24px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
img { max-width: 100%; }
.good { color: var(--good); } .mid { color: var(--mid); } .bad { color: var(--bad); }

/* ---------- Controls ---------- */
input, select, textarea, .btn-like {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-height: 40px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; margin-bottom: 14px; }
label.check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; white-space: nowrap; }
label.check input { width: auto; min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 0; margin: 0 0 14px; }
legend { padding: 0 6px; font-weight: 600; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.btn {
  font: inherit; font-weight: 500; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; min-height: 40px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger, .icon-btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; width: 32px; height: 32px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 4px 0; text-align: start; }

.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.tag.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
button.tag { font-family: inherit; cursor: pointer; margin: 1px 2px; }
button.tag:disabled { cursor: default; }
.tag.role-company_admin { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.role-manager, .tag.role-shift_manager { background: var(--mid-bg); color: var(--mid); border-color: transparent; }
.pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.table td, .mini-list li, input[type=date], input[type=number], #toasts { font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
:is(.emp-grid, .cards, .chart-grid, .two-col, .kpis) > .card + .card { margin-top: 0; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty.small { padding: 24px; border: 0; }
.empty.err { color: var(--bad); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
/* skeleton blocks */
.sk-wrap { display: contents; }
.sk { display: inline-block; max-width: 100%; border-radius: 6px; background: var(--grid); vertical-align: middle; animation: sk-pulse 1.4s ease-in-out infinite; }
.sk-wrap .card .sk + br + .sk { margin-top: 8px; }
.emp-card .sk[style*="64px"], .me-hero .sk[style*="72px"] { border-radius: 50%; }
@keyframes sk-pulse { 50% { opacity: .55; } } /* not interactive; switched off under reduced motion */
.is-refreshing { opacity: .55; transition: opacity .2s; }
.alert { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; padding: 28px; }
.login-brand, .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; margin-bottom: 8px; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.login .muted { margin: 0 0 18px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 240px; flex-shrink: 0; background: var(--surface); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 0 8px 14px; font-size: 18px; }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
#nav a:hover { background: var(--surface-2); color: var(--ink); }
#nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: grid; gap: 2px; }
.me-chip { display: grid; margin-bottom: 6px; }
.me-chip span { font-size: 13px; color: var(--muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.menu-btn { display: none; }
.company-switch { max-width: 320px; font-weight: 600; }
.company-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.company-name img { height: 28px; border-radius: 6px; }
.top-actions { margin-inline-start: auto; }
.top-actions .btn { width: auto; }
.view { padding: 24px; max-width: 1240px; width: 100%; }
.scrim { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .actions select { width: auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar > input, .toolbar > select { width: auto; min-width: 170px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; max-width: 360px; }
.range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.range select, .range input { width: auto; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -18px -18px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.compact td { padding: 7px 10px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td.row-actions { white-space: nowrap; }
.cell-id { display: flex; align-items: center; gap: 10px; }
.logo-sm { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.bar-cell { width: 30%; }

/* ---------- Avatars & employee cards ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; }
.avatar.ph { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.emp-card { font: inherit; color: inherit; display: grid; justify-items: center; text-align: center; gap: 6px; cursor: pointer; transition: transform .12s, border-color .12s; }
.emp-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.emp-card.inactive { opacity: .6; }
.emp-card .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.emp-head { display: flex; gap: 16px; align-items: center; }
.emp-head p { margin: 2px 0; }
.photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.file-btn { width: auto; margin: 0; display: inline-flex; }

/* ---------- Cards grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cards .card + .card { margin-top: 0; }
.branch-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.branch-card p { margin: 2px 0 0; }
.form-card { display: flex; flex-direction: column; gap: 8px; }
.form-card.inactive { opacity: .65; }
.form-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.form-card p { margin: 0; font-size: 13px; }
.item-preview { margin: 0; padding-inline-start: 20px; font-size: 13px; color: var(--muted); flex: 1; }
.form-card .row-actions { justify-content: flex-start; }

/* ---------- Form builder ---------- */
.items-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.fb-items { display: grid; gap: 8px; margin: 10px 0 12px; }
.fb-row { display: grid; gap: 8px; align-items: center; }
.fb-num { color: var(--muted); font-size: 13px; text-align: center; }
.fb-btns { display: flex; }

/* ---------- Rating ---------- */
.rate-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.rate-who { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.rate-who > div { display: grid; }
.rate-who .muted { font-size: 13px; }
.rate-total { margin-inline-start: auto; text-align: end; display: grid; }
.rate-total span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rate-total strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.rate-total.big { display: flex; gap: 14px; align-items: baseline; margin: 6px 0 14px; font-size: 18px; }
.meter { display: block; height: 8px; background: var(--grid); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.meter.thin { height: 6px; margin: 0; }
.rate-items { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; counter-reset: ri; }
.rate-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); counter-increment: ri; }
.rate-item.done { border-color: var(--accent); background: var(--surface); }
.ri-label::before { content: counter(ri) '. '; color: var(--muted); }
.ri-input input { width: 110px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { font: inherit; border: 0; background: none; color: var(--ink); padding: 7px 12px; min-width: 38px; cursor: pointer; border-inline-end: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.seg button:last-child { border-inline-end: 0; }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.rate-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kind-seg { display: flex; margin-bottom: 14px; width: 100%; }
.kind-seg label { flex: 1; margin: 0; display: block; }
.kind-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-seg span { display: block; text-align: center; padding: 9px; cursor: pointer; border-inline-end: 1px solid var(--line); }
.kind-seg label:last-child span { border-inline-end: 0; }
.kind-seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.kind-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.notes { white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; margin: 0; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.small-kpis { margin: 16px 0 4px; }
.small-kpis .kpi strong { font-size: 20px; }
.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid .card + .card { margin-top: 0; }
.chart-card h3 { margin-bottom: 12px; }
.chart-box { position: relative; height: 260px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li.clickable { cursor: pointer; }
.mini-list li.clickable:hover { color: var(--accent); }
.me-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.me-hero p { margin: 2px 0 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.two-col .card + .card { margin-top: 0; }
.two-col h3 { margin-bottom: 8px; }
.bulk-prev { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.bulk-prev p { padding: 10px; margin: 0; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 15, 12, .45); display: grid; place-items: center; padding: 16px; z-index: 50; transition: opacity .15s ease-out; }
@starting-style { .modal-bg { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px 6px; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 12px; }
#toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; display: grid; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-action { font: inherit; font-weight: 600; background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; min-height: 32px; margin-inline-start: auto; }
.toast.err { background: var(--bad); color: #fff; }
.toast.hide { opacity: 0; transform: translateY(6px); }

/* ---------- Excel import ---------- */
.import-tips { margin: 0 0 14px; padding-inline-start: 18px; }
.import-tips li { margin-bottom: 4px; }
.import-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.import-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 12px; }
.import-summary .kpi strong { font-size: 20px; }
.import-table { max-height: 320px; overflow: auto; margin-bottom: 12px; }
.import-table th { position: sticky; top: 0; }
.import-table td, .emp-table td { white-space: nowrap; }
.import-table td:nth-child(2) { white-space: normal; min-width: 140px; }
@media (max-width: 760px) { .import-summary { grid-template-columns: 1fr 1fr; } }

/* ---------- Small utilities ---------- */
.block { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tag.mid { background: var(--mid-bg); color: var(--mid); border-color: transparent; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; align-items: end; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.three-col .card + .card { margin-top: 0; }
.three-col h3 { margin-bottom: 8px; }
.done-list { margin: 0 0 12px; padding-inline-start: 18px; line-height: 1.9; }
.view-toggle button { font-size: 16px; }
.emp-table .cell-id { color: inherit; text-decoration: none; }
.emp-card { text-decoration: none; }
a.emp-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Employee profile ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-bottom: 12px; min-height: 32px; }
.back-link:hover { color: var(--accent); }
.prof-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 22px; }
.prof-photo { position: relative; flex-shrink: 0; }
.prof-photo .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.photo-edit { position: absolute; bottom: 2px; inset-inline-end: 2px; width: 36px; height: 36px; margin: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 3px var(--surface); }
.photo-edit:hover { filter: brightness(1.1); }
.prof-id { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.prof-id h1 { font-size: 26px; }
.prof-alt { margin: 0; }
.prof-role { margin: 2px 0 4px; font-weight: 500; }
.prof-id .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.prof-contact { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.prof-contact a { color: var(--accent); text-decoration: none; }
.prof-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-start; }
.prof-actions .btn { text-decoration: none; }
.tabs { display: flex; gap: 4px; margin: 18px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tabs button { font: inherit; font-weight: 500; background: none; border: 0; color: var(--muted); padding: 10px 14px; min-height: 44px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.prof-form .form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }
.prof-form .span2 { grid-column: 1 / -1; }
.prof-form input:disabled, .prof-form select:disabled, .prof-form textarea:disabled { background: var(--surface-2); color: var(--ink); opacity: 1; }
.input-row { display: flex; gap: 6px; }
.input-row .btn { flex-shrink: 0; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; }
.lock-note { margin: 0 0 14px; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 12px 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.pay-net { font-size: 18px; margin: 4px 0 14px; }

/* ---------- Form builder: Arabic label column ---------- */
.fb-row { grid-template-columns: 24px 1fr 1fr 120px 72px auto; }

/* ---------- Pricing ---------- */
.pr-standalone { min-height: 100vh; padding: calc(16px + var(--sa-t, 0px)) calc(16px + var(--sa-r, 0px)) calc(32px + var(--sa-b, 0px)) calc(16px + var(--sa-l, 0px)); }
.pr-standalone main { max-width: 1180px; margin: 0 auto; }
.pr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pricing { --glow: color-mix(in srgb, var(--accent) 16%, transparent); }
.pr-hero { text-align: center; padding: 28px 12px 10px; position: relative;
  background: radial-gradient(60% 80% at 50% 0%, var(--glow), transparent 70%); border-radius: 24px; }
.pr-hero h1 { font-size: clamp(26px, 4vw, 40px); max-width: 720px; margin: 8px auto 10px; letter-spacing: -0.01em; }
.pr-hero p { max-width: 620px; margin: 0 auto 22px; font-size: 16px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.pr-edit { position: absolute; top: 12px; inset-inline-end: 12px; width: auto; }
.bill-toggle { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.bill-toggle button { position: relative; z-index: 1; font: inherit; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 9px 18px; min-height: 42px;
  border-radius: 999px; cursor: pointer; transition: color .25s; white-space: nowrap; }
.bill-toggle button[aria-checked="true"] { color: var(--accent-ink); }
.bill-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; inset-inline-start: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--accent);
  transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); box-shadow: 0 4px 14px var(--glow); }
.bill-toggle[data-bill="year"] .bill-pill { transform: translateX(100%); }
[dir=rtl] .bill-toggle[data-bill="year"] .bill-pill { transform: translateX(-100%); }
.save-chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--good-bg); color: var(--good); margin-inline-start: 4px; }
.bill-toggle button[aria-checked="true"] .save-chip { background: rgba(255,255,255,.22); color: inherit; }
.pr-calc { max-width: 640px; margin: 18px auto 22px; }
.pr-calc-top { display: flex; justify-content: space-between; align-items: baseline; }
.pr-calc-top label { margin: 0; }
.pr-out { font-size: 28px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.pr-calc input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; min-height: 8px; padding: 0; margin: 14px 0 10px; border: 0; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--fill, 10%), var(--grid) var(--fill, 10%)); }
[dir=rtl] .pr-calc input[type=range] { background: linear-gradient(to left, var(--accent) var(--fill, 10%), var(--grid) var(--fill, 10%)); }
.pr-calc input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: grab; transition: transform .15s; }
.pr-calc input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); cursor: grabbing; }
.pr-calc input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); cursor: grab; }
.pr-calc-res { margin: 0; color: var(--muted); }
.pr-calc-res strong { color: var(--ink); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px 20px; display: flex; flex-direction: column; gap: 6px;
  corner-shape: squircle; box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.3, 1.2, .5, 1), border-color .25s, box-shadow .25s;
  animation: plan-in .5s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes plan-in { from { opacity: 0; } } /* fade only, so it never fights the hover/recommend movement */
.plan:hover { transform: translateY(-3px); }
.plan.popular { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.plan.rec { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow), 0 14px 34px var(--glow); transform: translateY(-4px); }
.plan-badge { position: absolute; top: -12px; inset-inline-start: 20px; font-size: 12px; font-weight: 600; background: var(--accent); color: var(--accent-ink); padding: 4px 10px; border-radius: 999px; }
.plan-rec { position: absolute; top: 14px; inset-inline-end: 14px; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px;
  opacity: 0; transform: scale(.85); transition: opacity .25s, transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.plan.rec .plan-rec { opacity: 1; transform: none; }
.plan h3 { font-size: 20px; }
.plan-tag { margin: 0 0 8px; min-height: 2.6em; font-size: 14px; }
.plan-price { display: flex; align-items: baseline; gap: 2px; direction: ltr; justify-content: flex-start; }
[dir=rtl] .plan-price { justify-content: flex-end; }
.plan-price .cur { font-size: 22px; font-weight: 600; color: var(--muted); }
.plan-price .amt { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.plan-price .per { color: var(--muted); margin-inline-start: 4px; }
.plan-custom { font-size: 30px; font-weight: 700; line-height: 1.1; }
.plan-sub { min-height: 1.5em; margin: 2px 0 8px; }
.plan-limits, .plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.plan-limits { padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); font-weight: 600; }
.plan-feats { flex: 1; margin-bottom: 16px; }
.plan-feats li, .plan-limits li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats li::before { content: ''; flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--accent-soft)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a85400' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 12px no-repeat; }
.plan .btn.block { text-decoration: none; }
.pr-faq { max-width: 760px; margin: 36px auto 10px; }
.pr-faq h2 { font-size: 22px; margin-bottom: 12px; text-align: center; }
.pr-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; margin-bottom: 10px; }
.pr-faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 44px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pr-faq summary::-webkit-details-marker { display: none; }
.pr-faq summary::after { content: '+'; font-size: 20px; color: var(--accent); transition: transform .25s; }
.pr-faq details[open] summary::after { transform: rotate(45deg); }
.pr-faq details p { margin: 0 0 14px; }
.plan-edit-list { display: grid; gap: 12px; margin-bottom: 12px; }
.login-pricing { display: block; margin: 16px auto 0; text-align: center; }

@media (max-width: 900px) { .three-col { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .prof-hero { padding: 16px; gap: 14px; }
  .prof-actions { width: 100%; }
  .prof-actions .btn { flex: 1; }
  .fb-row { grid-template-columns: 20px 1fr 1fr; }
  .fb-row [data-f=label], .fb-row [data-f=label_ar] { grid-column: 2 / -1; }
  .pr-edit { position: static; margin-top: 12px; }
  .plan.rec { transform: none; }
}

/* ---------- Command menu & shortcut hints ---------- */
kbd { font: 500 11px/1 var(--font); min-width: 20px; padding: 3px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--muted); display: inline-block; text-align: center; }
.keys { display: inline-flex; gap: 3px; margin-inline-start: 8px; }
.btn.primary .keys kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .7; }
.nav-key { margin-inline-start: auto; opacity: 0; transition: opacity .15s; }
#nav a:hover .nav-key, #nav a:focus-visible .nav-key { opacity: 1; }
.cmdk-btn { color: var(--muted); gap: 8px; }
.modal-bg.cmdk-bg { align-items: start; padding-top: max(12vh, calc(16px + var(--sa-t, 0px))); }
.cmdk-bg .modal { max-width: 560px; }
.cmdk-bg .modal header { display: none; }
.cmdk-bg .modal-body { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.cmdk-input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; min-height: 54px; }
.cmdk-input:focus { outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; max-height: 50vh; }
.cmdk-list li[role=option] { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.cmdk-list li.on { background: var(--accent-soft); color: var(--accent); }
.cmdk-group { font-size: 12px; color: var(--muted); padding: 10px 12px 4px; }
.cmdk-empty { padding: 18px 12px; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (pointer: coarse) { .keys, .cmdk-foot { display: none; } .cmdk-list li[role=option] { min-height: 48px; } }
@media (max-width: 760px) { .cmdk-label { display: none; } }

/* ---------- Continuous (squircle) corners — Chromium draws them, others keep the normal radius ---------- */
.card, .kpi, .modal, .table-wrap, .empty, .rate-item, .btn, .mark, .toast, .alert, .seg, input, select, textarea { corner-shape: squircle; }

/* ---------- Safe areas (notch, Dynamic Island, home indicator) ---------- */
:root { --sa-t: env(safe-area-inset-top, 0px); --sa-r: env(safe-area-inset-right, 0px); --sa-b: env(safe-area-inset-bottom, 0px); --sa-l: env(safe-area-inset-left, 0px); }
.top { padding-top: calc(12px + var(--sa-t)); padding-inline: calc(24px + var(--sa-l)) calc(24px + var(--sa-r)); }
.side { padding-top: calc(18px + var(--sa-t)); padding-bottom: calc(18px + var(--sa-b)); padding-inline-start: calc(12px + var(--sa-l)); }
.view { padding-bottom: calc(24px + var(--sa-b)); padding-inline: calc(24px + var(--sa-l)) calc(24px + var(--sa-r)); }
#toasts { bottom: calc(20px + var(--sa-b)); }
.modal-bg { padding: calc(16px + var(--sa-t)) calc(16px + var(--sa-r)) calc(16px + var(--sa-b)) calc(16px + var(--sa-l)); }
.modal { max-height: calc(100vh - 32px - var(--sa-t) - var(--sa-b)); max-height: calc(100dvh - 32px - var(--sa-t) - var(--sa-b)); }
.login-wrap { padding: calc(24px + var(--sa-t)) calc(16px + var(--sa-r)) calc(24px + var(--sa-b)) calc(16px + var(--sa-l)); }

/* ---------- Touch screens: every tap target at least 44 × 44 ---------- */
@media (pointer: coarse) {
  .btn, .btn.sm { min-height: 44px; }
  .btn.sm { padding-inline: 12px; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button { min-width: 44px; min-height: 44px; }
  .kind-seg span { padding: 12px 9px; }
  .link { min-height: 44px; display: inline-flex; align-items: center; }
  .toast-action { min-height: 44px; padding-inline: 8px; }
  .cmdk-btn { min-width: 44px; }
  label.check input { width: 20px; height: 20px; }
  #nav a { min-height: 44px; }
  label.check { min-height: 44px; }
  input, select { min-height: 44px; }
}

/* ---------- View transitions (in-page swaps), kept short ---------- */
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 180ms; animation-timing-function: ease-out; }
.rate-who { view-transition-name: rate-who; }
::view-transition { pointer-events: none; } /* clicks during the 180ms go to the live page */

/* ---------- Reduced motion: every animation and transition off ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  .sk, .plan { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .chart-grid, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { position: fixed; inset-inline-start: 0; top: 0; z-index: 40; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  [dir=rtl] .side { transform: translateX(105%); }
  .side.open { transform: none !important; }
  .side.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .menu-btn { display: inline-grid; place-items: center; }
  .top { padding: calc(10px + var(--sa-t)) calc(16px + var(--sa-r)) 10px calc(16px + var(--sa-l)); }
  .view { padding: 16px calc(16px + var(--sa-r)) calc(16px + var(--sa-b)) calc(16px + var(--sa-l)); }
  h1 { font-size: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .fb-row { grid-template-columns: 20px 1fr 1fr; }
  .fb-row [data-f=label] { grid-column: 2 / -1; }
  .fb-row .fb-btns { grid-column: 2 / -1; justify-content: flex-end; }
  .toolbar > input, .toolbar > select { min-width: 0; flex: 1 1 140px; }
  .rate-item { flex-direction: column; align-items: stretch; }
  .company-switch { max-width: 60vw; }
  .emp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .table th, .table td { padding: 9px 10px; }
}



/* ---------- Attendance: day list & day editor ---------- */
.day-list { list-style: none; margin: 12px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-list li { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 52px; }
.day-list li:last-child { border-bottom: 0; }
.day-list li.clickable { cursor: pointer; }
.day-list li.clickable:hover, .day-list li.clickable:focus-visible { background: var(--surface-2); }
.dl-date { display: grid; line-height: 1.2; }
.dl-date span { font-size: 13px; color: var(--muted); }
.dl-times { font-variant-numeric: tabular-nums; font-size: 14px; }
.dl-end { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; text-align: end; }
.pair { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.pair label { margin: 0; }
.pair .icon-btn { margin-top: 26px; }
input.missing { border-color: var(--bad); background: var(--bad-bg); }

/* ---------- Phone app: bottom tab bar, bottom-sheet popups ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px calc(4px + var(--sa-r)) calc(4px + var(--sa-b)) calc(4px + var(--sa-l)); }
  .tabbar a, .tabbar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; border: 0; background: none;
    color: var(--muted); font: 500 11px var(--font); text-decoration: none; border-radius: 10px; cursor: pointer; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a.active { color: var(--accent); background: var(--accent-soft); }
  .shell:has(.tabbar) .view { padding-bottom: calc(84px + var(--sa-b)); }
  body:has(.tabbar) #buzz { bottom: calc(76px + var(--sa-b)); }
  body:has(.tabbar) #toasts { bottom: calc(80px + var(--sa-b)); }
  input, select, textarea { font-size: 16px; } /* below 16px iPhones zoom in on every tap */
  .modal-bg:not(.cmdk-bg) { place-items: end center; padding: calc(16px + var(--sa-t)) 0 0; }
  .modal-bg:not(.cmdk-bg) .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: calc(92dvh - var(--sa-t)); padding-bottom: var(--sa-b); }
  .day-list li { grid-template-columns: 58px 1fr; padding: 10px 12px; }
  .dl-end { grid-column: 2; justify-content: flex-start; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}

/* ---------- Attendance: month calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-day { position: relative; display: grid; align-content: start; gap: 2px; min-height: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; text-align: start; }
button.cal-day { cursor: pointer; }
button.cal-day:hover, button.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day b { font-size: 14px; }
.cal-day small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day i { position: absolute; top: 4px; inset-inline-end: 5px; font-style: normal; font-size: 11px; }
.st-work { background: var(--good-bg); border-color: transparent; }
.st-wrong, .st-absent { background: var(--bad-bg); border-color: var(--bad); }
.st-check { background: var(--mid-bg); border-color: var(--mid); }
.st-sick { background: #e3eefc; border-color: transparent; }
.st-leave { background: var(--accent-soft); border-color: transparent; }
.st-off { background: var(--surface-2); border-style: dashed; }
.st-future { opacity: .45; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cal-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 5px; vertical-align: -2px; border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-sick { background: #1d2c40; } }
:root[data-theme="dark"] .st-sick { background: #1d2c40; }
.day-kind label span { font-size: 13px; }

/* ---------- Attendance: Today board ---------- */
.now-title { font-size: 18px; margin: 18px 0 10px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.now-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.now-grid .card + .card { margin-top: 0; }
.now-col h3 { margin-bottom: 6px; }
.now-col li { gap: 8px; }
.now-col li > span { display: grid; }
.now-in { border-top: 3px solid var(--good); }
.now-out { border-top: 3px solid var(--bad); }
@media (max-width: 900px) { .now-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .cal { gap: 3px; }
  .cal-day { min-height: 48px; padding: 4px; }
  .cal-day small { font-size: 9px; }
  .now-grid { grid-template-columns: 1fr; }
}

.rate-items .ri-section { font-weight: 600; color: var(--accent); padding: 10px 2px 0; }
.ri-table input { width: 52px; min-width: 52px; padding: 4px 6px; min-height: 34px; }
.ri-table select { min-width: 160px; }
.ri-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
