/* Brand: deep purple #32074f, magenta #d154c9 (from the Molo Services logo) */
:root {
  --bg: #f6f2f9; --surface: #ffffff; --text: #26112f; --muted: #6f5e7a;
  --line: #e6dcee; --accent: #9a2d92; --accent-text: #ffffff; --accent-soft: #f4e4f2;
  --brand: #32074f; --brand-pop: #d154c9;
  --danger: #c0392b; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14091d; --surface: #200f2f; --text: #f1e8f6; --muted: #b3a1c0;
    --line: #36204b; --accent: #d154c9; --accent-text: #1a0826; --accent-soft: #3a1c4d;
    --brand: #f3e8fa; --brand-pop: #d154c9;
    --danger: #ff8d7d;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px;
}
.login-card { border-top: 4px solid var(--brand-pop); }
.login-card h1 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.login-card p { margin: 0 0 20px; color: var(--muted); text-align: center; }
.login-card .error { text-align: center; }
.logo { display: block; }
.logo img { display: block; height: 100%; width: auto; }
.logo-lg { height: 72px; margin: 4px auto 18px; }
.logo-lg img { margin: 0 auto; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 0; border-radius: 8px; text-decoration: none;
  background: var(--accent); color: var(--accent-text); font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.small { padding: 6px 12px; }
.error { color: var(--danger); min-height: 1.4em; margin: 0 0 10px; font-size: 14px; }

/* ---------- app shell ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  border-top: 3px solid var(--brand-pop);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand .logo { height: 38px; }
.brand-text {
  font-weight: 600; font-size: 15px; color: var(--muted);
  padding-inline-start: 14px; border-inline-start: 1px solid var(--line);
}
.search {
  flex: 1; max-width: 460px; margin-inline-start: auto;
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.cats { display: flex; flex-direction: column; gap: 4px; align-self: start; position: sticky; top: 76px; }
.cat {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  padding: 10px 12px; border: 0; border-radius: 8px; background: transparent;
}
.cat:hover { background: var(--accent-soft); }
.cat[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-pop); }
[dir="rtl"] .cat[aria-current="true"] { box-shadow: inset -3px 0 0 var(--brand-pop); }
.cat .icon { width: 1.4em; text-align: center; }
.cat .count { margin-inline-start: auto; font-size: 12px; color: var(--muted); }

main h2 { margin: 0 0 2px; font-size: 22px; color: var(--brand); }
.lead { margin: 0 0 16px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.group { margin-bottom: 24px; }
.group h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.group .gdesc { margin: -4px 0 8px; color: var(--muted); font-size: 14px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.file { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.file + .file { border-top: 1px solid var(--line); }
.file .info { flex: 1; min-width: 0; }
.file .name { font-weight: 600; overflow-wrap: anywhere; }
.file .desc { color: var(--muted); font-size: 14px; }
.file .meta { color: var(--muted); font-size: 13px; white-space: nowrap; text-align: end; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
  .cats { flex-direction: row; overflow-x: auto; position: static; }
  .cat { width: auto; white-space: nowrap; }
  .cat .count { display: none; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .brand .logo { height: 32px; }
  .search { margin-inline-start: 0; }
  .brand-text { display: none; }
  #logout { margin-inline-start: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .file { flex-wrap: wrap; gap: 8px 16px; }
  .file .info { flex-basis: 100%; }
  .file .meta { margin-inline-end: auto; text-align: start; }
  .cat[aria-current="true"], [dir="rtl"] .cat[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--brand-pop); }
}
