/* Libas admin. Brand colours from the guide; logical properties so one sheet serves Arabic (RTL) and French (LTR). */
:root {
  --ink: #111111;
  --cotton: #F4F4F2;
  --navy: #1F3A4A;
  --linen: #EDE7DA;
  --mist: #D6E0E6;
  --white: #FFFFFF;
  --muted: #5B6670;
  --line: #E2DDD1;
  --ok: #2F6B4F;
  --ok-bg: #E3EFE8;
  --warn: #8A5A12;
  --warn-bg: #F6EBD7;
  --bad: #9B2C2C;
  --bad-bg: #F6E1E1;
  --radius: 14px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--cotton); color: var(--ink); font-size: 15px; line-height: 1.6; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 6px; }

/* Shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: var(--cotton); padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; border-block-end: 1px solid #2a2a2a; margin-block-end: 16px; }
.side .brand img { height: 30px; }
.side nav a { display: flex; align-items: center; gap: 10px; color: #d9d9d4; padding: 10px 12px; border-radius: 10px; margin-block-end: 2px; font-size: .95rem; }
.side nav a:hover { background: #1d1d1d; text-decoration: none; color: var(--white); }
.side nav a.active { background: var(--navy); color: var(--white); }
.side nav .count { margin-inline-start: auto; background: var(--mist); color: var(--navy); border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 600; }
.side .group { color: #8a8a85; font-size: .75rem; padding: 14px 12px 4px; letter-spacing: .02em; }
.main { padding: 28px 32px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 22px; flex-wrap: wrap; }
.topbar .who { color: var(--muted); font-size: .9rem; display: flex; gap: 12px; align-items: center; }
.bubbles { position: relative; width: 34px; height: 30px; display: inline-block; }
.bubbles i { position: absolute; border-radius: 50%; border: 2px solid currentColor; }
.bubbles i:nth-child(1) { width: 6px; height: 6px; background: currentColor; inset-inline-start: 0; top: 0; }
.bubbles i:nth-child(2) { width: 9px; height: 9px; inset-inline-start: 7px; top: 7px; }
.bubbles i:nth-child(3) { width: 16px; height: 16px; inset-inline-start: 14px; top: 13px; }

/* Cards and grids */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-block-start: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: .85rem; }
.kpi .value { font-size: 1.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi.navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.kpi.navy .label { color: var(--mist); }
.kpi.linen { background: var(--linen); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: start; color: var(--muted); font-weight: 500; font-size: .82rem; padding: 10px 12px; border-block-end: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-block-end: 1px solid #f0ece3; vertical-align: middle; }
tr:hover td { background: #fbfaf7; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
[dir=rtl] .num { text-align: right; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: isolate; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; background: var(--mist); color: var(--navy); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.ink { background: var(--ink); color: var(--white); }
.badge.linen { background: var(--linen); color: var(--ink); }

/* Forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-block-end: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid #cfd6db; border-radius: 10px; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(31, 58, 74, .15); }
input[type=checkbox] { width: auto; }
.field { margin-block-end: 14px; }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 500; cursor: pointer; background: var(--ink); color: var(--white); min-height: 42px; white-space: nowrap; }
.btn:hover { background: #2a2a2a; text-decoration: none; }
.btn.navy { background: var(--navy); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid #cfd6db; }
.btn.ghost:hover { background: var(--white); }
.btn.danger { background: var(--bad); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.inline { display: inline; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-block-end: 16px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }

/* Filters and tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-block-end: 16px; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-size: .88rem; }
.tabs a.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.tabs a:hover { text-decoration: none; border-color: var(--navy); }

/* Timeline (ten stages) */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-inline-start: 30px; padding-block-end: 16px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 2px solid #c7cdd1; }
.timeline li.done::after { background: var(--navy); border-color: var(--navy); }
.timeline li.current::after { background: var(--white); border: 4px solid var(--navy); }
.timeline .when { color: var(--muted); font-size: .82rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: end; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.bar { height: 10px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--navy); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .art { background: var(--ink); color: var(--cotton); display: flex; flex-direction: column; justify-content: center; padding: 60px; gap: 18px; }
.login .art img { height: 64px; align-self: start; }
.login .art p { font-size: 1.3rem; max-width: 26ch; color: var(--mist); }
.login .form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login .form .card { width: 100%; max-width: 380px; }

/* Driver view: phone-first */
.driver .task { border-inline-start: 4px solid var(--navy); }

@media (max-width: 1100px) {
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.k3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side .group { display: none; }
  .main { padding: 20px 16px 48px; }
  .grid.k2, .grid.k4 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .art { padding: 32px; }
}

/* App home page editor, with a phone preview from the client's mock-up */
.home-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .home-editor { grid-template-columns: 1fr; } }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: .95rem; cursor: pointer; }
.toggle-row input { margin-top: 5px; }
.service-order { list-style: none; padding: 0; margin: 12px 0 0; }
.service-order li { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-block-end: 1px solid var(--line); }
.service-order li:last-child { border-block-end: 0; }
.service-order li.off img, .service-order li.off b { opacity: .5; }
.service-order img { border-radius: 10px; flex: 0 0 auto; }
.grow { flex: 1 1 auto; min-width: 0; }
.clamp { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-wrap { position: sticky; top: 20px; }
.phone { background: var(--cotton); border: 10px solid var(--ink); border-radius: 36px; padding: 18px 14px; height: 640px; overflow-y: auto; font-size: 12px; line-height: 1.5; box-shadow: 0 12px 30px rgba(17, 17, 17, .12); }
.phone [hidden] { display: none !important; }
.p-head { display: flex; gap: 8px; align-items: center; margin-block-end: 12px; }
.p-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font-weight: 600; }
.p-bell { width: 34px; height: 34px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; }
.p-muted { color: var(--muted); font-size: 11px; }
.p-plan { background: var(--linen); border-radius: 18px; padding: 14px; margin-block-end: 14px; }
.p-title { font-size: 17px; font-weight: 600; }
.p-count b { font-size: 26px; }
.p-bar { height: 5px; background: rgba(255, 255, 255, .7); border-radius: 99px; margin: 6px 0 10px; overflow: hidden; }
.p-bar span { display: block; height: 100%; background: var(--ink); }
.p-cta { background: var(--ink); color: var(--white); border-radius: 12px; padding: 10px 12px; font-weight: 500; }
.p-h { font-weight: 600; font-size: 14px; margin: 4px 0 8px; }
.p-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-block-end: 14px; }
.p-steps { display: flex; gap: 6px; margin-top: 8px; }
.p-steps i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #c7cdd1; background: var(--white); }
.p-steps i.done { background: var(--ink); border-color: var(--ink); }
.p-steps i.cur { background: var(--mist); border: 2px solid var(--navy); }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block-end: 14px; }
.p-svc { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p-svc img { border-radius: 8px; }
.p-how { background: var(--ink); color: var(--cotton); border-radius: 18px; padding: 14px; }
.p-how p { margin: 6px 0 0; color: var(--cotton); }
