/* =========================================================
   FORGE COATINGS — admin dashboard styles
   ========================================================= */
:root {
  --red: #e30613;
  --red-dark: #b8050f;
  --black: #0b0b0c;
  --ink: #16171a;
  --muted: #62656d;
  --line: #e4e5e8;
  --bg: #f4f5f7;
  --card: #ffffff;
  --grid: #eceef1;

  /* status + event colors (always shown with a text label) */
  --s-new: #2563eb;      --s-new-bg: #e8effd;
  --s-contacted: #b45309; --s-contacted-bg: #fdf1e3;
  --s-quoted: #7c3aed;   --s-quoted-bg: #f1ebfd;
  --s-booked: #15803d;   --s-booked-bg: #e6f4ea;
  --s-lost: #6b7280;     --s-lost-bg: #eef0f2;

  --font-head: "Exo 2", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--muted); margin: 4px 0 0; }
a { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 9px; border: 1px solid transparent;
  font: 700 .92rem/1 var(--font-head); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; border-color: #cfd1d6; color: inherit; }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.topbar .btn-ghost { border-color: #3a3c42; color: #fff; }
.topbar .btn-ghost:hover { background: #1b1c20; }
.link-btn { background: none; border: 0; padding: 4px; font: 600 .9rem var(--font-body); color: var(--red); cursor: pointer; }
.link-btn.danger { color: #b42318; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: var(--bg); }

/* ---------- Top bar + tabs ---------- */
.topbar {
  background: var(--black); color: #fff; height: 64px; padding: 0 20px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 28px; }
.brand span { font: 700 .85rem/1 var(--font-head); letter-spacing: .28em; }
.badge-demo {
  font: 700 .7rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 9px; border: 1px dashed #6b6e75; border-radius: 6px; color: #c9ccd1;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar .link-btn { color: #c9ccd1; }

.tabs {
  position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; gap: 4px; padding: 0 20px; overflow-x: auto;
}
.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 16px 14px 13px;
  font: 600 .95rem var(--font-body); color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--red); }
.count {
  display: inline-block; min-width: 20px; padding: 2px 6px; margin-left: 4px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; text-align: center;
}
.count:empty { display: none; }

/* ---------- Layout ---------- */
.main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cols, .cols.three { grid-template-columns: 1fr; } }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi-value { font: 800 1.9rem/1.1 var(--font-head); }
.kpi-sub { color: var(--muted); font-size: .8rem; }
.up { color: var(--s-booked); font-weight: 700; }
.down { color: #b42318; font-weight: 700; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.list li:first-child { border-top: 0; }
.list li:hover { background: var(--bg); }
.list .main-txt { flex: 1; min-width: 0; }
.list .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { color: var(--muted); font-size: .85rem; }
.list .when { color: var(--muted); font-size: .85rem; white-space: nowrap; text-align: right; }
.list .empty-row { cursor: default; color: var(--muted); }
.list .empty-row:hover { background: none; }
.date-chip { width: 44px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; flex: none; }
.date-chip b { display: block; font: 800 1.1rem/1 var(--font-head); }
.date-chip small { font-size: .68rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* ---------- Status pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill.New { color: var(--s-new); background: var(--s-new-bg); }
.pill.Contacted { color: var(--s-contacted); background: var(--s-contacted-bg); }
.pill.Quoted { color: var(--s-quoted); background: var(--s-quoted-bg); }
.pill.Booked { color: var(--s-booked); background: var(--s-booked-bg); }
.pill.Lost { color: var(--s-lost); background: var(--s-lost-bg); }

/* ---------- Quotes table ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px;
  font: 600 .86rem var(--font-body); cursor: pointer; color: var(--ink);
}
.chips button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips button span { color: var(--muted); margin-left: 4px; }
.chips button.active span { color: #c9ccd1; }
.search { padding: 9px 12px; border: 1px solid #cfd1d6; border-radius: 9px; font: inherit; min-width: 240px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; background: #fafafb; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #fafafb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .who { font-weight: 600; }
.table .who small { display: block; color: var(--muted); font-weight: 400; }
.empty { padding: 30px; text-align: center; color: var(--muted); margin: 0; }
@media (max-width: 700px) {
  .search { min-width: 0; width: 100%; }
  .table thead { display: none; }
  .table tr { display: block; position: relative; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { display: inline; padding: 0; border: 0; color: var(--muted); font-size: .88rem; }
  .table td.who { display: block; padding-right: 96px; color: var(--ink); font-size: .95rem; margin-bottom: 2px; }
  .table td.who small { display: inline; margin-left: 6px; }
  .table td:nth-child(2)::after, .table td:nth-child(3)::after { content: " · "; }
  .table td:nth-child(5) { position: absolute; right: 16px; top: 12px; }
}

/* ---------- Charts ---------- */
.chart { position: relative; height: 180px; display: flex; gap: 0; padding-left: 34px; }
.chart.tall { height: 260px; }
.chart .gridline { position: absolute; left: 34px; right: 0; border-top: 1px solid var(--grid); }
.chart .gridline span { position: absolute; left: -34px; top: -8px; width: 28px; text-align: right; font-size: .72rem; color: var(--muted); }
.chart .bar-slot { flex: 1; display: flex; align-items: flex-end; padding: 0 1px; position: relative; z-index: 1; cursor: default; }
.chart .bar { width: 100%; background: var(--red); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .15s; }
.chart:hover .bar { opacity: .45; }
.chart .bar-slot:hover .bar { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; padding: 6px 0 0 34px; font-size: .72rem; color: var(--muted); }
.hbars { display: grid; gap: 12px; }
.hbar-row { display: grid; gap: 5px; }
.hbar-top { display: flex; justify-content: space-between; font-size: .9rem; }
.hbar-top b { font-weight: 700; }
.hbar-track { height: 8px; background: var(--grid); border-radius: 99px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--red); border-radius: 99px; }
.tooltip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--black); color: #fff;
  padding: 7px 10px; border-radius: 8px; font-size: .82rem; opacity: 0; transition: opacity .1s; white-space: nowrap;
}
.tooltip.show { opacity: 1; }
.tooltip b { display: block; font-size: 1rem; }

/* ---------- Reviews helper ---------- */
.review-msg { background: var(--bg); border-radius: 10px; padding: 14px; margin: 12px 0; font-size: .92rem; }
.quick-links { display: grid; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.quick-links a { color: var(--ink); font-weight: 600; text-decoration: none; font-size: .92rem; }
.quick-links a:hover { color: var(--red); }

/* ---------- Calendar ---------- */
.cal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-head h2 { font-size: 1.2rem; min-width: 170px; text-align: center; }
.cal-head .link-btn { margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow span { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: center; padding-bottom: 6px; }
.day {
  min-height: 96px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; background: #fff; min-width: 0;
}
.day:hover { border-color: #c4c6cb; }
.day.other { background: #fafafb; color: #a3a6ad; }
.day .num { font-size: .82rem; font-weight: 700; }
.day.today .num { background: var(--red); color: #fff; border-radius: 99px; width: 24px; height: 24px; display: grid; place-items: center; }
.ev {
  font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; border-left: 3px solid;
}
.more { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.t-estimate { --c: var(--s-new); --cb: var(--s-new-bg); }
.t-install { --c: var(--red); --cb: #fde8e9; }
.t-followup { --c: var(--s-contacted); --cb: var(--s-contacted-bg); }
.t-other { --c: var(--s-lost); --cb: var(--s-lost-bg); }
.ev { border-color: var(--c); background: var(--cb); color: var(--ink); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.type-tag { font-size: .72rem; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 620px) {
  .day { min-height: 58px; padding: 4px; }
  .ev { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--c); border-radius: 3px; }
  .more { display: none; }
}

/* ---------- Dialogs ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
.dialog::backdrop { background: rgba(11,11,12,.55); }
.dialog-body { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-head .icon-btn { border: 0; }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; padding: 14px; background: var(--bg); border-radius: 10px; font-size: .92rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 5px; font-size: .85rem; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 10px 12px; border: 1px solid #cfd1d6; border-radius: 8px; font: 400 .95rem var(--font-body); color: var(--ink); background: #fff;
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-grid :is(input, select, textarea):focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,6,19,.15); }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.dialog-actions .spacer { flex: 1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } .dialog-actions { flex-wrap: wrap; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--black); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600;
  transition: opacity .2s, transform .2s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 620px) {
  .badge-demo, .topbar .link-btn { display: none; }
  .main { padding-top: 20px; }
  h1 { font-size: 1.45rem; }
  .kpi-value { font-size: 1.5rem; }
}

/* Forge Pro Partners applications */
.pro-tag { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 4px; background: var(--black); color: #fff; font: 700 .65rem/1.2 var(--font-head); letter-spacing: .1em; vertical-align: 2px; }

/* ---------- Live site: sign in, settings, demo/live switches (Nov 2026) ---------- */
.booting .tabs, .booting .main, .locked .tabs, .locked .main { visibility: hidden; }
.live-only { display: none; }
body.live .live-only { display: inline-flex; }
body.live .demo-only { display: none; }
body.locked .topbar .live-only { display: none; }
.signed-in { color: #9a9da4; font-size: .85rem; align-items: center; }
@media (max-width: 700px) { .signed-in { display: none !important; } }

.auth { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px; background: #0b0b0c; overflow-y: auto; }
.auth-card { width: min(100%, 400px); background: #fff; color: var(--ink); border-radius: 16px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.auth-logo { width: 72px; height: auto; background: #0b0b0c; padding: 9px 11px; border-radius: 10px; }
.auth-card h1 { font: 800 1.6rem/1.15 var(--font-head); margin: 0; }
.auth-card .muted { margin: -6px 0 4px; }
.auth-card label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.auth-card input { font: inherit; font-weight: 400; padding: 11px 12px; border: 1px solid #cfd1d6; border-radius: 10px; width: 100%; }
.auth-card input:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
.auth-card .btn { width: 100%; justify-content: center; padding-block: 12px; }
.auth-card .btn:disabled { opacity: .6; cursor: wait; }
.auth-error { margin: 0; color: var(--red-dark); background: #fdeced; border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.auth-back { text-align: center; color: var(--muted); font-size: .88rem; text-decoration: none; }
.auth-back:hover { color: var(--ink); }

.set-block { display: grid; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.set-block h3 { margin: 0; font-size: 1rem; }
.set-block .btn { justify-self: start; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.user-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.user-list li span { overflow-wrap: anywhere; }
.chart-empty { margin: auto; color: var(--muted); font-size: .92rem; align-self: center; text-align: center; width: 100%; }
.small { font-size: .88rem; }

/* ---------- Pro Partners tab ---------- */
.kpis.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .kpis.three { grid-template-columns: 1fr; } }
.pill.Approved { color: var(--s-booked); background: var(--s-booked-bg); }
.pill.Notafit { color: var(--s-lost); background: var(--s-lost-bg); }
.kpi-sub .link-btn { font-size: inherit; padding: 0; }

/* ---------- Nov 11 polish ---------- */
.review-pending { background: var(--bg); border-radius: 10px; padding: 14px; margin: 12px 0; font-size: .92rem; color: var(--muted); }
.quick-links + .muted.small { margin-top: 10px; font-size: .8rem; }
