:root {
  --brand: #0e7c66;
  --brand-dark: #0a5c4c;
  --brand-soft: #e6f4f0;
  --accent: #f59e0b;
  --ink: #15201d;
  --muted: #5f6f6a;
  --line: #e3e9e7;
  --bg: #f6f8f7;
  --card: #ffffff;
  --danger: #c0392b;
  --ok: #1f9d55;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Cairo", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
[dir="rtl"] { font-family: "Cairo", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body { -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

/* Layout */
.app { max-width: 1100px; margin: 0 auto; padding: 0 16px 96px; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(246,248,247,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .95rem; }
.logo small { font-weight: 600; color: var(--accent); font-size: .8rem; }
.spacer { flex: 1; }
.loc-chip { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .85rem; cursor: pointer; max-width: 55vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; max-width: 160px; text-align: center; padding: 8px 4px 10px; color: var(--muted); font-size: .75rem; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.tabbar a .ic { font-size: 1.3rem; line-height: 1; }
.tabbar a.on { color: var(--brand); font-weight: 700; }
.tabbar .badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 8px); }

@media (min-width: 900px) {
  .tabbar { top: 0; bottom: auto; left: auto; right: auto; position: static; border: none; background: none; }
}

h1 { font-size: 1.5rem; margin: 20px 0 8px; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 22px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.svc { display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: transform .12s, border-color .12s; min-height: 118px; position: relative; }
.svc:hover { transform: translateY(-2px); border-color: var(--brand); }
.svc .ic { font-size: 1.9rem; }
.svc .nm { font-weight: 700; font-size: .95rem; }
.svc.soon { opacity: .6; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.tag.warn { background: #fff4dd; color: #8a5a00; }
.tag.red { background: #fde8e6; color: var(--danger); }
.tag.grey { background: #eef1f0; color: var(--muted); }
.tag.green { background: #e3f6ea; color: var(--ok); }
.svc .tag { position: absolute; top: 10px; inset-inline-end: 10px; }
.badge { background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; border-radius: 999px; padding: 1px 6px; }

/* Assistant */
.ai { background: linear-gradient(135deg, var(--brand) 0%, #13a085 100%); color: #fff; border-radius: 18px; padding: 18px; margin-top: 16px; }
.ai h2 { margin: 0 0 4px; font-size: 1.05rem; }
.ai p { margin: 0 0 12px; opacity: .9; font-size: .9rem; }
.ai form { display: flex; gap: 8px; }
.ai input { flex: 1; border: none; border-radius: 12px; padding: 12px 14px; color: var(--ink); min-width: 0; }
.ai button { border: none; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; padding: 0 16px; cursor: pointer; }
.ai-res { margin-top: 12px; display: grid; gap: 8px; }
.ai-res a { background: rgba(255,255,255,.14); color: #fff; border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.ai-res a:hover { background: rgba(255,255,255,.24); }

/* Forms */
label.f { display: block; }
label.f > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
label.f > span .req { color: var(--danger); }
input.i, select.i, textarea.i { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 12px; outline: none; transition: border-color .12s; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.i { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer; background: var(--brand); color: #fff; transition: background .12s, opacity .12s; text-align: center; }
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.accent { background: var(--accent); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3c7c1; }
.btn.small { padding: 7px 11px; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.oauth { background: #fff; color: var(--ink); border-color: var(--line); width: 100%; }
.btn.oauth:hover { border-color: var(--ink); }

.slots-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.day { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 12px; text-align: center; cursor: pointer; min-width: 64px; }
.day b { display: block; font-size: 1.1rem; }
.day.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.slot { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 6px; text-align: center; cursor: pointer; font-size: .9rem; }
.slot.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot:disabled { opacity: .35; cursor: not-allowed; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.seg button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

.map { height: 280px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 1; }
.map.tall { height: 380px; }

/* Lists */
.list { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: flex-start; }
.item .ic { font-size: 1.6rem; width: 40px; height: 40px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 12px; flex: 0 0 auto; }
.item .body { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.tablewrap { overflow-x: auto; }

/* Auth */
.auth { max-width: 420px; margin: 6vh auto; }
.auth .logo { justify-content: center; font-size: 2rem; }
.auth .logo .dot { width: 44px; height: 44px; font-size: 1.4rem; border-radius: 13px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.langs { display: flex; gap: 6px; justify-content: center; }
.langs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: .85rem; }
.langs button.on { border-color: var(--brand); color: var(--brand); font-weight: 700; }

/* Toast & modal */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: .9rem; box-shadow: var(--shadow); animation: up .2s ease; }
.toast.err { background: var(--danger); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,18,.45); z-index: 90; display: grid; place-items: end center; }
@media (min-width: 700px) { .modal-bg { place-items: center; } }
.modal { background: #fff; width: min(100vw, 560px); max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px; }
@media (min-width: 700px) { .modal { border-radius: 18px; } }
.modal h2 { margin-top: 0; }

.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }
.steps { display: flex; gap: 6px; margin: 8px 0 0; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--brand); }
.leaflet-container { font: inherit; }

/* Admin */
.side { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.side a { padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.side a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.stat { font-size: 1.6rem; font-weight: 800; }
