/* Hamba OS. Identity from the official brand kit: white canvas, evergreen text, orange for actions. */
@font-face { font-family: Inter; src: url(/fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(/fonts/plex-arabic-400.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; src: url(/fonts/plex-arabic-500.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; src: url(/fonts/plex-arabic-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
:root {
  --orange: #F29B20; --orange-soft: #FDF1DE; --green: #094B35; --deep: #042D21; --muted: #3A6F5D; --line: #DAE4E1; --surface: #F3F6F5; --line-strong: #558373; --bad: #A3271B; --bad-soft: #FBEDEB;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1); --out: cubic-bezier(0.16, 1, 0.3, 1);
  --side: 264px; --pad: clamp(16px, 4vw, 48px); --tabs: 68px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--green); font: 400 16px/1.75 Inter, "Plex Arabic", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
h1, h2, p, ul { margin: 0; } ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 8px; }
.ic { flex: none; fill: none; stroke: currentColor; }
.skip { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 90; padding: 10px 14px; background: var(--green); color: #fff; border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* shell */
.side { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); display: flex; flex-direction: column; gap: 28px; padding: 28px 18px 20px; border-inline-end: 1px solid var(--line); background: #fff; }
.brand { display: inline-flex; padding: 4px 10px; }
.menu { display: grid; gap: 4px; }
.menu a, .tabs a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px; font-weight: 500; text-decoration: none; color: var(--muted); transition: background-color 180ms var(--ease), color 180ms var(--ease); }
.menu a:hover { background: var(--surface); color: var(--green); }
.menu a.is-on { background: var(--surface); color: var(--green); font-weight: 600; }
.menu a.is-on::before { content: ""; position: absolute; inset-inline-start: -18px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
[dir="rtl"] .menu a.is-on::before { border-radius: 4px 0 0 4px; }
.menu-h { margin: 18px 14px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.menu a.is-soon { opacity: 0.62; }
.side-foot { margin-top: auto; }
.ghost { width: 100%; min-height: 44px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 500; text-align: start; padding: 0 14px; cursor: pointer; }
.ghost:hover { background: var(--surface); color: var(--green); }
.top, .tabs { display: none; }
#view { margin-inline-start: var(--side); padding: clamp(28px, 5vw, 64px) var(--pad) 96px; max-width: calc(var(--side) + 1040px); outline: 0; }
#view > * { animation: rise 420ms var(--out) both; }
#view > *:nth-child(2) { animation-delay: 40ms; } #view > *:nth-child(3) { animation-delay: 80ms; } #view > *:nth-child(4) { animation-delay: 120ms; } #view > *:nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* page head */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.eyebrow::before, .cut { content: ""; display: inline-block; width: 22px; height: 10px; background: var(--orange); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }
h1 { font-size: clamp(32px, 4.6vw, 56px); font-weight: 600; line-height: 1.3; }
.lead { max-width: 46em; margin-bottom: 24px; color: var(--muted); font-size: 17px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 4px; font-weight: 500; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--green); }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* buttons */
.btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--orange); color: var(--deep); font-weight: 600; text-decoration: none; cursor: pointer; transition: color 240ms var(--ease); }
.btn::before { content: ""; position: absolute; z-index: -1; inset: -2px -30%; background: var(--green); transform: translateX(102%) skewX(-18deg); transition: transform 420ms var(--out); }
.btn:hover, .btn:focus-visible { color: #fff; } .btn:hover::before, .btn:focus-visible::before { transform: translateX(0) skewX(-18deg); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn--ghost { background: none; box-shadow: inset 0 0 0 1.5px var(--line-strong); } .btn--ghost::before { background: var(--surface); } .btn--ghost:hover { color: var(--green); }
.btn--danger { background: none; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); } .btn--danger::before { background: var(--bad); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.icon-btn:hover { background: var(--surface); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { display: grid; gap: 2px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; text-decoration: none; transition: border-color 180ms, transform 300ms var(--out), box-shadow 300ms var(--out); }
.tile:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgba(4, 45, 33, 0.4); }
.tile b { font-size: clamp(34px, 4vw, 52px); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 14px; font-weight: 500; color: var(--muted); }
.tile.is-now { background: var(--orange); border-color: var(--orange); color: var(--deep); } .tile.is-now span { color: var(--deep); }
.tile.is-late { background: var(--bad-soft); border-color: #EBC7C2; color: var(--bad); } .tile.is-late span { color: var(--bad); }

/* quick add */
.quick { display: flex; align-items: center; gap: 10px; min-height: 60px; margin-bottom: 32px; padding: 6px 8px 6px 10px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; transition: border-color 180ms, box-shadow 180ms; }
[dir="rtl"] .quick { padding: 6px 10px 6px 8px; }
.quick:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(9, 75, 53, 0.1); }
.quick-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--muted); }
.quick-in { flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: 0; font-size: 17px; }
.quick-in::placeholder { color: var(--line-strong); }

/* blocks and tasks */
.block { margin-bottom: 36px; }
.block-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 18px; font-weight: 600; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tasks { border-top: 1px solid var(--line); }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 9px; padding: 0; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff; color: transparent; cursor: pointer; transition: background-color 200ms var(--ease), border-color 200ms, color 200ms, transform 300ms var(--out); }
.check:hover { border-color: var(--orange); color: var(--orange); transform: scale(1.08); }
.task.p1 .check { border-color: var(--orange); } .task.p2 .check { border-color: var(--bad); }
.task.is-done .check { background: var(--green); border-color: var(--green); color: #fff; }
.task-main { flex: 1; min-width: 0; display: grid; gap: 4px; min-height: 46px; align-content: center; padding: 4px 0; border: 0; background: none; text-align: start; cursor: pointer; border-radius: 8px; }
.task-title { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.task-meta:empty { display: none; }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--muted); }
.chip--doing { background: var(--orange-soft); color: var(--deep); }
.due { font-size: 13px; font-weight: 600; color: var(--muted); } .due.is-late { color: var(--bad); } .due.is-now { color: #A86708; }
.empty { display: grid; gap: 6px; justify-items: start; padding: 28px; border: 1.5px dashed var(--line); border-radius: 20px; color: var(--muted); }
.empty-t { font-size: 18px; font-weight: 600; color: var(--green); } .empty .btn { margin-top: 10px; }
.log li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.log time { flex: none; color: var(--muted); font-size: 13px; }

/* projects */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.pcard { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 196px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: #fff; text-decoration: none; transition: border-color 180ms, transform 320ms var(--out), box-shadow 320ms var(--out); }
.pcard::after { content: ""; position: absolute; top: -1px; inset-inline-end: -1px; width: 120px; height: 22px; background: var(--orange); clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%); transform: scaleX(0); transform-origin: 0 50%; transition: transform 420ms var(--out); }
[dir="ltr"] .pcard::after { clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%); transform-origin: 100% 50%; }
.pcard:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: 0 26px 48px -32px rgba(4, 45, 33, 0.45); } .pcard:hover::after { transform: scaleX(1); }
.pcard-top, .pmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; } .pmeta { margin-bottom: 16px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.status--active::before { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); } .status--done::before { background: var(--green); } .status--idea::before { background: none; box-shadow: inset 0 0 0 2px var(--line-strong); }
.sector { font-size: 13px; color: var(--muted); }
.pcard-name { font-size: 22px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.pcard-sum { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { margin-top: auto; display: grid; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.bar { display: block; height: 4px; border-radius: 4px; background: var(--surface); overflow: hidden; } .bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 4px; transition: width 900ms var(--out); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 500; text-decoration: none; transition: border-color 180ms, background-color 180ms; }
.chip-tab:hover { border-color: var(--line-strong); } .chip-tab.is-on { background: var(--green); border-color: var(--green); color: #fff; } .chip-tab.is-on .count { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* sheet */
.scrim { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(4, 45, 33, 0.38); animation: fade 200ms var(--ease); }
.sheet { width: min(100%, 520px); max-height: min(92vh, 92dvh); overflow: auto; padding: 24px; border-radius: 24px; background: #fff; box-shadow: 0 40px 80px -30px rgba(4, 45, 33, 0.6); animation: pop 320ms var(--out); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; } .sheet-h h2 { font-size: 22px; font-weight: 600; }
.sheet-f { display: flex; gap: 10px; justify-content: space-between; margin-top: 24px; }
.field { display: grid; gap: 6px; margin-top: 14px; } .field label { font-size: 14px; font-weight: 600; } .hint { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea, .gate-card input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; }
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .gate-card input:focus-visible { outline: 0; border-color: var(--green); box-shadow: 0 0 0 4px rgba(9, 75, 53, 0.12); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); }
.seg button { min-height: 40px; border: 0; border-radius: 10px; background: none; font-weight: 500; cursor: pointer; } .seg button[aria-checked="true"] { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(4, 45, 33, 0.18); }
.toast { position: fixed; z-index: 95; inset-inline: 0; bottom: calc(var(--tabs) + 16px); margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--deep); color: #fff; font-weight: 500; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 240ms, transform 320ms var(--out); }
.toast.on { opacity: 1; transform: none; }

/* gate (login and first password) */
.gate { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 20px; }
.gate-card { display: grid; gap: 10px; width: min(100%, 400px); }
.gate-card h1 { margin-top: 22px; font-size: 34px; } .gate-card p { color: var(--muted); margin-bottom: 8px; } .gate-card label { font-size: 14px; font-weight: 600; }
.gate-card .btn { margin-top: 10px; } .err { min-height: 26px; color: var(--bad); font-weight: 500; font-size: 15px; }

/* phone */
@media (max-width: 900px) {
  .side { display: none; }
  .top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 var(--pad); background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .top .icon-btn { background: var(--orange); color: var(--deep); }
  .tabs { position: fixed; z-index: 40; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabs) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line); }
  .tabs a { flex-direction: column; justify-content: center; gap: 2px; min-height: 0; padding: 0; border-radius: 0; font-size: 12px; }
  .tabs a.is-on { color: var(--green); font-weight: 600; } .tabs a.is-on .ic { color: var(--orange); }
  #view { margin: 0; padding: 22px var(--pad) calc(var(--tabs) + 40px); max-width: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scrim { place-items: end center; padding: 0; } .sheet { width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; } }
