/* ══════════════════════════════════════════════════════════════
   Panel de Proyectos — CD Latam
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0c0f16;
  --bg-2: #111624;
  --card: #151b2b;
  --card-2: #1a2133;
  --line: #232c42;
  --line-2: #2d3852;
  --txt: #e6ebf5;
  --txt-2: #97a3bd;
  --txt-3: #66718c;
  --blue: #4c8dff;
  --blue-2: #2f6fe0;
  --amber: #f0a742;
  --green: #35d07f;
  --red: #f2585b;
  --purple: #a179f5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .42);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Animaciones ────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { background-position: 200% 0; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn   { from { opacity: 0; transform: translateX(28px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pulse   { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.is-spinning { animation: spin .9s linear infinite; }

/* ── Login ──────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 600px at 15% -10%, #1a2740 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 110%, #241c3d 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 30px;
  box-shadow: var(--shadow);
  animation: fadeUp .4s ease both;
}
.login-logo { font-size: 34px; text-align: center; margin-bottom: 8px; }
.login-card h1 { font-size: 21px; text-align: center; }
.login-sub { text-align: center; color: var(--txt-3); font-size: 13px; margin: 5px 0 26px; }
.field { display: block; margin-bottom: 15px; }
.field span { display: block; font-size: 12.5px; color: var(--txt-2); margin-bottom: 6px; font-weight: 550; }
.field input {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(76,141,255,.16); }
.login-error {
  background: rgba(242,88,91,.11);
  border: 1px solid rgba(242,88,91,.34);
  color: #ff9a9c;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 15px;
  animation: fadeUp .2s ease both;
}

/* ── Botones ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--txt);
  font-size: 14px;
  font-weight: 550;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #222b41; border-color: #3a4763; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-2); border-color: var(--blue-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--card-2); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-icon { padding: 7px 10px; font-size: 15px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.ico { font-size: 15px; line-height: 1; display: inline-block; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 22px;
  background: rgba(12,15,22,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 22px; }
.topbar h1 { font-size: 16.5px; }
.topbar-sub { font-size: 12px; color: var(--txt-3); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.last-update { font-size: 12px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  padding: 4px 4px 4px 12px; border-radius: 30px;
  font-size: 13.5px; font-weight: 550;
}

/* ── Error fatal ────────────────────────────────────────────── */
.fatal {
  max-width: 460px;
  margin: 15vh auto;
  text-align: center;
  padding: 38px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: fadeUp .3s ease both;
}
.fatal-ico { font-size: 40px; margin-bottom: 12px; }
.fatal h2 { font-size: 19px; margin-bottom: 8px; }
.fatal p { color: var(--txt-2); font-size: 14px; margin: 0 0 22px; }

/* ── Strip del servidor ─────────────────────────────────────── */
.srv-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 11px;
  margin: 20px 22px 0;
}
.srv {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  animation: fadeUp .35s ease both;
}
.srv-label { font-size: 11.5px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.srv-value { font-size: 21px; font-weight: 680; margin-top: 3px; font-variant-numeric: tabular-nums; }
.srv-value small { font-size: 12.5px; color: var(--txt-3); font-weight: 500; }
.srv-bar { height: 4px; background: var(--bg-2); border-radius: 3px; margin-top: 9px; overflow: hidden; }
.srv-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* ── Filtros ────────────────────────────────────────────────── */
.filters { display: flex; align-items: center; gap: 8px; margin: 20px 22px 0; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: 30px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--txt-2);
  font-size: 13.5px;
  font-weight: 550;
  transition: all .15s;
}
.chip:hover { color: var(--txt); border-color: #3f4c68; }
.chip.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.filters-count { margin-left: auto; font-size: 12.5px; color: var(--txt-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-blue { background: var(--blue); }
.dot-amber { background: var(--amber); }
.dot-slate { background: var(--txt-3); }

/* ── Grid de tarjetas ───────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  padding: 16px 22px 60px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 18px 15px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s, box-shadow .16s;
  animation: fadeUp .35s ease both;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--line-2); transition: background .16s;
}
.card:hover { transform: translateY(-3px); border-color: #35425e; box-shadow: var(--shadow); }
.card:hover::before { background: var(--blue); }
.card.is-down::before { background: var(--red); }
.card.is-up::before { background: var(--green); }
.card.is-self::before { background: var(--purple); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-name { font-size: 15.5px; font-weight: 640; letter-spacing: -.01em; }
.card-path { font-size: 11.5px; color: var(--txt-3); font-family: var(--mono); margin-top: 2px; word-break: break-all; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap; flex-shrink: 0;
}
.badge-ok    { background: rgba(53,208,127,.14); color: var(--green); }
.badge-down  { background: rgba(242,88,91,.14); color: var(--red); }
.badge-error { background: rgba(240,167,66,.14); color: var(--amber); }
.badge-none  { background: rgba(150,163,189,.13); color: var(--txt-2); }
.badge-env   { background: rgba(76,141,255,.14); color: var(--blue); }
.badge-self  { background: rgba(161,121,245,.16); color: var(--purple); }

.card-stack { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 11px; }
.tag {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--txt-2);
}
.card-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 11px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--txt-3);
}
.card-foot span { display: inline-flex; align-items: center; gap: 5px; }
.card-note {
  margin-top: 10px; padding: 9px 11px;
  background: rgba(240,167,66,.07);
  border-left: 2px solid var(--amber);
  border-radius: 0 6px 6px 0;
  font-size: 12.5px; color: #d8c39a;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Skeletons (carga) ──────────────────────────────────────── */
.sk { background: linear-gradient(90deg, var(--card-2) 25%, #232c42 50%, var(--card-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
.sk-line { height: 11px; margin-bottom: 8px; }
.sk-title { height: 15px; width: 55%; margin-bottom: 6px; }
.sk-tag { height: 19px; width: 62px; border-radius: 6px; display: inline-block; margin: 0 5px 8px 0; }
.sk-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; }
.sk-foot { height: 28px; margin-top: 12px; }

/* ── Drawer (detalle) ───────────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(4,6,11,.66);
  backdrop-filter: blur(2px); z-index: 50; animation: fadeIn .2s ease both;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(660px, 100%);
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  box-shadow: -18px 0 46px rgba(0,0,0,.5);
  z-index: 51;
  display: flex; flex-direction: column;
  animation: popIn .26s cubic-bezier(.22,1,.36,1) both;
}
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 19px 22px 15px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 18px; }
.drawer-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.tabs { display: flex; gap: 3px; padding: 11px 22px 0; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--txt-3); padding: 8px 13px 10px; font-size: 13.5px; font-weight: 570;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--txt-2); }
.tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ── Bloques de detalle ─────────────────────────────────────── */
.blk { margin-bottom: 22px; }
.blk-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--txt-3); font-weight: 650; margin-bottom: 9px;
}
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv dt { color: var(--txt-3); }
.kv dd { margin: 0; word-break: break-word; }
.kv dd.mono { font-family: var(--mono); font-size: 12.5px; }

.tree { font-family: var(--mono); font-size: 12.5px; line-height: 1.85; }
.tree div { white-space: nowrap; }
.tree .lvl-1 { padding-left: 18px; color: var(--txt-2); }
.tree .lvl-2 { padding-left: 36px; color: var(--txt-3); }
.tree .d-name { color: #7fb2ff; }
.tree .d-arrow { color: var(--txt-3); margin-right: 5px; }

.filelist { display: flex; flex-wrap: wrap; gap: 5px; }
.filelist span {
  font-family: var(--mono); font-size: 11.5px; padding: 3px 8px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 5px; color: var(--txt-2);
}

.ctr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 15px; margin-bottom: 11px; }
.ctr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ctr-name { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.ctr-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--txt-3); margin-top: 9px; }
.ctr-stats b { color: var(--txt); font-weight: 600; font-variant-numeric: tabular-nums; }

.dbt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dbt th { text-align: left; color: var(--txt-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 6px 0; border-bottom: 1px solid var(--line); }
.dbt td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dbt td:not(:first-child), .dbt th:not(:first-child) { text-align: right; }
.dbt tr.is-empty td { color: var(--txt-3); }
.dbt tr:last-child td { border-bottom: none; }

.note-area {
  width: 100%; min-height: 190px; padding: 13px 15px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--txt); font-family: var(--font); font-size: 14px; line-height: 1.6;
  resize: vertical; outline: none; transition: border-color .15s, box-shadow .15s;
}
.note-area:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(76,141,255,.16); }
.note-actions { display: flex; gap: 9px; align-items: center; margin-top: 12px; }
.note-hint { font-size: 12px; color: var(--txt-3); }
.note-saved { font-size: 12.5px; color: var(--green); display: inline-flex; align-items: center; gap: 5px; }

.empty { text-align: center; padding: 34px 20px; color: var(--txt-3); font-size: 14px; }
.empty .e-ico { font-size: 30px; display: block; margin-bottom: 9px; opacity: .55; }

/* ── Toasts ─────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; bottom: 20px; right: 20px; z-index: 80;
  display: flex; flex-direction: column; gap: 9px; align-items: flex-end;
}
.toast {
  background: var(--card-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 11px 16px; font-size: 13.5px;
  box-shadow: var(--shadow); animation: fadeUp .22s ease both;
  display: flex; align-items: center; gap: 9px;
}
.toast.ok  { border-color: rgba(53,208,127,.45); color: #8fe8b8; }
.toast.err { border-color: rgba(242,88,91,.45); color: #ffa1a3; }

/* ── Pestañas grandes ────────────────────────────────────────── */
.tabs-main { display: flex; gap: 6px; margin: 20px 22px 0; border-bottom: 1px solid var(--line); }
.tab-main {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--txt-3); padding: 11px 18px 13px;
  font-size: 15px; font-weight: 620; letter-spacing: -.01em;
  transition: color .15s, border-color .15s;
}
.tab-main:hover { color: var(--txt-2); }
.tab-main.is-active { color: var(--txt); border-bottom-color: var(--blue); }
.tm-ico { font-size: 16px; }
.tm-count {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 1px 8px;
  font-size: 11.5px; font-weight: 650; color: var(--txt-3);
  font-variant-numeric: tabular-nums;
}
.tab-main.is-active .tm-count { background: rgba(76,141,255,.16); border-color: rgba(76,141,255,.4); color: var(--blue); }

/* Las pestañas son enlaces (#/ruta): sin subrayado ni color de link */
a.tab, a.tab-main { text-decoration: none; cursor: pointer; }
a.tab:hover, a.tab-main:hover { text-decoration: none; }

/* ── Vista de ideas ──────────────────────────────────────────── */
.ideas-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin: 18px 22px 0; flex-wrap: wrap;
}
.ideas-intro { margin: 0; font-size: 13.5px; color: var(--txt-3); max-width: 620px; line-height: 1.55; }
.ideas-intro b { color: var(--txt-2); font-weight: 600; }

.idea-form {
  margin: 16px 22px 0;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 20px 22px;
  animation: fadeUp .25s ease both;
}
.idea-form .field { margin-bottom: 13px; }
.if-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.if-grid2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; }
.idea-form select {
  width: 100%; padding: 11px 13px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); color: var(--txt);
  font-size: 15px; outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2397a3bd' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
.idea-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(76,141,255,.16); }
.if-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }

.idea-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 18px;
  position: relative; overflow: hidden;
  transition: transform .16s, border-color .16s, box-shadow .16s;
  animation: fadeUp .35s ease both;
}
.idea-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line-2); }
.idea-card:hover { transform: translateY(-2px); border-color: #35425e; box-shadow: var(--shadow); }
.idea-card.s-idea::before          { background: var(--txt-3); }
.idea-card.s-para-empezar::before   { background: var(--purple); }
.idea-card.s-en-desarrollo::before  { background: var(--blue); }
.idea-card.s-en-pausa::before       { background: var(--amber); }
.idea-card.s-listo::before          { background: var(--green); }
.idea-card.s-archivada::before      { background: #4a556e; }
.idea-card.is-archivada { opacity: .6; }

.idea-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.idea-name { font-size: 15.5px; font-weight: 640; letter-spacing: -.01em; }
.idea-desc { font-size: 13.5px; color: var(--txt-2); line-height: 1.5; }
.idea-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--txt-3); }
.idea-meta span { display: inline-flex; align-items: center; gap: 5px; }
.idea-notes {
  margin-top: 11px; padding: 9px 11px; font-size: 12.5px; color: var(--txt-2);
  background: var(--card-2); border-radius: 7px; border-left: 2px solid var(--line-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-wrap;
}
.idea-actions { display: flex; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }

/* ── Alertas ────────────────────────────────────────────────── */
.alerts {
  margin: 20px 22px 0; padding: 13px 15px; border-radius: var(--radius-sm);
  background: rgba(240,167,66,.07); border: 1px solid rgba(240,167,66,.3);
  animation: fadeUp .3s ease both;
}
.alerts.is-clear { background: rgba(53,208,127,.07); border-color: rgba(53,208,127,.3); color: #8fe8b8; font-size: 13.5px; }
.alerts-head { font-size: 13.5px; font-weight: 600; margin-bottom: 9px; }
.alerts-head b { color: var(--red); }
.alerts-list { display: flex; flex-wrap: wrap; gap: 7px; }
.alert {
  font-size: 12.5px; padding: 5px 10px; border-radius: 20px; font-weight: 550;
  border: 1px solid transparent; transition: filter .15s;
}
.alert:hover { text-decoration: none; filter: brightness(1.2); }
.alert-error { background: rgba(242,88,91,.14); color: #ff9a9c; border-color: rgba(242,88,91,.35); }
.alert-warn  { background: rgba(240,167,66,.12); color: #f5c27a; border-color: rgba(240,167,66,.3); }

/* ── Vistas de infraestructura ──────────────────────────────── */
.srv-sub { font-size: 12px; color: var(--txt-3); margin-top: 7px; }
.iblk {
  margin: 18px 22px 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; animation: fadeUp .3s ease both;
  min-width: 0;
}
.iblk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.iblk-head h3 { font-size: 14.5px; }
.icols { display: grid; grid-template-columns: 1fr 1fr; }
.icols > .iblk:first-child { margin-right: 9px; }
.icols > .iblk:last-child { margin-left: 9px; }
.hint { font-size: 12.5px; color: var(--txt-3); margin: 12px 0 0; line-height: 1.5; }
.hint b { color: var(--txt-2); }
.dim { color: var(--txt-3); }
.txt-warn { color: var(--amber); font-weight: 600; }
.cmd { max-width: 380px; font-size: 12px; color: var(--txt-2); }
.logline {
  margin-top: 5px; font-family: var(--mono); font-size: 11.5px; color: var(--txt-2);
  background: var(--bg-2); border-radius: 5px; padding: 4px 7px; word-break: break-all;
}
.iblk .kv { margin: 0; }
.more { margin-top: 10px; font-size: 13px; }
.more summary { cursor: pointer; color: var(--txt-2); }
.more .tbl { margin-top: 6px; }
.card-foot .warn { color: var(--amber); }
.iblk h3 a { color: var(--txt); }
.plain { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.8; }
.mono { font-family: var(--mono); font-size: 12.5px; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--txt-3); font-weight: 650; padding: 0 10px 8px 0; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; word-break: break-word; }
.tbl tr:last-child td { border-bottom: none; }
.tbl a { color: var(--txt); }
.cell-bar { display: flex; align-items: center; gap: 8px; }
.cell-bar .srv-bar { flex: 1; margin: 0; }
.cell-bar span { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.rank { display: flex; flex-direction: column; gap: 2px; }
.rank-row {
  display: grid; grid-template-columns: minmax(140px, 220px) 1fr 70px 80px; gap: 12px; align-items: center;
  padding: 7px 8px; border-radius: 7px; color: var(--txt); font-size: 13.5px;
}
.rank-row:hover { background: var(--card-2); text-decoration: none; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar .srv-bar { margin: 0; }
.rank-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rank-cpu { text-align: right; color: var(--txt-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; padding: 14px; }
  .srv-strip { margin: 14px 14px 0; grid-template-columns: repeat(2, 1fr); }
  .filters { margin: 14px 14px 0; }
  .topbar { padding: 11px 14px; }
  .last-update { display: none; }
  .drawer { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .tabs-main { margin: 14px 14px 0; }
  .tab-main { padding: 10px 12px 12px; font-size: 14px; }
  .ideas-head, .idea-form { margin-left: 14px; margin-right: 14px; }
  .if-grid, .if-grid2 { grid-template-columns: 1fr; gap: 0; }
  .iblk { margin: 14px 14px 0; padding: 14px; }
  .alerts { margin: 14px 14px 0; }
  .icols { grid-template-columns: 1fr; }
  .icols > .iblk:first-child, .icols > .iblk:last-child { margin-left: 14px; margin-right: 14px; }
  .rank-row { grid-template-columns: 1fr 64px; }
  .rank-bar, .rank-cpu { display: none; }
  .tabs-main { overflow-x: auto; scrollbar-width: none; }
  .tab-main { white-space: nowrap; }
  /* Pestañas del detalle: una sola línea con scroll, no partidas */
  .tabs { overflow-x: auto; scrollbar-width: none; padding: 8px 14px 0; }
  .tab { white-space: nowrap; flex-shrink: 0; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  /* Tablas anchas: scroll horizontal en vez de partir los textos letra por letra */
  .tbl { min-width: 620px; }
  .tbl td:first-child { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Al final a propósito ──────────────────────────────────────
   El atributo hidden SIEMPRE oculta. Sin esto, cualquier regla con display
   (.drawer es flex, .login-wrap es grid) le gana y el elemento queda visible:
   el panel de detalle tapaba la pantalla después del login. */
[hidden] { display: none !important; }
