/* ================================================================
   VEditor — Professional Production Console Design System
   Clean, solid, and utilitarian broadcast editor styling
   ================================================================ */

@import 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap';
@import 'theme.css';

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--v-font-sans);
  background: var(--v-bg-canvas);
  color: var(--v-text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--v-primary); text-decoration: none; transition: color .12s; }
a:hover { color: var(--v-primary-hover); }

/* ── App Shell & Layout ───────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Topbar (Full-Width Fixed Header) ────────────────────────── */
.topbar {
  height: var(--v-topbar-height);
  background: var(--v-bg-subtle);
  border-bottom: 1px solid var(--v-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 12px;
  gap: 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-toggle-btn {
  padding: 6px 8px;
  color: var(--v-text-secondary);
  border-radius: var(--v-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  color: var(--v-text-primary);
  background: var(--v-bg-surface-hover);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--v-text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  padding-right: 14px;
  border-right: 1px solid var(--v-border-subtle);
  flex-shrink: 0;
}
.topbar-brand svg {
  color: var(--v-primary);
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--v-text-primary);
}

/* ── Sidebar (Underneath Fixed Topbar) ───────────────────────── */
.sidebar {
  width: var(--v-sidebar-width);
  background: var(--v-bg-subtle);
  border-right: 1px solid var(--v-border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--v-topbar-height);
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 4px 16px;
}

.sidebar-header .nav-label {
  padding: 0;
}

.sidebar-collapse-btn {
  padding: 4px 6px;
  color: var(--v-text-muted);
  border-radius: var(--v-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-collapse-btn:hover {
  color: var(--v-text-primary);
  background: var(--v-bg-surface-hover);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--v-text-muted);
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--v-radius-sm);
  color: var(--v-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background .12s, color .12s;
  cursor: pointer;
}

.push-bottom {
  margin-top: auto;
}

.nav-item:hover {
  background: var(--v-bg-surface-hover);
  color: var(--v-text-primary);
}

.nav-item.active {
  background: var(--v-primary-subtle);
  color: var(--v-primary);
  font-weight: 600;
}

.nav-item.danger {
  color: var(--v-status-danger-text);
}
.nav-item.danger:hover {
  background: var(--v-status-danger-bg);
  color: var(--v-status-danger-text);
}

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
  margin-top: var(--v-topbar-height);
  margin-left: var(--v-sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--v-topbar-height));
  transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Sidebar Collapsed State ─────────────────────────────────── */
html[data-sidebar="collapsed"] .sidebar {
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
}

html[data-sidebar="collapsed"] .main-content {
  margin-left: 0;
  width: 100%;
}

/* ── Video Studio Mode Speaker Clean View ───────────────────── */
html[data-sidebar="hidden"] .sidebar,
html[data-sidebar="hidden"] #sidebar-toggle-btn,
body.is-studio-mode.is-speaker .sidebar,
body.is-studio-mode.is-speaker #sidebar-toggle-btn {
  display: none;
}

html[data-sidebar="hidden"] .main-content,
body.is-studio-mode.is-speaker .main-content {
  margin-left: 0;
  width: 100%;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--v-text-secondary);
}

.breadcrumb .current { color: var(--v-text-primary); font-weight: 600; }
.breadcrumb .sep { color: var(--v-text-muted); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Topbar Controls ─────────────────────────────────────────── */
.topbar-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-badge-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-sm);
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--v-text-secondary);
  height: 30px;
}

.role-badge-select label {
  color: var(--v-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  cursor: pointer;
}

.role-badge-select select {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--v-text-primary);
  cursor: pointer;
  padding: 0;
}


/* ── Global Modals ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modal-fade-in 0.15s ease-out;
}

.modal-dialog {
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-default);
  border-radius: var(--v-radius-lg, 12px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: modal-pop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--v-text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--v-bg-subtle);
  border-top: 1px solid var(--v-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.page-body { padding: 24px 28px; flex: 1; }

/* ── Stats Summary Row ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--v-text-muted);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--v-text-primary);
}

.stat-value.amber { color: var(--v-status-pending-text); }
.stat-value.blue  { color: var(--v-status-active-text); }
.stat-value.green { color: var(--v-status-success-text); }
.stat-value.red   { color: var(--v-status-danger-text); }

.stat-value-sm {
  font-size: 1.25rem;
}

/* ── Filter Bar & Inputs ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.search-wrap svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--v-text-muted);
  pointer-events: none;
}

.input-field {
  width: 100%;
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border);
  color: var(--v-text-primary);
  border-radius: var(--v-radius-sm);
  padding: 7px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}

.input-field:focus {
  border-color: var(--v-border-focus);
}

.search-wrap .input-field { padding-left: 32px; }

.select-field {
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border);
  color: var(--v-text-primary);
  border-radius: var(--v-radius-sm);
  padding: 7px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.select-field:focus { border-color: var(--v-border-focus); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--v-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-primary {
  background: var(--v-primary);
  color: #fff;
  border-color: var(--v-primary);
}
.btn-primary:hover { background: var(--v-primary-hover); }

.btn-success {
  background: var(--v-status-success-bg);
  color: var(--v-status-success-text);
  border-color: var(--v-status-success-border);
}
.btn-success:hover {
  background: var(--v-status-success-text);
  color: #fff;
  border-color: var(--v-status-success-text);
}

.btn-danger {
  background: var(--v-status-danger-bg);
  color: var(--v-status-danger-text);
  border-color: var(--v-status-danger-border);
}
.btn-danger:hover {
  background: var(--v-status-danger-text);
  color: #fff;
  border-color: var(--v-status-danger-text);
}

[data-theme="dark"] .btn-success:hover {
  background: var(--v-status-success-border);
  border-color: var(--v-status-success-border);
}

[data-theme="dark"] .btn-danger:hover {
  background: var(--v-status-danger-border);
  border-color: var(--v-status-danger-border);
}

.btn-ghost {
  background: var(--v-bg-surface);
  color: var(--v-text-secondary);
  border-color: var(--v-border);
}
.btn-ghost:hover { background: var(--v-bg-surface-hover); color: var(--v-text-primary); border-color: var(--v-border-strong); }

.btn-sm { padding: 4px 8px; font-size: 0.75rem; }
.btn-lg { padding: 9px 18px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap {
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--v-border-subtle);
}

.table-title { font-size: 0.88rem; font-weight: 600; color: var(--v-text-primary); }
.table-count { font-size: 0.78rem; color: var(--v-text-muted); }

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

thead th {
  background: var(--v-bg-subtle);
  color: var(--v-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 9px 16px;
  text-align: left;
  border-bottom: 1px solid var(--v-border-subtle);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--v-border-subtle);
  transition: background .1s;
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--v-bg-surface-hover); }

td {
  padding: 11px 16px;
  vertical-align: middle;
  color: var(--v-text-secondary);
}

.td-title { color: var(--v-text-primary); font-weight: 500; max-width: 320px; }
.td-title small { display: block; color: var(--v-text-muted); font-size: 0.74rem; margin-top: 2px; }

.td-mono {
  font-family: var(--v-font-mono);
  font-size: 0.78rem;
  color: var(--v-text-muted);
}

/* ── Solid Semantic Status Badges & Circular Spinners ───────── */
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: v-spin 0.75s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 9px;
  height: 9px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

@keyframes v-spin {
  to { transform: rotate(360deg); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--v-radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentcolor;
}

.badge-waiting    { background: var(--v-status-waiting-bg); color: var(--v-status-waiting-text); border-color: var(--v-status-waiting-border); }
.badge-pending    { background: var(--v-status-pending-bg); color: var(--v-status-pending-text); border-color: var(--v-status-pending-border); }
.badge-processing { background: var(--v-status-active-bg);  color: var(--v-status-active-text);  border-color: var(--v-status-active-border); }
.badge-preview    { background: var(--v-status-preview-bg); color: var(--v-status-preview-text); border-color: var(--v-status-preview-border); }
.badge-done       { background: var(--v-status-success-bg); color: var(--v-status-success-text); border-color: var(--v-status-success-border); }
.badge-danger     { background: var(--v-status-danger-bg);  color: var(--v-status-danger-text);  border-color: var(--v-status-danger-border); }
.badge-info       { background: var(--v-primary-subtle);   color: var(--v-primary);             border-color: var(--v-border-focus); font-variant-numeric: tabular-nums; }

/* ── Role Badges ──────────────────────────────────────────────── */
.badge-role {
  text-transform: capitalize;
  font-weight: 600;
}

.badge-admin,
.badge-purple {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

[data-theme="dark"] .badge-admin,
[data-theme="dark"] .badge-purple {
  background: #2e1065;
  color: #d8b4fe;
  border-color: #7e22ce;
}

.badge-organizer {
  background: var(--v-status-active-bg);
  color: var(--v-status-active-text);
  border-color: var(--v-status-active-border);
}

.badge-user {
  background: var(--v-status-waiting-bg);
  color: var(--v-status-waiting-text);
  border-color: var(--v-status-waiting-border);
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--v-bg-subtle);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-xs);
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.job-progress-track {
  height: 4px;
  background: var(--v-border-subtle);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.job-progress-fill {
  height: 100%;
  background: var(--v-primary);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.job-progress-fill.animated {
  background: linear-gradient(90deg, var(--v-primary) 0%, #38bdf8 50%, var(--v-primary) 100%);
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s infinite linear;
}

@media (prefers-reduced-motion: reduce) {
  .job-progress-fill.animated {
    animation: none;
    background: var(--v-primary);
  }
}

@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.job-timing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--v-text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ── Studio 2-Panel Layout ────────────────────────────────────── */
.studio-shell {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  height: calc(100vh - var(--v-topbar-height));
  overflow: hidden;
  transition: grid-template-columns 0.25s ease;
}

.studio-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--v-border-subtle);
  background: var(--v-bg-surface);
}

.studio-panel:last-child { border-right: none; }

.studio-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--v-border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--v-bg-surface);
  z-index: 10;
}

.studio-panel-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--v-text-muted);
}

.studio-panel-body { padding: 18px; flex: 1; }

.action-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-group { margin-bottom: 16px; }
.meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--v-text-muted);
  margin-bottom: 3px;
}
.meta-value { font-size: 0.88rem; color: var(--v-text-primary); font-weight: 500; }
.meta-value.mono { font-family: var(--v-font-mono); font-size: 0.8rem; }
.divider { height: 1px; background: var(--v-border-subtle); margin: 16px 0; }

/* ── Player Panel & Controls ──────────────────────────────────── */
.player-panel {
  background: var(--v-bg-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.player-viewport {
  background: var(--v-player-bg, #000);
  position: relative;
  width: 100%;
}

.player-viewport video {
  width: 100%;
  display: block;
  max-height: 380px;
  object-fit: contain;
}

.player-no-preview {
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--v-text-muted);
}

.timecode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--v-bg-subtle);
  border-top: 1px solid var(--v-border-subtle);
  border-bottom: 1px solid var(--v-border-subtle);
}

.timecode {
  font-family: var(--v-font-mono);
  font-size: 0.88rem;
  color: var(--v-text-primary);
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  padding: 3px 8px;
  border-radius: var(--v-radius-xs);
}

/* ── Player Controls: Fine, Big & Mega Seeks ─────────────────── */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--v-bg-surface);
  border-bottom: 1px solid var(--v-border-subtle);
  flex-wrap: wrap;
}

.ctrl-btn {
  background: var(--v-bg-subtle);
  border: 1px solid var(--v-border);
  color: var(--v-text-secondary);
  border-radius: var(--v-radius-sm);
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--v-font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .1s;
  min-height: 30px;
}

.ctrl-btn:hover {
  background: var(--v-bg-surface-hover);
  color: var(--v-text-primary);
  border-color: var(--v-border-strong);
}

.ctrl-btn.play-btn {
  background: var(--v-primary);
  border-color: var(--v-primary);
  color: #fff;
  width: 38px; height: 38px;
  border-radius: 50%;
  padding: 0;
}
.ctrl-btn.play-btn:hover { background: var(--v-primary-hover); }

/* ── Timeline Track & Draggable Cut Points ─────────────────────── */
.timeline-section {
  padding: 14px 16px;
  background: var(--v-bg-subtle);
  border-top: 1px solid var(--v-border-subtle);
  flex: 1;
}

.timeline-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--v-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-track {
  position: relative;
  height: 44px;
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border);
  border-radius: var(--v-radius-sm);
  overflow: hidden;
}

.tl-block {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.tl-intro   { background: rgba(61,107,255,0.18); color: var(--v-primary); border-right: 1px solid var(--v-primary); }
.tl-outro   { background: rgba(61,107,255,0.18); color: var(--v-primary); border-left: 1px solid var(--v-primary); }
.tl-content { background: rgba(255,255,255,0.04); }

.tl-marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--v-status-success-text);
  z-index: 5;
}

.tl-marker::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  background: var(--v-status-success-text);
  border-radius: 2px;
}

.tl-marker.end-marker {
  background: var(--v-status-danger-text);
}
.tl-marker.end-marker::after {
  background: var(--v-status-danger-text);
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.65rem;
  font-family: var(--v-font-mono);
  color: var(--v-text-muted);
}

/* ── 4-Stage Milestone Stepper ────────────────────────────────── */
.milestones-stepper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.milestone-card {
  background: var(--v-bg-subtle);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-sm);
  padding: 10px 12px;
  transition: border-color .12s;
}

.milestone-card.active {
  border-color: var(--v-primary-border);
  background: var(--v-primary-subtle);
}

.milestone-card.completed {
  border-color: var(--v-status-success-border);
}

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

.milestone-title {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--v-text-primary);
}

.milestone-card.active .milestone-title { color: var(--v-primary); }
.milestone-card.completed .milestone-title { color: var(--v-status-success-text); }

.milestone-substeps {
  font-size: 0.72rem;
  color: var(--v-text-muted);
  line-height: 1.4;
  padding-left: 18px;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--v-radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-danger {
  background: var(--v-status-danger-bg);
  color: var(--v-status-danger-text);
  border-color: var(--v-status-danger-border);
  border-radius: var(--v-radius-sm);
  padding: 10px 14px;
}

/* ── Authentication Pages ─────────────────────────────────────── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 20px;
  min-height: calc(100vh - var(--v-topbar-height));
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 28px;
}

.auth-header {
  margin-bottom: 24px;
  text-align: center;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--v-text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--v-text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-form .form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--v-text-secondary);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--v-text-muted);
}

.auth-footer a {
  color: var(--v-primary);
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .studio-shell { grid-template-columns: 1fr 300px; }
  .stats-grid   { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 850px) {
  .studio-shell { grid-template-columns: 1fr; height: auto; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .main-content { margin-left: 0; }
  .sidebar { box-shadow: 0 0 20px rgba(0, 0, 0, 0.25); }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .main-content {
    transition: none;
  }
}

/* ── Base Navigation & Utility Classes ───────────────────────── */
.sidebar-logo svg {
  color: var(--v-primary);
}

.user-email {
  font-size: 0.85rem;
  color: var(--v-text-secondary);
  font-weight: 500;
}

.logout-form {
  margin: 0;
  display: inline;
}

#theme-toggle-btn:not(.user-dropdown-item) {
  padding: 5px 8px;
  height: 30px;
}

.theme-icon-hidden {
  display: none;
}

/* ── User Menu Dropdown ────────────────────────────────────────── */
.user-menu-wrapper {
  position: relative;
  display: inline-flex;
}

summary.user-bubble-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  color: var(--v-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  list-style: none;
}

summary.user-bubble-btn::-webkit-details-marker {
  display: none;
}

summary.user-bubble-btn:hover,
details[open] > summary.user-bubble-btn {
  background: var(--v-bg-surface-hover);
  border-color: var(--v-border-strong);
  color: var(--v-text-primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--v-bg-surface);
  border: 1px solid var(--v-border-subtle);
  border-radius: var(--v-radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  padding: 6px;
  z-index: 100;
}

.user-dropdown-header {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-dropdown-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--v-text-muted);
}

.user-dropdown-header .user-email {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--v-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}


.user-dropdown-divider {
  height: 1px;
  background: var(--v-border-subtle);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--v-radius-xs);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--v-text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: var(--v-bg-surface-hover);
  color: var(--v-text-primary);
}

.user-dropdown-item#theme-toggle-btn {
  height: auto;
  padding: 8px 10px;
}

.user-dropdown-item.logout-item:hover {
  color: var(--v-status-danger-text);
  background: var(--v-status-danger-bg);
}

