/* Tomi Demo — high-impact dark theme designed to wow on a projector */

:root {
  --bg: #07070a;
  --bg-raised: #0e0e14;
  --bg-sunk: #16161e;
  --border: #23232d;
  --border-strong: #34343f;
  --text: #f5f5f9;
  --text-muted: #a1a1aa;
  --text-subtle: #6e6e7a;
  --brand: #22d3ee;
  --brand-2: #a855f7;
  --accent: #f59e0b;
  --good: #16a34a;
  --bad: #ef4444;
  --shadow: 0 20px 50px -20px rgba(0,0,0,0.7);
  --radius: 12px;
  --radius-lg: 18px;
  --transition: 180ms cubic-bezier(0.4,0,0.2,1);
  --grad: linear-gradient(120deg, var(--brand), var(--brand-2));
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(168,85,247,0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(34,211,238,0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 0.6rem; line-height: 1.55; }
code, kbd { font-family: 'SF Mono', Consolas, monospace; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: 0.85rem; }
.hidden { display: none !important; }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(180%);
  background: rgba(7,7,10,0.7);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em;
}
.brand-mark .dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--grad);
  display: grid; place-items: center; color: white; font-size: 0.78rem; font-weight: 800;
  box-shadow: 0 4px 16px -4px rgba(168,85,247,0.5);
}
.brand-tag {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.spacer { flex: 1; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  border-radius: 999px;
  background: var(--bg-sunk); border: 1px solid var(--border);
  font-size: 0.85rem;
}
.user-chip .av {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.7rem;
}

/* ---- Buttons ---- */
.btn {
  font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 0.55rem 1rem; border-radius: 10px;
  background: var(--bg-sunk); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn:hover { border-color: var(--border-strong); }
.btn.primary {
  background: var(--grad);
  border-color: transparent; color: #07070a; font-weight: 700;
  box-shadow: 0 8px 26px -10px rgba(168,85,247,0.6);
}
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); border-color: transparent; color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  width: 100%; font: inherit; font-size: 0.95rem;
  padding: 0.6rem 0.8rem; border-radius: 10px;
  background: var(--bg-sunk); border: 1px solid var(--border); color: var(--text);
  transition: border var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
}
label {
  display: block; margin: 0.85rem 0 0.3rem;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}

/* ---- Login ---- */
.login-shell {
  min-height: calc(100vh - 80px);
  display: grid; place-items: center; padding: 2rem 1rem;
}
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(14,14,20,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.login-card .lede { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.92rem; }

/* ---- Industry picker ---- */
.picker-wrap { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.picker-wrap h1 {
  font-size: 2.4rem; letter-spacing: -0.02em; line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 0.4rem;
}
.picker-wrap .lede { color: var(--text-muted); font-size: 1.05rem; max-width: 720px; margin-bottom: 2rem; }
.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.industry-card {
  position: relative;
  background: linear-gradient(180deg, rgba(34,211,238,0.05), rgba(168,85,247,0.05)), var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.industry-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 18px 40px -16px rgba(34,211,238,0.35);
}
.industry-card .icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}
.industry-card h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.industry-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.5rem; }
.industry-card .industry-actions {
  display: flex; gap: 0.4rem; margin-top: 0.85rem;
}

/* ---- Call workspace ---- */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr 360px;
  gap: 1rem;
  padding: 1.25rem;
  height: calc(100vh - 65px);
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
}
.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column;
  min-height: 0;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.panel-head h3 { font-size: 0.95rem; }
.panel-body {
  flex: 1; overflow-y: auto; padding-right: 0.25rem;
}

/* Live transcript */
.transcript .turn {
  margin-bottom: 0.85rem; padding: 0.65rem 0.85rem;
  border-radius: 12px; font-size: 0.95rem; line-height: 1.5;
  border: 1px solid var(--border);
  position: relative;
}
.transcript .turn.user    { background: rgba(34,211,238,0.08); border-color: rgba(34,211,238,0.25); }
.transcript .turn.assistant{ background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.25); }
.transcript .turn.tool    { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.25); font-family: monospace; font-size: 0.85rem; opacity: 0.75; }
.transcript .turn .who {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.2rem;
}
.transcript .turn.user .who { color: var(--brand); }
.transcript .turn.assistant .who { color: var(--brand-2); }

/* Status / call controls */
.call-status {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1rem; border-radius: 999px;
  background: var(--bg-sunk); border: 1px solid var(--border);
  font-size: 0.88rem;
}
.call-status .dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--text-subtle);
}
.call-status.live .dot { background: var(--good); animation: pulse 1.4s infinite; }
.call-status.error .dot { background: var(--bad); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.big-call {
  background: var(--grad);
  color: #07070a;
  font-weight: 800; font-size: 1.05rem;
  padding: 1rem 2rem; border-radius: 999px;
  border: none; cursor: pointer;
  box-shadow: 0 14px 36px -10px rgba(168,85,247,0.7);
  transition: all var(--transition);
}
.big-call:hover { transform: translateY(-2px); }
.big-call.live { background: linear-gradient(180deg, #ef4444, #b91c1c); color: white; }
.big-call:disabled { opacity: 0.6; cursor: not-allowed; }

/* Dashboard panels */
.kv {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 0.4rem 0.85rem; font-size: 0.9rem; line-height: 1.5;
}
.kv dt { color: var(--text-muted); white-space: nowrap; }
.kv dd { margin: 0; }

.pill {
  display: inline-block; padding: 0.15rem 0.55rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: var(--bg-sunk); border: 1px solid var(--border); color: var(--text-muted);
}
.pill.ok  { background: rgba(22,163,74,0.15); border-color: rgba(22,163,74,0.4); color: #4ade80; }
.pill.bad { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.pill.warn{ background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); color: #fcd34d; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }

.summary-card {
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(34,211,238,0.05)), var(--bg-raised);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.summary-card .head {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand-2); margin-bottom: 0.4rem;
}
.summary-card h2 {
  font-size: 1.1rem; margin-bottom: 0.6rem;
}
.summary-card ul { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); }

.ticket {
  background: var(--bg-sunk);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.ticket .ticket-head {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 0.4rem;
}

.zone-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.zone {
  padding: 0.55rem 0.7rem; border-radius: 10px;
  background: var(--bg-sunk); border: 1px solid var(--border);
  font-size: 0.82rem;
}
.zone .name { font-weight: 600; margin-bottom: 0.25rem; }

.cart-row {
  padding: 0.55rem 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem;
}
.cart-row:last-child { border-bottom: none; }
.cart-row .desc { flex: 1; }
.cart-row .qty { color: var(--text-muted); margin-right: 0.6rem; }
.cart-row .price { color: var(--brand); font-weight: 600; min-width: 60px; text-align: right; }

/* Toasts */
.toast-host { position: fixed; top: 1rem; right: 1rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem 0.95rem; box-shadow: var(--shadow); font-size: 0.88rem; min-width: 240px;
  animation: toast-in 200ms ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: translateY(0);} }
.toast.ok  { border-left: 3px solid var(--good); }
.toast.err { border-left: 3px solid var(--bad); }
.toast.info{ border-left: 3px solid var(--brand); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* Admin users table */
table.users { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.users th, table.users td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
table.users th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-sunk); }
table.users tbody tr:hover { background: rgba(34,211,238,0.04); }
