/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:         #0A0F1E;
  --card:       #111827;
  --card2:      #1A2235;
  --border:     #1E2D45;
  --border2:    #253550;
  --text:       #F0F4FF;
  --muted:      #6B7FA8;
  --accent:     #3B82F6;
  --accent-h:   #2563EB;
  --green:      #10B981;
  --amber:      #F59E0B;
  --red:        #EF4444;
  --orange:     #F97316;
  --panel-w:    420px;
  --navbar-h:   56px;
  --radius:     12px;
  --tr:         0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
button { cursor: pointer; font-family: inherit; }
input  { font-family: inherit; }

/* ── Utilities ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════════════════════════════════ */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, #0f1e3a 0%, var(--bg) 70%);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px #00000070;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 0 20px #3B82F650);
}
.login-logo svg { width: 100%; height: 100%; }

.login-brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.login-brand p  { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ── Form ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--tr);
}
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--tr), opacity var(--tr);
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card2); color: var(--text); }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error { background: #2d1212; border: 1px solid #5a1e1e; color: #fca5a5; }

/* ════════════════════════════════════════════════════════════════════════════
   NAVBAR
════════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  gap: 12px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.brand-icon {
  width: 20px; height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.nav-user { font-size: 13px; font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-quota { font-size: 11px; color: var(--muted); }

/* Polling dot */
.poll-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border2);
  transition: background 0.3s;
  flex-shrink: 0;
}
.poll-dot.polling {
  background: var(--accent);
  animation: pulse-dot 1s ease-in-out infinite;
}
.poll-dot.error { background: var(--red); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT / DASHBOARD
════════════════════════════════════════════════════════════════════════════ */
.main-content {
  padding-top: calc(var(--navbar-h) + 24px);
  padding-bottom: 40px;
  padding-left: 24px;
  padding-right: 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header h2 { font-size: 20px; font-weight: 700; }
.last-update { font-size: 12px; color: var(--muted); }

/* ── Agents grid ────────────────────────────────────────────────────────────── */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color var(--tr), transform var(--tr), box-shadow var(--tr);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px #0007;
}
.agent-card.selected { border-color: var(--accent); }

/* Cards con alertas activas */
.agent-card.has-alerts {
  border-color: var(--amber);
  background: linear-gradient(160deg, #1f1a0f 0%, var(--card) 50%);
}
.agent-card.has-alerts:hover {
  border-color: var(--amber);
  box-shadow: 0 8px 24px rgba(245,158,11,.18);
}
.agent-card.has-alerts.selected { border-color: var(--amber); }

/* Card header */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--muted); }

.status-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.status-chip.online  { background: #0d2e20; color: var(--green); }
.status-chip.offline { background: #1e1e28; color: var(--muted); }

/* Card metrics */
.card-metrics { display: flex; flex-direction: column; gap: 8px; }

.card-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.cm-label { color: var(--muted); flex-shrink: 0; width: 60px; }
.cm-value { color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mini bar */
.mini-bar {
  width: 60px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.mini-bar-fill.warn { background: var(--red); }
.mini-bar-fill.med  { background: var(--amber); }

/* Alert badges */
.card-alerts { display: flex; flex-wrap: wrap; gap: 4px; }
.alert-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.alert-chip.ram     { background: #3d1515; color: #fca5a5; border: 1px solid #5a2020; }
.alert-chip.storage { background: #3d2a0a; color: #fcd34d; border: 1px solid #5a3f10; }
.alert-chip.media   { background: #1a2040; color: #93c5fd; border: 1px solid #2a3560; }
.alert-chip.offline { background: #1e1e28; color: var(--muted); border: 1px solid var(--border); }

/* Icono de alerta en el header de la card */
.card-alert-icon {
  font-size: 14px;
  line-height: 1;
  animation: warn-pulse 2s ease-in-out infinite;
}
@keyframes warn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Card footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}
.card-detail-hint { color: var(--accent); font-weight: 500; }

/* ── Empty / loading ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-sub  { font-size: 12px; margin-top: 4px; }

.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════════════
   DETAIL PANEL
════════════════════════════════════════════════════════════════════════════ */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
}

.detail-panel {
  width: var(--panel-w);
  max-width: 100vw;
  height: 100%;
  background: var(--card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-in 0.2s ease;
}

@keyframes slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* Panel header */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.panel-title-row .status-dot { width: 10px; height: 10px; }

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-model { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }

.btn-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
  transition: color var(--tr), background var(--tr);
}
.btn-close:hover { color: var(--text); background: var(--border); }

/* Panel body */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Status bar */
.status-bar {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
}
.status-bar.online  { display: block; background: #0d2e20; color: var(--green); }
.status-bar.offline { display: block; background: #1e1e28; color: var(--muted); }
.status-bar.alert   { display: block; background: #2d1818; color: #fca5a5; }

/* Panel sections */
.panel-section { display: flex; flex-direction: column; gap: 12px; }
.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-tile {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.metric-tile-wide {
  grid-column: 1 / -1;
}
.metric-tile-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.metric-tile-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.playback-val { color: var(--green); }

/* Full-width progress bar */
.bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease, background 0.2s;
}
.bar-fill.warn { background: var(--red); }
.bar-fill.med  { background: var(--amber); }

/* ── Commands ───────────────────────────────────────────────────────────────── */
.cmd-group { display: flex; flex-direction: column; gap: 8px; }
.cmd-group-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.cmd-row { display: flex; gap: 8px; flex-wrap: wrap; }

.cmd-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 64px; height: 56px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  transition: background var(--tr), border-color var(--tr), transform var(--tr);
  font-size: 12px;
}
.cmd-btn:hover:not(:disabled) {
  background: var(--border);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.cmd-btn:active { transform: translateY(0); }
.cmd-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cmd-icon { font-size: 18px; line-height: 1; }
.cmd-label { font-size: 10px; color: var(--muted); }

/* Feedback */
.cmd-feedback {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.cmd-feedback.ok  { background: #0d2e20; color: var(--green); }
.cmd-feedback.err { background: #2d1212; color: #fca5a5; }

/* Last seen */
.d-lastseen {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding-bottom: 4px;
}

/* ── Command history ────────────────────────────────────────────────────────── */
.cmd-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cmd-history-empty {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.cmd-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
}
.cmd-history-type {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-history-status {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.cmd-history-status.ok      { background: #0d2e20; color: var(--green); }
.cmd-history-status.pending { background: #2a1f00; color: var(--amber); }
.cmd-history-status.failed  { background: #2d1212; color: #fca5a5; }
.cmd-history-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════════════
   TABS
════════════════════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.tab-btn {
  position: relative;
  padding: 6px 16px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--tr), color var(--tr);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
}

/* ════════════════════════════════════════════════════════════════════════════
   ALERTS VIEW
════════════════════════════════════════════════════════════════════════════ */
.alerts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.filter-btns {
  display: flex;
  gap: 4px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.filter-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--tr), color var(--tr);
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.alerts-list { display: flex; flex-direction: column; gap: 10px; }

.alert-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.alert-card.resolved {
  opacity: 0.6;
  border-style: dashed;
}

.alert-type-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.alert-type-icon.ram     { background: #2d1212; }
.alert-type-icon.storage { background: #2d2010; }
.alert-type-icon.media   { background: #1a1a30; }
.alert-type-icon.offline { background: #1e1e28; }

.alert-info { flex: 1; min-width: 0; }
.alert-agent {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alert-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.alert-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.alert-status-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.alert-status-chip.active   { background: #2d1212; color: #fca5a5; }
.alert-status-chip.resolved { background: #0d2e20; color: var(--green); }

.alert-time { font-size: 11px; color: var(--muted); }

.alerts-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ════════════════════════════════════════════════════════════════════════════
   PAGE HEADER RIGHT
════════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════════════════════════
   VIEW TOGGLE
════════════════════════════════════════════════════════════════════════════ */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.view-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--muted);
  transition: background var(--tr), color var(--tr);
}
.view-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.view-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ════════════════════════════════════════════════════════════════════════════
   GRID MODES
════════════════════════════════════════════════════════════════════════════ */

/* ── Medium ─────────────────────────────────────────────────────────────────── */
.agents-grid.grid-medium {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.agents-grid.grid-medium .agent-card  { padding: 12px; gap: 8px; }
.agents-grid.grid-medium .card-metric-row:last-of-type { display: none; } /* oculta batería */
.agents-grid.grid-medium .card-footer { padding-top: 8px; }
.agents-grid.grid-medium .card-detail-hint { display: none; }
.agents-grid.grid-medium .cm-label   { width: 50px; font-size: 11px; }
.agents-grid.grid-medium .cm-value   { font-size: 11px; }
.agents-grid.grid-medium .card-name  { font-size: 13px; }

/* ── Small ──────────────────────────────────────────────────────────────────── */
.agents-grid.grid-small {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.agents-grid.grid-small .agent-card       { padding: 10px; gap: 6px; }
.agents-grid.grid-small .card-metric-row  { display: none; }
.agents-grid.grid-small .card-alerts      { display: none; }
.agents-grid.grid-small .card-footer      { display: none; }
.agents-grid.grid-small .card-name        { font-size: 12px; }
.agents-grid.grid-small .status-chip      { font-size: 10px; padding: 1px 6px; }
.agents-grid.grid-small .card-alert-icon  { font-size: 11px; }

/* RAM bar solo visual en small */
.agents-grid.grid-small .card-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.agents-grid.grid-small .card-name-row { width: 100%; }
.agents-grid.grid-small .status-chip   { align-self: flex-end; margin-top: -24px; }

.small-ram-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}
.small-ram-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
}
.small-ram-bar-fill.warn { background: var(--red); }
.small-ram-bar-fill.med  { background: var(--amber); }

/* ── List ───────────────────────────────────────────────────────────────────── */
.agents-grid.grid-list {
  grid-template-columns: 1fr;
  gap: 6px;
}

.list-card {
  flex-direction: row !important;
  align-items: center !important;
  padding: 10px 14px !important;
  gap: 10px !important;
  min-height: 50px;
}

.list-name-col {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 0 0 220px;
}
.list-name-col .card-name { font-size: 13px; }

.list-playback-col {
  flex: 1;
  font-size: 12px;
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.list-playback-col.muted { color: var(--muted); }

.list-ram-col {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 90px;
}
.list-ram-pct { font-size: 11px; color: var(--muted); white-space: nowrap; }

.list-bat-col {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 60px;
}

.list-alert-col {
  display: flex;
  gap: 3px;
  flex: 0 0 auto;
}

.list-time-col {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 70px;
  text-align: right;
}

.list-arrow {
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   CARD CHECKBOX (selección múltiple)
════════════════════════════════════════════════════════════════════════════ */
.card-check {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
  margin-right: 2px;
}
.card-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 3px;
}

/* Card seleccionada en modo multi-select */
.agent-card.multi-selected {
  border-color: var(--accent) !important;
  background: linear-gradient(160deg, #0f1a2e 0%, var(--card) 60%);
  box-shadow: 0 0 0 1px var(--accent);
}

/* ════════════════════════════════════════════════════════════════════════════
   BULK COMMAND BAR
════════════════════════════════════════════════════════════════════════════ */
.bulk-bar {
  position: fixed;
  bottom: -80px;
  left: 0; right: 0;
  height: 60px;
  background: var(--card2);
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 150;
  transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}
.bulk-bar.active { bottom: 0; }

.bulk-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bulk-clear-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--border);
  border: none;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  transition: background var(--tr), color var(--tr);
}
.bulk-clear-btn:hover { background: var(--red); color: #fff; }

.bulk-select-all-btn {
  height: 26px;
  padding: 0 10px;
  display: flex; align-items: center;
  background: var(--border);
  border: none;
  border-radius: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr);
}
.bulk-select-all-btn:hover { background: var(--accent); color: #fff; }
.bulk-select-all-btn.all-selected { background: var(--accent); color: #fff; }

.bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.bulk-cmds {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}

.bulk-group { display: flex; gap: 4px; }

.bulk-sep {
  width: 1px;
  height: 28px;
  background: var(--border2);
  flex-shrink: 0;
  margin: 0 4px;
}

.bulk-cmd-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text);
  transition: background var(--tr), border-color var(--tr), transform var(--tr);
  flex-shrink: 0;
}
.bulk-cmd-btn:hover:not(:disabled) {
  background: var(--border2);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.bulk-cmd-btn:active:not(:disabled) { transform: translateY(0); }
.bulk-cmd-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.bulk-feedback {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
}
.bulk-feedback.ok      { background: #0d2e20; color: var(--green); }
.bulk-feedback.partial { background: #2d2010; color: var(--amber); }
.bulk-feedback.err     { background: #2d1212; color: #fca5a5; }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  :root { --panel-w: 100vw; }

  .main-content { padding-left: 14px; padding-right: 14px; }

  .agents-grid { grid-template-columns: 1fr; }

  .nav-info { display: none; }

  .detail-panel { border-left: none; border-top: 1px solid var(--border); }

  .bulk-bar { padding: 0 12px; gap: 10px; }
  .bulk-count { display: none; }
  .bulk-sep { margin: 0 2px; }
}
