/* StreetAI admin console — same dark theme as the customer dashboard. */
:root {
  --bg: #0a0a0a; --bg-card: #141414; --bg-card-hover: #1a1a1a; --bg-section: #111111;
  --red: #e11d48; --red-dim: #be123c; --red-glow: rgba(225,29,72,.18);
  --green: #4ade80; --green-glow: rgba(34,197,94,.14); --amber: #fbbf24;
  --text: #f0f0f0; --text-secondary: #a0a0a0; --text-muted: #666;
  --border: #222; --border-light: #2a2a2a; --radius: 14px; --radius-sm: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; font-family: inherit; padding: 9px 16px; border-radius: var(--radius-sm); transition: background .15s; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-dim); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-outline:hover:not(:disabled) { background: var(--bg-card); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.link { color: var(--text-secondary); cursor: pointer; }
.link:hover { color: var(--text); }

input, select { background: var(--bg); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text); font-size: 14px; font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--red); }

.form-msg { font-size: 13.5px; padding: 9px 12px; border-radius: var(--radius-sm); }
.form-msg.err { background: var(--red-glow); color: #fb7185; }
.form-msg.ok { background: var(--green-glow); color: var(--green); }

/* ── Modal + toast ── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 26px; width: 100%; max-width: 400px; }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { color: var(--text-secondary); font-size: 14px; line-height: 1.55; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 12px 18px; font-size: 14px; z-index: 1100; opacity: 0; transition: opacity .25s ease, transform .25s ease; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(225,29,72,.4); color: #fb7185; }
.toast.ok { border-color: rgba(34,197,94,.35); color: var(--green); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 32px 30px; width: 100%; max-width: 380px; }
.login-card img { height: 46px; width: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 22px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }

/* shell */
.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-section); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar-logo { display: flex; align-items: center; gap: 9px; margin: 2px 6px 22px; font-weight: 700; font-size: 15px; }
.sidebar-logo img { height: 30px; width: auto; }
.nav-item { display: block; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); font-size: 14.5px; font-weight: 500; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: var(--red-glow); color: var(--text); }
.sidebar-spacer { flex: 1; }
.main { min-width: 0; }
.main-head { display: flex; align-items: center; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--border); }
.main-head h1 { font-size: 20px; }
.main-head .spacer { flex: 1; }
.main-head .who { color: var(--text-muted); font-size: 13px; }
.view { padding: 26px 28px; max-width: 1100px; }

/* cards / tables */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 24px 0 10px 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.stat .cap { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 180px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--bg-card-hover); }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }
/* unhandled (new) leads stand out with a subtle accent tint + left bar */
tr.lead-new td { background: rgba(225,29,72,.06); }
tr.lead-new td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

.pill { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 100px; }
.pill.active { color: var(--green); background: var(--green-glow); }
.pill.suspended { color: #fb7185; background: var(--red-glow); }
.pill.muted { color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); }

.kv { display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.kv:first-child { border-top: none; }
.kv .k { color: var(--text-muted); width: 150px; flex: none; font-size: 13px; }

.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { color: var(--text-secondary); font-size: 13.5px; cursor: pointer; margin-bottom: 12px; display: inline-block; }
.back:hover { color: var(--text); }

.price-edit { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.8fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.price-edit:first-of-type { border-top: none; }
.price-edit input { width: 100%; }
.price-edit .pm { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.price-edit .cust { color: var(--text-muted); font-size: 12px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-spacer { display: none; }
  .view { padding: 18px 16px; }
  .main-head { padding: 14px 16px; }
  .table-wrap { overflow-x: auto; }
}
