/* Design system — RTL via logical properties. Deep-blue Saif brand as functional placeholder. */
:root {
  --brand: #1c3d6e; --brand-2: #2a5ca8; --brand-soft: #e8eef8;
  --bg: #f2f5f9; --surface: #ffffff; --text: #182338; --muted: #5c6b82; --line: #d9e1ec;
  --ok: #15803d; --ok-soft: #e5f5eb; --warn: #b45309; --warn-soft: #fdf0dd; --danger: #b91c1c; --danger-soft: #fde8e8;
  --info: #1d4ed8; --info-soft: #e6edfd; --radius: 12px; --shadow: 0 1px 3px rgba(23, 35, 56, .1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif; -webkit-font-smoothing: antialiased; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
a { color: var(--brand-2); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.3; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }

/* shell */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.topbar .title { font-weight: 700; font-size: 16px; flex: 1; }
.topbar .who { font-size: 12px; opacity: .85; }
.iconbtn { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 9px; padding: 7px 11px; font-size: 14px; cursor: pointer; position: relative; }
.iconbtn .dot { position: absolute; top: -4px; inset-inline-start: -4px; background: #f59e0b; color: #1c2a44; border-radius: 999px; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 3px; }
.nav { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 4px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--text); box-shadow: var(--shadow); }
.nav a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
main { padding: 12px 14px 90px; max-width: 1080px; margin-inline: auto; }

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-block-end: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; } .muted { color: var(--muted); } .center { text-align: center; }
.small { font-size: 12.5px; } .bold { font-weight: 700; } .mb0 { margin-block-end: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.tile .num { font-size: 24px; font-weight: 800; color: var(--brand); }
.tile .lbl { font-size: 12.5px; color: var(--muted); }
.banner { border-radius: var(--radius); padding: 10px 14px; margin-block-end: 12px; font-size: 13.5px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f2ddba; }
.banner.info { background: var(--info-soft); color: var(--info); border: 1px solid #c9d8f8; }
.banner.danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c6c6; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: start; padding: 9px 12px; border-block-end: 1px solid var(--line); white-space: nowrap; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: 12.5px; position: sticky; top: 0; }
tr:last-child td { border-block-end: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7faff; }

/* badges */
.badge { display: inline-block; border-radius: 999px; padding: 2.5px 10px; font-size: 11.5px; font-weight: 700; }
.b-info { background: var(--info-soft); color: var(--info); }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-muted { background: #eef1f6; color: var(--muted); }

/* forms & buttons */
label.f { display: block; margin-block-end: 10px; font-size: 13px; color: var(--muted); }
label.f > span { display: block; margin-block-end: 4px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; background: var(--surface); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand-2); }
input.inline { width: 90px; padding: 5px 8px; font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-2); }
.btn-xl { width: 100%; padding: 15px; font-size: 17px; border-radius: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-block-start: 10px; }

/* employee count screen */
.taskcard { border-inline-start: 4px solid var(--brand-2); }
.taskcard.overdue { border-inline-start-color: var(--danger); }
.sku { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--brand); font-size: 13px; }
.prodname { font-size: 17px; font-weight: 700; margin: 2px 0; }
.bignum input { font-size: 26px; font-weight: 800; text-align: center; padding: 12px; }
.totalbox { background: var(--brand-soft); border-radius: var(--radius); padding: 14px; text-align: center; margin-block: 12px; }
.totalbox .t { font-size: 34px; font-weight: 800; color: var(--brand); }
.countgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.photo-thumb { max-width: 120px; border-radius: 9px; border: 1px solid var(--line); }
.success-big { font-size: 52px; }

/* groups on tasks page */
.gtitle { display: flex; align-items: center; gap: 8px; margin: 16px 4px 8px; font-size: 14px; font-weight: 700; color: var(--muted); }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); border-radius: 16px 16px 0 0; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 18px; }
@media (min-width: 640px) { .overlay { align-items: center; } .modal { border-radius: 16px; } }
.modal h2 { margin-block-end: 12px; }
#toasts { position: fixed; bottom: 14px; inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: #1e293b; color: #fff; border-radius: 10px; padding: 10px 18px; font-size: 13.5px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 90vw; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--danger); }

/* states */
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.empty .big { font-size: 40px; }
.loading { text-align: center; color: var(--muted); padding: 30px; }
.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; background: linear-gradient(160deg, var(--brand) 0%, #10254a 100%); }
.login-card { background: var(--surface); border-radius: 16px; padding: 26px 22px; width: 100%; max-width: 380px; }
.login-logo { text-align: center; font-size: 21px; font-weight: 800; color: var(--brand); margin-block-end: 4px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; margin-block-end: 9px; font-size: 13.5px; color: var(--text); }
.checklist input { width: auto; margin-top: 3px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; font-size: 13.5px; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.steps { display: flex; gap: 6px; margin-block-end: 12px; }
.step { flex: 1; text-align: center; font-size: 12.5px; padding: 7px 4px; border-radius: 9px; background: #eef1f6; color: var(--muted); }
.step.on { background: var(--brand); color: #fff; font-weight: 700; }
.step.done { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
