/* PITCH Dashboard. Tokens follow the pitch-partners theme on pitchroofing.com. */

@font-face {
  font-family: "ABC Favorit";
  src: url("/fonts/abcfavorit-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #BA0000;
  --red-dark: #8f0000;
  --red-tint: #fbeaea;
  --ink: #0a0a0a;
  --ink-2: #2b2b29;
  --ink-3: #6b6b66;
  --paper: #fafaf7;
  --card: #ffffff;
  --line: #e6e6e2;
  --line-strong: #cfcfca;
  --good: #1f7a3a;
  --good-tint: #e6f3ea;
  --warn: #9a6400;
  --warn-tint: #fff4dc;
  --radius-card: 14px;
  --radius-control: 8px;
  --shadow-card: 0 1px 2px rgba(10, 10, 10, 0.06), 0 8px 24px rgba(10, 10, 10, 0.06);
  --font-head: "ABC Favorit", "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f3f3ef;
    --ink-2: #d4d4ce;
    --ink-3: #9d9d96;
    --paper: #0f0f0e;
    --card: #181817;
    --line: #2a2a28;
    --line-strong: #3b3b38;
    --red-tint: #2b0d0d;
    --good-tint: #0f2a18;
    --warn-tint: #2d2000;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px 0; line-height: 1.15; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--line); padding: 1px 5px; border-radius: 4px; }

/* Laser rule: the thin red line the site uses under headings and on cards */
.laser { position: relative; }
.laser::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 56px; height: 3px; background: var(--red); border-radius: 2px; }

/* App frame */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #f3f3ef; padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar { border-right: 1px solid var(--line); } }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; background: var(--red); border-radius: 8px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: #fff; font-size: 15px; letter-spacing: 0.02em; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #bdbdb7; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8d8d87; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #e8e8e3; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.active { background: var(--red); color: #fff; }
.nav a.soon { color: #7d7d77; cursor: default; }
.nav a.soon:hover { background: none; color: #7d7d77; }
.nav .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 14px; font-size: 13px; color: #bdbdb7; }
.sidebar-foot strong { color: #fff; display: block; }
.sidebar-foot form { margin-top: 8px; }

.main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 10px 0 0; color: var(--ink-3); max-width: 70ch; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 20px; }
.stat .label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.stat .value { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1; }
.stat .sub { color: var(--ink-3); font-size: 13px; margin-top: 8px; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.help { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-control);
  background: var(--card); color: var(--ink); font: inherit; font-size: 15px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); vertical-align: -3px; margin-right: 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 180px; margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.inline-form { display: inline; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-control); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-tint); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* Alerts and badges */
.flash { padding: 12px 16px; border-radius: var(--radius-control); margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--good-tint); color: var(--good); border-color: rgba(31, 122, 58, 0.3); }
.flash-warning { background: var(--warn-tint); color: var(--warn); border-color: rgba(154, 100, 0, 0.3); }
.flash-error { background: var(--red-tint); color: var(--red); border-color: rgba(186, 0, 0, 0.3); }
.flash ul { margin: 6px 0 0 18px; padding: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; border: 1px solid transparent; white-space: nowrap; }
.badge-on { background: var(--good-tint); color: var(--good); }
.badge-off { background: var(--line); color: var(--ink-3); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-red { background: var(--red-tint); color: var(--red); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px; border-bottom: 1px solid var(--line-strong); }
table.data td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data td .actions { margin-top: 6px; gap: 6px; }

/* Connector cards */
.connector { padding: 0; overflow: hidden; }
.connector summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.connector summary::-webkit-details-marker { display: none; }
.connector summary h3 { margin: 0; }
.connector summary .blurb { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.connector .status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.connector .body { padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.connector .meta { font-size: 13px; color: var(--ink-3); margin: 12px 0; }
.connector .error { background: var(--red-tint); color: var(--red); padding: 10px 12px; border-radius: var(--radius-control); font-size: 13px; margin-top: 10px; word-break: break-word; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 32px; border-top: 4px solid var(--red); }
.auth-card .brand { padding: 0; margin-bottom: 20px; color: var(--ink); }
.auth-card .brand-sub { color: var(--ink-3); }
.auth-card h1 { font-size: 22px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.auth-card .foot { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 26px; letter-spacing: 0.3em; text-align: center; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-control); margin: 12px 0; }
.qr svg { width: 220px; height: 220px; }

/* Empty state */
.empty { padding: 32px; text-align: center; color: var(--ink-3); }
.empty h3 { color: var(--ink); }

/* Pagination */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 16px 0 0; }
.pagination a, .pagination span { display: inline-block; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; font-size: 13px; }
.pagination .active span { background: var(--red); color: #fff; border-color: var(--red); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Spacing utilities (inline styles are blocked by the CSP) */
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-28 { margin-top: 28px; }

/* Sign out sits on the dark sidebar: light text and border there */
.sidebar-foot .btn-ghost { color: #f3f3ef; border-color: rgba(255, 255, 255, 0.35); }
.sidebar-foot .btn-ghost:hover { color: #fff; border-color: #fff; }
