@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap);
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface2: #f1f3f7;
  --border: #e5e8ef;
  --border2: #d0d5e0;
  --text: #111827;
  --text2: #4b5563;
  --text3: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --yellow: #d97706;
  --yellow-light: #fffbeb;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --sidebar-w: 240px;
  --header-h: 56px;
  --font: 'Inter', system-ui, sans-serif;
}

body.dark {
  --bg: #0f1117;
  --surface: #1a1d23;
  --surface2: #22262f;
  --border: #2d3141;
  --border2: #383d4f;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #1e3a5f;
  --accent-border: #1e40af;
  --green: #22c55e;
  --green-light: #052e16;
  --red: #ef4444;
  --red-light: #2d0a0a;
  --yellow: #f59e0b;
  --yellow-light: #1c1108;
  --purple: #a78bfa;
  --purple-light: #1e1241;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
}

html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .15s; font-family: var(--font); white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text2); border-color: var(--border2); }
.btn-secondary:hover:not(:disabled) { background: var(--surface2); }
.btn-danger { background: var(--red-light); color: var(--red); border-color: var(--red-light); }
.btn-danger:hover:not(:disabled) { filter: brightness(0.93); }
.btn-ghost { background: none; color: var(--text2); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: var(--radius); }

/* Inputs */
.input { width: 100%; padding: 8px 12px; border: 1px solid var(--border2); border-radius: var(--radius); font-size: 13px; font-family: var(--font); color: var(--text); background: var(--surface); transition: border-color .15s; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.input::placeholder { color: var(--text3); }
.input-sm { padding: 6px 10px; font-size: 12px; }

/* Labels */
.label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }

/* Form group */
.form-group { display: flex; flex-direction: column; gap: 5px; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray { background: var(--surface2); color: var(--text3); }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); background: var(--surface2); }
td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

.gestures-table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.gestures-table th { white-space: nowrap; }
.gestures-table td { vertical-align: top; }
.gestures-table .gestures-table-video-cell {
  width: 280px;
  min-width: 280px;
  padding: 14px;
}
.gestures-table .gestures-table-video-cell > div { min-width: 252px; }

/* Gestures page toolbar */
.gestures-page-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.gestures-page-header h1 { font-size: 18px; font-weight: 700; margin: 0; }
.gestures-page-sub { font-size: 13px; color: var(--text3); }
.gestures-page-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.gestures-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 14px; overflow: hidden;
}
.gestures-panel-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.gestures-panel-row:last-child { border-bottom: none; }
.gestures-search-row { padding: 12px 14px; gap: 12px; }
.gestures-search-row .input { flex: 1; min-width: 200px; }

.gestures-filter-group {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.gestures-filter-label {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .04em;
  min-width: 58px; flex-shrink: 0;
}
.gestures-filter-options { display: flex; gap: 4px; flex-wrap: wrap; }

.gestures-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; padding: 12px 14px;
  background: var(--surface2);
}
.gestures-stat-chip {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; text-align: left;
  cursor: default; font-family: inherit;
}
.gestures-stat-chip.clickable { cursor: pointer; }
.gestures-stat-chip.clickable:hover { border-color: var(--accent-border); }
.gestures-stat-val { font-size: 18px; font-weight: 700; line-height: 1.2; }
.gestures-stat-lbl { font-size: 11px; color: var(--text3); }

.gestures-cat-select { min-width: 200px; max-width: 320px; flex: 1; }

/* Gesture cards & list */
.gesture-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.gesture-card:hover { border-color: var(--border2); box-shadow: var(--shadow-md); }
.gesture-card-media {
  aspect-ratio: 16 / 10;
  position: relative;
  background: var(--surface2);
  overflow: hidden;
}
.gesture-card-media .gesture-thumb-root {
  position: absolute; inset: 0;
  width: 100%; height: 100% !important;
  border-radius: 0;
}
.gesture-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gesture-card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gesture-card-title {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; font-size: 15px; font-weight: 700; color: var(--text);
  text-align: left; cursor: pointer; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gesture-card-title:hover { color: var(--accent); }
.gesture-card-slug { font-size: 11px; color: var(--text3); font-family: ui-monospace, monospace; }
.gesture-card-cat {
  display: inline-block; align-self: flex-start;
  font-size: 11px; color: var(--text2); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px;
}
.gesture-card-notes {
  font-size: 12px; color: var(--text2); line-height: 1.45;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gesture-card-notes-empty { color: var(--text3); font-style: italic; }
.gesture-actions {
  display: flex; gap: 6px; margin-top: auto; padding-top: 4px;
}
.gesture-actions-col { flex-direction: column; }
.gesture-action-btn { flex: 1; justify-content: center; min-width: 0; }
.gesture-action-btn .gesture-action-label { font-size: 12px; }
.gesture-actions-compact .gesture-action-label { display: none; }
.gesture-actions-compact .gesture-action-btn { flex: 0 0 auto; min-width: 34px; padding: 6px 8px; }

.gestures-list-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden; margin-bottom: 16px;
}
.gestures-list-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: 14px; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.gestures-list-row:last-child { border-bottom: none; }
.gestures-list-row:hover { background: var(--surface2); }
.gestures-list-thumb { width: 96px; flex-shrink: 0; cursor: pointer; border-radius: 8px; overflow: hidden; }
.gestures-list-thumb .gesture-thumb-root { border-radius: 8px; }
.gestures-list-main { min-width: 0; cursor: pointer; }
.gestures-list-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.gestures-list-sub {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 12px; color: var(--text3);
}
.gestures-list-sub code {
  font-family: ui-monospace, monospace; font-size: 11px;
  background: var(--surface2); padding: 1px 6px; border-radius: 4px;
}
.gestures-list-notes { color: var(--text2); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gestures-list-badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

@media (max-width: 720px) {
  .gestures-list-row {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .gestures-list-badges { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
  .gesture-actions { grid-column: 1 / -1; }
  .gestures-list-thumb { width: 72px; }
}

/* Video batch stitch (admin) */
.stitch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .stitch-layout { grid-template-columns: 1fr; }
}
.stitch-clips-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stitch-sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  z-index: 2;
}
@media (max-width: 960px) {
  .stitch-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
}
.stitch-clip-card { padding: 14px; }
.stitch-clip-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.stitch-clip-index {
  width: 26px; height: 26px; border-radius: 6px; color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stitch-clip-video {
  width: 100%; max-height: 280px; border-radius: 8px; background: #111; display: block;
}
.stitch-preview-video {
  width: 100%; border-radius: 8px; background: #111; min-height: 120px; display: block;
}
.split-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.split-preview-main {
  min-width: 0;
  position: sticky;
  top: 12px;
  align-self: start;
}
.split-preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 2px;
  align-self: start;
}
.split-preview-sidebar-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
  flex-shrink: 0;
}
.split-preview-row { padding: 10px; }
.split-preview-row .input.input-sm { width: 56px; }
@media (max-width: 960px) {
  .split-preview-layout { grid-template-columns: 1fr; }
  .split-preview-sidebar {
    max-height: none;
    position: static;
    order: 2;
  }
  .split-preview-main { order: 1; }
}
.trim-track-wrap { margin-top: 10px; }
.trim-track {
  position: relative; height: 32px; background: var(--surface2); border-radius: 6px;
  border: 1px solid var(--border);
}
.trim-track-active {
  position: absolute; top: 0; bottom: 0; background: rgba(99, 102, 241, 0.35);
  border-left: 2px solid var(--accent); border-right: 2px solid var(--accent);
  pointer-events: none; border-radius: 4px;
}
.trim-range {
  position: absolute; left: 0; width: 100%; height: 32px;
  margin: 0; background: transparent; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.trim-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 28px; border-radius: 4px;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  pointer-events: auto; cursor: ew-resize;
}
.trim-range::-moz-range-thumb {
  width: 14px; height: 28px; border-radius: 4px; border: 2px solid #fff;
  background: var(--accent); pointer-events: auto; cursor: ew-resize;
}
.trim-range-start { z-index: 2; }
.trim-range-end { z-index: 3; }
.trim-times {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-top: 4px;
}
.master-timeline { margin-bottom: 4px; }
.master-timeline-bar {
  display: flex; height: 28px; border-radius: 6px; overflow: hidden; background: var(--surface2);
  border: 1px solid var(--border);
}
.master-timeline-seg { min-width: 2px; transition: opacity .15s; }
.master-timeline-seg:hover { opacity: 0.85; }
.master-timeline-legend {
  display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px;
}
.master-timeline-label {
  font-size: 10px; color: var(--text3); display: flex; align-items: center; gap: 4px;
}
.master-timeline-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.stitch-json-preview {
  font-size: 11px; line-height: 1.45; max-height: 320px; overflow: auto;
  background: var(--surface2); padding: 10px; border-radius: 8px; margin: 0;
}
.stitch-sign-list { max-height: 280px; overflow-y: auto; margin-top: 8px; }
.stitch-sign-row { border-bottom: 1px solid var(--border); }
.stitch-sign-row:last-child { border-bottom: none; }
.stitch-sign-row-main {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px;
}
.stitch-sign-hover-video {
  width: 72px; height: 48px; flex-shrink: 0; border-radius: 6px;
  background: var(--surface2); overflow: hidden; display: flex;
  align-items: center; justify-content: center; position: relative;
}
.stitch-sign-hover-video video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.stitch-sign-hover-placeholder { font-size: 20px; line-height: 1; }
.stitch-sign-search-dropdown {
  margin-top: 6px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); max-height: 200px; overflow-y: auto;
}
.stitch-sign-search-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  cursor: pointer; border-bottom: 1px solid var(--border);
}
.stitch-sign-search-item:last-child { border-bottom: none; }
.stitch-sign-search-item:hover { background: var(--surface2); }
.stitch-sign-search-item-info { flex: 1; min-width: 0; }
.stitch-sign-search-item-name {
  font-size: 13px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.stitch-sign-search-item-id {
  font-size: 10px; color: var(--text3); font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stitch-sign-linked-badge {
  font-size: 10px; color: var(--green); font-weight: 600; margin-top: 4px;
}
.stitch-sign-name {
  flex: 1; text-align: left; border: none; background: none; cursor: pointer;
  padding: 4px 6px; border-radius: 6px; display: flex; flex-direction: column; gap: 2px;
}
.stitch-sign-name:hover { background: var(--surface2); }
.stitch-sign-videos { display: flex; flex-direction: column; gap: 4px; padding: 4px 0 8px 8px; }
.stitch-sign-video-btn {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); font-size: 12px; cursor: pointer; text-align: left;
}
.stitch-sign-video-btn:hover { border-color: var(--accent); background: var(--accent-light); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 480px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-wide { max-width: 820px; }
.modal-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface); }

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 13px; animation: slideUp .2s ease; max-width: 320px; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-btn { padding: 5px 10px; border-radius: var(--radius); font-size: 12px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; min-width: 32px; text-align: center; }
.page-btn:hover { background: var(--surface2); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Search bar */
.search-bar { position: relative; }
.search-bar input { padding-left: 34px; }
.search-bar::before { content: ''; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 24 24%27 stroke=%27%239ca3af%27%3E%3Cpath stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z%27/%3E%3C/svg%3E") center/contain no-repeat; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transition: transform .25s; overflow-y: auto; }
.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.page-header { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 50; }
.page-body { padding: 24px; }

/* Sidebar styles */
.sidebar-logo { padding: 18px 16px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.sidebar-logo-icon { width: 30px; height: 30px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; }
.sidebar-nav { flex: 1; padding: 12px 8px; }
.sidebar-section { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; padding: 10px 8px 4px; }
.nav-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: var(--radius); border: none; background: none; color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; transition: all .12s; font-family: var(--font); }
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: var(--accent-light); color: var(--accent); }
.nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-btn.active svg { opacity: 1; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.sidebar-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info { min-width: 0; }
.sidebar-username { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-role { font-size: 11px; color: var(--text3); }

/* Mobile */
.mobile-header { display: none; height: var(--header-h); align-items: center; justify-content: space-between; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 60; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .mobile-header { display: flex; }
  .page-header { display: none; }
  .page-body { padding: 16px; }
}

/* Auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-icon { width: 44px; height: 44px; background: var(--accent); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; margin-bottom: 10px; }
.auth-title { font-size: 20px; font-weight: 700; }
.auth-subtitle { font-size: 13px; color: var(--text3); margin-top: 2px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-error { background: var(--red-light); color: var(--red); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.stat-label { font-size: 12px; color: var(--text3); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty-state svg { width: 40px; height: 40px; opacity: .3; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* Loading */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { text-align: center; padding: 32px; color: var(--text3); font-size: 13px; }

/* Video transition picker */
.video-picker-col { min-width: 0; }
.video-picker-selected {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}
.video-picker-meta { min-width: 0; flex: 1; }
.video-picker-filename {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.generate-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 640px) {
  .generate-modal-grid { grid-template-columns: 1fr; }
}

/* Code block */
.code-block { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; line-height: 1.7; overflow-x: auto; color: var(--text2); }
.code-block .ck { color: var(--accent); }
.code-block .cs { color: var(--green); }
.code-block .cn { color: var(--yellow); }
.code-block .cc { color: var(--text3); font-style: italic; }
.code-block .cm { color: var(--purple); }

/* Method badges */
.m-get { background: var(--green-light); color: var(--green); border: 1px solid var(--green); }
.m-post { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }
.m-put { background: var(--yellow-light); color: var(--yellow); border: 1px solid var(--yellow); }
.m-del { background: var(--red-light); color: var(--red); border: 1px solid var(--red); }
.m-patch { background: var(--purple-light); color: var(--purple); border: 1px solid var(--purple); }

/* Permissions grid */
.perm-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.perm-route { font-family: monospace; font-size: 12px; color: var(--text2); }
.perm-methods { display: flex; gap: 4px; flex-wrap: wrap; }
.perm-method { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.perm-method input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--accent); }

/* Docs */
.doc-endpoint { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px; }
.doc-ep-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; background: var(--surface); }
.doc-ep-header:hover { background: var(--surface2); }
.doc-ep-path { font-family: monospace; font-size: 13px; flex: 1; }
.doc-ep-summary { font-size: 12px; color: var(--text3); }
.doc-ep-body { border-top: 1px solid var(--border); padding: 16px; display: none; background: var(--bg); }
.doc-ep-body.open { display: block; }
.params-tbl { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 12px; }
.params-tbl th { padding: 6px 10px; text-align: left; color: var(--text3); font-size: 11px; border-bottom: 1px solid var(--border); background: none; text-transform: uppercase; }
.params-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.params-tbl td:first-child { font-family: monospace; color: var(--accent); }
.params-tbl td:nth-child(2) { color: var(--purple); font-family: monospace; }
.req-star { color: var(--red); }

/* Try it */
.try-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-top: 10px; }
.try-row { display: flex; gap: 6px; }
.try-result { background: var(--surface2); border-radius: var(--radius); padding: 10px; margin-top: 8px; display: none; }
.try-result.show { display: block; }
.try-status { font-size: 11px; font-weight: 600; margin-bottom: 6px; font-family: monospace; }
.try-ok { color: var(--green); }
.try-err { color: var(--red); }

/* Nav badge */
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Support chat */
.support-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
  min-height: calc(100vh - 180px);
}
@media (max-width: 768px) {
  .support-layout { grid-template-columns: 1fr; }
}
.support-list { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.support-list-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--border); }
.support-ticket-items { overflow-y: auto; flex: 1; max-height: 520px; }
.support-ticket-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border: none; background: none;
  border-bottom: 1px solid var(--border); cursor: pointer; font-family: var(--font);
}
.support-ticket-item:hover { background: var(--surface2); }
.support-ticket-item.active { background: var(--accent-light); }
.support-ticket-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.support-ticket-user { font-weight: 600; font-size: 13px; flex: 1; }
.support-ticket-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); }
.support-chat { display: flex; flex-direction: column; padding: 0; min-height: 480px; }
.support-chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 14px; padding: 40px; }
.support-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.support-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: 420px; }
.support-msg { display: flex; }
.support-msg.user { justify-content: flex-start; }
.support-msg.admin { justify-content: flex-end; }
.support-msg-wrap { position: relative; max-width: 75%; }
.support-msg.admin .support-msg-wrap { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 4px; }
.support-msg.user .support-msg-wrap { display: flex; align-items: flex-start; gap: 4px; }
.support-msg-menu { position: relative; flex-shrink: 0; }
.support-msg-menu-btn {
  width: 28px; height: 28px; border: none; border-radius: 6px; cursor: pointer;
  background: var(--surface2); color: var(--text2); font-size: 16px; line-height: 1;
}
.support-msg-menu-btn:hover { background: var(--border); }
.support-msg-dropdown {
  position: absolute; top: 100%; right: 0; z-index: 20; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); padding: 4px; margin-top: 4px;
}
.support-msg-dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: none;
  background: none; cursor: pointer; font-size: 13px; border-radius: 6px; font-family: var(--font);
}
.support-msg-dropdown button:hover { background: var(--surface2); }
.support-msg-dropdown button.danger { color: var(--red); }
.support-msg-bubble { padding: 10px 12px; border-radius: 12px; background: var(--surface2); flex: 1; }
.support-msg.admin .support-msg-bubble { background: var(--accent-light); }
.support-msg-edit { display: flex; flex-direction: column; gap: 8px; }
.support-msg-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.support-msg-sender { font-size: 11px; font-weight: 600; color: var(--text3); margin-bottom: 4px; }
.support-msg-text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.support-msg-video { max-width: 100%; border-radius: 8px; margin: 6px 0; max-height: 240px; }
.support-msg-image { max-width: 100%; border-radius: 8px; margin: 6px 0; max-height: 280px; object-fit: cover; }
.support-msg-file {
  display: inline-flex; align-items: center; gap: 6px; margin: 6px 0; padding: 8px 12px;
  border-radius: 8px; background: var(--accent-light); color: var(--accent); font-size: 13px;
  font-weight: 600; text-decoration: none;
}
.support-msg-file:hover { text-decoration: underline; }
.support-pending-file-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.support-msg-time { font-size: 10px; color: var(--text3); margin-top: 4px; text-align: right; }
.support-reply { padding: 12px 14px; border-top: 1px solid var(--border); }
.support-pending-video {
  display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 10px;
  background: var(--surface2); border-radius: 10px;
}
.support-pending-video-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #000; }
.support-pending-video-info { flex: 1; min-width: 0; }
.support-attach-btn { flex-shrink: 0; width: 40px; padding: 0; font-size: 18px; }
.support-reply-as { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.support-reply-row { display: flex; gap: 8px; align-items: flex-end; }
.support-reply-row textarea { flex: 1; resize: vertical; min-height: 44px; }
.support-status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-status-row select { min-width: 140px; }



/*# sourceMappingURL=main.1e0d283d.css.map*/