:root {
  --bg: #f4f6f9;
  --sidebar: #0f2744;
  --sidebar-text: #e8eef5;
  --accent: #1a5fb4;
  --border: #d8dee9;
  --text: #1e293b;
  --muted: #64748b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1.25rem 0;
  flex-shrink: 0;
}
.sidebar h1 {
  font-size: 1rem;
  margin: 0 1rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sidebar nav a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: #a8c0dc;
  text-decoration: none;
  font-size: 0.92rem;
  position: relative;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: super;
  line-height: 1;
}
.row-unread td {
  font-weight: 700;
}
.doc-item-new .doc-name,
.doc-item-new .doc-name a {
  font-weight: 700;
}
.cronograma-prev {
  color: var(--muted);
  font-size: 0.85em;
  text-decoration: line-through;
}
.cronograma-val-changed {
  color: #b91c1c;
  font-weight: 700;
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.cronograma-val-new {
  color: #047857;
  font-weight: 700;
}
.doc-fecha {
  font-size: 0.9em;
  white-space: nowrap;
}
.cronograma-changed {
  background: #fffbeb;
}
.cronograma-new {
  background: #ecfdf5;
}
.cronograma-removed {
  background: #fef2f2;
}
.cronograma-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.cronograma-tag-new {
  background: #d1fae5;
  color: #065f46;
}
.cronograma-tag-removed {
  background: #fee2e2;
  color: #991b1b;
}
.watch-update-banner {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar .nav-group-label {
  display: block;
  padding: 0.85rem 1.25rem 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.sidebar nav a.nav-sub {
  padding-left: 1.75rem;
  font-size: 0.92rem;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.filter-row .btn.active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}

.main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-x: auto;
}

h2 { margin-top: 0; font-size: 1.35rem; }
.detail-subtitle {
  margin: 0.35rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.card .num { font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.card .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; }

.filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.filters select, .filters button {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}
table.data th, table.data td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.data th {
  background: #eef2f7;
  font-weight: 600;
  white-space: nowrap;
}
table.data th.sortable a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
table.data th.sortable a:hover { color: var(--accent); }
table.data th.sortable.sorted a::after {
  font-size: 0.65rem;
  opacity: 0.7;
}
table.data th.sortable.sorted-asc a::after { content: "▲"; }
table.data th.sortable.sorted-desc a::after { content: "▼"; }
table.data tr:hover td { background: #f8fafc; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-publicada { background: #dbeafe; color: #1e40af; }
.badge-descargando { background: #fef3c7; color: #92400e; }
.badge-descartando { background: #fee2e2; color: #991b1b; }
.badge-archivando { background: #fef3c7; color: #92400e; }
.badge-descargada { background: #e0e7ff; color: #3730a3; }
.badge-analizada { background: #d1fae5; color: #065f46; }
.badge-portafolio { background: #fef3c7; color: #92400e; }
.badge-portafolio_preparado { background: #dbeafe; color: #1e40af; }
.badge-descartada { background: #fee2e2; color: #991b1b; }
.badge-archivada { background: #f3e8ff; color: #6b21a8; }
.badge-interest { background: #e0f2fe; color: #075985; }
.badge-lifecycle { background: #f0fdf4; color: #166534; border: 1px solid #86efac; text-transform: none; }
.badge-linked { background: #ffedd5; color: #9a3412; }
.badge-channel { background: #e2e8f0; color: #334155; text-transform: none; }

.channel-links {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.channel-links-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}
.channel-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.channel-link-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  font-size: 0.88rem;
}
.channel-link-origin {
  border-left: 2px solid #047857;
  padding-left: 0.45rem;
  margin-left: -0.1rem;
}
.channel-origin-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #047857;
  text-transform: uppercase;
}
.channel-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}
a.channel-ref { color: #1d4ed8; text-decoration: none; }
a.channel-ref:hover { text-decoration: underline; }
.channel-trigger { font-size: 0.75rem; }

.doc-analyzed-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
  vertical-align: middle;
}

.doc-removed-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  vertical-align: middle;
  cursor: help;
}
.doc-item-removed .doc-name,
.doc-item-removed .doc-name a {
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-analyzing { background: #d97706; color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn:disabled,
button.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

table.data td.actions-cell {
  vertical-align: top;
  white-space: nowrap;
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}
.actions-stack form { margin: 0; }

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}
table.data td.status-cell { vertical-align: top; white-space: nowrap; }
.btn-seace { white-space: nowrap; }

.alert {
  padding: 0.75rem 1rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.detail-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.detail-box h3 { margin-top: 0; font-size: 0.95rem; }
.detail-box pre {
  white-space: pre-wrap;
  font-size: 0.85rem;
  margin: 0;
}
.detail-box-wide {
  grid-column: 1 / -1;
}

.autoreject-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.75rem 0;
}
.autoreject-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.detail-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .detail-split {
    grid-template-columns: 1fr;
  }
}

.detail-summary {
  min-height: 12rem;
}

.detail-cronograma {
  min-width: 0;
}

.detail-docs {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0;
}

.detail-docs h3 { margin-top: 0; }

.markdown-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  max-height: 70vh;
  overflow: auto;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.25rem 0 0.5rem;
  line-height: 1.3;
}

.markdown-body h1 { font-size: 1.25rem; }
.markdown-body h2 { font-size: 1.1rem; }
.markdown-body h3 { font-size: 1rem; }

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin: 0.5rem 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.25rem;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: #eef2f7;
  font-weight: 600;
}

.markdown-body code {
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.markdown-body pre {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  overflow: auto;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.detail-chat {
  margin-top: 1rem;
  margin-bottom: 0;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-messages {
  max-height: 28rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 0;
}

.chat-bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.chat-bubble-user {
  align-self: flex-end;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chat-bubble-model {
  align-self: flex-start;
  background: #fff;
}

.chat-bubble-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chat-bubble-body {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-model .chat-bubble-body.markdown-body {
  max-height: none;
  overflow: visible;
  font-size: 0.88rem;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-form textarea {
  width: 100%;
  min-height: 3.25rem;
  resize: vertical;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  line-height: 1.4;
}

.chat-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-status {
  flex: 1;
}

.chat-unavailable {
  margin: 0;
}

.doc-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
  align-items: flex-end;
}

.doc-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
}

.doc-checkbox {
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.doc-checkbox-spacer {
  display: inline-block;
  width: 1rem;
  flex-shrink: 0;
}

.doc-list-tree .doc-tree-item {
  display: block;
  padding: 0.45rem 0;
}

.doc-tree-children {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0 0 0 1.1rem;
  border-left: 1px solid var(--border);
}

.doc-item-folder > .doc-row .doc-name {
  color: var(--muted);
  font-weight: 500;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.doc-item:last-child { border-bottom: none; }
.doc-item-missing { opacity: 0.75; }

.doc-select-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  cursor: pointer;
}
.doc-select-label input[type="checkbox"] {
  margin-top: 0.35rem;
  flex-shrink: 0;
}
.doc-list-selectable .doc-item { padding: 0.35rem 0; }
.doc-meta { flex: 1; min-width: 0; }
.doc-name {
  font-size: 0.88rem;
  word-break: break-word;
}
.doc-name a {
  color: var(--accent);
  text-decoration: none;
}
.doc-name a:hover { text-decoration: underline; }
.doc-sub { margin-top: 0.15rem; }
.doc-size {
  white-space: nowrap;
  font-size: 0.8rem;
  padding-top: 0.1rem;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.file-badge-pdf { background: #fee2e2; color: #991b1b; }
.file-badge-docx { background: #dbeafe; color: #1e40af; }
.file-badge-xlsx { background: #d1fae5; color: #065f46; }
.file-badge-dwg { background: #fef3c7; color: #92400e; }
.file-badge-zip { background: #ede9fe; color: #5b21b6; }
.file-badge-rar { background: #fce7f3; color: #9d174d; }
.file-badge-file { background: #e2e8f0; color: #475569; }
.file-badge-folder {
  background: #fef9c3;
  color: #854d0e;
  font-size: 0.55rem;
  min-width: 3.2rem;
}

.watch-changelog {
  margin-top: 1.5rem;
}
.watch-changelog-entry {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
}
.watch-changelog-entry:last-child { border-bottom: none; }
.watch-changelog-at {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.watch-changelog-table {
  width: 100%;
  font-size: 0.82rem;
}
.watch-changelog-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 0.15rem 0.5rem 0.15rem 0;
  vertical-align: top;
  white-space: nowrap;
}
.watch-changelog-table td {
  padding: 0.15rem 0;
  vertical-align: top;
}
.watch-changelog-kind-added { color: #047857; font-weight: 600; }
.watch-changelog-kind-removed { color: #b91c1c; font-weight: 600; }
.watch-changelog-kind-modified { color: #92400e; font-weight: 600; }
.watch-changelog-old {
  color: var(--muted);
  text-decoration: line-through;
}
.watch-changelog-new { font-weight: 500; }

table.cronograma-table { font-size: 0.85rem; }
table.cronograma-table th { white-space: nowrap; }

pre.free-reader {
  max-height: 36rem;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.45;
}

.muted { color: var(--muted); font-size: 0.8rem; }
.desc { max-width: 280px; }

.pipeline-error-cell {
  max-width: 280px;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pipeline-error-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data td.col-entidad,
table.data th.col-entidad {
  min-width: 10.5rem;
  max-width: 14rem;
}
/* La fila define su alto (objeto, descripción…); la entidad solo llena ese alto. */
table.data td.col-entidad {
  height: 1px;
  padding: 0;
  vertical-align: top;
}
.entidad-nombre {
  box-sizing: border-box;
  height: 100%;
  padding: 0.55rem 0.65rem;
  overflow: hidden;
  line-height: 1.35;
  word-break: break-word;
}

.sidebar nav a.nav-settings {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.sidebar .nav-settings-icon {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.9;
}

.settings-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 3rem);
  max-height: calc(100vh - 3rem);
  overflow: hidden;
}
.settings-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}
.settings-header h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.settings-header .muted {
  font-size: 0.82rem;
}
.settings-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}
.settings-filter-check {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.filter-input {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  min-width: 220px;
}
.entity-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
  line-height: 1.35;
}
.entity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entity-row {
  border-bottom: 1px solid var(--border);
}
.entity-row:last-child { border-bottom: none; }
.entity-row-label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-weight: normal;
}
.entity-row-label:hover { background: #f8fafc; }
.entity-row-label input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.entity-row-line {
  min-width: 0;
  word-break: break-word;
  color: var(--text);
}
.entity-row-sep {
  color: var(--muted);
  padding: 0 0.15rem;
}
.entity-row-extra {
  color: var(--muted);
}
.entity-empty { padding: 0.75rem 0.65rem; font-size: 0.82rem; }

.settings-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.settings-footer-summary {
  font-size: 0.82rem;
}
.settings-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}
.rules-editor {
  width: 100%;
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.code-sample {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f6f8fa;
  overflow-x: auto;
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 68, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10000;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.modal-card h3 { margin-top: 0; }
.modal-card section { margin: 1rem 0; }
.modal-options { display: flex; flex-direction: column; gap: 0.55rem; }
.modal-option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.92rem;
  line-height: 1.4;
}
.modal-option-inline { flex-wrap: wrap; align-items: center; }
.modal-date { width: 6.5rem; min-width: 0; margin-left: 0.25rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.form-error { color: #b91c1c; font-size: 0.85rem; margin: 0.25rem 0 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 720px) {
  .main { padding: 1rem; }
  .settings-header { flex-direction: column; }
  .settings-header-actions { display: none; }
  .filter-input { width: 100%; min-width: 0; }
  .settings-page {
    height: calc(100vh - 2rem);
    max-height: calc(100vh - 2rem);
  }
}

.main:has(.settings-page) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.import-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.import-panel { padding: 1.25rem; }
.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}
.stack-form input[type="text"],
.stack-form textarea,
.stack-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: inherit;
}

/* 100 PR3 — banner de mantenimiento (sólo si hay desvíos o cuarentena) */
.banner-warning {
  background: #fff3cd;
  border: 1px solid #e0c36a;
  color: #664d03;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
