:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242836;
  --border: #2e3345;
  --text: #e8eaef;
  --text-muted: #8b92a8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --font: "Inter", system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.brand { display: flex; gap: 0.75rem; align-items: center; }
.brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem;
}
.brand h1 { font-size: 1.1rem; font-weight: 700; }
.brand p { font-size: 0.75rem; color: var(--text-muted); }

.sidebar-section h3 {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.5rem;
}

.meetings-list { list-style: none; max-height: 50vh; overflow-y: auto; }
.meetings-list li {
  padding: 0.6rem 0.75rem; border-radius: 8px; cursor: pointer;
  font-size: 0.875rem; transition: background 0.15s;
}
.meetings-list li:hover { background: var(--surface-2); }
.meetings-list li.active { background: var(--primary); color: white; }
.meetings-list .meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.meetings-list li.active .meta { color: rgba(255,255,255,0.7); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.powered-by {
  display: block; text-align: center; font-size: 0.68rem; letter-spacing: 0.03em;
  color: var(--text-muted); text-decoration: none; opacity: 0.75;
  transition: opacity 0.15s, color 0.15s;
}
.powered-by:hover { opacity: 1; color: var(--text); }
.powered-by strong { color: var(--primary-hover); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1rem; border: none; border-radius: 8px;
  font-family: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; width: 100%; justify-content: center; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); width: 100%; justify-content: center; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; background: var(--surface-2); color: var(--text); }
.btn-record { background: var(--danger); color: white; }
.btn-record.recording { background: #991b1b; }
.btn-record .rec-dot { width: 8px; height: 8px; border-radius: 50%; background: white; }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; text-decoration: underline; font: inherit; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 0.25rem; }
.tab {
  padding: 0.5rem 1rem; background: transparent; border: none;
  color: var(--text-muted); font-family: inherit; font-size: 0.875rem;
  border-radius: 8px; cursor: pointer;
}
.tab.active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.status-badge { font-size: 0.75rem; color: var(--success); }

.panel { display: none; padding: 1.5rem; flex: 1; overflow-y: auto; }
.panel.active { display: block; }
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.title-input {
  flex: 1; min-width: 200px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.6rem 1rem; color: var(--text); font-size: 1.1rem;
  font-weight: 600; font-family: inherit;
}
.rec-controls { display: flex; align-items: center; gap: 1rem; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 600; }

.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-actions { display: flex; gap: 0.5rem; align-items: center; }

.live-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem; border-radius: 4px;
  background: var(--surface-2); color: var(--text-muted);
}
.live-badge.live { background: rgba(239,68,68,0.2); color: var(--danger); }

.transcript-body, .summary-body {
  min-height: 300px; max-height: 55vh; overflow-y: auto;
  line-height: 1.7; font-size: 0.9rem;
}
.transcript-segment { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.transcript-segment .time { font-size: 0.7rem; color: var(--text-muted); margin-right: 0.5rem; }
.placeholder { color: var(--text-muted); font-style: italic; }
.placeholder.error, .status-msg.error { color: var(--danger); font-style: normal; }
.status-msg { font-size: 0.8rem; margin-top: 0.75rem; padding: 0.5rem; background: var(--surface-2); border-radius: 6px; }

.feature-list { list-style: none; margin: 1rem 0; }
.feature-list li { padding: 0.35rem 0; font-size: 0.875rem; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 1rem; }

.summary-section { margin-bottom: 1.25rem; }
.summary-section h3 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--primary); margin-bottom: 0.5rem;
}
.summary-section ul { padding-left: 1.25rem; }
.summary-section li { margin-bottom: 0.35rem; font-size: 0.9rem; }

.summary-stream {
  margin-top: 1rem; padding: 0.75rem; background: var(--surface-2);
  border-radius: 8px; font-size: 0.8rem; color: var(--text-muted); display: none;
}
.summary-stream.active { display: block; }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 3rem 2rem; text-align: center; margin: 1.5rem 0; cursor: pointer;
}
.drop-zone.dragover { border-color: var(--primary); }

.modal {
  border: none; border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--text); max-width: 420px; width: 90%;
}
.modal::backdrop { background: rgba(0,0,0,0.6); }
.modal-content { padding: 1.5rem; }
.modal-content label { display: block; margin-bottom: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.modal-content input, .modal-content select {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.5rem 0.75rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: inherit;
}
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }
.modal-actions .btn { width: auto; }
