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

body {
  font-family: 'Inter', sans-serif;
  background: #0d1117;
  color: #e6edf3;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app { display: flex; flex-direction: column; height: 100vh; }

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 1rem; color: #fb923c; }
.version { font-size: 0.7rem; color: #6e7681; margin-left: 8px; }
.btn-logout {
  font-size: 0.8rem; color: #8b949e; text-decoration: none;
  padding: 4px 10px; border: 1px solid #30363d; border-radius: 4px;
}
.btn-logout:hover { color: #e6edf3; border-color: #6e7681; }

/* Tabs */
.tab-bar {
  display: flex; gap: 2px; padding: 8px 12px 0;
  background: #161b22; border-bottom: 1px solid #30363d; flex-shrink: 0;
}
.tab-btn {
  padding: 6px 18px; border: none; background: transparent;
  color: #8b949e; cursor: pointer; border-radius: 6px 6px 0 0;
  font-size: 0.875rem; font-weight: 500;
}
.tab-btn.active { background: #0d1117; color: #fb923c; }
.tab-content { display: none; flex: 1; overflow: hidden; }
.tab-content.active { display: flex; flex-direction: column; }

/* Editor layout */
.editor-layout {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 0;
  height: 100%;
  overflow: hidden;
}

/* Sidebars */
.sidebar-left, .sidebar-right {
  background: #161b22;
  border-right: 1px solid #30363d;
  overflow-y: auto;
  padding: 12px;
}
.sidebar-right { border-right: none; border-left: 1px solid #30363d; }

.panel-section { margin-bottom: 16px; }
.panel-label {
  display: block; font-size: 0.7rem; font-weight: 600; color: #6e7681;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.mini-label { font-size: 0.75rem; color: #8b949e; white-space: nowrap; }
.mt-8 { margin-top: 8px; }

.select-input {
  width: 100%; padding: 6px 8px; background: #0d1117; border: 1px solid #30363d;
  border-radius: 6px; color: #e6edf3; font-size: 0.8rem;
}
.text-input {
  width: 100%; padding: 6px 8px; background: #0d1117; border: 1px solid #30363d;
  border-radius: 6px; color: #e6edf3; font-size: 0.8rem; resize: vertical;
}
.text-input:focus, .select-input:focus { outline: none; border-color: #fb923c; }
.num-input {
  width: 60px; padding: 4px 6px; background: #0d1117; border: 1px solid #30363d;
  border-radius: 4px; color: #e6edf3; font-size: 0.8rem;
}
.color-input { width: 36px; height: 28px; border: none; cursor: pointer; border-radius: 4px; background: none; }
.checkbox { width: 16px; height: 16px; cursor: pointer; }

.row-controls { display: flex; align-items: center; gap: 8px; }
.slider { flex: 1; accent-color: #fb923c; }

/* Video list */
.video-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.video-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent;
}
.video-item:hover { background: #0d1117; }
.video-item.selected { border-color: #fb923c; background: #0d1117; }
.video-thumb-sm { width: 48px; height: 27px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.placeholder-thumb {
  width: 48px; height: 27px; background: #30363d;
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #6e7681; flex-shrink: 0;
}
.video-item-title { font-size: 0.75rem; color: #c9d1d9; line-height: 1.3; }

/* Buttons */
.btn-primary {
  padding: 8px 14px; background: #ea580c; border: none;
  border-radius: 6px; color: white; font-size: 0.8rem; cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: #fb923c; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  padding: 6px 12px; background: transparent; border: 1px solid #30363d;
  border-radius: 6px; color: #8b949e; font-size: 0.8rem; cursor: pointer;
}
.btn-secondary:hover { border-color: #6e7681; color: #e6edf3; }

/* Canvas area */
.canvas-area {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding: 16px;
  background: #0d1117; overflow: auto;
}

.format-bar {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.fmt-btn {
  padding: 5px 14px; background: transparent; border: 1px solid #30363d;
  border-radius: 20px; color: #8b949e; font-size: 0.8rem; cursor: pointer;
}
.fmt-btn.active { border-color: #fb923c; color: #fb923c; }

.canvas-wrapper {
  position: relative; border: 2px solid #30363d; border-radius: 4px;
  overflow: hidden;
}

.canvas-placeholder {
  width: 768px; height: 432px;
  display: flex; align-items: center; justify-content: center;
  background: #161b22; color: #484f58; font-size: 0.875rem;
}

.canvas-actions { margin-top: 14px; }

.btn-generate {
  padding: 10px 32px;
  background: linear-gradient(135deg, #ea580c, #dc2626);
  border: none; border-radius: 8px; color: white;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-generate:hover { opacity: 0.9; }
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; }

/* Jobs */
.jobs-container { padding: 20px; max-width: 800px; margin: 0 auto; width: 100%; }
.jobs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.jobs-header h2 { font-size: 1rem; font-weight: 600; }

.job-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #161b22;
  border: 1px solid #30363d; border-radius: 8px; margin-bottom: 10px;
}
.job-title { font-size: 0.875rem; font-weight: 500; color: #e6edf3; }
.job-meta { font-size: 0.75rem; color: #6e7681; margin-top: 3px; }
.job-actions { display: flex; align-items: center; gap: 10px; }

.badge {
  padding: 3px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 600;
}
.badge-pending  { background: #1e3a5f; color: #60a5fa; }
.badge-processing { background: #1a3320; color: #4ade80; }
.badge-done     { background: #14532d; color: #86efac; }
.badge-failed   { background: #450a0a; color: #f87171; }

.btn-download {
  padding: 5px 12px; background: #ea580c; border-radius: 6px;
  color: white; text-decoration: none; font-size: 0.75rem; font-weight: 500;
}
.btn-download:hover { background: #fb923c; }
.btn-preview {
  padding: 5px 12px; background: transparent; border: 1px solid #30363d;
  border-radius: 6px; color: #8b949e; text-decoration: none; font-size: 0.75rem;
}
.btn-preview:hover { color: #e6edf3; border-color: #6e7681; }

/* Login page */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.min-h-screen { min-height: 100vh; }
.bg-slate-900 { background: #0d1117; }
.text-white { color: #f8fafc; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.p-8 { padding: 2rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.bg-slate-800 { background: #161b22; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,.4); }
.border { border-width: 1px; }
.border-slate-700 { border-color: #30363d; }
.text-center { text-align: center; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.text-transparent { color: transparent; }
.bg-clip-text { -webkit-background-clip: text; background-clip: text; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-orange-500 { --tw-gradient-stops: #f97316, var(--tw-gradient-to, transparent); }
.to-rose-500 { --tw-gradient-to: #f43f5e; }
.text-slate-400 { color: #8b949e; }
.text-sm { font-size: 0.875rem; }
.mt-1 { margin-top: 0.25rem; }
.bg-red-900\/40 { background: rgba(127,29,29,.4); }
.border-red-700 { border-color: #b91c1c; }
.text-red-300 { color: #fca5a5; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.rounded { border-radius: 0.25rem; }
.block { display: block; }
.font-medium { font-weight: 500; }
.mb-1 { margin-bottom: 0.25rem; }
.text-slate-300 { color: #c9d1d9; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.bg-slate-700 { background: #30363d; }
.border-slate-600 { border-color: #484f58; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px #f97316; }
.outline-none { outline: none; }
.placeholder-slate-500::placeholder { color: #6e7681; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.bg-gradient-to-r.from-orange-600.to-rose-600 {
  background: linear-gradient(to right, #ea580c, #e11d48);
}
.hover\:from-orange-500:hover { --tw-gradient-stops: #f97316, var(--tw-gradient-to, transparent); }
.hover\:to-rose-500:hover { --tw-gradient-to: #f43f5e; }
.transition-colors { transition: background-color 0.2s; }

button[type="submit"] {
  width: 100%; padding: 0.5rem 1rem;
  background: linear-gradient(to right, #ea580c, #e11d48);
  border: none; border-radius: 0.25rem; color: white;
  font-weight: 500; cursor: pointer; font-size: 0.875rem;
}
button[type="submit"]:hover { background: linear-gradient(to right, #f97316, #f43f5e); }

input[type="email"], input[type="password"], input[type="text"] {
  display: block; width: 100%; padding: 0.5rem 1rem;
  background: #30363d; border: 1px solid #484f58; border-radius: 0.25rem;
  color: white; font-size: 0.875rem;
}
input:focus { outline: none; box-shadow: 0 0 0 2px #f97316; border-color: #f97316; }

.loading { color: #6e7681; font-size: 0.875rem; padding: 12px; text-align: center; }
.empty { color: #484f58; font-size: 0.875rem; padding: 12px; text-align: center; }
