/* Keblawi Motors design system: midnight surfaces, one blue for actions, colour reserved for meaning. */
:root {
  color-scheme: dark;
  --bg: #070a12;
  --surface: #0f1422;
  --surface-2: #141a2b;
  --surface-3: #1b2236;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #eef1f8;
  --muted: #8e97ab;
  --faint: #5d6679;
  --accent: #2f6fed;
  --accent-2: #6b9dff;
  --accent-soft: rgba(47, 111, 237, .15);
  --green: #34d399;
  --red: #f87171;
  --whish: #e3122b;
  --amber: #f5b642;
  --radius: 16px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 14px 34px rgba(0, 0, 0, .34);
  --ring: 0 0 0 3px rgba(107, 157, 255, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: #2a3350 transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; }
a { color: var(--accent-2); }
img { max-width: 100%; }
::selection { background: rgba(107, 157, 255, .35); }
[hidden] { display: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* buttons */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.05rem; border: 1px solid transparent; border-radius: 10px;
  background: var(--accent); color: #fff; font: 600 .92rem/1.2 var(--body);
  cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 16px rgba(47, 111, 237, .28);
  transition: background .2s, border-color .2s, color .2s, box-shadow .25s, transform .15s var(--ease);
}
.btn::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%); transform: translateX(-120%); }
.btn:hover { background: #3f7df5; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 24px rgba(47, 111, 237, .4); }
.btn:hover::after { transform: translateX(120%); transition: transform .65s var(--ease); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.secondary, .btn.ghost { background: rgba(255, 255, 255, .04); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn.secondary:hover, .btn.ghost:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .24); box-shadow: none; }
.btn.danger, .btn.danger.secondary { background: transparent; color: var(--red); border-color: rgba(248, 113, 113, .35); box-shadow: none; }
.btn.danger:hover, .btn.danger.secondary:hover { background: rgba(248, 113, 113, .14); border-color: rgba(248, 113, 113, .6); box-shadow: none; }
.btn.secondary::after, .btn.ghost::after, .btn.danger::after { display: none; }
.btn.small { padding: .36rem .72rem; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn { background: none; border: 0; border-radius: 8px; font-size: 1.5rem; line-height: 1; padding: .15rem .55rem; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

/* forms */
.field { display: grid; gap: .38rem; margin-bottom: 1rem; }
.field label, .field .label { font-weight: 600; font-size: .82rem; color: #c3cada; }
.hint { font-size: .82rem; color: var(--muted); }
input, select, textarea {
  width: 100%; font: .95rem/1.3 var(--body); color: var(--text);
  padding: .62rem .8rem; border: 1px solid var(--line-2); border-radius: 10px; background: #0a0f1b;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .24); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent-2); box-shadow: var(--ring); background: #0c1220; }
textarea { min-height: 6rem; resize: vertical; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
input[type="file"] { padding: .45rem; }
.check { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1rem; align-items: start; }
.form-error { color: var(--red); font-weight: 600; margin: 0 0 .8rem; }
.form-error:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; margin-top: .5rem; }
.actions .spacer { margin-right: auto; }
select.pay-red { color: #ff5468; font-weight: 700; border-color: var(--whish); }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .76rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); padding: .78rem .65rem; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .72rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1.1rem; }
th:last-child, td:last-child { padding-right: 1.1rem; }
tbody tr { transition: background .15s; animation: rowIn .45s var(--ease) both; }
tbody tr:nth-child(2) { animation-delay: .03s; } tbody tr:nth-child(3) { animation-delay: .06s; } tbody tr:nth-child(4) { animation-delay: .09s; }
tbody tr:nth-child(5) { animation-delay: .12s; } tbody tr:nth-child(6) { animation-delay: .15s; } tbody tr:nth-child(7) { animation-delay: .18s; }
tbody tr:nth-child(8) { animation-delay: .21s; } tbody tr:nth-child(9) { animation-delay: .24s; } tbody tr:nth-child(n+10) { animation-delay: .27s; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 1px solid var(--line-2); font-weight: 700; border-bottom: 0; background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; white-space: nowrap; }
.empty { padding: 2.6rem 1rem; text-align: center; color: var(--muted); }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .17rem .62rem; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.badge.available { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .25); }
.badge.reserved { background: rgba(245, 182, 66, .12); color: #fcd27a; border-color: rgba(245, 182, 66, .25); }
.badge.sold { background: rgba(255, 255, 255, .06); color: #b9c0cf; border-color: var(--line-2); }
.badge.admin { background: var(--accent-soft); color: #a9c4ff; border-color: rgba(107, 157, 255, .35); }
.badge.staff { background: rgba(255, 255, 255, .06); color: #c3cada; border-color: var(--line-2); }
.badge.off { background: rgba(248, 113, 113, .12); color: #fca5a5; border-color: rgba(248, 113, 113, .28); }
.badge.admin::before, .badge.staff::before, .badge.pay::before { display: none; }
.badge.pay-cash { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .25); }
.badge.pay-whish-money { background: #e3122b; color: #fff; border-color: #ff5468; }

/* dialog */
dialog.modal { border: 1px solid var(--line-2); padding: 0; width: min(560px, 94vw); max-height: 92vh; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .65); overflow: hidden; }
dialog.modal[open] { animation: pop .28s var(--ease); }
dialog.modal.wide { width: min(900px, 94vw); }
dialog.modal::backdrop { background: rgba(4, 6, 12, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s ease; }
.modal-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 1rem 1.4rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.modal-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); }
.modal-head h2 { margin: 0; font: 700 1.1rem var(--body); }
.modal-body { padding: 1.4rem; overflow-y: auto; max-height: calc(92vh - 4.5rem); }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 200; width: min(440px, 92vw); }
.toast { display: flex; align-items: center; gap: .7rem; background: var(--surface-3); color: var(--text); padding: .8rem 1.1rem; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-weight: 500; animation: toastIn .35s var(--ease); }
.toast::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.toast.error { border-color: rgba(248, 113, 113, .45); }
.toast.error::before { background: var(--red); box-shadow: 0 0 0 4px rgba(248, 113, 113, .18); }

@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* 2026 Neon Blue / White refresh */
:root { color-scheme: light; --bg:#f4f9ff; --surface:#ffffff; --surface-2:#edf5ff; --surface-3:#e5f1ff; --line:rgba(22,91,177,.11); --line-2:rgba(22,91,177,.22); --text:#102a4d; --muted:#54708f; --faint:#8299b2; --accent:#1464f6; --accent-2:#00baff; --accent-soft:rgba(0,153,255,.12); --green:#07865c; --red:#d92d48; --amber:#a66b06; --shadow:0 10px 32px rgba(24,96,186,.08),0 1px 3px rgba(24,96,186,.06); --ring:0 0 0 4px rgba(0,186,255,.19); }
body { background:var(--bg); }
* { scrollbar-color:#b5d8fa transparent; }
.btn { background:linear-gradient(120deg,#155ef4,#00aaff); box-shadow:0 5px 18px rgba(0,140,255,.23); }
.btn:hover { background:linear-gradient(120deg,#004ce5,#0094f4); box-shadow:0 8px 25px rgba(0,153,255,.35); }
.btn.secondary,.btn.ghost { background:#f1f7ff; color:#174d8a; border-color:#c6defb; }
.btn.secondary:hover,.btn.ghost:hover { background:#e3f2ff; border-color:#00baff; }
.icon-btn:hover { background:#e9f4ff; }
.field label,.field .label { color:#335678; }
input,select,textarea { background:#fff; color:var(--text); }
input:hover,select:hover,textarea:hover { border-color:#66b9ff; }
input:focus-visible,select:focus-visible,textarea:focus-visible { background:#fff; }
tbody tr:hover { background:#eef8ff; }
.badge.available,.badge.pay-cash { color:#08774e; }
.badge.reserved { color:#93600a; }
.badge.sold,.badge.staff { color:#5e728b; }
.badge.admin { color:#0964b8; }
.badge.off { color:#b82c42; }
.modal-head { background:#f1f7ff; }
dialog.modal { box-shadow:0 24px 75px rgba(12,67,143,.24); }
dialog.modal::backdrop { background:rgba(12,37,74,.38); }
.toast { box-shadow:0 12px 35px rgba(12,67,143,.18); }
::selection { background:rgba(0,186,255,.24); }
