:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #647282;
  --line: #d8e0e8;
  --panel: #ffffff;
  --canvas: #f4f7fa;
  --nav: #101923;
  --nav-soft: #1a2633;
  --blue: #2563eb;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --violet: #6d28d9;
  --shadow: 0 18px 42px rgba(20, 31, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.auth-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2633, var(--nav));
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.auth-brand span {
  color: var(--muted);
}

.auth-card h1 {
  font-size: 22px;
}

.auth-sub {
  margin: -8px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-field input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.auth-card .primary-action {
  margin-top: 4px;
  width: 100%;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  color: #e8eef5;
  background: var(--nav);
  /* Keep the nav fixed in the viewport while only the content scrolls. */
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand span,
.tenant-card span,
.tenant-card small {
  color: #9fb0c1;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #e8f4ff;
}

.brand-mark svg {
  width: 30px;
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #c9d5e2;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: var(--nav-soft);
  border-color: rgba(255, 255, 255, 0.08);
}

.tenant-card {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--nav-soft);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.search {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search input {
  width: min(360px, 36vw);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.primary-action,
.ghost-action {
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}

.link-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-action {
  color: #fff;
  border: 1px solid #174dc0;
  background: var(--blue);
}

.ghost-action {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.ghost-action.danger {
  height: 34px;
  padding: 0 12px;
  color: #b42318;
  border: 1px solid #f3b9b3;
  background: #fff5f4;
}

.ghost-action.danger:hover {
  color: #fff;
  border-color: #b42318;
  background: #b42318;
}

/* Compact inline action buttons inside inventory tables (Instalar parche). */
.compact-table .ghost-action {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--blue);
  border: 1px solid #b9ccf3;
  background: #f2f6ff;
}

.compact-table .ghost-action:hover {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.compact-table .ghost-action.danger {
  height: 30px;
  color: #b42318;
  border-color: #f3b9b3;
  background: #fff5f4;
}

.compact-table .ghost-action.danger:hover {
  color: #fff;
  border-color: #b42318;
  background: #b42318;
}

.compact-table .ghost-action:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Live progress bar shown in a row while a remote action runs. */
.action-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.action-progress-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: #e7ebf0;
  overflow: hidden;
}

.action-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background-color: #1aa34a;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.22) 0,
    rgba(255, 255, 255, 0.22) 8px,
    transparent 8px,
    transparent 16px
  );
  background-size: 22px 22px;
  transition: width 0.5s ease;
  animation: action-stripes 0.7s linear infinite;
}

@keyframes action-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 22px 0; }
}

.action-progress-fill.is-fail,
.action-progress.is-fail .action-progress-fill {
  background: linear-gradient(90deg, #b42318, #e0584b);
  animation: none;
}

.action-progress-label {
  font-size: 11px;
  font-weight: 600;
  color: #1aa34a;
  white-space: nowrap;
}

.action-progress.is-fail .action-progress-label {
  color: #b42318;
}

.action-progress.is-done .action-progress-label {
  color: #1aa34a;
}

/* Per-partition disk usage bars shown above the volumes table. */
.disk-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 4px 0 18px;
}

.disk-bar-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.disk-bar-track {
  height: 12px;
  border-radius: 7px;
  background: #e7ebf0;
  overflow: hidden;
}

.disk-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.4s ease;
}

.disk-bar-fill.is-ok { background: #1aa34a; }
.disk-bar-fill.is-warn { background: #d98c00; }
.disk-bar-fill.is-bad { background: #b42318; }

.disk-bar-foot {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Endpoints table: multiple inline actions + "update available" badge. */
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.ver-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #8a5a00;
  background: #fff4e0;
  border: 1px solid #f0c88a;
}

/* Search box above the installed-software list. */
.inv-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.inv-search {
  flex: 1;
  max-width: 360px;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.inv-search:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 77, 192, 0.12);
}

.inv-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #667085);
}

.content {
  display: grid;
  gap: 18px;
}

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

.grid.metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
}

.panel,
.metric,
.record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.metric {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 16px;
}

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

.metric strong {
  font-size: 30px;
}

.metric small {
  color: var(--muted);
}

.metric .trend.good {
  color: var(--green);
}

.metric .trend.warn {
  color: var(--amber);
}

.metric .trend.bad {
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  color: #075b2c;
  background: #dcfce7;
}

.pill.warn {
  color: #7a3c00;
  background: #fef3c7;
}

.pill.bad {
  color: #7f1d1d;
  background: #fee2e2;
}

.pill.info {
  color: #164b8f;
  background: #dbeafe;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f7;
}

.segmented button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 31, 43, 0.12);
}

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.risk-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.risk-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.automation-grid {
  grid-template-columns: repeat(3, minmax(210px, 1fr));
}

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

.script-card code {
  display: block;
  padding: 10px;
  overflow-x: auto;
  color: #dbeafe;
  border-radius: 8px;
  background: #0b1220;
}

.inventory-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.inventory-sidebar {
  position: sticky;
  top: 18px;
}

.endpoint-selector-list {
  display: grid;
  gap: 8px;
}

.endpoint-selector {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 74px;
  padding: 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.endpoint-selector strong,
.endpoint-selector span,
.endpoint-selector small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-selector span,
.endpoint-selector small {
  color: var(--muted);
}

.endpoint-selector.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.inventory-detail {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.inventory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.inventory-panel {
  box-shadow: none;
}

.inv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inv-tab {
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.inv-tab:hover {
  color: var(--ink);
  background: #eef3f7;
}

.inv-tab.active {
  color: #fff;
  background: var(--blue);
  border-color: #174dc0;
}

.inv-tab-content > .inventory-panel {
  box-shadow: var(--shadow);
}

.inv-subhead {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.inv-subhead:first-child {
  margin-top: 4px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.field-row {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.field-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-row strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.compact-table th,
.compact-table td {
  padding: 9px 8px;
  font-size: 13px;
}

.toolbar-cluster {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Centralized patches view */
.patch-count {
  min-width: 2.2rem;
  padding: 2px 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--blue);
  background: #eef3fe;
  border: 1px solid #c4d4f5;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.patch-count:hover,
.patch-count.is-open {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.patch-actions {
  white-space: nowrap;
}
.patch-actions .ghost-action {
  margin-left: 6px;
}
.patch-endpoints-row > td {
  background: #f4f7fa;
}
.patch-endpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 2px;
}
.patch-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Connected user line on the endpoint selector cards. */
.endpoint-selector .es-user {
  color: var(--teal);
  font-weight: 600;
}

/* Usuarios tab: current user + en linea / desconectados toggle. */
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.session-current {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.session-current span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.session-current strong {
  font-size: 16px;
  color: var(--ink);
}
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}
.seg-btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.seg-btn:hover {
  color: var(--ink);
}
.seg-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: #174dc0;
}

.download-menu {
  position: relative;
}

.download-menu summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  user-select: none;
}

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

.download-menu summary::marker {
  content: "";
}

.download-menu-list {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 260px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.download-menu-list a,
.download-menu-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
}

.download-menu-list a small,
.download-menu-list button small {
  color: var(--muted);
}

.download-menu-list a:hover,
.download-menu-list button:hover {
  background: #eef3f7;
}

.head-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 26px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 12px;
  font-weight: 800;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(18, 183, 106, 0); }
}

.control-tag {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
}

.ai-plan {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
}

.empty-state p,
.muted-note {
  margin: 0;
  color: var(--muted);
}

.empty-state p {
  max-width: 560px;
  margin: 0 auto;
}

.muted-note {
  padding: 10px 2px;
  font-size: 14px;
}

.toast {
  display: none;
  padding: 12px 14px;
  color: #063f3a;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #ccfbf1;
}

.toast.show {
  display: block;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .grid.metrics,
  .grid.two,
  .automation-grid,
  .inventory-layout,
  .inventory-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .inventory-sidebar {
    position: static;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search input {
    width: 100%;
  }
}

/* ITSM / Help Desk */
.tickets-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tickets-layout { grid-template-columns: 1fr; } }
.ticket-create { gap: 8px; flex-wrap: wrap; }
.ticket-create input[type="text"] { min-width: 240px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.ticket-create select { height: 36px; }
.ticket-row { cursor: pointer; }
.ticket-row:hover { background: #f3f6ff; }
.ticket-row.active { background: #e7eefc; }
.ticket-thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ticket-comment { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.ticket-comment.internal { background: #fff7e6; border-color: #f0c88a; }
.ticket-comment-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.ticket-comment-head small { color: var(--muted, #667085); }
.ticket-reply { display: flex; flex-direction: column; gap: 8px; }
.ticket-reply textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.ticket-internal { font-size: 12px; color: var(--muted, #667085); display: inline-flex; align-items: center; gap: 6px; }

/* Control remoto / escritorio remoto */
#remoteOverlay { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column;
  background: #0b1220; outline: none; }
.remote-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: #111a2e; color: #e8eef5; border-bottom: 1px solid rgba(255,255,255,.1); }
.remote-bar strong { font-size: 14px; }
.remote-bar #remoteStatus { color: #9fb0c1; font-size: 12px; margin-right: auto; }
.remote-bar .primary-action.danger { background: #b42318; border-color: #8a1a12; }
.remote-stage { flex: 1; display: grid; place-items: center; overflow: hidden; }
#remoteImg { max-width: 100%; max-height: 100%; cursor: crosshair;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #000; user-select: none; }

/* Remote Assist — modal de solicitud (motivo/modo/duración) */
#remoteReq, #connectorModal { position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center;
  background: rgba(11,18,32,.55); }

/* External connector cards (Ajustes) — info on the left, status + actions right. */
.connector-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.connector-info { min-width: 0; }
.connector-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.connector-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.connector-actions .ghost-action { height: 32px; padding: 0 12px; font-size: 13px; }
.connector-actions .muted-note { margin: 0; font-size: 12px; }

/* ---- Report Engine (Reportes view) ---- */
.report-cat { margin-top: 18px; }
.report-cat:first-child { margin-top: 8px; }
.report-cat-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.report-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.report-tpl { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; background: #fff; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.report-tpl:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-1px); }
.report-tpl-icon { flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: #e8f4f2; color: var(--teal); }
.report-tpl-body { flex: 1; min-width: 0; }
.report-tpl-body h3 { margin: 0 0 4px; font-size: 14.5px; }
.report-tpl-body p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.report-tpl-go { height: 34px; padding: 0 14px; align-self: center; flex-shrink: 0; }
.report-hist-actions { display: flex; gap: 6px; justify-content: flex-end; }
.report-hist-actions .ghost-action { height: 30px; padding: 0 12px; font-size: 12px; }
.report-hist-actions .ghost-action.danger { padding: 0 10px; }
#reportWizard { position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center; background: rgba(11,18,32,.55); }
.report-wizard select { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); }
.report-wizard-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 13px !important; color: var(--ink) !important; font-weight: 600; }
.report-wizard-check.disabled { color: var(--muted) !important; }
.report-wizard-check input { width: 16px; height: 16px; }
.remote-req-card { width: min(440px, 92vw); background: #fff; border-radius: 14px; padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; }
.remote-req-card h2 { margin: 0; font-size: 17px; }
.remote-req-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  font-weight: 600; color: var(--muted, #647282); }
.remote-req-card input, .remote-req-card select { height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; color: var(--ink); }
.remote-req-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Remote Assist — canvas del visor (WebSocket tiles) */
#remoteCanvas { max-width: 100%; max-height: 100%; cursor: crosshair;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #000; image-rendering: auto; }

/* Control remoto: verde en todas las paginas (Endpoints, Inventario, etc.). */
[data-remote-control] {
  color: #fff;
  border: 1px solid #16a34a;
  background: #16a34a;
}
[data-remote-control]:hover {
  border-color: #15803d;
  background: #15803d;
}

/* Iconos de sistema operativo en la lista de endpoints y el detalle. */
.os-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.os-icon svg { width: 56px; height: 56px; }   /* 80px reducido 30% */
.endpoint-selector { position: relative; min-height: 80px; padding-right: 74px; }
.endpoint-selector .os-icon { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); }
.os-title { display: inline-flex; align-items: center; gap: 12px; }
.os-title .os-icon svg { width: 62px; height: 62px; }   /* 88px reducido 30% */

/* Dropdown de control de servicios (Inventario -> Servicios). */
.svc-dropdown { position: relative; display: inline-block; }
.svc-dropdown > summary {
  list-style: none; cursor: pointer; user-select: none;
  height: 30px; padding: 0 12px; display: inline-flex; align-items: center;
  font-size: 12px; color: var(--blue);
  border: 1px solid #b9ccf3; border-radius: 8px; background: #f2f6ff;
}
.svc-dropdown > summary::-webkit-details-marker { display: none; }
.svc-dropdown[open] > summary { color: #fff; border-color: var(--blue); background: var(--blue); }
.svc-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  display: grid; min-width: 150px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 31, 43, 0.18);
}
.svc-menu button {
  text-align: left; padding: 8px 10px; font-size: 13px;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer;
}
.svc-menu button:hover { background: #eef3fb; }
.svc-menu button:disabled { color: #aab4c0; cursor: default; background: transparent; }

/* El contenedor de la tabla de servicios debe permitir que el menu desplegable
   sobresalga (overflow-x:auto fuerza overflow-y:auto y lo recortaria). */
.table-wrap:has(.svc-dropdown) { overflow: visible; }

/* ===== Xecura Automation Engine ========================================== */
.automation .auto-tab-content { display: grid; gap: 16px; }
.auto-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.auto-row-actions { display: flex; gap: 6px; }
.auto-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.auto-checks-col { display: grid; gap: 8px; margin-top: 10px; }
.auto-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.auto-check input { width: 15px; height: 15px; }

/* Monospace editor / output textareas */
.auto-editor {
  width: 100%; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px; line-height: 1.5; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: #0f172a; color: #e2e8f0; resize: vertical; box-sizing: border-box;
}
.auto-editor[readonly] { background: #f1f5f9; color: var(--ink); }

/* Risk findings chips */
.auto-findings { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.auto-finding { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.auto-finding.critical { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.auto-finding.high { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.auto-finding.medium { color: #854d0e; border-color: #fde68a; background: #fefce8; }
.auto-finding.low { color: #067647; border-color: #abefc6; background: #ecfdf3; }

/* Modals (script editor / execute / job detail) */
#scriptEditor, #execModal, #jobDetail {
  position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center;
  background: rgba(11, 18, 32, .55); padding: 24px;
}
.auto-modal-card {
  width: min(680px, 95vw); max-height: 92vh; overflow-y: auto; background: var(--panel);
  border-radius: 14px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.34);
  display: flex; flex-direction: column; gap: 12px;
}
.auto-editor-card { width: min(860px, 96vw); }
.auto-modal-head { display: flex; align-items: center; gap: 14px; }
.auto-modal-head h2 { margin: 0; font-size: 17px; flex: 1; overflow-wrap: anywhere; }
.auto-modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.auto-editor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.auto-modal-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.auto-modal-card label.auto-full { grid-column: 1 / -1; }
.auto-modal-card input, .auto-modal-card select {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink);
}
.auto-endpoint-list {
  display: grid; gap: 6px; max-height: 200px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; background: #f8fafc;
}
.auto-endpoint-list .auto-check { font-weight: 600; }

/* Cabeceras de tabla ordenables (clic para ordenar asc/desc). */
.compact-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.compact-table th.sortable:hover { color: var(--blue); }
.compact-table th .sort-ind { color: var(--blue); font-weight: 700; }

/* Etiqueta divisoria dentro del menu desplegable de acciones (p. ej. "Prioridad"). */
.svc-menu-label {
  padding: 6px 10px 2px; margin-top: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--muted); border-top: 1px solid var(--line);
}

/* ===== Automation runbooks ============================================== */
.auto-steps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.rb-steps { display: grid; gap: 10px; }
.rb-step { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f8fafc; }
.rb-step-top { display: flex; align-items: center; gap: 8px; }
.rb-step-order {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; flex: none;
}
.rb-step-top .rb-step-name { flex: 1; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.rb-step-top select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; }
.rb-step-ctrl { display: flex; gap: 4px; }
.rb-step-ctrl .ghost-action { padding: 4px 9px; }
.rb-step-cfg { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: end; }
.rb-step-cfg label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.rb-step-cfg input, .rb-step-cfg select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); }
.rb-step-cfg .auto-check { flex-direction: row; align-items: center; }

/* Runbook per-step results in job detail */
.rb-result-list { display: grid; gap: 8px; }
.rb-result { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 10px; background: #f8fafc; }
.rb-result.ok { border-left-color: #12b76a; }
.rb-result.fail { border-left-color: #f04438; }
.rb-result-head { display: flex; align-items: center; gap: 8px; }
.rb-result-head strong { font-size: 13px; }

/* =========================================================================
   XECURA PREMIUM VISUAL SYSTEM — theming, chrome, charts, animations
   ========================================================================= */

/* Semantic tokens layered on top of the existing palette. */
:root {
  --primary: var(--blue);
  --accent: #06b6d4;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --ring-track: #e7ebf0;
  --elev-1: 0 1px 2px rgba(20,31,43,.06), 0 4px 16px rgba(20,31,43,.06);
  --elev-2: 0 18px 42px rgba(20,31,43,.12);
}

/* ---- DARK THEME (cybersecurity console) ---- */
[data-theme="dark"] {
  --ink: #e8eef6;
  --muted: #8aa0b6;
  --line: #1e2c3c;
  --panel: #0d1b2a;
  --canvas: #07111f;
  --nav: #060e1a;
  --nav-soft: #0f2030;
  --blue: #3b82f6;
  --teal: #22d3ee;
  --primary: #3b82f6;
  --accent: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f04438;
  --ring-track: #1b2a3b;
  --shadow: 0 18px 42px rgba(0,0,0,.45);
  --elev-1: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  --elev-2: 0 18px 42px rgba(0,0,0,.5);
}
[data-theme="dark"] body { background: var(--canvas); }
/* Surfaces that were hardcoded white in light mode. */
[data-theme="dark"] .search input,
[data-theme="dark"] .auth-field input,
[data-theme="dark"] .ghost-action,
[data-theme="dark"] .session-chip,
[data-theme="dark"] .primary-action.report-tpl-go,
[data-theme="dark"] .report-tpl,
[data-theme="dark"] .remote-req-card,
[data-theme="dark"] .report-wizard select,
[data-theme="dark"] .inv-search,
[data-theme="dark"] select { background: var(--nav-soft); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .auth-card { background: var(--panel); }
[data-theme="dark"] .auth-gate { background: radial-gradient(1200px 600px at 50% -10%, #0f2030, #060e1a); }
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .empty-pro { background: var(--panel); }
[data-theme="dark"] .pill.ok { color: #6ee7a8; background: rgba(34,197,94,.14); }
[data-theme="dark"] .pill.warn { color: #fcd34d; background: rgba(245,158,11,.14); }
[data-theme="dark"] .pill.bad { color: #fca5a5; background: rgba(240,68,56,.16); }
[data-theme="dark"] .pill.info { color: #93c5fd; background: rgba(59,130,246,.16); }
[data-theme="dark"] .command-center { background:
  linear-gradient(135deg, #0a1826 0%, #0d2230 55%, #0a2a2e 100%); border-color: #14324a; }
[data-theme="dark"] .compact-table .ghost-action { background: rgba(59,130,246,.12); border-color: #234; color: #93c5fd; }
[data-theme="dark"] .mini-meter, [data-theme="dark"] .dash-hbar-track { background: #14243a; }
[data-theme="dark"] .skeleton .sk { background: linear-gradient(90deg,#12243a,#1b3147,#12243a); }

/* Smooth theme transition. */
body, .panel, .metric, .sidebar, .kpi-card, .chart-card, input, select, .ghost-action {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* ---- Header icon button (theme toggle) ---- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn:active { transform: scale(.94); }

/* ---- Sidebar: icons, active indicator, system status ---- */
.nav-item { display: flex; align-items: center; gap: 11px; position: relative; font-weight: 600; }
.nav-ico-slot { display: inline-flex; width: 18px; height: 18px; color: #8fa3b8; flex-shrink: 0; transition: color .15s, transform .15s; }
.nav-item:hover .nav-ico-slot { color: #fff; transform: translateX(1px); }
.nav-item.active .nav-ico-slot { color: var(--teal); }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--teal);
  animation: navIndicator .25s ease; box-shadow: 0 0 12px var(--teal);
}
@keyframes navIndicator { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.sys-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #9fb0c1; }
.sys-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex-shrink: 0; }
.sys-status.ok .sys-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulseDot 2s infinite; }
.sys-status.warn .sys-dot { background: #f59e0b; }
@keyframes pulseDot { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.5);} 70%{box-shadow:0 0 0 7px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }

/* ---- Entrance animations ---- */
@keyframes revealUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { animation: revealUp .45s cubic-bezier(.22,1,.36,1) both; }
.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .10s; }
.reveal:nth-child(4) { animation-delay: .15s; }
.reveal:nth-child(5) { animation-delay: .20s; }
.kpis.reveal .kpi-card { animation: revealUp .45s cubic-bezier(.22,1,.36,1) both; }
.kpis.reveal .kpi-card:nth-child(2){animation-delay:.04s} .kpis.reveal .kpi-card:nth-child(3){animation-delay:.08s}
.kpis.reveal .kpi-card:nth-child(4){animation-delay:.12s} .kpis.reveal .kpi-card:nth-child(5){animation-delay:.16s}
.kpis.reveal .kpi-card:nth-child(6){animation-delay:.20s}
@media (prefers-reduced-motion: reduce) { .reveal, .kpis.reveal .kpi-card { animation: none !important; } }

/* ---- Command Center hero ---- */
.command-center {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 26px 30px; border-radius: 16px; border: 1px solid #d6e3ef;
  background: linear-gradient(135deg, #0b2440 0%, #0f3a52 55%, #0d4a52 100%);
  color: #eaf4ff; box-shadow: var(--elev-2); position: relative; overflow: hidden;
}
.command-center::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 90% -20%, rgba(34,211,238,.25), transparent 70%); pointer-events: none; }
.cc-eyebrow { margin: 0 0 4px; color: #7fe3d6; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cc-left h2 { margin: 0 0 6px; font-size: 26px; color: #fff; }
.cc-sub { margin: 0 0 16px; color: #b7d4e8; font-size: 14px; max-width: 52ch; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #eaf4ff; }
.cc-chip i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.cc-chip.ok i { background: #22c55e; } .cc-chip.warn i { background: #f59e0b; } .cc-chip.info i { background: #22d3ee; }
.cc-ring { flex-shrink: 0; }

/* ---- Health ring ---- */
.dash-ring { position: relative; width: 180px; height: 180px; }
.dash-ring-fill { transition: stroke-dashoffset 1.1s cubic-bezier(.22,1,.36,1); filter: drop-shadow(0 0 6px currentColor); }
.dash-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dash-ring-center strong { font-size: 40px; font-weight: 800; line-height: 1; color: #fff; }
.command-center .dash-ring-center span { color: #cfe6f3; font-size: 13px; font-weight: 700; }
.command-center .dash-ring-center small { color: #8fb8cf; font-size: 11px; }

/* ---- KPI cards ---- */
.grid.kpis { grid-template-columns: repeat(6, minmax(0,1fr)); }
.kpi-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px;
  box-shadow: var(--elev-1); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); opacity: .85; }
.kpi-card.ok::before { background: var(--success); } .kpi-card.warn::before { background: var(--warning); }
.kpi-card.bad::before { background: var(--danger); } .kpi-card.info::before { background: var(--primary); }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--elev-2); border-color: var(--primary); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ico { display: inline-flex; width: 34px; height: 34px; border-radius: 9px; place-items: center; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.kpi-card.ok .kpi-ico { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.kpi-card.warn .kpi-ico { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.kpi-card.bad .kpi-ico { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.kpi-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.kpi-card.ok .kpi-dot { background: var(--success); } .kpi-card.warn .kpi-dot { background: var(--warning); } .kpi-card.bad .kpi-dot { background: var(--danger); }
.kpi-val { display: block; font-size: 30px; font-weight: 800; margin-top: 12px; line-height: 1; }
.kpi-label { display: block; font-size: 13px; font-weight: 700; margin-top: 4px; }
.kpi-detail { color: var(--muted); font-size: 11.5px; }

/* ---- Chart cards ---- */
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.chart-card { min-height: 220px; }
.dash-empty-chart { color: var(--muted); font-size: 13px; padding: 24px 4px; text-align: center; }
.dash-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dash-donut-total { font-size: 26px; font-weight: 800; fill: var(--ink); }
.dash-donut-lbl { font-size: 11px; fill: var(--muted); }
.dash-legend { display: flex; flex-direction: column; gap: 7px; }
.dash-leg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dash-leg span { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.dash-leg strong { margin-left: auto; }
.dash-hbars { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.dash-hbar { display: grid; grid-template-columns: 88px 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.dash-hbar-lbl { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hbar-track { height: 12px; border-radius: 7px; background: var(--ring-track); overflow: hidden; }
.dash-hbar-track i { display: block; height: 100%; border-radius: 7px; transition: width .9s cubic-bezier(.22,1,.36,1); }
.dash-hbar-val { text-align: right; font-weight: 700; }

/* ---- Mini CPU/RAM meter in tables ---- */
.ep-cell { display: flex; align-items: center; gap: 10px; }
.ep-os { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; flex-shrink: 0; }
.ep-os svg { width: 22px; height: 22px; }
.ep-meter-cell { min-width: 90px; }
.ep-meter-cell small { color: var(--muted); font-size: 11px; }
.mini-meter { height: 7px; border-radius: 5px; background: var(--ring-track); overflow: hidden; margin-bottom: 3px; }
.mini-meter i { display: block; height: 100%; border-radius: 5px; background: var(--success); transition: width .6s ease; }
.mini-meter.warn i { background: var(--warning); } .mini-meter.bad i { background: var(--danger); }

/* ---- Premium empty state ---- */
.empty-pro { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 20px; gap: 8px; }
.empty-pro-ico { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); margin-bottom: 4px; }
.empty-pro-ico svg { width: 26px; height: 26px; }
.empty-pro h3 { margin: 0; font-size: 16px; }
.empty-pro p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 48ch; line-height: 1.5; }
.empty-pro-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ---- Skeleton loaders ---- */
.skeleton-list { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.skeleton-row { display: flex; align-items: center; gap: 12px; }
.sk { border-radius: 6px; background: linear-gradient(90deg,#eef2f6,#e2e8f0,#eef2f6); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.sk-dot { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.sk-line { height: 12px; flex: 1; } .sk-line.short { max-width: 120px; }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* ---- Button press feedback ---- */
.primary-action:active, .ghost-action:active { transform: scale(.97); }
.primary-action, .ghost-action { transition: transform .08s ease, background-color .15s, border-color .15s, color .15s; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .grid.kpis { grid-template-columns: repeat(3, 1fr); }
  .grid.three { grid-template-columns: 1fr; }
  .command-center { flex-direction: column; align-items: flex-start; }
  .cc-ring { align-self: center; }
}
@media (max-width: 720px) {
  .grid.kpis { grid-template-columns: repeat(2, 1fr); }
}

/* metric() premium card — label-at-top variant (no icon) + loading spinner */
.kpi-label-top { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.metric.kpi-card { min-height: 124px; }
.metric.kpi-card .kpi-val { margin-top: 10px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ring-track);
  border-top-color: var(--primary); animation: spin .8s linear infinite; margin-bottom: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Execute-modal policy block message */
.auto-block-msg { border: 1px solid #fecdca; background: #fef3f2; color: #b42318; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.auto-block-msg ul { margin: 6px 0 8px; padding-left: 18px; }
.auto-block-msg li { margin: 2px 0; }
.auto-block-msg .ghost-action { color: #b42318; border-color: #fecdca; }
