:root {
  color-scheme: light dark;
  font-family: Inter, "Noto Sans Hebrew", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f5f8;
  color: #152231;
  --blue: #087fe8;
  --blue-dark: #0567be;
  --card: #ffffff;
  --muted: #667788;
  --line: #dce3ea;
  --surface: #eef4fa;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #f3f5f8; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.screen { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)); }
.auth-screen { display: grid; align-content: center; justify-items: center; gap: 8px; text-align: center; }
.auth-screen .card { width: min(100%, 440px); text-align: start; }
.brand-mark { display: grid; place-items: center; width: 72px; aspect-ratio: 1; border-radius: 22px; color: white; background: var(--blue); font-size: 36px; font-weight: 800; box-shadow: 0 14px 35px #087fe83b; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; }
h2 { font-size: 19px; margin-bottom: 12px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: -24px -20px 24px; padding: 40px 20px 54px; color: white; background: linear-gradient(145deg, #087fe8, #0564bd); border-radius: 0 0 34px 34px; }
.eyebrow { margin-bottom: 5px; color: inherit; opacity: .78; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.header-actions { display: flex; gap: 8px; }
.icon-button { display: grid; place-items: center; min-width: 46px; height: 46px; border: 1px solid #ffffff4a; border-radius: 15px; color: white; background: #ffffff1c; font-weight: 800; }
.hamburger-button { font-size: 23px; line-height: 1; }
.availability-card { margin-top: -52px; padding: 20px; border: 1px solid #ffffff4a; border-radius: 24px; color: white; background: #298fe9; box-shadow: 0 16px 40px #075ca628; }
.availability-numbers { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: baseline; gap: 8px; }
.availability-numbers strong { font-size: 30px; }
.availability-numbers span { font-size: 13px; opacity: .9; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.action-card { min-height: 150px; padding: 20px 12px; border: 0; border-radius: 22px; color: #152231; background: var(--card); box-shadow: 0 9px 30px #1a41670d; }
.action-card span, .action-card strong, .action-card small { display: block; }
.action-card small { margin-top: 5px; color: var(--muted); }
.action-icon { margin-bottom: 12px; color: var(--blue); font-size: 30px; font-weight: 800; }
.card { margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 9px 30px #1a41670d; }
.empty-state, .message { color: var(--muted); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; }
.status-pill { align-self: flex-start; padding: 6px 10px; border-radius: 999px; color: #08653a; background: #dcf7e9; font-size: 12px; font-weight: 800; }
.form-stack { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; color: #152231; background: var(--surface); }
html[dir="rtl"] input[type="datetime-local"],
html[dir="rtl"] input[type="date"],
html[dir="rtl"] input[type="time"] { direction: ltr; text-align: right; unicode-bidi: isolate; }
input[type="datetime-local"][readonly] { cursor: pointer; }
input:focus, select:focus { outline: 3px solid #087fe828; border-color: var(--blue); }
.primary-button { min-height: 50px; padding: 0 18px; border: 0; border-radius: 14px; color: white; background: var(--blue); font-weight: 800; }
.primary-button:hover { background: var(--blue-dark); }
.message { min-height: 20px; margin: 0; font-size: 13px; }
.message.error { color: #b42318; }
.development-link { color: var(--blue); font-weight: 700; }
.apartment-list { margin-top: 18px; }
.apartment-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.apartment-row small { color: var(--muted); }
.admin-dialog { width: min(calc(100% - 24px), 680px); max-height: 92vh; }
.admin-section { padding-top: 16px; border-top: 1px solid var(--line); }
.admin-section h3 { margin: 0 0 14px; }
.admin-user-list { display: grid; gap: 8px; }
.admin-user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: var(--surface); text-align: start; }
.admin-user-row span { min-width: 0; }
.admin-user-row strong, .admin-user-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-row small { margin-top: 4px; color: var(--muted); font-weight: 500; }
.admin-user-row b { padding: 5px 8px; border-radius: 999px; color: #08653a; background: #dcf7e9; font-size: 11px; }
.map-screen { padding-top: max(18px, env(safe-area-inset-top)); }
.map-page-header { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 12px; color: white; margin: -18px -20px 18px; padding: 28px 20px 20px; background: var(--blue-dark); }
.map-page-header h1 { font-size: 22px; }
.date-control { padding: 14px 18px; }
.date-control-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.date-control input { min-height: 34px; padding: 0; accent-color: var(--blue); }
.text-button { border: 0; color: var(--blue); background: transparent; font-weight: 800; }
.parking-map { position: relative; width: 100%; aspect-ratio: .88; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #24302c; box-shadow: inset 0 0 0 12px #2d3834; }
.parking-map::before { content: ""; position: absolute; top: 10%; bottom: 12%; left: 12%; width: 12%; border-radius: 8px; background: #3d4844; }
.street { position: absolute; top: 3%; left: 7%; right: 7%; height: 7%; padding-top: 4px; padding-left: 18%; border-block: 2px solid #d8d08c; color: #dfe6e2; text-align: center; background: #131917; font-size: 12px; }
.gate { position: absolute; top: 8%; left: 13%; z-index: 2; color: #ef5350; transform: rotate(-28deg); font-size: 30px; }
.entrance { position: absolute; top: 12%; left: 7%; z-index: 2; padding: 4px 8px; border-radius: 8px; color: white; background: #087fe8cc; font-size: 12px; }
.map-label { position: absolute; z-index: 1; color: #c8d2cd; font-size: 12px; }
.front-label, .rear-label { left: 24%; right: 7%; text-align: center; }
.front-label { top: 14%; }
.rear-label { top: 57%; }
.building-a, .building-b { position: absolute; padding: 5px 10px; border-radius: 8px; color: #c8d2cd; background: #3b4541; font-size: 11px; }
.building-a, .building-b { left: 58%; width: max-content; transform: translateX(-50%); text-align: center; }
.building-a { top: 35%; }
.building-b { bottom: 3%; }
.parking-space { position: absolute; display: grid; place-items: center; width: 13%; height: 9%; border: 1px solid #68756f; border-radius: 8px; color: #cad5d0; background: #34413c; font-size: clamp(10px, 2.5vw, 13px); }
.parking-space.vertical { width: 12%; height: 16%; top: 18%; }
.parking-space[data-spot="P01"] { right: 50%; }
.parking-space[data-spot="P02"] { right: 35%; }
.top-space { top: 14%; right: 15%; width: 18%; }
.connector-space { top: 48%; left: 22%; width: 16%; }
.rear-a, .rear-b, .rear-c, .rear-d, .rear-e { top: 61%; }
.rear-a { left: 29%; }.rear-b { left: 43%; }.rear-c { left: 57%; }.rear-d { left: 71%; }.rear-e { left: 85%; }
.lower-a, .lower-b, .lower-c, .lower-d, .lower-e, .lower-f { top: 74%; }
.lower-a { left: 11.5%; }.lower-b { left: 29%; }.lower-c { left: 43%; }.lower-d { left: 57%; }.lower-e { left: 71%; }.lower-f { left: 85%; }
.parking-space[data-status="available"] { border-color: #55d690; color: #79eca9; background: #183e2d; }
.parking-space[data-status="later"] { border-color: #ff8fb3; color: #ffd0df; background: #5d2840; }
.parking-space[data-status="occupied"] { border-color: #f0a64e; color: #ffd09a; background: #56381a; }
.parking-space[data-status="yours"] { border-color: #77baff; color: #d5eaff; background: #1f4972; box-shadow: 0 0 0 3px #77baff4a; }
.parking-space[data-status="unavailable"] { opacity: .56; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; padding: 14px 4px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend b { font-weight: 500; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: #83908a; }
.legend .available { background: #55d690; }.legend .later { background: #ff8fb3; }.legend .occupied { background: #f0a64e; }.legend .yours { background: #77baff; }.legend .unavailable { background: #83908a; }
.app-dialog { width: min(calc(100% - 24px), 520px); max-height: min(86vh, 720px); margin: auto auto 12px; padding: 0; border: 1px solid var(--line); border-radius: 26px; color: inherit; background: var(--card); box-shadow: 0 24px 80px #0006; }
.app-dialog::backdrop { background: #05100db5; backdrop-filter: blur(3px); }
.menu-dialog { width: min(88vw, 390px); height: 100dvh; max-height: none; margin-block: 0; padding: 0; border: 0; color: inherit; background: var(--card); }
html[dir="rtl"] .menu-dialog { margin-inline: auto 0; }
html[dir="ltr"] .menu-dialog { margin-inline: 0 auto; }
.menu-dialog::backdrop { background: #05100db5; backdrop-filter: blur(3px); }
.menu-panel { display: flex; flex-direction: column; min-height: 100%; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.menu-list { display: grid; gap: 8px; margin-block: 26px; }
.menu-list button { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 12px; min-height: 58px; padding: 0 14px; border: 0; border-radius: 14px; color: inherit; background: var(--surface); text-align: start; }
.menu-list button span { font-size: 20px; text-align: center; }
.menu-logout { width: 100%; margin-top: auto; }
.leaderboard-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.leaderboard-row > strong { color: var(--blue); font-size: 20px; }
.leaderboard-row small { display: block; margin-top: 3px; color: var(--muted); }
.danger-button { color: #c4312b; }
.spot-status-card { margin-top: 18px; }
.spot-status-card p { color: var(--muted); }
.spot-status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-card { padding: 22px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 16px; }
.close-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; color: inherit; background: var(--surface); font-size: 28px; line-height: 1; }
.check-row { grid-template-columns: 24px 1fr; align-items: center; color: inherit; }
.check-row input, .weekday-row input { width: 18px; min-height: 18px; accent-color: var(--blue); }
fieldset { padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.weekday-row { display: flex; justify-content: space-between; gap: 5px; }
.weekday-row label { display: flex; align-items: center; gap: 3px; }
.note { padding: 11px 12px; border-radius: 12px; color: #815312; background: #fff0d9; font-size: 13px; }
.date-time-dialog { width: min(calc(100% - 24px), 560px); }
.calendar-heading { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; text-align: center; }
.calendar-nav, .secondary-button { min-height: 46px; border: 1px solid var(--line); border-radius: 13px; color: inherit; background: var(--surface); font-weight: 800; }
.calendar-nav { padding: 0; font-size: 30px; line-height: 1; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; direction: ltr; }
.calendar-weekdays span { padding: 4px 0; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.calendar-days button { min-height: 46px; padding: 0; border: 1px solid transparent; border-radius: 12px; color: inherit; background: var(--surface); font-weight: 700; }
.calendar-days button:hover { border-color: var(--blue); }
.calendar-days button.selected { border-color: var(--blue); color: white; background: var(--blue); }
.calendar-days button.today:not(.selected) { border-color: var(--blue); color: var(--blue); }
.calendar-days button.outside { opacity: .35; }
.calendar-days button:disabled { cursor: not-allowed; opacity: .22; }
.time-selector-group { padding: 14px; }
.time-selectors { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; direction: ltr; }
.time-selectors strong { padding-bottom: 12px; font-size: 26px; }
.time-selectors label { text-align: center; }
.time-selectors select { min-height: 56px; text-align: center; font-size: 21px; font-weight: 800; }
.dialog-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

@media (max-width: 480px) {
  .screen { padding-inline: 14px; }
  .hero { margin-inline: -14px; padding-inline: 14px; }
  .map-page-header { margin-inline: -14px; padding-inline: 14px; }
  .action-grid { gap: 10px; }
  .action-card { min-height: 138px; }
}

@media (prefers-color-scheme: dark) {
  :root { background: #101715; color: #edf5f1; --card: #1c2522; --surface: #121a17; --muted: #a4b1aa; --line: #35413c; }
  body { background: #101715; }
  input, select, .action-card { color: #edf5f1; }
}

html[data-theme="light"] { color-scheme: light; background: #f3f5f8; color: #152231; --card: #ffffff; --surface: #eef4fa; --muted: #667788; --line: #dce3ea; }
html[data-theme="light"] body { background: #f3f5f8; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] .action-card { color: #152231; }
html[data-theme="dark"] { color-scheme: dark; background: #101715; color: #edf5f1; --card: #1c2522; --surface: #121a17; --muted: #a4b1aa; --line: #35413c; }
html[data-theme="dark"] body { background: #101715; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] .action-card { color: #edf5f1; }
