/* مغسلتي: الأنماط. الألوان كلها متغيرات، والوضع الليلي يغيّرها فقط. */
:root {
  --bg: #F3F6F6; --card: #FFFFFF; --fg: #0F2A30; --muted: #5B6F74; --line: #DCE5E6; --line2: #EDF2F2;
  --field: #F7FAFA; --accent: #0B6E78; --accent-fg: #FFFFFF; --accent-soft: #E6F2F3; --accent-ink: #084F56;
  --ink: #0F2A30; --ink-fg: #FFFFFF;
  --gold: #FCEBC8; --gold-strong: #F6C760; --gold-ink: #7A4A00; --gold-line: #E2B45C;
  --bad: #FBEFEC; --bad-ink: #8A2E1C; --ok: #E3F5EA; --ok-ink: #1C6B3C;
  --display: "Readex Pro", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --body: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0C1C20; --card: #13292F; --fg: #E4EEEF; --muted: #9BB0B4; --line: #22424A; --line2: #1B363D;
  --field: #0F2328; --accent: #4FC3CC; --accent-fg: #06181B; --accent-soft: #173C42; --accent-ink: #A6E4E8;
  --ink: #E4EEEF; --ink-fg: #0C1C20;
  --gold: #3A2E14; --gold-strong: #C99A3A; --gold-ink: #F4D08A; --gold-line: #8A6A2A;
  --bad: #3A1D18; --bad-ink: #F3B2A4; --ok: #173A27; --ok-ink: #9BE0B5;
  color-scheme: dark;
}
/* هوية «الهدوء»: بنفسجي وأزرق نيون. الهوية الكلاسيكية فوق تبقى كما هي، والمالك يبدّل بينهم. */
:root[data-style="neon"]:not([data-theme="dark"]) {
  --bg: #F4F2FB; --card: #FFFFFF; --fg: #1A1433; --muted: #5F587A; --line: #DED9F0; --line2: #EEEBF7;
  --field: #F8F6FD; --accent: #6D28D9; --accent-fg: #FFFFFF; --accent-soft: #EEE5FF; --accent-ink: #4A1A9E;
  --ink: #1A1433; --ink-fg: #FFFFFF; --glow: rgba(109,40,217,.18);
}
:root[data-style="neon"][data-theme="dark"] {
  --bg: #0B0A1F; --card: #16143A; --fg: #ECEAFF; --muted: #A9A3CF; --line: #2E2A63; --line2: #221F4C;
  --field: #100E2C; --accent: #B47CFF; --accent-fg: #0B0A1F; --accent-soft: #2A1F5C; --accent-ink: #DCC4FF;
  --ink: #ECEAFF; --ink-fg: #0B0A1F; --glow: rgba(180,124,255,.35);
  --gold: #3A2E14; --gold-strong: #E0B24A; --gold-ink: #F6D58E; --gold-line: #8A6A2A;
}
:root[data-style="neon"] .brand-logo { background: linear-gradient(135deg, #7B2FF7, #22B8F0); box-shadow: 0 0 14px var(--glow); }
:root[data-style="neon"] .hero-num { background: linear-gradient(135deg, #3B1C8C, #1A5FA8); color: #FFFFFF; }
:root[data-style="neon"] .btn.primary { background: linear-gradient(135deg, #7B2FF7, #2BA6E8); border-color: transparent; color: #FFFFFF; box-shadow: 0 0 16px var(--glow); }
:root[data-style="neon"] .stamp.done, :root[data-style="neon"] .dots span.done { background: linear-gradient(135deg, #8B3DFF, #22B8F0); color: #FFFFFF; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.6; }
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--gold-strong); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.3; }
p { margin: 0; }

.page { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.page.with-nav { padding-bottom: 96px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 19px; }
.sub { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.card { background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card.dashed { border: 1.5px dashed var(--accent); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row.top-line { padding-top: 8px; border-top: 1px solid var(--line2); }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.btn { min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.ink { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: var(--bad); color: var(--bad-ink); border-color: transparent; }
.btn.wa { background: var(--ok); color: var(--ok-ink); border-color: transparent; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 44px; min-height: 44px; padding: 0; }
.btn.big { min-height: 68px; font-family: var(--display); font-size: 21px; border-radius: 18px; flex-direction: column; gap: 0; line-height: 1.25; }
.btn.big small { font-family: var(--body); font-size: 12px; font-weight: 500; opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); font-weight: 600; }
.style-pick { min-height: 96px; border-radius: 14px; border: 1px solid var(--line); background: var(--field); color: var(--fg); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; }
.style-pick[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
.style-pick .sw { width: 34px; height: 34px; border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.tag.teal { background: var(--accent-soft); color: var(--accent-ink); }
.tag.gold { background: var(--gold); color: var(--gold-ink); }
.tag.bad { background: var(--bad); color: var(--bad-ink); }
.tag.ok { background: var(--ok); color: var(--ok-ink); }
.tag.gray { background: var(--line2); color: var(--muted); }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.input { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); padding: 0 12px; font-size: 15px; }
textarea.input { min-height: 90px; padding: 10px 12px; resize: vertical; }

.tile { border-radius: 14px; padding: 10px 6px; background: var(--card); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.tile b { font-family: var(--display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11px; }
.tile.gold { background: var(--gold); color: var(--gold-ink); }
.tile.bad { background: var(--bad); color: var(--bad-ink); }
.hero-num { background: var(--ink); color: var(--ink-fg); border-radius: 18px; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.hero-num b { font-family: var(--display); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* اللوحة */
.plate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--fg); border-radius: 10px; overflow: hidden; direction: ltr; font-family: var(--display); }
.plate span { padding: 8px; text-align: center; font-size: 26px; font-weight: 600; letter-spacing: .1em; min-height: 52px; }
.plate span:first-child { border-inline-end: 2px solid var(--fg); }
.plate.mini { min-width: 132px; }
.plate.mini span { font-size: 14px; padding: 3px 8px; min-height: 0; letter-spacing: .05em; }
.plate.mini span:nth-child(1), .plate.mini span:nth-child(3) { border-inline-end: 1.5px solid var(--fg); }
.plate.mini span:nth-child(3), .plate.mini span:nth-child(4) { border-top: 1.5px solid var(--fg); }
.scan-note { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 12px; padding: 8px; }
.scan-note img { width: 88px; height: 58px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
label.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.keys { display: grid; gap: 6px; direction: ltr; }
.keys.letters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.keys.digits { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.key { min-height: 50px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--fg); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 0; }
.key b { font-size: 18px; }
.key i { font-style: normal; font-size: 11px; color: var(--muted); }
.key.del { background: var(--bad); color: var(--bad-ink); border-color: transparent; }

/* النقاط */
.stamps { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; }
.stamp { aspect-ratio: 1 / 1; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 2px dashed var(--line); color: var(--muted); font-weight: 600; max-width: 72px; width: 100%; justify-self: center; }
.stamp.done { background: var(--accent); border: 0; color: var(--accent-fg); }
.stamp.gift { background: var(--gold); border: 2px dashed var(--gold-line); color: var(--gold-ink); }
.stamp.gift.ready { background: var(--gold-strong); border: 2px solid var(--gold-ink); }
.dots { display: inline-flex; gap: 5px; align-items: center; }
.dots span { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 2px dashed var(--line); }
.dots span.done { background: var(--accent); border: 0; }
.dots span.gift { background: var(--gold); border: 2px dashed var(--gold-line); }
.dots span.gift.ready { background: var(--gold-strong); border: 2px solid var(--gold-ink); }
.note { border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; text-align: center; }
.note.teal { background: var(--accent-soft); color: var(--accent-ink); }
.note.gold { background: var(--gold); color: var(--gold-ink); }
.note.bad { background: var(--bad); color: var(--bad-ink); }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line2); }
.list-row:first-child { border-top: 0; }
.list-row.cancelled { opacity: .55; }
.list-row.cancelled .strike { text-decoration: line-through; }
.carDot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0; background: var(--line2); }
.time { font-size: 12px; color: var(--muted); width: 42px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; border-bottom: 1px solid var(--line); direction: ltr; }
.bars div { flex: 1; border-radius: 4px 4px 0 0; background: var(--accent-soft); min-height: 2px; }
.bars div.peak { background: var(--accent); }
.meter { height: 8px; background: var(--line2); border-radius: 999px; overflow: hidden; }
.meter div { height: 100%; background: var(--accent); border-radius: 999px; }

.switch { width: 52px; height: 30px; flex-shrink: 0; border-radius: 999px; border: 0; padding: 3px; cursor: pointer; display: flex; background: var(--line); justify-content: flex-end; }
.switch::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-start; }

.tabbar { position: fixed; inset: auto 0 0 0; background: var(--card); border-top: 1px solid var(--line); z-index: 10;
  padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
.tabbar .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar a { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; text-decoration: none; color: var(--muted); }
.tabbar a::before { content: ""; width: 22px; height: 4px; border-radius: 4px; background: transparent; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar a[aria-current="page"]::before { background: var(--accent); }

.prices { display: grid; gap: 6px; align-items: center; font-size: 12px; }
.prices input { text-align: center; min-height: 40px; padding: 0 4px; font-weight: 600; }

#toast { position: fixed; inset: auto 16px calc(84px + env(safe-area-inset-bottom, 0px)) 16px; max-width: 520px; margin: 0 auto; z-index: 30;
  background: var(--ink); color: var(--ink-fg); border-radius: 14px; padding: 12px 16px; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

.modal-back { position: fixed; inset: 0; background: rgba(6,20,24,.55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 12px; }

.qr { background: #FFFFFF; padding: 10px; border-radius: 12px; border: 1px solid var(--line); display: inline-block; line-height: 0; }
.qr img, .qr svg { width: 150px; height: 150px; image-rendering: pixelated; }
.poster { max-width: 520px; margin: 0 auto; background: #FFFFFF; color: #0F2A30; border-radius: 24px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.poster .qr img, .poster .qr svg { width: 260px; height: 260px; }
.poster .brand-logo { background: #0B6E78; }
.poster-tag { font-size: 18px; font-weight: 600; margin-top: -6px; }
.poster-small { font-size: 14px; color: #5B6F74; }
.poster-slogan { font-family: var(--display); font-size: 26px; font-weight: 700; color: #0B6E78; }
.poster-info { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.poster-pill { display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid #0B6E78; border-radius: 999px; padding: 8px 16px; font-size: 16px; }
.poster-pill b { font-size: 22px; letter-spacing: .03em; }
.poster.neon { background: radial-gradient(70% 40% at 20% 10%, rgba(123,47,247,.55), transparent 70%), radial-gradient(60% 40% at 90% 20%, rgba(34,184,240,.45), transparent 70%), #0B0A1F; color: #F3F0FF;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.poster.neon .brand-logo { background: linear-gradient(135deg, #7B2FF7, #22B8F0); box-shadow: 0 0 20px rgba(123,47,247,.7); }
.poster.neon .brand-name { text-shadow: 0 0 14px rgba(180,124,255,.8); }
.poster.neon .poster-small { color: #BDB6E6; }
.poster.neon .poster-slogan { color: #E879F9; text-shadow: 0 0 12px rgba(232,121,249,.6); }
.poster.neon .poster-pill { border-color: #B47CFF; box-shadow: 0 0 12px rgba(180,124,255,.5), inset 0 0 10px rgba(34,184,240,.25); }
.poster.neon .qr { box-shadow: 0 0 24px rgba(34,184,240,.6); }
/* بوستر الهدوء بالوضع النهاري: أبيض بلمسات بنفسجية وزرقاء، أوفر في الحبر */
.poster.neon-light { background: radial-gradient(60% 30% at 15% 0%, rgba(123,47,247,.14), transparent 70%), radial-gradient(55% 30% at 90% 10%, rgba(34,184,240,.14), transparent 70%), #FFFFFF; color: #1A1433; border: 2px solid #E4DBFF; }
.poster.neon-light .brand-logo { background: linear-gradient(135deg, #7B2FF7, #22B8F0); }
.poster.neon-light .brand-name { color: #3B1C8C; }
.poster.neon-light .poster-slogan { color: #A21CAF; }
.poster.neon-light .poster-pill { border-color: #7B2FF7; }
.poster.neon-light .poster-small { color: #5F587A; }
.pin { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.pin span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.pin span.on { background: var(--fg); border-color: var(--fg); }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; direction: ltr; }
.pad .key { min-height: 58px; font-size: 22px; font-weight: 600; }
/* شاشة الدخول: صورة فوق ولوحة داكنة تحت، بنفس الشكل في الوضعين */
.login { min-height: 100vh; background: #151F27; color: #EAF3F4; }
.login-inner { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end;
  background-color: #151F27; background-size: 100% auto; background-position: center top; background-repeat: no-repeat;
  position: relative; margin-top: calc(-1 * env(safe-area-inset-top, 0px)); padding-top: calc(env(safe-area-inset-top, 0px) + min(86vw, 450px)); }
/* اسم المغسلة أعلى الشاشة، فوق الصورة وبعيد عن السيارة */
.login-top { position: absolute; inset: 0 0 auto 0; padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(to bottom, rgba(10,22,28,.55), rgba(10,22,28,0)); }
.login-top .login-brand { text-shadow: 0 2px 10px rgba(0,0,0,.55); color: #FFFFFF; }
.login-top .login-tag { margin: 0; color: #FFFFFF; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.login.neon .login-top { background: none; }
.login-panel { width: 100%; max-width: 440px; margin: 0 auto; position: relative; display: flex; flex-direction: column; gap: 16px;
  background: linear-gradient(to bottom, rgba(21,31,39,0), rgba(21,31,39,.75) 60px, rgba(21,31,39,.92)); padding-top: 40px !important;
  padding: 0 max(24px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 26px; }
.login h1 { text-align: center; font-size: 24px; font-weight: 500; color: #EAF3F4; }
.login-input { width: 100%; min-height: 54px; border-radius: 999px; border: 1px solid rgba(234,243,244,.22); background: rgba(234,243,244,.12); color: #EAF3F4; padding: 0 22px; font-size: 16px; }
.login-input::placeholder { color: rgba(234,243,244,.7); }
.login .btn.primary { background: #3FA9B3; border-color: #3FA9B3; color: #06181B; border-radius: 999px; }
.login a, .login .linkish { color: #9FE7F0; }
.login-tag { text-align: center; margin-top: -8px; color: rgba(234,243,244,.8); font-size: 14px; }
/* شاشة الدخول بهوية «الهدوء» */
.login.neon { background: #0B0A1F; }
.login-inner.neon-bg { position: relative; overflow: hidden; background-color: #0B0A1F;
  background-image:
    radial-gradient(60% 40% at 20% 18%, rgba(123,47,247,.55), transparent 70%),
    radial-gradient(55% 38% at 85% 30%, rgba(34,184,240,.45), transparent 70%),
    radial-gradient(70% 30% at 50% 55%, rgba(180,124,255,.25), transparent 70%),
    repeating-linear-gradient(60deg, transparent 0 46px, rgba(180,124,255,.10) 46px 48px),
    repeating-linear-gradient(-60deg, transparent 0 46px, rgba(34,184,240,.08) 46px 48px);
  background-size: auto; }
.neon-art { position: absolute; inset: calc(env(safe-area-inset-top, 0px) + 150px) 0 auto 0; display: flex; justify-content: center;
  filter: drop-shadow(0 0 10px rgba(180,124,255,.9)) drop-shadow(0 0 22px rgba(34,184,240,.6)); }
.login.neon .login-panel { background: linear-gradient(to bottom, rgba(11,10,31,0), rgba(11,10,31,.85) 60px, rgba(11,10,31,.95)); }
.login.neon .btn.primary { background: linear-gradient(135deg, #7B2FF7, #2BA6E8); color: #FFFFFF; box-shadow: 0 0 18px rgba(123,47,247,.5); }
.login.neon .login-input { border-color: rgba(180,124,255,.45); background: rgba(180,124,255,.10); }
.login.neon a, .login.neon .linkish { color: #CDB1FF; }
.login.neon h1 { color: #ECEAFF; }
.linkish { background: none; border: 0; padding: 8px 0; cursor: pointer; text-decoration: underline; font-size: inherit; }
.login a { text-decoration: underline; padding: 8px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-banner { background: var(--gold); color: var(--gold-ink); font-size: 12px; text-align: center; padding: 6px 12px; border-radius: 10px; }

@media print {
  body { background: #FFFFFF; }
  .no-print { display: none !important; }
  .poster { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
