:root {
  color-scheme: dark;
  --bg: #0f1115;
  --bg-soft: #12151b;
  --surface: #171a21;
  --surface-2: #20242d;
  --surface-3: #252a35;
  --cream: #f8f1df;
  --muted-cream: #d8ccb0;
  --gold: #c9a44c;
  --gold-soft: #e6cc7a;
  --text: #f7f2e8;
  --muted: #aeb4c0;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(230, 204, 122, .30);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #38bdf8;
  --shadow: 0 18px 50px rgba(0, 0, 0, .30);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, .22);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px rgba(201, 164, 76, .28);
  --font: Arial, Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(201, 164, 76, .07), transparent 34%),
    linear-gradient(180deg, #0c0e12 0%, var(--bg) 45%, #101218 100%);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

a {
  color: var(--gold-soft);
  text-decoration: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

a:hover { color: var(--cream); }

img { max-width: 100%; height: auto; }

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button,
.btn,
.actions a,
.actions button,
.link-button,
input[type="submit"] {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #12100a;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.15;
  box-shadow: 0 8px 18px rgba(201, 164, 76, .16);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

button:hover,
.btn:hover,
.actions a:hover,
.actions button:hover,
.link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(201, 164, 76, .24);
}

button:disabled,
.btn:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
  border-color: var(--gold);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 12, 16, .76);
  color: var(--text);
  padding: 10px 12px;
  outline: 0;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

textarea { min-height: 104px; resize: vertical; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-inline-end: 34px;
}

label {
  color: var(--muted-cream);
  font-size: .92rem;
  font-weight: 700;
}

label input,
label select,
label textarea { margin-top: 6px; }

label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .025);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--gold);
  margin: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted-cream);
  font-size: .78rem;
  letter-spacing: .02em;
  text-align: left;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .035);
}

td { color: var(--text); }

tr:hover td { background: rgba(255, 255, 255, .025); }

form { margin: 0; }

pre,
code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .36);
  color: var(--cream);
}

pre { padding: 14px; border: 1px solid var(--border); }
code { padding: 3px 7px; }

.panel,
.panel-card,
.card {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(32, 36, 45, .92), rgba(23, 26, 33, .96));
  box-shadow: var(--shadow-soft);
}

.panel > h1:first-child,
.card > h1:first-child {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--cream);
  line-height: 1.18;
  letter-spacing: 0;
}

h1 { margin: 0 0 18px; font-size: clamp(1.65rem, 3vw, 2.35rem); }
h2 { margin: 22px 0 12px; font-size: clamp(1.15rem, 2vw, 1.45rem); }
h3 { margin: 0 0 8px; font-size: 1rem; }
p { margin: 0 0 12px; }

.btn-secondary,
.btn-soft,
.actions a:nth-child(n+2),
.link-button {
  background: rgba(248, 241, 223, .10);
  color: var(--cream);
  border-color: var(--border);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--muted-cream);
  border-color: var(--border);
  box-shadow: none;
}

.btn-primary { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #12100a; }
.btn-danger,
.danger,
.actions .danger,
button.danger { background: rgba(239, 68, 68, .17) !important; color: #fecaca !important; border-color: rgba(239, 68, 68, .38) !important; box-shadow: none; }
.btn-small,
.btn.small,
.small { min-height: 32px; padding: 7px 10px; font-size: .84rem; }

.actions,
.toolbar,
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
}

.toolbar label {
  display: grid;
  gap: 4px;
  min-width: min(220px, 100%);
}

.inline-form { display: inline-flex; margin: 0; }
.pager { margin: 18px 0 0; color: var(--muted); }

.muted,
.text-muted { color: var(--muted); }
.warn { color: var(--warning); }
.success,
.text-success,
.pass { color: var(--success); }
.error,
.alert,
.fail,
.text-danger { color: #fca5a5; }

.notice,
.alert,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, .035);
}

.notice.success,
.success.notice { background: rgba(34, 197, 94, .10); border-color: rgba(34, 197, 94, .30); }
.notice.alert,
.alert.notice { background: rgba(239, 68, 68, .10); border-color: rgba(239, 68, 68, .30); }
.warn.notice,
p.warn { background: rgba(245, 158, 11, .10); border: 1px solid rgba(245, 158, 11, .28); border-radius: var(--radius); padding: 12px 14px; }

/* system50 readable utility defaults for neutral admin/owner surfaces. */
.form-note,
.help,
.hint { color: #374151; }
.toggle-line.is-disabled { color: #4b5563; opacity: 1; }

.empty-state,
.bd-empty {
  color: var(--muted);
  text-align: center;
  border-style: dashed;
}

.hidden { display: none !important; }

.form-grid,
.admin-form,
.restaurant-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px;
}

.admin-form label,
.restaurant-form label,
.form-grid label {
  display: grid;
  gap: 5px;
}

.admin-form .full,
.restaurant-form .full,
.form-grid .full,
.full { grid-column: 1 / -1; }

.switch-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}

.check-table,
.data-table,
.rtl-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(11, 13, 18, .42);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

.check-table th:first-child { border-top-left-radius: var(--radius-sm); }
.check-table th:last-child { border-top-right-radius: var(--radius-sm); }

.status-badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(201, 164, 76, .28);
  border-radius: 999px;
  background: rgba(201, 164, 76, .12);
  color: var(--gold-soft);
  padding: 3px 9px;
  font-size: .78rem;
  font-weight: 700;
}

.impersonation-banner {
  position: relative;
  z-index: 60;
  padding: 10px 18px;
  text-align: center;
  background: linear-gradient(90deg, #5b3a06, #8a6417);
  color: #fff7d2;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.impersonation-banner a { color: #fff; text-decoration: underline; }

.mobile-sidebar-toggle {
  display: none;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(255, 255, 255, .08);
  color: var(--cream);
  border-color: var(--border);
  box-shadow: none;
}

.mobile-sidebar-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  position: relative;
}

.mobile-sidebar-toggle span::before,
.mobile-sidebar-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-sidebar-toggle span::before { top: -6px; }
.mobile-sidebar-toggle span::after { top: 6px; }

.small-input { max-width: 180px; }

@media (max-width: 820px) {
  body { font-size: 15px; }
  .panel,
  .card { padding: 16px; }
  .toolbar { align-items: stretch; }
  .toolbar > * { flex: 1 1 190px; }
  .actions { align-items: stretch; }
  .actions > * { flex: 1 1 auto; }
  .check-table,
  .data-table,
  .rtl-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  th,
  td {
    min-width: 120px;
    padding: 10px 12px;
  }
  .mobile-sidebar-toggle { display: inline-flex; }
}

.public-auth-shell {
  --auth-bg: #f7f8fb;
  --auth-text: #101317;
  --auth-muted: #64707f;
  --auth-surface: rgba(255, 255, 255, .88);
  --auth-border: rgba(17, 24, 39, .11);
  --auth-accent: #0f766e;
  --auth-action: #111827;
  --auth-shadow: 0 22px 70px rgba(18, 27, 38, .12);
  position: relative;
  isolation: isolate;
}

.public-auth-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(15, 118, 110, .12), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(183, 121, 31, .10), transparent 28%),
    var(--auth-bg);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

.auth-panel-modern {
  width: min(100% - 24px, 480px);
  margin: clamp(28px, 8vh, 84px) auto;
  padding: clamp(22px, 6vw, 34px);
  border-radius: 8px;
  border: 1px solid var(--auth-border, rgba(17, 24, 39, .12));
  background: var(--auth-surface, #fff);
  color: var(--auth-text, #111827);
  box-shadow: var(--auth-shadow, 0 20px 60px rgba(15, 23, 42, .12));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-panel {
  width: min(100% - 24px, 560px);
  max-width: calc(100vw - 24px);
  margin: clamp(24px, 7vh, 72px) auto;
}

.auth-panel-modern .auth-eyebrow {
  margin: 0 0 8px;
  color: var(--auth-accent, #0f766e);
  font-size: .82rem;
  font-weight: 900;
}

.auth-panel-modern h1 {
  margin: 0 0 10px;
  color: #111827;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-panel-modern > p:not(.auth-eyebrow):not(.auth-register-link) {
  margin: 0 0 20px;
  color: #4b5563;
}

.auth-panel-modern label {
  color: #374151;
  font-weight: 800;
}

.auth-panel-modern input {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.auth-panel-modern button[type="submit"] {
  width: 100%;
  background: var(--auth-action, #111827);
  border-color: var(--auth-action, #111827);
  color: #fff;
}

.auth-register-link {
  margin: 16px 0 0;
  text-align: center;
}

.auth-register-link a {
  color: #111827;
  font-weight: 900;
}

.otp-panel { text-align: center; }
.otp-panel .muted { color: #6b7280; }
.otp-email {
  display: inline-flex;
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #f3f4f6;
  color: #111827 !important;
  font-weight: 900;
  overflow-wrap: anywhere;
  direction: ltr;
}
.otp-form {
  grid-template-columns: 1fr;
  justify-items: center;
}
.otp-boxes {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 62px));
  gap: clamp(8px, 3vw, 12px);
  justify-content: center;
  width: 100%;
  max-width: 300px;
  margin: 4px auto 2px;
}
.auth-panel-modern .otp-box {
  width: 100%;
  height: clamp(54px, 17vw, 66px);
  min-height: 54px;
  padding: 0;
  text-align: center;
  font-size: clamp(1.45rem, 8vw, 2rem);
  font-weight: 950;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}
.auth-panel-modern .otp-box:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, .12);
}
.otp-resend-form {
  grid-template-columns: 1fr;
  margin-top: 12px;
}
.otp-resend-form .button-light {
  width: 100%;
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
  box-shadow: none;
}

@media (max-width: 480px) {
  .auth-panel,
  .auth-panel-modern {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 18px auto;
    padding: 18px 14px;
  }

  .auth-panel h1,
  .auth-panel-modern h1 {
    font-size: clamp(1.55rem, 9vw, 2.2rem);
  }

  .auth-panel input,
  .auth-panel select,
  .auth-panel textarea,
  .auth-panel button,
  .auth-panel-modern input,
  .auth-panel-modern select,
  .auth-panel-modern textarea,
  .auth-panel-modern button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }

  .otp-boxes {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    max-width: 280px;
  }
}
