:root {
  --bg: #09111d;
  --panel: #111c2b;
  --panel-2: #142334;
  --border: #1f2d3d;
  --text: #eaf2ff;
  --muted: #9bb0c9;
  --primary: #4cc9f0;
  --success: #2dd4bf;
  --danger: #f87171;
  --warning: #fbbf24;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
}

.sidebar {
  width: 240px;
  height: 100vh;
  background: #0b1521;
  border-right: 1px solid var(--border);
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: #03131d;
  font-weight: bold;
}
.brand h1 { font-size: 1.4rem; margin: 0; }
.brand span { color: var(--primary); }
.brand small { color: var(--muted); }

.nav-btn {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 10px;
  cursor: pointer;
}
.nav-btn.active {
  background: var(--panel-2);
  border-color: var(--primary);
}

.main {
  flex: 1;
  padding: 24px;
}
.tab { display: none; }
.tab.active { display: block; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.toolbar input, .toolbar select {
  flex: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat strong {
  font-size: 1.8rem;
}

.table-card { overflow: hidden; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: bold;
}
.btn.primary { background: var(--primary); color: #03131d; }
.btn.success { background: var(--success); color: #041a1a; }
.btn.danger { background: var(--danger); color: white; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}
label.full { grid-column: 1 / -1; }
input, select, textarea {
  background: #0d1726;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
}

.ia-panel {
  min-height: 200px;
  background: #0b1725;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
}

.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.prompt-item {
  background: #0b1725;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.prompt-item button {
  margin-top: 10px;
}

.badge {
  display: inline-block;
  background: rgba(76, 201, 240, 0.15);
  color: var(--primary);
  border: 1px solid rgba(76, 201, 240, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  body { display: block; }
  .sidebar { width: 100%; height: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .toolbar { flex-direction: column; }
}

.creative-body { background: #071218; }
.creative-sidebar { background: #0b1b1d; border-color: #234044; }
.creative-sidebar .brand-icon { background: #f6c453; color: #102021; }
.creative-sidebar .brand span, .eyebrow { color: #f6c453; }
.nav-link { display: block; color: var(--muted); text-decoration: none; border-radius: 8px; padding: 11px 12px; margin-bottom: 5px; }
.nav-link:hover, .nav-link.active { background: #163337; color: var(--text); }
.creative-main { max-width: 1500px; margin: 0 auto; }
.creative-hero { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding: 18px 0 28px; }
.creative-hero h2 { max-width: 700px; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.02; margin: 10px 0; letter-spacing: 0; }
.creative-hero p { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.eyebrow { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .1em; }
.hero-metric { min-width: 150px; border-left: 2px solid #f6c453; padding-left: 16px; }
.hero-metric strong { display: block; font-size: 2.8rem; color: #f6c453; }
.hero-metric span, .muted { color: var(--muted); }
.creative-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.4fr); gap: 18px; align-items: start; }
.creative-left, .creative-right { display: grid; gap: 18px; }
.creative-body .card { background: #0e2023; border-color: #234044; border-radius: 8px; }
.section-heading, .analysis-top, .form-actions, .confidence-line { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.section-heading h3, .analysis-top h3 { margin: 6px 0; }
.status-dot { color: #72e0bb; font-size: .7rem; font-weight: bold; }
.form-actions { margin-top: 18px; }
.form-actions button:disabled { opacity: .55; cursor: wait; }
.creative-list { display: grid; gap: 7px; margin-top: 14px; }
.creative-row { display: grid; grid-template-columns: 70px 1fr 20px; text-align: left; align-items: center; gap: 12px; width: 100%; background: #0a191c; color: var(--text); border: 1px solid #1b363a; border-radius: 7px; padding: 12px; cursor: pointer; }
.creative-row { grid-template-columns: 22px 1fr; }
.creative-open { display: grid; grid-template-columns: 70px 1fr 20px; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; padding: 0; }
.creative-check { accent-color: #f6c453; }
.creative-row:hover, .creative-row.selected { border-color: #f6c453; background: #13292b; }
.creative-row small { display: block; color: var(--muted); margin-top: 3px; }
.creative-type { color: #f6c453; font-size: .68rem; text-transform: uppercase; }
.row-arrow { color: #72e0bb; font-size: 1.2rem; }
.empty-analysis { min-height: 480px; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 40px; }
.empty-analysis h3 { color: var(--text); }
.empty-icon { color: #f6c453; font-size: 3.2rem; }
.analysis-top { align-items: start; }
.score-ring { border: 2px solid #f6c453; border-radius: 50%; width: 88px; height: 88px; display: grid; place-content: center; text-align: center; flex: 0 0 auto; }
.score-ring strong { color: #f6c453; font-size: 1.8rem; line-height: 1; }
.score-ring span { color: var(--muted); font-size: .65rem; }
.confidence-line { border-top: 1px solid #234044; border-bottom: 1px solid #234044; padding: 10px 0; color: var(--muted); font-size: .78rem; }
.confidence-line b { color: #72e0bb; }
.analysis-tabs { display: flex; gap: 5px; border-bottom: 1px solid #234044; margin-top: 16px; overflow-x: auto; }
.analysis-tab { background: transparent; color: var(--muted); border: 0; padding: 10px 12px; cursor: pointer; white-space: nowrap; }
.analysis-tab.active { color: #f6c453; border-bottom: 2px solid #f6c453; }
.analysis-panel { display: none; padding-top: 16px; }
.analysis-panel.active { display: block; }
.signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.signal-grid > div, .copy-structure > div { background: #0a191c; border: 1px solid #1b363a; padding: 12px; border-radius: 6px; min-height: 74px; }
.signal-grid small, .copy-structure small { display: block; color: #f6c453; text-transform: uppercase; font-size: .63rem; margin-bottom: 8px; }
.signal-grid strong { font-size: .9rem; line-height: 1.35; }
.copy-structure { display: grid; gap: 8px; }
.copy-structure p { margin: 0; color: var(--text); line-height: 1.45; }
.insight-list, .lab-list { padding-left: 20px; color: var(--text); line-height: 1.6; }
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lab-card h3 { margin: 7px 0 14px; }
.lab-list { margin: 0; }
.lab-list li { margin-bottom: 12px; }
.lab-list small { display: block; color: #72e0bb; font-size: .7rem; }
.history-tools { display: flex; gap: 8px; align-items: center; }
.history-tools input { width: 150px; }
.history-tools .btn { padding: 9px 11px; font-size: .72rem; }
.search-line { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.search-line input { flex: 1; }
.search-line .muted { font-size: .7rem; }
.matrix-box { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; border-top: 1px solid #234044; margin-top: 18px; padding-top: 15px; }
.matrix-box strong { display: block; margin-top: 5px; }
.matrix-box .muted { grid-column: 1 / -1; font-size: .78rem; }
.copilot-card, .intelligence-card { margin-top: 18px; }
.copilot-answer { background: #0a191c; border: 1px solid #1b363a; border-radius: 6px; padding: 13px; min-height: 70px; line-height: 1.5; }
.copilot-answer p { margin: 0 0 7px; }
.copilot-form { display: flex; gap: 8px; margin-top: 10px; }
.copilot-form input { flex: 1; }
.intelligence-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.intelligence-group { background: #0a191c; border: 1px solid #1b363a; border-radius: 6px; padding: 11px; min-height: 110px; }
.intelligence-group small { color: #f6c453; text-transform: uppercase; font-size: .65rem; }
.intelligence-group p { display: flex; justify-content: space-between; gap: 5px; font-size: .76rem; margin: 9px 0 0; }
.intelligence-group b { color: #72e0bb; }

@media (max-width: 1100px) { .creative-layout { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .creative-hero, .section-heading, .analysis-top { align-items: start; flex-direction: column; } .lab-grid, .signal-grid, .intelligence-grid { grid-template-columns: 1fr; } .hero-metric { border-left: 0; border-top: 2px solid #f6c453; padding: 12px 0 0; } .history-tools { width: 100%; flex-direction: column; align-items: stretch; } .history-tools input { width: auto; } .copilot-form { flex-direction: column; } }
