:root {
  --bg: #f6f3ed;
  --panel: #fffdfa;
  --panel-strong: #ffffff;
  --ink: #17201c;
  --muted: #68716d;
  --line: #dfd8cc;
  --accent: #0d766e;
  --accent-dark: #075e59;
  --gold: #b98935;
  --danger: #9f3434;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  /* Original login photograph, now served locally (the CRM loads nothing from third-party hosts). */
  background: linear-gradient(rgba(8,33,31,.72), rgba(8,33,31,.82)), url("/public/img/login-background.jpg");
  background-size: cover;
  background-position: center;
}
.login-card { width: min(440px, 100%); background: var(--panel-strong); border-radius: 8px; padding: 32px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.login-card h1, .topbar h1 { margin-bottom: 10px; font-size: 30px; }
.muted { color: var(--muted); }
.form-grid { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field span { color: #35423d; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); padding: 11px 12px; }
textarea { min-height: 92px; resize: vertical; }
.button, .nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
.button:hover { background: var(--accent-dark); }
.error { color: var(--danger); font-weight: 700; }
.success { color: #0d766e; font-weight: 700; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { background: #102c29; color: #f8f3ea; padding: 24px; }
.brand { display: grid; gap: 4px; margin-bottom: 30px; }
.brand strong { font-size: 20px; }
.brand span { color: #c2d6d1; font-size: 13px; }
.nav { display: grid; gap: 8px; }
.nav a, .nav button { width: 100%; justify-content: start; background: transparent; padding: 11px 12px; text-align: start; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.1); }
.main { padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.user-pill { border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: 9px 12px; color: #3c4944; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric, .panel { background: var(--panel-strong); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 28px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: start; vertical-align: top; }
th { color: #50605a; font-size: 12px; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; background: #e5f0ed; color: #125e56; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.quick-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}
.quick-band h2 { margin-bottom: 6px; }
.capture-wrap { max-width: 860px; margin: 0 auto; }
.capture-hero {
  margin-bottom: 16px;
  padding: 22px;
  border-radius: 8px;
  background: #102c29;
  color: #fffaf0;
}
.capture-hero h2 { margin-bottom: 8px; font-size: 28px; }
.capture-hero p { margin-bottom: 0; color: #d9e5e1; }
.capture-panel { padding: 22px; }
.capture-form { display: grid; gap: 16px; }
.capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.capture-submit {
  min-height: 54px;
  font-size: 18px;
}
@media (max-width: 900px) {
  .shell, .metrics, .two-column { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .sidebar { padding: 16px; }
  .brand { margin-bottom: 14px; }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav a, .nav button { justify-content: center; min-height: 48px; padding: 9px; font-size: 14px; }
  .main { padding: 18px; }
  .quick-band { grid-template-columns: 1fr; }
  .capture-grid { grid-template-columns: 1fr; }
  input, select, textarea { min-height: 48px; font-size: 16px; }
  .capture-submit { position: sticky; bottom: 12px; box-shadow: 0 12px 28px rgba(13, 118, 110, .28); }
}
@media (max-width: 560px) {
  .auth-page { padding: 16px; }
  .login-card { padding: 22px; }
  .topbar h1 { font-size: 24px; }
  .metrics { gap: 10px; }
  .metric, .panel, .capture-hero { padding: 16px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 10px 8px; }
}

/* Beautyworld Middle East 2026 quick lead capture (/beautyworld). Touch-first: every choice is a
   tall chip (real radio/checkbox inputs underneath, so keyboard and screen readers still work). */
.bw-wrap [hidden] { display: none !important; }
.bw-wrap .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.bw-form { display: grid; gap: 22px; }
.bw-section { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.bw-section > legend { margin: 0 0 8px; padding: 0; font-size: 15px; font-weight: 700; }
.bw-errors ul { margin: 6px 0 0; padding-inline-start: 20px; }
.bw-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.bw-chips--stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.bw-chip { position: relative; display: block; margin: 0; }
.bw-chip input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; }
.bw-chip span {
  display: flex; align-items: center; min-height: 52px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.25; cursor: pointer; user-select: none;
}
.bw-chip input:checked + span { border-color: #102c29; background: #102c29; color: #fffaf0; }
.bw-chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.bw-choice { display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.bw-choice input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: 0 0 auto; }
.bw-choice--disabled { color: var(--muted); background: #f4f0e8; cursor: not-allowed; }
.bw-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); min-height: 48px; }
.bw-secondary:hover { background: #f0ebe1; }
.bw-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 0 0 22px; }
.bw-summary dt { color: var(--muted); font-weight: 700; }
.bw-summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .bw-chips:not(.bw-chips--stack) .bw-chip { flex: 1 1 calc(50% - 10px); }
  .bw-chips--stack { grid-template-columns: 1fr; }
  .bw-chip span { min-height: 56px; }
  .bw-summary { grid-template-columns: 1fr; gap: 2px; }
  .bw-summary dd { margin-bottom: 12px; }
}
/* On phones/tablets the shared CRM header + two-column nav would push the form ~500px down the
   screen. For this page only (scoped with :has, so every other page is untouched): hide the
   workspace header, and turn the nav into one thin scrollable row. */
@media (max-width: 900px) {
  .shell:has(.bw-wrap) .topbar, .shell:has(.bw-wrap) .brand { display: none; }
  .shell:has(.bw-wrap) .sidebar { padding: 8px 12px; }
  .shell:has(.bw-wrap) .nav { display: flex; gap: 6px; overflow-x: auto; }
  .shell:has(.bw-wrap) .nav a, .shell:has(.bw-wrap) .nav button { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .shell:has(.bw-wrap) .nav form { flex: 0 0 auto; }
  .shell:has(.bw-wrap) .main { padding-top: 12px; }
}
@media (max-width: 900px) {
  /* Without minmax(0, ...) the no-wrap nav row's min-content would widen the whole grid column. */
  .shell:has(.bw-wrap) { grid-template-columns: minmax(0, 1fr); }
  .shell:has(.bw-wrap) .sidebar, .shell:has(.bw-wrap) .main { min-width: 0; }
}
/* Single-select vs multi-select must be unmistakable at a glance and when selected:
   single-select = pill with a round "radio" dot; multi-select = rounded square with a tick. */
.bw-chip span::before {
  content: ""; flex: 0 0 auto; width: 22px; height: 22px; margin-inline-end: 12px;
  border: 2px solid #9aa6a1; background: #fff;
}
.bw-chip--radio span::before { border-radius: 50%; }
.bw-chip--checkbox span::before { border-radius: 5px; }
.bw-chip--radio span { border-radius: 999px; padding-inline: 18px; }
.bw-chip input:checked + span { box-shadow: 0 0 0 2px #102c29; }
.bw-chip input:checked + span::before { border-color: #fffaf0; background-color: #fffaf0; }
.bw-chip--radio input:checked + span::before { background: radial-gradient(circle, #102c29 0 38%, #fffaf0 42%); }
.bw-chip--checkbox input:checked + span::before {
  background: #fffaf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23102c29' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
