/* Ambre Blends wholesale portal — self-contained brand stylesheet.
   No build step; brand palette via custom properties. */

:root {
  --brand: #603820;
  --brand-dark: #4a2b18;
  --brand-tint: #f3ece3;
  --paper: #fbf8f4;
  --card: #ffffff;
  --ink: #2a231d;
  --muted: #6f645a;
  --line: #e7ddd0;
  --danger: #b3261e;
  --danger-tint: #fbeceb;
  --ok: #3f6f4a;
  --ok-tint: #eaf3ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(42, 35, 29, .06), 0 8px 24px rgba(42, 35, 29, .05);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--brand-dark); line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .25rem; }
h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* Layout ---------------------------------------------------------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: 1040px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.brandmark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--brand-dark);
}
.brandmark:hover { text-decoration: none; }
.brandmark .tile {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); color: var(--brand-tint);
  display: grid; place-items: center; font-size: 1.05rem;
}
.site-nav { display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--muted);
  padding: .4rem .7rem;
  border-radius: 8px;
  font-size: .95rem;
}
.site-nav a:hover { background: var(--brand-tint); color: var(--brand-dark); text-decoration: none; }
.site-nav a.active { background: var(--brand-tint); color: var(--brand-dark); }
.site-nav .who { color: var(--muted); font-size: .875rem; padding-left: .5rem; }

.container { max-width: 1040px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.narrow { max-width: 560px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  padding: 1.5rem;
}

/* Cards ----------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card.pad-lg { padding: 2rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }

/* Tiles ----------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.tile-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform .1s ease, border-color .1s ease;
}
.tile-link:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--brand); }
.tile-link .t { font-family: var(--serif); font-size: 1.15rem; color: var(--brand-dark); margin-bottom: .25rem; }
.tile-link .d { color: var(--muted); font-size: .9rem; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand);
  padding: .65rem 1.2rem;
  border-radius: 9px;
  font-size: .98rem; font-weight: 500;
  cursor: pointer;
  transition: background .1s ease;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn.sm { padding: .4rem .8rem; font-size: .875rem; }

/* Forms ----------------------------------------------------------------- */
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 500; margin-bottom: .35rem; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
textarea { min-height: 4.5rem; resize: vertical; }
.qty-input { max-width: 90px; text-align: center; }
.error { color: var(--danger); font-size: .85rem; margin-top: .35rem; }
.checkline { display: flex; align-items: center; gap: .5rem; }
.checkline input { width: auto; }

/* Alerts ---------------------------------------------------------------- */
.alert { border-radius: 9px; padding: .85rem 1rem; margin-bottom: 1.25rem; font-size: .95rem; }
.alert.ok { background: var(--ok-tint); color: var(--ok); border: 1px solid #cfe3d4; }
.alert.err { background: var(--danger-tint); color: var(--danger); border: 1px solid #f2cfcc; }

/* Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: none; }

/* Badges ---------------------------------------------------------------- */
.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; text-transform: capitalize;
}
.badge.new { background: var(--brand-tint); color: var(--brand-dark); }
.badge.confirmed { background: #e6eef7; color: #1c4e80; }
.badge.shipped { background: var(--ok-tint); color: var(--ok); }
.badge.pending { background: #fdf1dd; color: #8a5a12; }
.badge.approved { background: #e6eef7; color: #1c4e80; }
.badge.active { background: var(--ok-tint); color: var(--ok); }
.badge.denied { background: var(--danger-tint); color: var(--danger); }

/* Definition rows ------------------------------------------------------- */
dl.rows { margin: 0; }
dl.rows > div { display: flex; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
dl.rows > div:last-child { border-bottom: none; }
dl.rows dt { color: var(--muted); min-width: 160px; margin: 0; }
dl.rows dd { margin: 0; white-space: pre-line; }

/* Wizard ---------------------------------------------------------------- */
.progress { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.progress .bar { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s ease; }
.policy-text {
  white-space: pre-line;
  background: var(--brand-tint);
  border-radius: 9px;
  padding: 1.25rem;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
}

.stack-sm > * + * { margin-top: .5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* Two-column field grid (collapses on small screens) */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.15rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.req { color: var(--danger); }
input[type=file] { width: 100%; font: inherit; padding: .5rem 0; }
.section-label { font-family: var(--serif); color: var(--brand-dark); font-size: 1.05rem; margin: 1.5rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.section-label:first-child { margin-top: 0; }

/* Signature-style initials field (onboarding policy wizard) --------------- */
.signature-field { max-width: 360px; margin: .25rem 0 0; }
.signature-field .sig-label { font-size: .95rem; font-weight: 500; margin-bottom: .5rem; }
.signature-line {
  display: flex; align-items: flex-end; gap: .55rem;
  border-bottom: 2px solid var(--brand-dark);
  padding: .1rem .5rem .3rem;
}
.signature-line .x {
  font-family: var(--serif); font-size: 1.4rem; color: var(--muted);
  line-height: 1; padding-bottom: .3rem; user-select: none;
}
/* Higher specificity than the base input rules so the box styling is stripped. */
.signature-line input.sig {
  flex: 1; min-width: 0;
  border: 0; background: transparent; border-radius: 0;
  padding: 0; margin: 0;
  font-family: "Snell Roundhand", "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: 2.2rem; line-height: 1.3; letter-spacing: .06em;
  color: var(--brand-dark); text-transform: uppercase;
}
.signature-line input.sig:focus { outline: none; border: 0; box-shadow: none; background: transparent; }
.signature-caption { color: var(--muted); font-size: .8rem; margin-top: .5rem; }
