:root {
  --bg: #08111f;
  --bg-soft: #0d1728;
  --panel: #0f1b2d;
  --panel-soft: #122238;
  --panel-2: #16263d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eef8;
  --muted: #8ea2bf;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --success: #4ade80;
  --warning: #facc15;
  --danger: #f87171;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 260px;
  --topbar-height: 78px;
  --content-max: 1600px;
  --transition: 180ms ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 24%),
    linear-gradient(180deg, #07101d 0%, #0a1423 100%);
  color: var(--text);
}

body {
  line-height: 1.4;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

pre {
  margin: 0;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* =========================
   APP LAYOUT
   ========================= */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, rgba(8, 17, 31, 0.98), rgba(11, 22, 40, 0.98));
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  overflow-y: auto;
  z-index: 30;
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar-height);
  background: rgba(8, 17, 31, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
}

.main-content {
  flex: 1;
  width: 100%;
  padding: 24px;
}

.page-section {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-heading h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-heading p {
  color: var(--muted);
  font-size: 14px;
}

/* =========================
   SIDEBAR
   ========================= */

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 800;
  font-size: 16px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-section-title {
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-project-card {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-project-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.sidebar-project-id {
  font-size: 11px;
  color: var(--muted);
  word-break: break-word;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  transition: all var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, 0.22);
  color: #ccefff;
}

/* =========================
   TOPBAR
   ========================= */

.topbar-left {
  min-width: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.topbar-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tenant-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
}

.user-role {
  font-size: 11px;
  color: var(--muted);
}

/* =========================
   GENERIC UI
   ========================= */

.subnav,
.row-gap-sm {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-md {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-grid {
  display: grid;
  gap: 16px;
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metrics-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(15, 27, 45, 0.96), rgba(11, 21, 36, 0.98));
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.metric-card {
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
}

.card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-number {
  font-size: 34px;
  font-weight: 800;
  margin-top: 8px;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.project-row:last-child {
  border-bottom: 0;
}

.project-name {
  font-weight: 800;
  font-size: 15px;
}

.project-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #06111d;
  font-weight: 800;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.empty-title {
  font-weight: 700;
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.badge-success,
.badge-warning,
.badge-danger,
.badge-neutral {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
}

.badge-success {
  background: rgba(74, 222, 128, 0.14);
  color: #b8f5cf;
}

.badge-warning {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
}

.badge-danger {
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.feedback-success,
.feedback-error {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.feedback-success {
  background: rgba(74, 222, 128, 0.08);
  color: #b8f5cf;
}

.feedback-error {
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

/* =========================
   DRAFT STUDIO
   ========================= */

.studio-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1.3fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.draft-list-item,
.build-list-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: all var(--transition);
}

.draft-list-item:hover,
.build-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.draft-list-item.active,
.build-list-item.active {
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, 0.24);
}

.draft-list-title,
.build-list-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.draft-list-meta,
.build-list-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.draft-chat-card {
  display: flex;
  flex-direction: column;
  min-height: 760px;
}

.draft-chat-thread {
  flex: 1;
  min-height: 520px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 80%;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.chat-row.user .chat-bubble {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.22);
}

.chat-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.chat-content {
  white-space: pre-wrap;
  line-height: 1.55;
}

.draft-chat-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 14px;
  outline: none;
}

.textarea:focus {
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.manifest-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.summary-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-label {
  color: var(--muted);
  font-size: 13px;
}

.summary-value {
  word-break: break-word;
}

.manifest-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================
   BUILD / HISTORY
   ========================= */

.build-center-layout,
.history-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.stepper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stepper-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.stepper-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: transparent;
  flex: 0 0 auto;
}

.stepper-item.completed .stepper-dot {
  background: var(--success);
  border-color: var(--success);
}

.stepper-item.running .stepper-dot {
  background: var(--warning);
  border-color: var(--warning);
}

.stepper-item.failed .stepper-dot {
  background: var(--danger);
  border-color: var(--danger);
}

.stepper-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper-title {
  font-weight: 700;
}

.stepper-status {
  width: fit-content;
}

.accordion-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-body {
  padding: 0 14px 14px;
}

.run-title {
  font-weight: 800;
}

.run-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* =========================
   ARTIFACTS / JSON
   ========================= */

.artifacts-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: none;
  overflow: visible;
}

.artifact-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  min-width: 0;
}

.artifact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.artifact-main {
  min-width: 0;
  flex: 1;
}

.artifact-title {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.artifact-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  word-break: break-word;
}

.artifact-body {
  margin-top: 12px;
}

.code-block {
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 18, 0.92);
  padding: 14px;
  white-space: pre;
  word-break: normal;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .artifact-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================
   CODE / JSON
   ========================= */

.code-block {
  max-height: 620px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 18, 0.92);
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1380px) {
  .studio-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .studio-layout > :last-child {
    grid-column: 1 / -1;
  }

  .build-center-layout,
  .history-layout,
  .metrics-grid,
  .card-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .project-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .draft-chat-card {
    min-height: auto;
  }

  .draft-chat-thread {
    min-height: 320px;
    max-height: 420px;
  }
}

/* ===== Draft screen dedicated ===== */

.draft-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.draft-side-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manifest-card,
.build-center-layout > .card,
.history-layout > .card,
.studio-layout > .card,
.card,
.metric-card {
  min-width: 0;
  min-height: 0;
}

.manifest-panel-scroll {
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.list-scroll {
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.summary-value-scroll {
  max-height: 110px;
  overflow: auto;
  padding-right: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.draft-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.draft-summary-item:last-child {
  border-bottom: 0;
}

.draft-summary-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-block {
  max-height: 620px;
  overflow: auto;
  white-space: pre;
  word-break: normal;
}

@media (max-width: 1380px) {
  .draft-focus-layout {
    grid-template-columns: 1fr;
  }
}
/* ===== Extended admin UI ===== */

.metrics-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 10px 14px;
  outline: none;
}

.input:focus {
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.textarea-sm {
  min-height: 88px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.entity-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entity-card.compact {
  gap: 10px;
}

.entity-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entity-card-title {
  font-weight: 800;
}

.entity-card-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.entity-grid {
  display: grid;
  gap: 10px;
}

.entity-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-stack .summary-row {
  padding: 8px 0;
}

.workspace-code {
  max-height: 780px;
}

.workspace-file-list {
  max-height: 780px;
}

@media (max-width: 1380px) {
  .metrics-grid-five,
  .form-grid.two,
  .form-grid.three,
  .entity-grid.two {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   FIX LAYOUT / SCROLL / PANELS TOO SMALL
   Pegarlo AL FINAL de frontend/style.css
   ========================================= */

html,
body,
#app {
  height: 100%;
  min-height: 100%;
}

body {
  overflow-y: auto;
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
}

.app-main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 24px;
  overflow-x: auto;
}

.page-section,
.card,
.metric-card,
.entity-card,
.studio-layout > .card,
.build-center-layout > .card,
.history-layout > .card,
.manifest-card {
  min-width: 0;
}

/* -------- grids menos apretadas -------- */

.metrics-grid.metrics-grid-five {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.build-center-layout,
.history-layout {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  align-items: start;
}

/* el panel pesado pasa a ancho completo */
.build-center-layout > :last-child,
.history-layout > :last-child {
  grid-column: 1 / -1;
}

.studio-layout {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(420px, 560px);
  align-items: start;
}

.draft-focus-layout {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

/* -------- cards y paneles con mejor respiración -------- */

.card,
.metric-card {
  overflow: hidden;
}

.card {
  padding: 20px;
}

.card-header,
.entity-card-header,
.project-row {
  min-width: 0;
}

.project-row {
  align-items: flex-start;
}

.project-row > div:first-child,
.entity-card-header > div:first-child,
.card-header > div:first-child {
  min-width: 0;
  flex: 1;
}

/* -------- scroll real en listas / artefactos / código -------- */

.list-scroll,
.artifacts-scroll,
.manifest-panel-scroll,
.workspace-file-list,
.workspace-code,
.draft-chat-thread,
.code-block,
.summary-value-scroll {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* listas más altas */
.list-scroll,
.workspace-file-list {
  max-height: calc(100vh - 260px);
}

/* artefactos y paneles largos */
.artifacts-scroll,
.manifest-panel-scroll,
.workspace-code {
  max-height: calc(100vh - 240px);
}

/* chat */
.draft-chat-card {
  min-height: 0;
}

.draft-chat-thread {
  min-height: 360px;
  max-height: calc(100vh - 320px);
}

/* código legible y con scroll horizontal */
.code-block,
.workspace-code {
  max-width: 100%;
  white-space: pre;
  word-break: normal;
  overflow-x: auto;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}

/* valores largos */
.summary-value,
.build-list-meta,
.draft-list-meta,
.entity-card-meta,
.project-meta,
.sidebar-project-id,
.run-meta,
.mono {
  word-break: break-word;
}

/* inputs y forms */
.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input,
.textarea,
.textarea-sm {
  min-width: 0;
}

/* topbar */
.topbar {
  min-width: 0;
}

.topbar-right {
  min-width: 0;
  flex-wrap: wrap;
}

/* sidebar */
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

/* -------- breakpoints mejores -------- */

@media (max-width: 1600px) {
  .metrics-grid.metrics-grid-five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-layout {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }

  .studio-layout > :last-child {
    grid-column: 1 / -1;
  }

  .draft-focus-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .card-grid.two,
  .form-grid.two,
  .form-grid.three,
  .entity-grid.two,
  .metrics-grid,
  .metrics-grid.metrics-grid-five,
  .build-center-layout,
  .history-layout,
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .build-center-layout > :last-child,
  .history-layout > :last-child {
    grid-column: auto;
  }

  .list-scroll,
  .workspace-file-list,
  .artifacts-scroll,
  .manifest-panel-scroll,
  .workspace-code,
  .draft-chat-thread,
  .code-block {
    max-height: none;
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-main {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .project-row {
    flex-direction: column;
  }
}

.toolbar-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-value-scroll {
  overflow-x: auto;
}

.list-scroll {
  overflow: auto;
}

@media (max-width: 980px) {
  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
}
