/* voicy-app — Minimalistic Google-style design */

:root {
  --blue: #1a73e8;
  --blue-hover: #1557b0;
  --green: #34a853;
  --red: #ea4335;
  --yellow: #fbbc04;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f4;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-500: #9aa0a6;
  --gray-700: #5f6368;
  --gray-900: #202124;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 256px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 16px 0;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 0 24px 24px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}

.sidebar-brand span { color: var(--blue); }

.sidebar-nav { list-style: none; padding: 8px 0; }

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-nav li a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.sidebar-nav li a.active {
  background: #e8f0fe;
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 500;
}

.sidebar-nav li a .icon { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-nav .divider {
  height: 1px;
  background: var(--gray-200);
  margin: 8px 0;
}

.sidebar-user {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* The text column must be allowed to shrink so ellipsis truncation works. */
.sidebar-user > div { min-width: 0; flex: 1; }

.main-content {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  background: var(--gray-50);
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--gray-900);
}

.page-header p {
  color: var(--gray-700);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ─── Cards ──────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 24px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--gray-900);
  margin-top: 4px;
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-100); }

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: var(--gray-300);
}
.btn-danger:hover { background: #fce8e6; }

.btn-sm { padding: 4px 12px; font-size: 0.8rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Inputs ─────────────────────────────────────────────── */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

textarea { resize: vertical; min-height: 120px; }

label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-700);
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group { margin-bottom: 16px; }

/* ─── Tables ─────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 500;
  border-bottom: 2px solid var(--gray-200);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
}

tr:hover td { background: var(--gray-50); }

/* ─── Badges ─────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-green { background: #e6f4ea; color: #137333; }
.badge-blue { background: #e8f0fe; color: #1967d2; }
.badge-red { background: #fce8e6; color: #c5221f; }
.badge-yellow { background: #fef7e0; color: #b06000; }
.badge-gray { background: var(--gray-100); color: var(--gray-700); }

/* ─── Login Screen ───────────────────────────────────────── */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--gray-50);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 48px;
  width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--gray-700);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.google-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-500);
}

/* ─── Placeholder / Coming Soon ──────────────────────────── */

.placeholder {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.placeholder::after {
  content: 'Coming Soon';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gray-700);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ─── Toast ──────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Modal ──────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ─── Key display ────────────────────────────────────────── */

.key-display {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  word-break: break-all;
  user-select: all;
}

/* ─── Funnel ─────────────────────────────────────────────── */

.funnel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-bar {
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--white);
  transition: width 0.3s;
}

.funnel-bar.green { background: var(--green); }
.funnel-bar.blue { background: var(--blue); }
.funnel-bar.yellow { background: var(--yellow); color: var(--gray-900); }
.funnel-bar.red { background: var(--red); }
.funnel-bar.gray { background: var(--gray-300); }

.funnel-label { width: 120px; font-size: 0.8rem; color: var(--gray-700); }
.funnel-count { width: 40px; text-align: right; font-size: 0.85rem; font-weight: 500; }

/* ─── Upload Zone ─────────────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover {
  border-color: var(--blue);
  background: #e8f0fe;
}

.upload-link {
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

/* ─── Prompt Textarea ─────────────────────────────────────── */

.prompt-textarea {
  width: 100%;
  min-height: 250px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 12px;
}

/* ─── Sidebar improvements ────────────────────────────────── */

.sidebar {
  display: flex;
  flex-direction: column;
  position: relative;
}

.sidebar-header {
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Data Table ──────────────────────────────────────────── */

.data-table {
  width: 100%;
  margin-top: 16px;
}

/* ─── Funnel Chart ────────────────────────────────────────── */

.funnel-chart {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0;
}

/* ─── Stats Grid ──────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

/* ─── Toast Container ─────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

/* ═══════════════════════════════════════════════════════════
   Polish layer — ink + single teal accent (no gradients),
   line-icons, grouped nav, and the orb-as-button
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink: #17181d;
  --ink-soft: #2a2c35;
  --accent: #0c9c83;
  --accent-soft: rgba(12, 156, 131, 0.12);
}

h1 { font-weight: 600; letter-spacing: -0.01em; }

/* Brand dot: solid accent, no gradient */
.sidebar-header h2 span,
.login-card h1 span { color: var(--accent); -webkit-text-fill-color: var(--accent); }

/* Nav line-icons */
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; }

/* Active nav uses the accent (overrides the earlier blue rule) */
.sidebar-nav li a.active {
  background: var(--accent-soft);
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Context Management group + its sub-items */
.nav-group { margin: 4px 0; }
.nav-group-label {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--gray-500);
}
.nav-sub { list-style: none; padding: 0; margin: 0; }
.nav-sub li a { padding-left: 44px; font-size: 0.85rem; }
.nav-sub .nav-ico { width: 16px; height: 16px; }

/* ── Hero: Talk to AI (dark, premium) ───────────────────────── */
.hero-voice {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 30px 34px; margin-bottom: 24px;
  border-radius: 18px;
  color: #f4f5f7;
  background: radial-gradient(120% 140% at 0% 0%, #23252e 0%, #15161b 60%, #101116 100%);
  border: 1px solid rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.hero-voice-eyebrow {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.hero-voice-title { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }
.hero-voice-sub { font-size: 0.92rem; color: #b9bcc6; margin-top: 6px; max-width: 42ch; }

/* ── The orb, as a button ───────────────────────────────────── */
.orb-button {
  position: relative; flex-shrink: 0;
  width: 132px; height: 132px;
  display: grid; place-items: center;
  text-decoration: none;
}
.orb-button-core {
  position: relative; z-index: 2;
  width: 96px; height: 96px; border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255,255,255,0.22), transparent 42%),
    radial-gradient(circle at 50% 55%, #2c2f3a 0%, #16181f 55%, #090a0e 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.18),
    inset 0 -8px 18px rgba(0,0,0,0.55),
    0 14px 34px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.18s ease;
}
/* luminous accent ring (radial sphere shading is not blue-violet) */
.orb-button-glow {
  position: absolute; inset: 10px; z-index: 1; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(12,156,131,0.5), 0 0 34px rgba(12,156,131,0.45);
  animation: orbPulse 3.2s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}
.orb-button-label {
  position: absolute; z-index: 3; bottom: 2px;
  font-size: 0.64rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: #cfd2da; opacity: 0; transition: opacity 0.18s ease;
}
.orb-button:hover .orb-button-core { transform: scale(1.06); }
.orb-button:hover .orb-button-label { opacity: 1; }

/* ── Buttons: solid ink, no gradient ────────────────────────── */
.btn-primary { background: var(--ink); border: none; color: #fff; }
.btn-primary:hover { background: var(--ink-soft); filter: none; }

.btn-talk-sidebar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 16px; margin-bottom: 8px;
  border-radius: 10px; font-size: 0.9rem; font-weight: 600; text-decoration: none;
  color: #fff; background: var(--ink);
  transition: background 0.12s ease;
}
.btn-talk-sidebar:hover { background: var(--ink-soft); }
.btn-talk-sidebar .nav-ico { color: var(--accent); }

/* Login card presence */
.login-card { box-shadow: 0 20px 60px rgba(60,64,67,0.12); }

@media (max-width: 640px) {
  .hero-voice { flex-direction: column; align-items: flex-start; }
  .main-content { padding: 24px 18px; }
}
