/* JUARA CRM: cream and gold, following the approved CRM designs. No scripts anywhere. */
:root {
  --page: #f3f0ea; --card: #ffffff; --line: #e9e3d8; --soft: #f8f6f1;
  --ink: #17140f; --body: #4a443b; --muted: #6b6458;
  --gold: #9a6b0d; --gold-hover: #86600c; --gold-tint: #f6e7c1; --gold-ink: #7a5408;
  --ok: #1e6b34; --ok-tint: #e3f1e6; --warn: #9a3412; --warn-tint: #fbe4d8; --info: #1f3a5c; --info-tint: #e4eef8;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--gold-ink); }
a:hover { color: #5c3f06; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
h3 { margin: 20px 0 8px; font-size: 14px; font-weight: 600; color: var(--body); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }

/* Shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 240px; max-width: 100%; background: var(--card); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 18px; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px clamp(16px, 3vw, 36px) 48px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; padding: 6px; text-decoration: none; }
.brand img { display: block; height: 20px; width: auto; max-width: 100%; }
.auth .brand img { height: 24px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; color: var(--body); text-decoration: none; }
.nav:hover { background: var(--soft); color: var(--ink); }
.nav.on { background: var(--gold-tint); color: #5c3f06; font-weight: 600; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #141210; color: #e6b24a; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.me-text { display: flex; flex-direction: column; font-size: 14px; flex: 1; }
.me-text span { color: var(--muted); font-size: 12px; }
@media (max-width: 820px) {
  .side { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .me { margin-top: 0; border-top: 0; padding: 0; }
}

/* Building blocks */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; }
.crumb { margin: 0; font-size: 14px; }
.crumb a { text-decoration: none; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 640px; }
.panel.highlight { background: var(--gold-tint); border-color: #ebd7a4; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.cols > .panel { flex: 1 1 360px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.kpi:hover { border-color: #d5cbb8; color: var(--ink); }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi strong { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; }
.kpi em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--gold-ink); }
.kpi.gold { background: var(--gold-tint); border-color: #ebd7a4; }
.kpi.gold span { color: var(--gold-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--gold); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--gold-hover); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid #e2dcd0; font-weight: 500; }
.btn.ghost:hover { background: #faf7f1; color: var(--ink); }
.link { background: none; border: 0; padding: 4px 0; min-height: 32px; font: inherit; font-size: 14px; color: var(--gold-ink); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--warn); }
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 20px; white-space: nowrap; background: #f3f0ea; color: var(--body); }
.chip.gold, .st-qualified { background: var(--gold-tint); color: var(--gold-ink); }
.st-new { background: var(--warn-tint); color: var(--warn); }
.st-contacted, .st-invited { background: var(--info-tint); color: var(--info); }
.st-closed, .st-disabled { background: #f3f0ea; color: var(--body); }
.st-active { background: var(--ok-tint); color: var(--ok); }
.flash { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--ok-tint); color: var(--ok); font-weight: 500; }
.alert { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--warn-tint); color: var(--warn); }
.empty { color: var(--muted); padding: 18px 22px; margin: 0; }
.panel > .empty { padding: 0; }

/* Lists and tables */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 9px; text-decoration: none; color: var(--body); font-size: 14px; font-weight: 500; }
.tabs a.on { background: #141210; color: #fff; }
.search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 460px; }
.search input { flex: 1; min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 12px 16px; background: var(--soft); white-space: nowrap; }
td { padding: 13px 16px; border-top: 1px solid #efeae0; vertical-align: top; }
td a { text-decoration: none; color: var(--ink); }
td a:hover { text-decoration: underline; }
.rows, .people { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #efeae0; }
.rows li:first-child { border-top: 0; }
.rows li > a { flex: 1; text-decoration: none; color: var(--ink); min-width: 0; }
.people li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid #efeae0; }
.people li:first-child { border-top: 0; }
.facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.prose { margin: 0; overflow-wrap: anywhere; }
.notes { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.add { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.add summary { cursor: pointer; font-weight: 600; color: var(--gold-ink); min-height: 32px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.form .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #d9d1c2; border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--gold); }
.form .btn { align-self: flex-start; }

/* Sign-in pages */
body.plain { display: flex; justify-content: center; padding: 48px 16px; }
.auth { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.auth:has(.wide) { max-width: 620px; }
.auth .brand { padding: 0; font-size: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.card h1 { font-size: 24px; }
.card p { margin: 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; line-height: 1.55; }
.key { display: block; margin: 8px 0; padding: 12px 14px; background: var(--soft); border: 1px dashed #d5cbb8; border-radius: 10px; font-size: 17px; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.key.wrap { font-size: 14px; letter-spacing: 0; }
.fine { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }

/* Quotation builder and review */
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (min-width: 1100px) { .sticky { position: sticky; top: 16px; align-self: flex-start; } }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.pkgs { border: 0; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pkgs legend { font-size: 14px; font-weight: 600; color: var(--body); margin-bottom: 8px; }
.pkg { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid #e2dcd0; border-radius: 14px; cursor: pointer; }
.pkg.on { border: 2px solid var(--gold); background: #fffbf2; padding: 13px; }
.pkg-top { display: flex; align-items: center; gap: 8px; }
.pkg-top input { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); margin: 0; }
.pkg-price { font-size: 18px; font-weight: 600; }
.feats { list-style: none; margin: 0; padding: 0; }
.feats li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #efeae0; flex-wrap: wrap; }
.feats li:first-child { border-top: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 260px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; accent-color: var(--gold); flex: none; }
.block { display: block; }
.qty { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.qty input, .short { width: 72px; min-height: 36px; padding: 6px 8px; }
.amt { white-space: nowrap; font-size: 14px; }
.addsol { min-height: 56px; border: 2px dashed #cdbf9f; border-radius: 18px; background: transparent; font: inherit; font-weight: 600; color: var(--gold-ink); cursor: pointer; }
.addsol:hover { background: #fffbf2; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin-top: 10px; }
.row-wrap .check { flex: 0 1 auto; }
.inline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tp { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin: 0 0 14px; font-size: 14px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum .sub { font-size: 12px; }
.sum .strong { color: var(--ink); font-weight: 600; font-size: 15px; border-top: 1px solid var(--line); padding-top: 8px; }
.panel.dark { background: #141210; border-color: #141210; color: #fff; }
.panel.dark .sum dt { color: #b9ae98; }
.panel.dark a { color: #e6b24a; }
.panel.warnbox { background: #fff7f3; border-color: #f2c4ae; }
.panel.warnbox h2 { color: var(--warn); }
.tight { margin: 6px 0 0; padding-left: 18px; }
.btn.wide { width: 100%; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pad { padding: 16px 22px; margin: 0; }
tr.tot td { font-weight: 600; background: #fffbf2; }
.small-kpis .kpi strong { font-size: 20px; }
.alert ul { margin-top: 4px; }
.main-col { flex: 999 1 560px; }
.side-col { flex: 1 1 320px; }
.chip.internal { background: #141210; color: #e6b24a; }

/* Approval and issue */
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.inline-form { display: inline-block; margin: 0; }
.status-panel { border-color: #ebd7a4; }
.cancel-row { margin-top: 10px; }
.form .check, .status-panel .check { flex: 0 0 auto; }
table.rates { min-width: 1000px; }
table.rates td:first-child { min-width: 150px; }
table.rates td:nth-child(2) input { width: 120px; }
table.rates td:nth-child(3) input { min-width: 240px; }
table.rates input[type="checkbox"] { margin: 10px auto 0; display: block; }
table.rates td { vertical-align: middle; }
