.credentials-root {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Buttons scoped under root (mirrors DeckyFleet/LiveLogs pattern) */
.credentials-root .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  background: transparent;
  border: 1px solid var(--matrix);
  color: var(--matrix);
  cursor: pointer;
  transition: all 0.3s ease;
}
.credentials-root .btn:hover { background: var(--matrix); color: var(--bg); box-shadow: var(--matrix-glow); }
.credentials-root .btn.violet { border-color: var(--violet); color: var(--violet); }
.credentials-root .btn.violet:hover { background: var(--violet); color: var(--bg); box-shadow: var(--violet-glow); }
.credentials-root .btn.ghost { border-color: var(--border); color: var(--matrix); opacity: 0.7; }
.credentials-root .btn.ghost:hover { opacity: 1; border-color: var(--matrix); background: transparent; box-shadow: var(--matrix-glow); }
.credentials-root .btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Header controls */
.credentials-root .controls-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.credentials-root .controls-row .search-container { flex: 1; max-width: none; }

/* Segmented service filter */
.credentials-root .seg-group {
  display: flex;
  border: 1px solid var(--border);
  background: var(--panel);
  flex-wrap: wrap;
}
.credentials-root .seg-group button {
  padding: 8px 14px;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  font-family: inherit;
}
.credentials-root .seg-group button:last-child { border-right: none; }
.credentials-root .seg-group button.active {
  background: var(--violet-tint-10);
  color: var(--violet);
}
.credentials-root .seg-group button:hover:not(.active) { color: var(--matrix); }

/* Table row interactivity */
.credentials-root .logs-table tr.clickable { cursor: pointer; }
.credentials-root .logs-table tr.clickable:hover { background: var(--violet-tint-10); }
.credentials-root .logs-table td .attacker-link {
  text-decoration: underline dotted;
  cursor: pointer;
}
.credentials-root .logs-table td .data-preview {
  font-size: 0.74rem;
  opacity: 0.7;
  max-width: 400px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.credentials-root .logs-table td .secret-cell {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--matrix);
  max-width: 320px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.credentials-root .logs-table td .secret-cell.hashed {
  opacity: 0.7;
  color: var(--violet);
}
.credentials-root .logs-table td .principal-cell {
  font-size: 0.8rem;
}
.credentials-root .logs-table td .attempt-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  letter-spacing: 1px;
  opacity: 0.85;
}

/* Empty state */
.credentials-root .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px 20px;
  opacity: 0.45;
}
.credentials-root .empty-state .type-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
}

/* Pagination */
.credentials-root .pager { display: flex; align-items: center; gap: 12px; font-size: 0.7rem; }
.credentials-root .pager button {
  padding: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--matrix);
  display: flex;
  cursor: pointer;
}
.credentials-root .pager button:disabled { opacity: 0.3; cursor: not-allowed; }
.credentials-root .pager button:hover:not(:disabled) { border-color: var(--accent); }

/* ── Drawer ────────────────────────────────────────────── */
.credentials-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: flex-end;
  z-index: 1000;
  animation: cd-fade 0.15s ease;
}
@keyframes cd-fade { from { opacity: 0; } to { opacity: 1; } }

.credentials-drawer {
  width: min(620px, 100%);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--violet);
  box-shadow: -12px 0 40px var(--violet-tint-10);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: cd-slide 0.2s ease;
}
@keyframes cd-slide { from { transform: translateX(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.credentials-drawer .bd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.credentials-drawer .bd-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  letter-spacing: 3px;
  color: var(--violet);
  margin: 0;
}
.credentials-drawer .close-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--matrix);
  display: flex;
  padding: 4px;
  cursor: pointer;
}
.credentials-drawer .close-btn:hover { border-color: var(--accent); }

.credentials-drawer .bd-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.credentials-drawer .kvs {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 12px;
  font-size: 0.8rem;
}
.credentials-drawer .kvs .k {
  opacity: 0.55;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
}
.credentials-drawer .kvs .v { word-break: break-all; }
.credentials-drawer .kvs .attacker-link {
  text-decoration: underline dotted;
  cursor: pointer;
  color: var(--matrix);
}
.credentials-drawer .violet-accent { color: var(--violet); }

.credentials-drawer .type-label {
  font-size: 0.68rem;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-bottom: 8px;
}

.credentials-drawer .code-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--violet);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--matrix);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  overflow-x: auto;
}
.credentials-drawer .code-block .ck { color: var(--violet); }
.credentials-drawer .code-block .cs { color: var(--matrix); }

.credentials-drawer .hash-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.credentials-drawer .hash-row .hash-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--matrix);
  word-break: break-all;
  flex: 1;
}
.credentials-drawer .icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--matrix);
  padding: 4px 6px;
  display: inline-flex;
  cursor: pointer;
}
.credentials-drawer .icon-btn:hover { border-color: var(--accent); }

.credentials-drawer .bd-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.credentials-drawer .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--matrix);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.8;
}
.credentials-drawer .btn.ghost:hover { opacity: 1; border-color: var(--matrix); box-shadow: var(--matrix-glow); }
