:root {
  --bg-main: #06080d;
  --bg-card: #0c0f17;
  --bg-surface: #111622;
  --bg-input: #090c13;
  --border-color: #1c2436;
  --border-subtle: #141b2a;
  --border-focus: #00f0ff;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #475569;
  --accent-cyan: #00f0ff;
  --accent-cyan-dim: rgba(0, 240, 255, 0.15);
  --accent-green: #00e676;
  --accent-green-dim: rgba(0, 230, 118, 0.15);
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body.teardown-theme {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.03) 0%, transparent 60%),
    linear-gradient(rgba(28, 36, 54, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 36, 54, 0.15) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* TOP NAVIGATION */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-symbol {
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.brand-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drive-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.pill-label {
  color: var(--text-dim);
}

.pill-value {
  color: var(--text-main);
  font-weight: 600;
}

.pill-code {
  color: var(--accent-cyan);
}

/* TEARDOWN 3D VIEWPORT CARD */
.teardown-viewport-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.viewport-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.viewport-desc {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.viewport-controls {
  display: flex;
  gap: 8px;
}

.btn-tech-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tech-toggle:hover {
  background: #182030;
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.canvas-container {
  width: 100%;
  height: 290px;
  background: #040609;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
}

#teardownCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#teardownCanvas:active {
  cursor: grabbing;
}

/* BUTTONS */
button, .btn-tech-primary, .btn-tech-secondary, .btn-tech-danger, .btn-tech-drive, .btn-tech-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.btn-tech-primary {
  background: var(--accent-cyan);
  color: #030712;
  font-weight: 700;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.btn-tech-primary:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-tech-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-tech-secondary:hover {
  background: #1a2336;
  border-color: #2b3956;
}

.btn-tech-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-tech-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-tech-drive {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-weight: 700;
}

.btn-tech-drive:hover {
  background: rgba(0, 240, 255, 0.2);
}

.btn-tech-sub {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-tech-sub:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

/* TECH PANELS */
.tech-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

/* LAUNCHER CARD */
.launcher-card {
  padding: 22px 24px;
}

.panel-header h2 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.launcher-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flex-2 { flex: 2; min-width: 280px; }
.flex-1 { flex: 1; min-width: 200px; }

.input-group label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
}

.input-with-icon input {
  padding-left: 42px;
}

input[type="text"], input[type="url"], input[type="password"] {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-cyan-dim);
}

/* LIVE SESSION BANNER */
.live-banner {
  background: #0d121c;
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 18px 22px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.live-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tech-radar-beacon {
  width: 10px;
  height: 10px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
  position: relative;
}

.live-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-title-row h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.badge-joining { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-recording { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); border: 1px solid rgba(0, 240, 255, 0.4); }
.badge-completed { background: rgba(0, 230, 118, 0.15); color: var(--accent-green); border: 1px solid rgba(0, 230, 118, 0.4); }

.timer-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  background: #040609;
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.status-message {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.live-transcript-box {
  background: #040609;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-transcript-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 600;
}

.transcript-live-tag {
  color: var(--accent-cyan);
}

.captions-stream {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.caption-line {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.caption-time {
  color: var(--text-dim);
}

.caption-speaker {
  font-weight: 700;
  color: var(--accent-cyan);
}

.caption-text {
  color: var(--text-main);
}

.caption-placeholder {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* DASHBOARD GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* SIDEBAR CARD */
.sidebar-card {
  display: flex;
  flex-direction: column;
  height: 680px;
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.header-count-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-count-row h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.count-badge {
  background: var(--bg-surface);
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.search-box {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
}

.search-box input {
  font-size: 0.82rem;
}

.meetings-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meeting-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meeting-item:hover {
  background: #141b2a;
  border-color: var(--border-color);
}

.meeting-item.active {
  background: #162033;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.meeting-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.meeting-item-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.3;
}

.meeting-item-meta {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.meeting-drive-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

/* EMPTY STATES */
.empty-state, .empty-detail-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
}

.empty-detail-state {
  height: 100%;
}

.empty-detail-state h3 {
  color: var(--text-muted);
}

.empty-detail-state p {
  font-size: 0.82rem;
  max-width: 420px;
}

/* DETAIL CARD */
.detail-card {
  min-height: 680px;
  display: flex;
  flex-direction: column;
}

.meeting-detail-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detail-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.detail-header h2 {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
}

.detail-meta {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* TABS */
.detail-tabs {
  display: flex;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  gap: 6px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.tab-highlight {
  color: var(--accent-green) !important;
}

.tab-highlight.active {
  border-bottom-color: var(--accent-green) !important;
}

.tab-content-area {
  flex: 1;
  padding: 22px 24px;
  overflow-y: auto;
  max-height: 520px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* MARKDOWN STYLING */
.markdown-body {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.65;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-top: 22px;
  margin-bottom: 10px;
}

.markdown-body h2 {
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
}

.markdown-body p { margin-bottom: 12px; }
.markdown-body ul, .markdown-body ol { margin-left: 20px; margin-bottom: 12px; }
.markdown-body li { margin-bottom: 4px; }

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.markdown-body th {
  background: var(--bg-surface);
  color: var(--accent-cyan);
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding-left: 12px;
  color: var(--text-muted);
  margin: 14px 0;
}

/* WHATSAPP CARD */
.client-message-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.client-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.client-message-header h4 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.client-message-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.whatsapp-card {
  background: #05080c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.whatsapp-bubble {
  background: #0f1722;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
}

.whatsapp-bubble pre {
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* MEDIA PLAYER */
.media-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.media-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.video-wrapper video {
  width: 100%;
  max-height: 380px;
  background: black;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.audio-wrapper {
  background: var(--bg-surface);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.audio-wrapper audio {
  width: 100%;
  margin-top: 6px;
}

/* FULL TRANSCRIPT FEED */
.transcript-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.transcript-toolbar input {
  max-width: 320px;
}

.full-transcript-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.full-transcript-line {
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* CHAT TAB */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 460px;
}

.chat-intro h4 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.chat-intro p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}

.chat-message {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  max-width: 82%;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-message.bot {
  background: var(--bg-surface);
  align-self: flex-start;
  border: 1px solid var(--border-color);
}

.chat-message.user {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
  align-self: flex-end;
}

.chat-input-form {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 540px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body small {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.72rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.hidden {
  display: none !important;
}
