/* uQualify Admin — built on the dashboard design (north star): left rail,
   Overview header, action pills, teal cards, list rows, right help column. */
@font-face { font-family: "Outfit"; font-weight: 300; font-display: swap; src: url("../fonts/Outfit-Light.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url("../fonts/Outfit-Regular.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("../fonts/Outfit-Medium.woff2") format("woff2"); }

:root {
  --teal-900: #122d2e; --teal-800: #1b3436; --teal-700: #273b3d; --teal-650: #264a4c; --teal-500: #4b8487;
  --slate-500: #546f71; --slate-400: #6a8486; --slate-300: #92b6b9; --slate-100: #b6dadd;
  --aqua-400: #6cb7bb; --aqua-300: #8ae0e5; --mint: #9fe7df;
  --white: #fff; --paper: #f6f8f8; --line: #e4eaea; --text: #1d2a2b; --text-soft: #4f5d5e;
  --danger: #8a2d22; --danger-bg: #fbe9e7; --ok-bg: rgba(138,224,229,.22);
  --font: "Outfit", "Strawford", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 64px; --aside: 300px; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-weight: 300; font-size: 15px; line-height: 1.5; color: var(--text); background: var(--white); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 300; color: var(--teal-700); line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; font-weight: 400; }
p { margin: 0; }
a { color: var(--teal-500); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--aqua-300); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.noscript { padding: 40px; text-align: center; }

.label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate-400); font-weight: 400; }
.muted { color: var(--slate-400); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--teal-700); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .logo svg { height: 22px; width: auto; }
.auth-side h2 { color: #fff; font-size: 34px; max-width: 14ch; }
.auth-side p { color: rgba(255,255,255,.7); margin-top: 14px; max-width: 36ch; }
.auth-side small { color: rgba(255,255,255,.45); font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-soft); margin-bottom: 22px; }
@media (max-width: 800px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-top: 16px; }
.field label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-400); font-weight: 400; }
.field input, .field select, .field textarea { font: inherit; font-weight: 300; font-size: 15px; color: var(--text); background: #fff; border: 1px solid #d5dfdf; border-radius: 10px; padding: 11px 13px; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--aqua-400); box-shadow: 0 0 0 4px rgba(138,224,229,.3); }
.field input.code { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-soft); margin-top: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; min-height: 42px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-weight: 400; font-size: 14px; line-height: 1; cursor: pointer; transition: background .2s, transform .2s; background: var(--paper); color: var(--teal-700); }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-800); }
.btn-mint { background: var(--mint); color: var(--teal-800); }
.btn-outline { background: #fff; border-color: #d5dfdf; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 22px; }
.link-btn { background: none; border: 0; color: var(--teal-500); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; }

.alert { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-ok { background: var(--ok-bg); color: var(--teal-700); }
.alert-info { background: var(--paper); color: var(--text-soft); border: 1px solid var(--line); }

/* ---------- shell (north star) ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 22px 0; gap: 10px; position: sticky; top: 0; height: 100vh; background: #fff; }
.rail .mark { height: 18px; width: auto; color: var(--teal-700); margin-bottom: 40px; }
.rail a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--slate-400); text-decoration: none; position: relative; }
.rail a:hover { background: var(--paper); color: var(--teal-700); }
.rail a.active { background: rgba(138,224,229,.35); color: var(--teal-700); }
.rail a svg { width: 18px; height: 18px; }
.rail a .tip { position: absolute; left: 50px; top: 50%; transform: translateY(-50%); background: var(--teal-700); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; }
.rail a:hover .tip, .rail a:focus-visible .tip { opacity: 1; }
.rail .spacer { flex: 1; }
.rail .badge { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--teal-500); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) var(--aside); min-height: 100vh; }
.main.no-aside { grid-template-columns: minmax(0, 1fr); }
.content { padding: 32px 36px 48px; min-width: 0; }
.aside { border-left: 1px solid var(--line); background: var(--paper); padding: 32px 22px; }
@media (max-width: 1080px) { .main { grid-template-columns: 1fr; } .aside { border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 700px) { .content { padding: 20px 16px 40px; } :root { --rail: 52px; } .rail a { width: 36px; height: 36px; } }

.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar .user { font-size: 13px; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; background: #fff; color: var(--teal-700); display: inline-flex; gap: 8px; align-items: center; }
.topbar .user b { font-weight: 400; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 26px; }
.pill { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--teal-700); background: #fff; text-decoration: none; cursor: pointer; }
.pill:hover, .pill.active { border-color: var(--aqua-400); background: rgba(138,224,229,.14); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 10px; }
.card { border-radius: 8px; padding: 14px 16px; color: #fff; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(135deg, #5d9a9d, #3f7b7e); text-decoration: none; }
.card:nth-child(2) { background: linear-gradient(135deg, #6aa7aa, #4b8487); }
.card:nth-child(3) { background: linear-gradient(135deg, #4f8b8e, #3a7174); }
.card:nth-child(4) { background: linear-gradient(135deg, #5a9598, #447f82); }
.card small { font-size: 11px; opacity: .85; letter-spacing: .04em; }
.card b { font-weight: 400; font-size: 24px; }

.section-label { margin: 26px 0 6px; }
.list { border-top: 1px solid var(--line); }
.list-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-row:hover { background: var(--paper); }
.list-row .t { font-size: 15px; color: var(--teal-700); }
.list-row .s { font-size: 11px; color: var(--slate-400); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.list-row .v { font-size: 13px; color: var(--teal-700); text-align: right; }
.list-row .p { font-size: 12px; color: var(--slate-400); }
.empty { padding: 32px 0; color: var(--slate-400); text-align: center; }

.status { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--paper); color: var(--teal-700); border: 1px solid var(--line); }
.status-new { background: rgba(138,224,229,.3); border-color: transparent; }
.status-contacted { background: #e8f1f1; } .status-qualified { background: #d9ecec; } .status-invited { background: var(--mint); border-color: transparent; }
.status-lost { background: #f1f1f1; color: var(--slate-400); } .status-spam { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; }
.box + .box { margin-top: 12px; }
.box h4 { margin-bottom: 6px; }
.box .row-link { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--teal-700); text-decoration: none; }
.box .row-link:first-of-type { border-top: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-400); font-weight: 400; white-space: nowrap; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: var(--paper); }
td a { color: var(--teal-700); text-decoration: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 14px; }
.filters .field { margin: 0; min-width: 150px; }
.filters .field input, .filters .field select { padding: 8px 10px; font-size: 14px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--slate-400); }

/* ---------- detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 12px; }
.detail-grid dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-400); }
.detail-grid dd { margin: 2px 0 0; font-size: 15px; word-break: break-word; }
.detail-grid .wide { grid-column: 1 / -1; }
.message { white-space: pre-wrap; background: var(--paper); border-radius: 10px; padding: 14px; margin-top: 6px; }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note .meta { font-size: 12px; color: var(--slate-400); margin-bottom: 4px; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; list-style: none; }
.timeline { padding: 0; margin: 8px 0 0; }
.timeline .when { color: var(--slate-400); font-size: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #d5dfdf; border-radius: 10px; background: #fff; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--slate-400); text-decoration: none; margin-bottom: 12px; }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--teal-700); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); z-index: 20; }
.toast.error { background: var(--danger); }
.qr { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 16px 0; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-variant-numeric: slashed-zero; font-size: 15px; letter-spacing: .06em; line-height: 1.6; word-spacing: .2em; background: var(--paper); padding: 10px 12px; border-radius: 8px; margin: 0; flex: 1; user-select: all; }
.secret-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.loading { padding: 48px; text-align: center; color: var(--slate-400); }
