/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

:root {
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --surface2:    #f1f5f9;
  --surface3:    #e2e8f0;
  --glass:       rgba(255, 255, 255, 0.8);
  --accent:      #4f46e5;
  --accent2:     #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.15);
  --border:      rgba(0, 0, 0, 0.08);
  --border2:     rgba(0, 0, 0, 0.12);
  --text:        #0f172a;
  --text2:       #334155;
  --text3:       #64748b;
  --green:       #10b981;
  --red:         #ef4444;
  --yellow:      #f59e0b;
  --blue:        #3b82f6;
  --radius:      16px;
  --radius-sm:   8px;
  --font-main:   'Inter', system-ui, -apple-system, sans-serif;
  --font-title:  'Outfit', sans-serif;
  --shadow-lg:   0 20px 50px rgba(0,0,0,0.1);
}

html, body { 
  margin: 0; padding: 0; font-family: var(--font-main); background: var(--bg); color: var(--text);
  overflow: hidden; height: 100vh; font-weight: 600;
}
h1, h2, h3, .logo-title, .modal-title, .plan-name, .plan-price { font-family: var(--font-title); font-weight: 800; }
h1, h2, h3, h4, .logo-title, .modal-title, .panel-title, .report-name {
  font-family: var(--font-title);
  letter-spacing: -0.01em;
}


/* ─── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-center { flex: 1; display: flex; justify-content: center; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; filter: drop-shadow(0 0 8px var(--accent)); }
.logo-title { font-size: 18px; font-weight: 900; letter-spacing: -0.5px; line-height: 1; }
.logo-sub { font-size: 10px; color: var(--text3); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }

.status-bar {
  display: flex; align-items: center; gap: 8px;
  background: #ffffff; border: 1px solid rgba(0,0,0,0.05);
  padding: 8px 16px; border-radius: 20px; font-size: 12px; color: var(--text2);
  font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.idle    { background: var(--text3); }
.status-dot.running { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.4s infinite; }
.status-dot.error   { background: var(--red); }
.status-dot.success { background: var(--green); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ─── NEURAL PULSE ────────────────────────────────────────── */
.neural-pulse {
  width: 14px; height: 14px; background: var(--accent); border-radius: 50%;
  position: relative; 
  box-shadow: 0 0 15px var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
}
.neural-pulse::before {
  content: ''; position: absolute; inset: -2px; border: 2px solid var(--accent);
  border-radius: 50%; opacity: 0.5;
}
.neural-pulse::after {
  content: ''; position: absolute; inset: -6px; border: 1px solid var(--accent);
  border-radius: 50%; opacity: 0; animation: neural-beat 2.5s cubic-bezier(0.2, 0, 0.2, 1) infinite;
}
@keyframes neural-beat {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}


/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 800;
  cursor: pointer; border: none; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap;
  font-family: var(--font-main); letter-spacing: 0.3px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent2); box-shadow: 0 0 16px var(--accent-glow); }
.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-success:hover:not(:disabled) { box-shadow: 0 0 16px rgba(34,197,94,0.3); }
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  background: transparent; border: none; color: var(--text3);
  cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 14px;
  transition: color 0.15s;
}
.btn-icon:hover { color: var(--text); background: var(--surface3); }

/* ─── LAYOUT ───────────────────────────────────────────────── */
.layout { display: flex; height: calc(100vh - 60px); overflow: hidden; }

/* ─── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: 270px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px 10px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text);
}
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }

.badge {
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}

.search-box { padding: 0 12px 10px; }
.search-box input {
  width: 100%; padding: 7px 10px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 12px; outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text3); }

.sprint-select {
  width: 100%;
  padding: 10px 14px;
  background: #f1f5f9;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat, repeat;
  background-position: right .7em top 50%, 0 0;
  background-size: .65em auto, 100%;
}
.sprint-select:focus { border-color: var(--accent); }

.report-list { padding: 0 8px 12px; flex: 1; overflow-y: auto; }
.report-sprint-item { margin-bottom: 8px; }
.report-sprint-name {
  font-size: 11px; font-weight: 600; color: var(--text3);
  padding: 4px 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.report-file {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px; border-radius: 6px; 
  font-size: 11px; color: var(--text2); transition: all 0.12s;
  margin: 1px 4px;
}
.report-file:hover { background: var(--surface3); color: var(--text); }
.file-main { 
  display: flex; align-items: center; gap: 8px; flex: 1; 
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.report-file .file-icon { color: var(--green); }
.delete-report-btn {
  padding: 4px; color: var(--text3); transition: all 0.2s;
  cursor: pointer; font-size: 14px;
}
.delete-report-btn:hover { color: var(--red); transform: scale(1.2); }

/* --- Enhanced Folder Styles --- */
.report-item.folder {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 4px 8px; border: 1px solid transparent;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
}
.report-item.folder:hover {
  background: var(--surface2);
  border-color: var(--border2);
  transform: translateX(2px);
}
.report-item.folder .report-icon { font-size: 16px; transition: transform 0.2s; }
.report-item.folder:hover .report-icon { transform: scale(1.1); }

.report-name { font-size: 12px; font-weight: 600; color: var(--text); }
.report-meta { font-size: 10px; color: var(--text3); margin-top: 1px; }

.delete-folder-btn {
  opacity: 0;
  transition: all 0.2s;
  padding: 4px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text3);
}
.report-item.folder:hover .delete-folder-btn { opacity: 0.6; }
.delete-folder-btn:hover {
  opacity: 1 !important;
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.empty-state-small { font-size: 12px; color: var(--text3); padding: 8px 12px; }

/* ─── MAIN ─────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 16px; gap: 14px; }

/* ─── PANEL ────────────────────────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.story-panel { flex: 1; min-height: 0; }
.terminal-panel { height: 240px; flex-shrink: 0; }

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.panel-title-row { display: flex; align-items: center; gap: 10px; }
.panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.panel-meta { font-size: 12px; color: var(--text3); }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.select-controls { display: flex; align-items: center; gap: 6px; }
.selected-count { font-size: 12px; font-weight: 600; color: var(--accent2); min-width: 70px; }

/* ─── FILTER TABS & SEARCH ─────────────────────────────────── */
.filter-controls-row {
  display: flex; align-items: center; border-bottom: 1px solid var(--border);
}
.filter-controls-row .search-box {
  padding: 0 16px; min-width: 200px;
}
.filter-tabs {
  display: flex; gap: 4px; padding: 10px 16px;
  overflow-x: auto; flex: 1; scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; color: var(--text3);
  background: transparent; transition: all 0.15s; white-space: nowrap;
}
.tab:hover { color: var(--text2); background: var(--surface2); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── STORY GRID ───────────────────────────────────────────── */
.story-grid {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; align-content: start;
}
.story-grid::-webkit-scrollbar { width: 4px; }
.story-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.story-grid-header {
  display: flex; align-items: center; padding: 14px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-title);
  position: sticky; top: 0; z-index: 10;
}
.report-table th, .report-table td {
  padding: 12px 15px; text-align: left; border: 1px solid var(--border1);
  font-size: 13px; line-height: 1.5; color: var(--text2);
  vertical-align: top;
}
.report-table th {
  background: var(--surface2); color: var(--text); font-weight: 600;
  position: sticky; top: 0; z-index: 10; border-bottom: 2px solid var(--accent);
}
.report-table tr:hover td { background: rgba(99, 102, 241, 0.05); }
.report-table td[contenteditable="true"]:focus {
  outline: 2px solid var(--accent); background: var(--surface3); color: var(--text);
}
.col-check { width: 40px; display: flex; justify-content: center; }
.col-type { width: 80px; }
.col-key { width: 120px; }
.col-summary { flex: 1; }
.col-status { width: 150px; }
.col-action { width: 60px; }

.story-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; transition: all 0.15s; position: relative;
  display: flex; flex-direction: column; gap: 8px;
}
.story-card:hover { border-color: var(--border2); background: var(--surface3); }
.story-card.selected { border-color: var(--accent); background: rgba(99,102,241,0.08); box-shadow: 0 0 0 1px var(--accent-glow); }
.story-card.already-generated { border-left: 3px solid var(--green); }

.story-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.story-card-key { font-size: 11px; font-weight: 700; color: var(--accent2); }
.story-card-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; flex: 1; }

.story-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-pill {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
}
.status-pill.dev-inprogress { background: rgba(99,102,241,0.2); color: var(--accent2); border: 1px solid rgba(99,102,241,0.3); }
.status-pill.in-progress     { background: rgba(59,130,246,0.2); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.status-pill.pr-requested    { background: rgba(168,85,247,0.2); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.status-pill.dit-deployed    { background: rgba(234,179,8,0.2); color: #facc15; border: 1px solid rgba(234,179,8,0.3); }
.status-pill.dit-tested      { background: rgba(249,115,22,0.2); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.status-pill.sit-ready       { background: rgba(14,165,233,0.2); color: #38bdf8; border: 1px solid rgba(14,165,233,0.3); }
.status-pill.in-qa           { background: rgba(236,72,153,0.2); color: #f472b6; border: 1px solid rgba(236,72,153,0.3); }
.status-pill.failed          { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.status-pill.done            { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.status-pill.other           { background: var(--surface3); color: var(--text3); border: 1px solid var(--border); }

.priority-pill {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
}
.priority-pill.critical { color: var(--red); }
.priority-pill.high { color: var(--yellow); }
.priority-pill.medium { color: var(--blue); }
.priority-pill.low { color: var(--text3); }

.story-card-footer { display: flex; align-items: center; justify-content: space-between; }
.assignee-tag { font-size: 11px; color: var(--text3); }
.checkbox-wrap {
  width: 18px; height: 18px; border: 2px solid var(--border2); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s;
}
.story-card.selected .checkbox-wrap { background: var(--accent); border-color: var(--accent); }
.story-card.selected .checkbox-wrap::after { content: '✓'; font-size: 11px; font-weight: 700; color: #fff; }

/* ─── EMPTY + LOADING ──────────────────────────────────────── */
.empty-state {
  grid-column: 1/-1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 10px; color: var(--text3);
}
.empty-icon { font-size: 40px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text2); }
.empty-sub { font-size: 13px; text-align: center; max-width: 300px; line-height: 1.6; }

.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 40px; color: var(--text3);
}
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TERMINAL ─────────────────────────────────────────────── */
.terminal-header {
  background: var(--surface2); padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.terminal-title-row { display: flex; align-items: center; gap: 6px; }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #22c55e; }
.terminal-label { font-size: 12px; font-weight: 600; color: var(--text3); margin-left: 6px; }
.terminal-controls { display: flex; align-items: center; gap: 10px; }

.progress-bar-wrap {
  width: 160px; height: 6px; background: var(--surface3);
  border-radius: 4px; position: relative; overflow: hidden;
}
.progress-bar { height: 100%; background: var(--accent); transition: width 0.3s ease; border-radius: 4px; }
.progress-text { font-size: 11px; color: var(--text2); margin-left: 6px; font-family: 'JetBrains Mono', monospace; }

.terminal-body {
  flex: 1; overflow-y: auto; padding: 14px 18px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13px; line-height: 1.6;
  background: #0f172a; color: #f1f5f9;
}
.terminal-line { margin: 3px 0; font-weight: 500; letter-spacing: -0.2px; }
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.terminal-line { padding: 1px 0; animation: fadeIn 0.2s ease; }
.terminal-line.info    { color: var(--text2); }
.terminal-line.success { color: var(--green); }
.terminal-line.error   { color: var(--red); }
.terminal-line.warn    { color: var(--yellow); }
.terminal-line.debug   { color: var(--text3); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; } }

/* ─── TOAST ────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500; min-width: 260px; max-width: 380px;
  background: var(--surface2); border: 1px solid var(--border2);
  box-shadow: var(--shadow); animation: slideIn 0.3s ease; color: var(--text);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(100%); opacity: 0; } }

/* ─── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 24px; width: auto; max-width: 95vw; box-shadow: 0 40px 100px rgba(0,0,0,0.7);
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 95vh; display: flex; flex-direction: column; position: relative;
}
@keyframes modalIn { from { transform: scale(0.95) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 30px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

.result-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px;
}
.result-key { font-weight: 700; color: var(--accent2); }
.result-title { color: var(--text2); flex: 1; margin: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-count { font-weight: 700; color: var(--green); white-space: nowrap; }

/* ─── EXCEL TABLE ─────────────────────────────────────────── */
.excel-table {
  width: 100%; border-collapse: collapse; font-size: 12px; color: var(--text); background: var(--surface2);
}
.excel-table th {
  position: sticky; top: 0; background: var(--surface3); color: var(--text2);
  padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border);
  white-space: nowrap; z-index: 10;
}
.excel-table td {
  padding: 8px 12px; border: 1px solid var(--border); vertical-align: top;
  line-height: 1.5; min-width: 100px; max-width: 400px;
}
.excel-table tr:hover td { background: rgba(255,255,255,0.02); }
.excel-table td[contenteditable="true"] {
  outline: none; transition: background 0.2s;
}
.excel-table td[contenteditable="true"]:focus {
  background: rgba(99,102,241,0.1); box-shadow: inset 0 0 0 1px var(--accent);
}
.excel-table td:first-child {
  background: var(--surface3); border-right: 2px solid var(--border);
}
.excel-table th:first-child {
  background: var(--surface3); border-right: 2px solid var(--border);
}
.modal-subtitle { font-size: 12px; color: var(--text3); }
/* ─── SETTINGS UI ───────────────────────────────────────────── */
.fab-settings {
  position: fixed; bottom: 24px; right: 24px;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; box-shadow: 0 4px 15px rgba(99,102,241,0.4);
  z-index: 150; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fab-settings:hover { transform: scale(1.1) rotate(45deg); background: var(--accent2); }

.settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; color: var(--text);
  font-size: 13px; outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }

/* Toggle Switch */
.toggle-group { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; }
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--surface3); transition: .3s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background: var(--green); }
input:checked + .slider:before { transform: translateX(20px); }

.settings-section-title {
  grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--accent2);
  margin: 10px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
/* ─── GLOBAL LEVEL UPGRADES ────────────────────────────────── */
.topbar-nav { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: 8px; margin-right: 20px; }
.nav-tab {
  padding: 6px 16px; border: none; background: transparent; color: var(--text2);
  font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 6px; transition: all 0.2s;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--surface3); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.war-room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px; animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.stat-card {
  background: #ffffff; border: 1px solid rgba(0,0,0,0.05); border-radius: 20px;
  padding: 30px; display: flex; align-items: center; gap: 24px;
  transition: transform 0.3s, border-color 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.stat-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.stat-icon { font-size: 32px; background: #f1f5f9; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 18px; }
.stat-label { font-size: 13px; color: var(--text3); margin-bottom: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 36px; font-weight: 900; color: #0f172a; font-family: 'Outfit', sans-serif; letter-spacing: -1px; }

.full-width-card { background: #ffffff; border: 1px solid rgba(0,0,0,0.05); border-radius: 20px; padding: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.card-title { font-size: 18px; font-weight: 900; color: #0f172a; }
.live-tag { background: rgba(239,68,68,0.1); color: var(--red); font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(239,68,68,0.2); animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.intelligence-feed { height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.feed-item {
  display: flex; gap: 16px; padding: 14px 18px; background: #f8fafc;
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; font-size: 13px;
  font-weight: 500;
}
.feed-time { color: var(--text3); font-family: 'JetBrains Mono', monospace; min-width: 75px; font-weight: 700; }
.feed-msg { color: #0f172a; font-weight: 600; }

/* Command Palette */
.command-box {
  background: var(--surface); border: 1px solid var(--border2);
  width: 100%; max-width: 600px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 50px 100px rgba(0,0,0,0.6); animation: scaleIn 0.2s ease-out;
}
.command-search-wrap { display: flex; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); gap: 16px; }
.cmd-icon { font-size: 20px; color: var(--text3); }
#cmdInput { flex: 1; background: transparent; border: none; color: #fff; font-size: 18px; outline: none; }
.cmd-shortcut { font-size: 10px; color: var(--text3); background: var(--surface2); padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); }
.command-results { padding: 12px; max-height: 400px; overflow-y: auto; }
.cmd-item { padding: 12px 16px; border-radius: 8px; cursor: pointer; color: var(--text2); font-size: 14px; transition: all 0.2s; }
.cmd-item:hover { background: var(--surface3); color: #fff; padding-left: 20px; }

@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── FOLDER & GENERATION MODALS ───────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 20px; width: 90%; max-width: 800px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}
.small-modal { max-width: 400px; }
.modal-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 20px; font-weight: 700; color: #fff; }
.btn-close { background: transparent; border: none; color: var(--text3); font-size: 24px; cursor: pointer; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

.drop-zone {
  border: 2px dashed var(--border2); border-radius: 12px; padding: 40px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text3); transition: all 0.2s; background: var(--bg);
}
.drop-zone.active { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.form-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; color: #fff; font-size: 14px; outline: none;
}
.form-input:focus { border-color: var(--accent); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Sidebar Folder Icons */
.report-item.folder { border-left-color: var(--yellow); }
.report-item.folder .report-icon { color: var(--yellow); }

.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: 11px; font-weight: bold; text-decoration: none;
  margin-left: 8px; transition: all 0.2s;
  cursor: pointer; vertical-align: middle;
  background: rgba(99, 102, 241, 0.1);
}
.info-icon:hover { background: var(--accent); color: white; transform: scale(1.15); }

.help-panel {
  background: var(--surface2); border: 1px solid var(--border1);
  border-radius: 8px; padding: 12px; margin: 10px 0;
  animation: slideDown 0.3s ease;
}
.help-steps { font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; }
.help-steps div { margin-bottom: 4px; }
.help-link {
  display: inline-block; font-size: 11px; color: var(--accent);
  text-decoration: none; font-weight: 600;
}
.help-link:hover { text-decoration: underline; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* ─── SUBSCRIPTION & PRICING UI ───────────────────────────────── */
.subscription-badge.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-radius: 10px; font-size: 13px; font-weight: 800; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid transparent;
  font-family: var(--font-main); letter-spacing: 0.3px;
}
.subscription-badge {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-radius: 20px; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all 0.3s; letter-spacing: 0.5px; text-transform: uppercase;
}
.subscription-badge.trial {
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--yellow);
}
.subscription-badge.pro {
  background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.3); color: var(--accent);
}
.subscription-badge:hover { transform: translateY(-1px); filter: brightness(1.2); }

.upgrade-modal { width: 1450px; max-width: 98vw; height: auto; max-height: 98vh; }
.upgrade-modal .modal-body { padding: 20px 32px 32px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin-top: 10px; align-items: stretch; flex: 1;
}
.pricing-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 28px; padding: 24px 20px; position: relative;
  display: flex; flex-direction: column; gap: 16px; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-height: auto; justify-content: space-between;
}
.pricing-card:hover { border-color: var(--accent); transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.pricing-card.popular {
  border: 2px solid var(--accent); background: #ffffff;
  box-shadow: 0 30px 60px rgba(0,0,0,0.08);
  transform: scale(1.03); z-index: 2;
}
.pricing-card.popular:hover { transform: scale(1.04) translateY(-8px); }

.popular-tag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 6px 18px;
  border-radius: 20px; font-size: 9px; font-weight: 900; text-transform: uppercase;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.plan-name { font-size: 16px; font-weight: 800; color: var(--text2); }
.plan-price { font-size: 34px; font-weight: 900; color: var(--text); }
.plan-price span { font-size: 14px; color: var(--text3); font-weight: 500; }

.plan-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plan-features li { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text2); }
.plan-features li span { color: var(--green); font-weight: 800; }

.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 14px; }

.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 14px; }

/* ─── CINEMATIC NEURAL BACKGROUND ─────────────────────────────── */
.neural-bg {
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  pointer-events: none;
}

/* Glassmorphism Overrides (Light Mode) */
.topbar { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,0.05); }
.sidebar { background: #ffffff; border-right: 1px solid rgba(0,0,0,0.05); }
.panel { background: #ffffff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.sidebar-footer { background: #f8fafc; border-top: 1px solid rgba(0,0,0,0.05); }
.usage-bar { background: #e2e8f0; }
.pricing-card { background: #ffffff; border: 1px solid rgba(0,0,0,0.05); }
.pricing-card.popular { background: #fdfdfd; box-shadow: 0 30px 60px rgba(0,0,0,0.1); }
.modal { background: #ffffff; border: none; box-shadow: 0 40px 100px rgba(0,0,0,0.2); }
.form-input { background: #f8fafc; border: 1px solid #e2e8f0; color: #0f172a; }
.form-input:focus { background: #ffffff; }
.search-box input { background: #f1f5f9; color: #0f172a; border-color: transparent; }
.search-box input:focus { background: #ffffff; }
.filter-controls-row { background: #ffffff; }
.terminal-panel { background: #0f172a; border: none; } /* Keep terminal dark for contrast */
.terminal-panel .panel-header { background: #1e293b; border-bottom: 1px solid #334155; }
.terminal-panel .panel-title { color: #fff; }
.terminal-panel .panel-meta { color: #94a3b8; }
.user-profile-btn {
  flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: all 0.2s; min-width: 0;
}
.user-profile-btn:hover { opacity: 0.8; transform: translateX(2px); }
.user-avatar {
  width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-plan { font-size: 9px; color: var(--accent2); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

/* ─── USAGE METER ─────────────────────────────────────────── */
.usage-container {
  margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.03);
  display: flex; flex-direction: column; gap: 6px;
}
.usage-header { display: flex; justify-content: space-between; font-size: 9px; font-weight: 800; color: var(--text2); letter-spacing: 0.5px; }
.usage-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.usage-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%; transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--accent-glow);
}
.usage-label { font-size: 9px; color: var(--text3); font-weight: 500; text-align: right; margin-top: 1px; }

.settings-btn-sidebar {
  background: var(--surface2); border: 1px solid var(--border);
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px; color: var(--text3);
}
.settings-btn-sidebar:hover {
  transform: rotate(90deg); background: var(--surface3); border-color: var(--accent); color: #fff;
}

/* ─── 10/10 ENTERPRISE NAVIGATION & FILTERS ─────────────────── */
.filter-controls-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: #ffffff; border-bottom: 1px solid rgba(0,0,0,0.05);
  gap: 24px;
}
.filter-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filter-tabs::-webkit-scrollbar { height: 0px; }
.tab {
  padding: 10px 18px; border: 1px solid rgba(0,0,0,0.03); background: #f1f5f9;
  color: #475569; font-size: 10px; font-weight: 800; cursor: pointer;
  border-radius: 10px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.8px;
}
.tab:hover { background: #e2e8f0; color: #0f172a; transform: translateY(-1px); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 15px var(--accent-glow); }

.search-box { flex: 1; max-width: 420px; position: relative; }
.search-box input {
  width: 100%; padding: 12px 18px; background: #f1f5f9; border: 1px solid transparent;
  border-radius: 12px; color: #0f172a; font-size: 14px; font-weight: 600; outline: none; transition: all 0.2s;
}
.search-box input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
