/*
  Business Salahkaar Club: app theme.
  Taken from the live website (salahkaarclub.com): emerald #031B17 header and text, gold #D4AF37 accents,
  cream backgrounds. Type (changed 1 Nov 2026 at the client's request): Inter for body and interface, Plus Jakarta Sans
  for headings and the brand name, Noto Sans Devanagari for Hindi.
  Gold is for fills, lines and hover; text on white stays emerald so it keeps its contrast.
*/
:root {
  --emerald: #031b17;
  --emerald-2: #0b2d27;       /* lifted emerald for hover / active surfaces */
  --gold: #d4af37;
  --gold-soft: #f3e6b3;       /* tint for highlights and selected rows */
  --cream: #f8f6f2;
  --white: #ffffff;
  --ink: var(--emerald);
  --muted: #4d625d;
  --line: #d9dcd7;
  --line-strong: var(--emerald);

  --ok: #1f7a3d;  --ok-bg: #e4f3e9;
  --warn: #8a5a00; --warn-bg: #fbefd2;
  --bad: #b3261e; --bad-bg: #fbe4e2;

  --font-body: "Inter", "Plus Jakarta Sans", "Poppins", "Noto Sans Devanagari", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-brand: "Cinzel", Georgia, serif;
  --font-heading: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-dashboard: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-editorial: "Playfair Display", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --radius-s: 4px; --radius-m: 12px; --radius-l: 18px;
  --container: 1200px;
  --header-h: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex; flex-direction: column; min-height: 100vh;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -0.025em; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; }
h4, h5 { font-family: var(--font-body); font-weight: 600; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--emerald); text-underline-offset: 3px; }
a:hover { color: var(--emerald-2); text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .9em; }
.gold-line { width: 40px; height: 2px; background: var(--gold); border-radius: 2px; margin: 0 0 18px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
main { flex: 1; padding-block: 32px 56px; }

/* header: same bar as the website */
.bsc-header { background: var(--emerald); min-height: var(--header-h); position: relative; z-index: 20; padding-top: env(safe-area-inset-top, 0px); }
.bsc-header-bar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bsc-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.bsc-brand img { width: 48px; height: 48px; object-fit: contain; }
.bsc-brand-name { font-family: var(--font-brand); font-weight: 800; font-size: 21px; line-height: 1.05; letter-spacing: -0.01em; color: var(--gold); }
.bsc-brand-sub { display: block; font: 400 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-top: 3px; }
.bsc-nav { display: flex; align-items: center; gap: 26px; }
.bsc-nav a { position: relative; color: var(--white); text-decoration: none; font-weight: 500; font-size: 14px; padding-block: 6px; }
.bsc-nav a::after { content: ""; position: absolute; left: 0; bottom: 1px; width: 0; height: 2px; background: var(--gold); border-radius: 10px; transition: width .25s ease; }
.bsc-nav a:hover, .bsc-nav a[aria-current="page"] { color: var(--gold); }
.bsc-nav a:hover::after, .bsc-nav a[aria-current="page"]::after { width: 100%; }
.bsc-nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.bsc-nav-toggle span { display: block; width: 24px; height: 3px; background: var(--gold); border-radius: 10px; margin: 5px 0; }
@media (max-width: 860px) {
  .bsc-nav-toggle { display: block; }
  .bsc-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--emerald); flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 20px 22px; border-top: 1px solid rgba(212,175,55,.35); }
  .bsc-nav.open { display: flex; }
  .bsc-nav a { padding-block: 10px; font-size: 16px; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-s); font: 600 14px var(--font-body); text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn-gold { background: var(--gold); color: var(--emerald); }
.btn-gold:hover { background: var(--white); color: var(--emerald); border-color: var(--gold); }
.btn-dark { background: var(--emerald); color: var(--white); }
.btn-dark:hover { background: var(--emerald-2); color: var(--gold); }
.btn-outline { background: transparent; color: var(--emerald); border-color: var(--emerald); }
.btn-outline:hover { background: var(--emerald); color: var(--gold); }
.btn-danger { background: var(--bad); color: var(--white); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* panels and tables */
.panel { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-m); padding: 22px; }
.panel-soft { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; }
.panel-accent { border-left: 3px solid var(--emerald); border-radius: 0 var(--radius-m) var(--radius-m) 0; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--cream); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfaf3; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* badges (status): meaning is in the text as well as the colour */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font: 600 12px var(--font-body); background: var(--cream); color: var(--emerald); border: 1px solid var(--line); }
.badge-gold { background: var(--gold-soft); border-color: var(--gold); }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 500; font-size: 14px; }
.input, .select, .textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--white); color: var(--ink); font: 400 15px var(--font-body); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.help { font-size: 13px; color: var(--muted); }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--bad); font-size: 13px; }
.alert { padding: 12px 16px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--white); margin-bottom: 16px; }
.alert-success { background: var(--ok-bg); border-color: var(--ok); }
.alert-warning { background: var(--warn-bg); border-color: var(--warn); }
.alert-error { background: var(--bad-bg); border-color: var(--bad); }

/* admin shell: sidebar like a darker version of the header */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0; flex: 1; }
.shell-side { background: var(--emerald); padding: 20px 12px; }
.shell-side a { display: block; padding: 10px 14px; border-radius: var(--radius-s); color: var(--white); text-decoration: none; font-size: 14px; font-weight: 500; }
.shell-side a:hover { background: var(--emerald-2); color: var(--gold); }
.shell-side a[aria-current="page"] { background: var(--emerald-2); color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.shell-side .group { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.5); padding: 16px 14px 6px; }
.shell-main { padding: 28px 24px 56px; min-width: 0; }
@media (max-width: 860px) { .shell { grid-template-columns: minmax(0, 1fr); } .shell-side { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; } .shell-side .group { display: none; } }

/* footer */
.bsc-footer { background: var(--emerald); color: rgba(255,255,255,.75); font-size: 13px; padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
.bsc-footer a { color: var(--gold); text-decoration: none; font-weight: 500; }
.bsc-footer a:hover, .bsc-footer a[aria-current="page"] { color: var(--white); text-decoration: underline; }
.bsc-footer-links { gap: 20px; }
@media (max-width: 600px) {
  .bsc-footer-links { gap: 12px 16px; }
}

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

/* sign-in, sign-up and account pages (django-allauth screens restyled) */
.auth-wrap { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.auth-card { padding: 28px 26px; }
.auth-title { font-size: 28px; margin-bottom: .3em; }
.auth-h2 { font-size: 20px; }
.auth-card p { margin: 0 0 14px; }
.auth-card form p { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.auth-card label { font-weight: 500; font-size: 14px; }
.auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), .auth-card select, .auth-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--white); color: var(--ink); font: 400 15px var(--font-body);
}
.auth-card input:focus, .auth-card select:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.auth-card form p:has(input[type="checkbox"]) { flex-direction: row; align-items: flex-start; gap: 10px; }
.auth-card input[type="checkbox"] { margin-top: 5px; accent-color: var(--emerald); width: 16px; height: 16px; flex: none; }
.auth-card form p:has(input[type="checkbox"]) label { font-weight: 400; }
.auth-card .helptext, .auth-card form p span:not(.errorlist) { font-size: 13px; color: var(--muted); }
.auth-card .btn { width: 100%; }
.auth-card .row .btn { width: auto; flex: 1 1 auto; }
.auth-card .btn-provider { gap: 10px; }
.auth-hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-card ul.errorlist, .auth-card .errorlist { margin: 0 0 4px; }
.verify-banner { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.code-box { display: inline-block; padding: 6px 12px; background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: var(--radius-s); font: 600 16px var(--font-mono); letter-spacing: .12em; }

/* team panel: breadcrumbs, toolbars, checkbox lists, action rows */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-current] { color: var(--ink); font-weight: 500; }
.crumbs .sep { color: var(--line); }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.toolbar .field { margin: 0; min-width: 160px; }
.toolbar .field.grow { flex: 1 1 240px; }
.pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 4px; font-size: 13px; color: var(--muted); }
.pager .row { gap: 8px; }
.checks ul { list-style: none; margin: 0; padding: 12px; display: grid; gap: 6px 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white); max-height: 320px; overflow: auto; }
.checks li label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.checks input[type="checkbox"], .field-check input[type="checkbox"] { accent-color: var(--emerald); width: 16px; height: 16px; margin-top: 4px; flex: none; }
.field-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
form.inline { display: inline; margin: 0; }
.form-card { max-width: 640px; }
.muted-row { opacity: .6; }
.secret-box { padding: 14px 16px; border: 1px dashed var(--gold); background: var(--gold-soft); border-radius: var(--radius-s); }
.kv { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.htmx-request .table-wrap { opacity: .6; transition: opacity .15s; }
@media (max-width: 640px) { .kv { grid-template-columns: minmax(0, 1fr); } }

/* signed-in customer pages: account tabs (top on phones, left on wide screens) */
.dash { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.dash-nav a { padding: 10px 14px; border-radius: var(--radius-s); text-decoration: none; font-weight: 500; font-size: 14px; border-left: 3px solid transparent; }
.dash-nav a:hover { background: var(--white); }
.dash-nav a[aria-current="page"] { background: var(--white); border-left-color: var(--gold); }
.dash-main { min-width: 0; }
@media (max-width: 760px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dash-nav { flex-direction: row; position: static; overflow-x: auto; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .dash-nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; border-radius: 0; }
  .dash-nav a[aria-current="page"] { background: transparent; border-bottom-color: var(--gold); }
}
.empty-state { border: 1px dashed var(--line-strong); border-radius: var(--radius-m); padding: 28px 24px; text-align: center; background: var(--white); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-state h3 { margin: 0; font-size: 19px; }
.empty-state p { margin: 0 0 8px; max-width: 46ch; }

/* public header (visitors who are not signed in): brand + sign-in buttons only */
.bsc-header-actions { display: flex; gap: 10px; align-items: center; }
.btn-ghost-light { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .45); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); color: var(--gold); border-color: var(--gold); }
@media (max-width: 520px) { .bsc-brand-sub { display: none; } .bsc-brand-name { font-size: 17px; } }
[x-cloak] { display: none !important; }

/* form action groups: spaced buttons on every form (allauth pages, app forms) */
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.auth-card .form-actions { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 14px; }
.auth-card .form-actions .btn { width: 100%; }
.auth-card form + form, .auth-card form + .form-actions { margin-top: 10px; }
/* entrance hold on public and sign-in pages (removed by motion-ui.js) */
.motion-pending main > .container > * { opacity: 0; }

/* form details found in the visual check */
/* checkbox before its label on allauth forms (Django puts the label first) */
.auth-card form p:has(input[type="checkbox"]) { flex-direction: row-reverse; justify-content: flex-end; align-items: flex-start; }
/* password rules and other help lists stay small and close to their field */
.auth-card form p ul, .auth-card .helptext ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.auth-card form p:has(ul) { margin-bottom: 12px; }
/* file inputs: a real button instead of the browser default */
input[type="file"] { padding: 6px; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border: 1px solid var(--emerald); border-radius: var(--radius-s);
  background: var(--white); color: var(--emerald); font: 600 13px var(--font-body); cursor: pointer;
  transition: background .2s, color .2s;
}
input[type="file"]::file-selector-button:hover { background: var(--emerald); color: var(--gold); }
/* headings inside form cards keep breathing room above the first field */
.form-card > h3, .panel-soft > form > h3, form.panel-soft > h3, form.panel > h3 { margin: 0 0 14px; }
/* allauth fields rendered as .field blocks (templates/allauth/elements/fields.html) */
.auth-card .field { margin-bottom: 14px; }
.auth-card .field-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.auth-card .field-check label { font-weight: 400; }
.auth-card .helptext { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.auth-card .helptext ul { margin: 4px 0 0; padding-left: 18px; }

/* Inter: tabular digits so amounts and counts line up in tables and stat tiles */
body { font-feature-settings: "cv11", "ss01"; }
.table, .count, .code-box, .app-content h3 { font-variant-numeric: tabular-nums; }

/* ===== modern controls (all pages): softer borders, rounded, gold focus ring ===== */
.input, .select, .textarea,
.auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="file"]),
.auth-card select, .auth-card textarea {
  min-height: 44px; padding: 10px 14px; border: 1px solid rgba(3, 27, 23, .16); border-radius: 12px;
  background-color: var(--white); color: var(--ink); font: 400 15px var(--font-body);
  box-shadow: 0 1px 2px rgba(3, 27, 23, .05); transition: border-color .15s ease, box-shadow .15s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: rgba(3, 27, 23, .28); }
.input:focus, .select:focus, .textarea:focus,
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 175, 55, .18);
}
.input::placeholder, .textarea::placeholder, .auth-card input::placeholder { color: #8a9a96; }
.textarea, .auth-card textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234d625d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input[readonly], .input:disabled { background-color: var(--cream); color: var(--muted); }
.btn { border-radius: 10px; min-height: 42px; }
.btn-sm { min-height: 34px; border-radius: 9px; }
.btn-outline { background: var(--white); color: var(--ink); border-color: rgba(3, 27, 23, .18); box-shadow: 0 1px 2px rgba(3, 27, 23, .05); }
.btn-outline:hover { background: var(--white); color: var(--emerald); border-color: var(--gold); }
.btn-gold { box-shadow: 0 1px 2px rgba(3, 27, 23, .08), inset 0 -1px 0 rgba(3, 27, 23, .12); }
.btn-danger { border-radius: 10px; }
.errorlist { font-size: 13px; }

/* Quote revision modal dialog */
dialog.quote-history-dialog {
  margin: auto;
  border: none;
  padding: 0;
  background: transparent;
  outline: none;
}
dialog.quote-history-dialog::backdrop {
  background: rgba(3, 27, 23, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
dialog.quote-history-dialog[open] {
  animation: dialog-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dialog-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
