/* ============================================
   GateAI Studio — Neo-Brutalist Design System
   Inspired by tasarim.html
   ============================================ */

:root {
  --bg:      #f1ede6;
  --bg2:     #ddd4c7;
  --panel:   #f8f4ec;
  --panel2:  #fcfaf5;
  --line:    #111111;
  --text:    #111111;
  --muted:   rgba(17,17,17,.64);
  --orange:  #ccb27a;
  --blue:    #d6e0ea;
  --green:   #dfe7db;
  --warn:    #e6dcc8;
  --danger:  #dfc2bc;
  --shadow:  6px 6px 0 #111111;
  --shadow-sm: 3px 3px 0 #111111;
  --radius:  26px;
  --font:    "Bahnschrift","Trebuchet MS","Segoe UI",sans-serif;
  --transition: .12s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: linear-gradient(180deg, #f4f0e8 0%, #ece7de 52%, #e4dfd6 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Decorative orbs on body */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border: 2px solid rgba(17,17,17,.55);
  border-radius: 999px;
  pointer-events: none;
  opacity: .18;
}
body::before {
  top: 42px; right: 54px;
  width: 180px; height: 180px;
  background: #d8e1e8;
  transform: rotate(14deg);
}
body::after {
  left: 40px; bottom: 34px;
  width: 130px; height: 130px;
  background: #ddd2c5;
  transform: rotate(-12deg);
}

/* ── Scrollbar ─────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #111; border-radius: 4px; }

/* ── Glass / Card ──────────────────── */
.glass {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Inputs ────────────────────────── */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 18px;
  border: 3px solid #111;
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--muted); }

input:focus, textarea:focus, select:focus {
  transform: translate(2px,2px);
  box-shadow: 2px 2px 0 #111;
  background: #fffef0;
}

/* select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111111' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
  cursor: pointer;
}

select option { background: #fff; }

textarea { resize: vertical; min-height: 100px; }

/* ── Buttons ────────────────────────── */
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 18px;
  border: 3px solid #111;
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg, button svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:hover:not(:disabled), button:hover:not(:disabled) {
  transform: translate(2px,2px);
  box-shadow: 2px 2px 0 #111;
}
.btn:active:not(:disabled), button:active:not(:disabled) {
  transform: translate(3px,3px);
  box-shadow: 1px 1px 0 #111;
}
.btn:disabled, button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Variants */
.btn-primary, button.primary {
  background: var(--orange);
  color: var(--text);
}
.btn-blue { background: var(--blue); }
.btn-green { background: var(--green); }
.btn-danger { background: var(--danger); }
.btn-warn { background: var(--warn); }

.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 14px; }
.btn-full { width: 100%; }

/* ── Alerts ─────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 3px solid #111;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-error { background: var(--danger); }
.alert-success { background: var(--green); }
.alert-info { background: var(--blue); }

/* ── Badges ─────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 2px solid #111;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #e4dbc9;
  box-shadow: var(--shadow-sm);
}
.badge:nth-child(2n) { background: var(--blue); }
.badge:nth-child(3n) { background: var(--green); }
.badge:nth-child(4n) { background: var(--warn); }

/* ── Section label ─────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #d7cfc4;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text);
  margin-bottom: 8px;
  margin-top: 16px;
}

/* ── Toast ──────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel2);
  border: 3px solid #111;
  border-radius: 18px;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toastIn .25s ease;
  transition: all .25s ease;
}

.toast.removing { opacity: 0; transform: translateX(110%); }

@keyframes toastIn {
  from { opacity:0; transform: translateX(110%); }
  to   { opacity:1; transform: translateX(0); }
}

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; }
.toast-title { font-size: 13px; font-weight: 900; margin-bottom: 2px; }
.toast-msg { font-size: 12px; color: var(--muted); }

.toast-success { background: var(--green); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--blue); }

/* ── Spinner ────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(17,17,17,.25);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 960px;
  width: 100%;
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Login Card */
.login-card {
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-box {
  width: 48px;
  height: 48px;
  border: 3px solid #111;
  border-radius: 14px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.logo-icon-box svg { width: 24px; height: 24px; }

.logo-text-group { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 22px; font-weight: 900; color: var(--text); letter-spacing: -.5px; }
.logo-sub  { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }

.login-heading h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.8px;
  margin-bottom: 10px;
}

.login-heading p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Feature pills */
.feature-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--panel2);
  border: 2px solid #111;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  box-shadow: 2px 2px 0 #111;
}
.pill svg { width: 12px; height: 12px; }

/* Login Form */
.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-label svg { width: 13px; height: 13px; }

.input-wrapper { position: relative; }
.input-wrapper input { padding-right: 48px; }

.toggle-vis {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  box-shadow: none;
  display: flex;
}
.toggle-vis:hover { color: var(--text); transform: translateY(-50%); box-shadow: none; }
.toggle-vis svg { width: 17px; height: 17px; }

.form-hint { font-size: 12px; color: var(--muted); }
.form-hint a { color: var(--text); font-weight: 700; }

.btn-login {
  width: 100%;
  padding: 14px 20px;
  background: var(--orange);
  font-size: 15px;
  font-weight: 900;
  border-radius: 18px;
  border: 3px solid #111;
  box-shadow: var(--shadow-sm);
}

.login-footer {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  padding-top: 10px;
  border-top: 2px solid rgba(17,17,17,.12);
}

/* Login Preview Panel */
.login-preview {
  background:
    linear-gradient(135deg, rgba(17,17,17,.04) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, transparent 75%, rgba(17,17,17,.04) 75%) 0 0 / 18px 18px,
    linear-gradient(180deg, #e8e0d4 0%, #ddd5c8 100%);
  border-left: 3px solid #111;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  position: relative;
}

/* Preview cards */
.prev-card {
  background: var(--panel2);
  border: 3px solid #111;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  animation: slideUp .4s ease both;
}
.prev-card:nth-child(1) { animation-delay: .1s; }
.prev-card:nth-child(2) { animation-delay: .2s; transform: rotate(.3deg); }
.prev-card:nth-child(3) { animation-delay: .3s; transform: rotate(-.3deg); }

@keyframes slideUp {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: translateY(0); }
}

.prev-thumb {
  width: 52px;
  height: 52px;
  border: 3px solid #111;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prev-thumb svg { width: 20px; height: 20px; }

.prev-info { flex: 1; min-width: 0; }
.prev-model { font-size: 12px; font-weight: 900; font-family: "Courier New", monospace; margin-bottom: 3px; }
.prev-prompt { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prev-status {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border: 2px solid #111;
  border-radius: 999px;
}
.prev-status.done { background: var(--green); }
.prev-status.run  { background: var(--warn); }

.spin-ring {
  width: 16px; height: 16px;
  border: 2px solid rgba(17,17,17,.25);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Preview stats row */
.prev-stats {
  display: flex;
  border: 3px solid #111;
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel2);
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}
.prev-stat {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-right: 2px solid #111;
}
.prev-stat:last-child { border-right: none; }
.prev-stat-num { font-size: 24px; font-weight: 900; line-height: 1; }
.prev-stat-label { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-body {
  padding: 20px;
  position: relative;
  z-index: 1;
}

.dashboard-layout {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0,1fr);
  gap: 24px;
}

/* ── Sidebar ──────────────────────── */
.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(17,17,17,.04) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, transparent 75%, rgba(17,17,17,.04) 75%) 0 0 / 18px 18px,
    linear-gradient(180deg, #e6ded1 0%, var(--bg2) 100%);
  padding: 24px;
}

.sidebar-brand h1 {
  font-size: 36px;
  font-weight: 900;
  line-height: .92;
  margin-bottom: 8px;
}
.sidebar-brand p { font-size: 13px; color: var(--muted); line-height: 1.65; }

/* Stats */
.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}
.s-stat {
  padding: 12px 10px;
  background: #fffdf7;
  border: 3px solid #111;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.s-stat:nth-child(2) { transform: rotate(-.4deg); }
.s-stat:nth-child(3) { transform: rotate(.4deg); }
.s-stat-num { font-size: 20px; font-weight: 900; line-height: 1; }
.s-stat-label { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }

/* Sidebar search */
.s-search {
  background: rgba(252,250,245,.92);
  border: 3px solid #111;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 10px;
}

/* Sidebar nav */
.s-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.s-nav::-webkit-scrollbar { width: 4px; }
.s-nav::-webkit-scrollbar-thumb { background: rgba(17,17,17,.2); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 16px;
  border: 2.5px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-align: left;
  box-shadow: none;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(17,17,17,.06);
  color: var(--text);
  transform: none;
  box-shadow: none;
}
.nav-item.active {
  background: var(--panel2);
  border-color: #111;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transform: none;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--orange);
  border: 2px solid #111;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Sidebar balance */
.s-balance {
  background: #fffdf7;
  border: 3px solid #111;
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.s-balance-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.s-balance-amount {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

/* ── Main content ─────────────────── */
.main-content { display: flex; flex-direction: column; gap: 24px; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 24px;
}

.topbar-title { font-size: 20px; font-weight: 900; flex: 1; }

.topbar-actions { display: flex; gap: 10px; align-items: center; }

.hamburger {
  display: none;
  background: none;
  border: 3px solid #111;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}
.hamburger svg { width: 20px; height: 20px; }
.hamburger:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 #111; }

/* Page body */
.page-body { display: flex; flex-direction: column; gap: 20px; }

/* ── Panel (card) ─────────────────── */
.panel {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 2px solid rgba(17,17,17,.12);
}

.panel-title {
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title svg { width: 18px; height: 18px; }

.panel-body { padding: 24px; }

/* ── Generator layout ─────────────── */
.generator-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* Model grid */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.model-card {
  background: #fffdf7;
  border: 3px solid #111;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.model-card:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 #111; }
.model-card.selected {
  background: var(--blue);
  transform: translate(2px,2px);
  box-shadow: 2px 2px 0 #111;
}

.model-card-name {
  font-size: 12px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.model-card-price { font-size: 10px; font-weight: 900; color: var(--muted); }
.model-card-type {
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1.5px solid #111;
  text-transform: uppercase;
  background: var(--green);
}

/* Params grid */
.params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.param-group { display: flex; flex-direction: column; gap: 6px; }
.param-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

/* Cost card (right panel) */
.cost-card {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cost-card-title {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(17,17,17,.1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cost-card-title svg { width: 14px; height: 14px; }

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed rgba(17,17,17,.12);
}
.cost-row:last-of-type { border-bottom: none; }
.cost-row-label { color: var(--muted); font-weight: 700; }
.cost-row-value { font-weight: 900; }
.cost-row-value.accent { color: #7a6000; }

.cost-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0 0;
  border-top: 3px solid #111;
  margin-top: 8px;
}
.cost-total-label { font-size: 14px; font-weight: 900; }
.cost-total-value { font-size: 24px; font-weight: 900; }

.generate-btn {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  background: var(--orange);
  font-size: 15px;
  font-weight: 900;
  border-radius: 18px;
  border: 3px solid #111;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.generate-btn svg { width: 18px; height: 18px; }

/* Quick prompts */
.quick-prompts { display: flex; flex-direction: column; gap: 6px; }
.quick-prompt-btn {
  justify-content: flex-start;
  font-size: 11px;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
  font-weight: 800;
}

/* Tips box */
.tips-box {
  margin-top: 16px;
  padding: 14px;
  border: 2px dashed rgba(17,17,17,.25);
  border-radius: 16px;
  background: rgba(17,17,17,.03);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.tips-box strong { color: var(--text); font-weight: 900; }

/* ── Jobs grid ─────────────────────── */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.job-card {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.job-card:hover {
  box-shadow: var(--shadow);
  transform: translate(-2px,-2px);
}

.job-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e0d8cc, #cec7be);
  border-bottom: 3px solid #111;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.job-thumb video { width:100%; height:100%; object-fit:cover; }

.job-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.job-thumb-placeholder svg { width: 28px; height: 28px; }

.job-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 2px solid #111;
}
.status-finished { background: var(--green); }
.status-processing, .status-queued { background: var(--warn); }
.status-failed { background: var(--danger); }

.progress-bar-outer {
  position: absolute; bottom:0; left:0; right:0;
  height: 4px;
  background: rgba(17,17,17,.1);
}
.progress-bar-inner {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width .5s ease;
}

.job-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.job-model {
  font-size: 11px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  background: var(--blue);
  border: 2px solid #111;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}
.job-prompt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.job-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  flex-wrap: wrap;
}

/* ── Tabs ─────────────────────────── */
.tabs-row {
  display: flex;
  gap: 6px;
  background: #ece5da;
  border: 3px solid #111;
  border-radius: 18px;
  padding: 5px;
}
.tab-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: none;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  color: var(--muted);
  box-shadow: none;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-btn:hover { background: rgba(17,17,17,.06); color: var(--text); transform: none; box-shadow: none; }
.tab-btn.active {
  background: var(--panel2);
  border-color: #111;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transform: none;
}
.tab-btn svg { width: 14px; height: 14px; }

/* ── Search bar ─────────────────────── */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-bar svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.search-bar input {
  padding-left: 38px;
  background: rgba(252,250,245,.92);
}

/* ── Empty state ────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 16px;
}
.empty-icon {
  width: 72px; height: 72px;
  background: var(--panel2);
  border: 3px solid #111;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { font-size: 20px; font-weight: 900; }
.empty-state p { font-size: 14px; color: var(--muted); max-width: 280px; line-height: 1.5; }

/* ── Modal ──────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17,17,17,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(10px);
  transition: transform .2s ease;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 2px solid rgba(17,17,17,.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 900; }
.modal-close {
  background: none;
  border: 2px solid #111;
  border-radius: 10px;
  cursor: pointer;
  padding: 6px;
  box-shadow: 2px 2px 0 #111;
  display: flex;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 #111; }

.modal-body { padding: 0; }
.modal-footer {
  padding: 16px 24px;
  border-top: 2px solid rgba(17,17,17,.12);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Catalog card ───────────────────── */
.catalog-card {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.catalog-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow); }

.catalog-thumb {
  aspect-ratio: 2.5/1;
  background: linear-gradient(135deg, #e5dcce, #d8d0c4);
  border-bottom: 3px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.catalog-thumb svg { width: 28px; height: 28px; color: var(--muted); }

.catalog-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.catalog-id {
  font-size: 12px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  background: var(--blue);
  border: 2px solid #111;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}
.catalog-name { font-size: 13px; color: var(--muted); }
.catalog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* ── Mode toggle buttons (topbar) ── */
.mode-toggle {
  background: var(--panel2);
  border: 3px solid #111;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  transition: all var(--transition);
}
.mode-toggle.active {
  background: var(--orange);
  color: var(--text);
  box-shadow: 2px 2px 0 #111;
  transform: translate(2px, 2px);
}
.mode-toggle:hover:not(.active) {
  background: var(--warn);
  color: var(--text);
}

/* ── Custom Confirm Modal ─────────── */
.confirm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17,17,17,.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  backdrop-filter: blur(2px);
}
.confirm-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.confirm-modal {
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 #111;
  width: 100%;
  max-width: 380px;
  transform: scale(.92) translateY(16px);
  transition: transform .18s ease;
  overflow: hidden;
}
.confirm-modal-overlay.open .confirm-modal {
  transform: scale(1) translateY(0);
}
.confirm-modal-header {
  padding: 20px 24px 14px;
  border-bottom: 2px solid rgba(17,17,17,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.confirm-modal-icon {
  width: 38px; height: 38px;
  background: var(--danger);
  border: 3px solid #111;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 #111;
}
.confirm-modal-icon svg { width: 18px; height: 18px; }
.confirm-modal-title { font-size: 16px; font-weight: 900; }
.confirm-modal-body {
  padding: 16px 24px 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 600;
}
.confirm-modal-footer {
  padding: 14px 24px;
  border-top: 2px solid rgba(17,17,17,.1);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Modal body padding fix ──────── */
.modal-body { padding: 20px 24px; }

/* ── Sidebar overlay (mobile) ─────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(17,17,17,.4);
  z-index: 200;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .generator-grid { grid-template-columns: 1fr; }
  .cost-card { position: static; }
}

@media (max-width: 980px) {
  .dashboard-body { padding: 14px; }
  .dashboard-layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 300px;
    z-index: 300;
    transform: translateX(-110%);
    transition: transform .25s ease;
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: flex; }
}

@media (max-width: 768px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .login-preview { display: none; }
  .login-card { padding: 36px 24px; }
  .jobs-grid { grid-template-columns: 1fr; }
  .params-grid { grid-template-columns: 1fr; }
  .sidebar-stats { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 520px) {
  .login-card { padding: 24px 16px; }
  .dashboard-body { padding: 10px; }
  .feature-pills { display: none; }
}