/* Praetor0 Console — sidebar + ZTA layout · γ-3.d */

/* ── Alias vars ────────────────────────────────────────────────────────────── */
:root, html.dark {
  --bg:         #1A0B2E;
  --bg-card:    #251447;
  --border:     #2E1A54;
  --text:       #F8F0FC;
  --text-muted: #9D8BB8;
  --surface-3:  #251447;
  --surface:    #1A0B2E;
  --surface-2:  #251447;
  --accent:     #C77DFF;
}

/* ── Base body ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #1A0B2E;
  color: #F8F0FC;
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0e0720; }
::-webkit-scrollbar-thumb { background: #2E1A54; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4A2878; }

/* ── Auth screen ───────────────────────────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #1A0B2E;
}

.auth-loading {
  text-align: center;
}

.auth-pulse {
  font-size: 13px;
  color: #9D8BB8;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Console layout (column) ───────────────────────────────────────────────── */
#console-layout {
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.p0-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 140px;
  background: linear-gradient(90deg, #1A0B2E 0%, #251447 100%);
  border-bottom: 1px solid #2E1A54;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.p0-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.p0-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Tenant picker ─────────────────────────────────────────────────────────── */
.tenant-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tenant-picker-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #5A3B7A;
  text-transform: uppercase;
}

.tenant-picker-select {
  padding: 3px 6px;
  font-size: 11px;
  background: #251447;
  border: 1px solid #2E1A54;
  border-radius: 4px;
  color: #C77DFF;
  cursor: pointer;
  outline: none;
}

.tenant-picker-select:focus { border-color: #7B2CBF; }

/* ── Lang switch ───────────────────────────────────────────────────────────── */
.lang-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #251447;
  border: 1px solid #2E1A54;
  border-radius: 5px;
}

.lang-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: transparent;
  border: none;
  color: #5A3B7A;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}

.lang-btn:hover { color: #9D8BB8; }

.lang-btn.active {
  background: #7B2CBF;
  color: #F8F0FC;
}

/* ── Custom SVG icons ──────────────────────────────────────────────────────── */
.icon-custom {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  opacity: 0.7;
  filter: invert(1) brightness(0.8);
}

.sidebar-section-header:hover .icon-custom { opacity: 1; }

.p0-subtitle {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5A3B7A;
  border-left: 1px solid #2E1A54;
  padding-left: 20px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #9D8BB8;
}

/* ── Body (sidebar + main) ─────────────────────────────────────────────────── */
.p0-body {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 140px);
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#console-sidebar {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid #2E1A54;
  padding: 8px 0 32px;
  overflow-y: auto;
  height: 100%;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
#console-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px 36px;
}

/* ── Sidebar nav ───────────────────────────────────────────────────────────── */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #5A3B7A;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.sidebar-section-header:hover { color: #8A6BAA; }

.sec-hd-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sec-hd-left svg { width: 13px; height: 13px; }

.chevron {
  font-size: 9px;
  transition: transform 0.2s ease;
  color: #3D2060;
  flex-shrink: 0;
}

.sidebar-section.collapsed .chevron { transform: rotate(-90deg); }

.sidebar-section-items {
  overflow: hidden;
  max-height: 1000px;
  transition: max-height 0.25s ease;
}

.sidebar-section.collapsed .sidebar-section-items { max-height: 0; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #9D8BB8;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-right: none;
  border-top: none;
  border-bottom: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}

.sidebar-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-nav-item:hover {
  background: rgba(37, 20, 71, 0.6);
  color: #F8F0FC;
}

.sidebar-nav-item.active {
  background: rgba(37, 20, 71, 0.9);
  color: #C77DFF;
  border-left-color: #C77DFF;
  font-weight: 600;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 28px;
  font-size: 12px;
  color: #9D8BB8;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-right: none;
  border-top: none;
  border-bottom: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}

.sidebar-sub-item:hover {
  background: rgba(37, 20, 71, 0.5);
  color: #F8F0FC;
}

.sidebar-sub-item.active {
  color: #C77DFF;
  border-left-color: #7B2CBF;
  background: rgba(37, 20, 71, 0.7);
  font-weight: 500;
}

/* ── Content sections ──────────────────────────────────────────────────────── */
.console-section { display: none; }
.console-section.active { display: block; }

/* ── Sub-tab nav in sections ───────────────────────────────────────────────── */
.siem-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.siem-sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
}
.tab-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.siem-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.siem-content { display: grid; gap: 6px; }

/* ── Toast notifications ───────────────────────────────────────────────────── */
#console-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.console-toast-item {
  background: #251447;
  border: 1px solid #2E1A54;
  color: #F8F0FC;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: toast-in 0.2s ease;
  max-width: 320px;
}

.console-toast-item.error { border-color: #ef4444; color: #ef4444; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section heading row ───────────────────────────────────────────────────── */
.console-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.console-section-title {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Placeholder "Coming soon" ─────────────────────────────────────────────── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 12px;
  padding: 48px 24px;
}

.coming-soon-icon {
  width: 48px;
  height: 48px;
  color: #4A2878;
  margin-bottom: 8px;
}

.coming-soon-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5A3B7A;
}

.coming-soon-title {
  font-size: 28px;
  font-weight: 700;
  color: #C77DFF;
  letter-spacing: -0.5px;
}

.coming-soon-desc {
  font-size: 13px;
  color: #5A3B7A;
  max-width: 420px;
  line-height: 1.6;
}

/* ── Identities section ────────────────────────────────────────────────────── */

/* Page header */
.id-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.id-page-title {
  font-size: 17px;
  font-weight: 700;
  color: #F8F0FC;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.id-page-desc {
  font-size: 12px;
  color: #5A3B7A;
}

.id-count {
  font-size: 11px;
  font-weight: 600;
  background: rgba(199,125,255,0.15);
  color: #C77DFF;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(199,125,255,0.3);
  vertical-align: middle;
}

/* State helpers */
.id-loading {
  padding: 48px;
  text-align: center;
  color: #9D8BB8;
}

.id-empty {
  padding: 48px;
  text-align: center;
  color: #5A3B7A;
  font-size: 13px;
}

.id-error {
  padding: 16px;
  color: #ef4444;
  font-size: 13px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
}

/* Table wrapper */
.id-table-wrap {
  border: 1px solid #2E1A54;
  border-radius: 10px;
  overflow: hidden;
}

.id-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.id-table thead tr {
  background: #251447;
}

.id-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #5A3B7A;
  border-bottom: 1px solid #2E1A54;
  white-space: nowrap;
}

.id-table td {
  padding: 10px 14px;
  color: #F8F0FC;
  border-bottom: 1px solid rgba(46,26,84,0.6);
  vertical-align: middle;
}

.id-table tbody tr:last-child td { border-bottom: none; }

.id-table tbody tr {
  transition: background 0.1s;
}

.id-table tbody tr:hover {
  background: rgba(37,20,71,0.6);
  cursor: pointer;
}

/* Avatar initials */
.id-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2CBF, #C77DFF);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.id-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.id-username { font-weight: 500; }
.id-fullname { font-size: 11px; color: #9D8BB8; margin-top: 1px; }

/* Badges */
.id-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active     { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.badge-suspended  { background: rgba(156,163,175,0.1); color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }
.badge-locked     { background: rgba(239,68,68,0.12);  color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.badge-system     { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.badge-custom     { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }

/* Clearance badges */
.id-clr {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.clr-public       { background: rgba(34,197,94,0.1);  color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }
.clr-interne      { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.clr-confidentiel { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.clr-secret       { background: rgba(239,68,68,0.14);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* Role badge inline */
.id-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(199,125,255,0.12);
  color: #C77DFF;
  border: 1px solid rgba(199,125,255,0.25);
}

/* Agent / workload status badge */
.id-agent-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.id-agent-active  { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.id-agent-inactive{ background: rgba(156,163,175,0.1); color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }

/* Perm count pill */
.id-perm-count {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(37,20,71,0.8);
  color: #9D8BB8;
  border: 1px solid #2E1A54;
}

/* Scope / action tags */
.id-scope-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(99,102,241,0.12);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.2);
  margin: 1px;
}

/* Filters bar */
.id-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.id-search {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  background: #251447;
  border: 1px solid #2E1A54;
  color: #F8F0FC;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.12s;
}
.id-search::placeholder { color: #5A3B7A; }
.id-search:focus { border-color: #7B2CBF; }

.id-select {
  background: #251447;
  border: 1px solid #2E1A54;
  color: #9D8BB8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
}
.id-select:focus { border-color: #7B2CBF; }

/* Info box (clearances) */
.id-info-box {
  background: rgba(37,20,71,0.7);
  border: 1px solid #2E1A54;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #9D8BB8;
  line-height: 1.6;
}

.id-info-box strong { color: #C77DFF; }

/* Hint text */
.id-hint {
  font-size: 11px;
  color: #5A3B7A;
  margin-top: 4px;
}

/* ── Drawer ─────────────────────────────────────────────────────────────────── */

#id-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  justify-content: flex-end;
}

#id-drawer.open {
  display: flex;
}

#id-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  cursor: pointer;
}

#id-drawer-panel {
  position: relative;
  width: 420px;
  max-width: 96vw;
  height: 100%;
  background: #1A0B2E;
  border-left: 1px solid #2E1A54;
  overflow-y: auto;
  animation: drawer-in 0.2s ease;
  padding: 24px 24px 40px;
}

@keyframes drawer-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.id-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.id-drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: #F8F0FC;
}

.id-drawer-close {
  background: transparent;
  border: none;
  color: #9D8BB8;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.1s, background 0.1s;
}
.id-drawer-close:hover { color: #F8F0FC; background: rgba(255,255,255,0.06); }

/* Detail sections inside drawer */
.id-detail-section {
  margin-bottom: 20px;
}

.id-detail-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #5A3B7A;
  margin-bottom: 6px;
}

.id-detail-value {
  font-size: 13px;
  color: #F8F0FC;
}

.id-detail-value.muted { color: #9D8BB8; }

.id-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.id-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(46,26,84,0.5);
  font-size: 12px;
  color: #9D8BB8;
}
.id-detail-row:last-child { border-bottom: none; }
.id-detail-row strong { color: #F8F0FC; margin-left: auto; font-weight: 500; }

.id-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Module 1.3 — shared ────────────────────────────────────────────────── */

/* Inline code / monospace label */
.ap-code {
  font-family: monospace;
  font-size: 12px;
  color: #a5b4fc;
  background: rgba(99,102,241,0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

/* JSON pre block in drawer */
.ap-json-block {
  background: rgba(0,0,0,0.25);
  border: 1px solid #2E1A54;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 11px;
  color: #9D8BB8;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
}

/* Pagination bar */
.ap-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.ap-page-btn {
  background: #251447;
  border: 1px solid #2E1A54;
  color: #9D8BB8;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ap-page-btn:hover:not(:disabled) { background: #3A1E6A; color: #F8F0FC; }
.ap-page-btn:disabled { opacity: 0.4; cursor: default; }

.ap-page-info {
  font-size: 12px;
  color: #9D8BB8;
}

/* Action badge (PDP decisions / DLP) */
.ap-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
}

/* ── Access Policies ────────────────────────────────────────────────────── */

.ap-label-group {
  margin-bottom: 16px;
  border: 1px solid #2E1A54;
  border-radius: 10px;
  overflow: hidden;
}

.ap-label-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #251447;
  border-bottom: 1px solid #2E1A54;
}

.ap-label-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ap-label-code {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: #F8F0FC;
}

.ap-label-name {
  font-size: 12px;
  color: #9D8BB8;
  flex: 1;
}

.ap-policies-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ap-policy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(46,26,84,0.4);
}
.ap-policy-row:last-child { border-bottom: none; }

.ap-policy-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.ap-policy-val {
  font-family: monospace;
  font-size: 12px;
  color: #F8F0FC;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-policy-pri {
  font-size: 11px;
  color: #5A3B7A;
  flex-shrink: 0;
}

/* ── Trust Telemetry ─────────────────────────────────────────────────────── */

.tt-sev-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
}

.tt-event-type {
  font-family: monospace;
  font-size: 11px;
  color: #C77DFF;
}

/* ── Data Protection ─────────────────────────────────────────────────────── */

.dp-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
}

/* ── Sidebar toggle button ───────────────────────────────────────────────── */

.sidebar-toggle {
  background: none;
  border: none;
  color: #9D8BB8;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.12s, color 0.12s;
}
.sidebar-toggle:hover { background: #251447; color: #C77DFF; }

/* ── Collapsed sidebar ───────────────────────────────────────────────────── */

#console-sidebar {
  transition: width 0.2s ease;
}

#console-sidebar.collapsed {
  width: 56px;
}

#console-sidebar.collapsed .sidebar-section-header {
  padding: 10px 0;
  justify-content: center;
  font-size: 0;
}
#console-sidebar.collapsed .chevron { display: none; }
#console-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 9px 0;
  font-size: 0;
}
#console-sidebar.collapsed .sidebar-sub-item { display: none; }

/* ── Soon badge ──────────────────────────────────────────────────────────── */

.badge-soon {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 6px;
  padding: 0px 4px;
  margin-left: 3px;
  vertical-align: middle;
}

.sidebar-sub-item.soon {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

/* ── Sidebar subsections (Trust A2A / Trust H2A) ─────────────────────────── */

.sidebar-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #5A3B7A;
  padding: 10px 16px 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.sidebar-subsection-header:hover { color: #7A5A9A; }

.chevron-sub {
  font-size: 8px;
  transition: transform 0.2s ease;
  color: #3D2060;
  flex-shrink: 0;
}

.sidebar-subsection.collapsed .chevron-sub { transform: rotate(-90deg); }

.sidebar-subsection-items {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.2s ease;
}

.sidebar-subsection.collapsed .sidebar-subsection-items { max-height: 0; }

#console-sidebar.collapsed .sidebar-subsection-header { display: none; }

/* ── SOON pages ──────────────────────────────────────────────────────────── */

.soon-page {
  max-width: 720px;
  padding: 32px 0;
}

.soon-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.soon-icon {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}

.soon-title-block h1 {
  font-size: 26px;
  font-weight: 700;
  color: #F8F0FC;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.soon-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  padding: 2px 8px;
}

.soon-description {
  font-size: 14px;
  color: #9D8BB8;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 640px;
}

.soon-features {
  margin-bottom: 28px;
}

.soon-features h2,
.soon-roadmap h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #5A3B7A;
  margin: 0 0 14px;
}

.soon-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.soon-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #150A2A;
  border: 1px solid #2A1650;
  border-radius: 10px;
  padding: 12px 16px;
}

.soon-feature-emoji {
  font-size: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}

.soon-feature-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.soon-feature-content strong {
  font-size: 13px;
  font-weight: 600;
  color: #E0AAFF;
}

.soon-feature-content span {
  font-size: 12px;
  color: #7A5A9A;
  line-height: 1.5;
}

.soon-roadmap {
  background: rgba(157,78,221,0.08);
  border: 1px solid rgba(157,78,221,0.2);
  border-radius: 12px;
  padding: 16px 20px;
}

.soon-roadmap p {
  font-size: 13px;
  color: #9D8BB8;
  line-height: 1.7;
  margin: 0;
}

/* ── Dashboard (Module 1.5) ──────────────────────────────────────────────── */

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-title {
  font-size: 22px;
  font-weight: 700;
  color: #F8F0FC;
  letter-spacing: -0.5px;
}

.dash-subtitle {
  font-size: 12px;
  color: #5A3B7A;
  margin-top: 4px;
}

.dash-kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #251447;
  border: 1px solid #2E1A54;
  border-radius: 10px;
  padding: 12px 20px;
  min-width: 76px;
}

.dash-kpi-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.dash-kpi-label {
  font-size: 10px;
  color: #5A3B7A;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.dash-tier-section {
  margin-bottom: 28px;
}

.dash-tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-tier-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid;
}

.dash-tier-count {
  font-size: 11px;
  color: #5A3B7A;
}

.dash-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.dash-agent-card {
  background: #251447;
  border: 1px solid #2E1A54;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dash-agent-card:hover {
  background: #2e1a54;
  border-color: #4A2878;
}

.dash-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dash-card-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-card-code {
  font-size: 12px;
  color: #a5b4fc;
  font-family: monospace;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-card-mandatory { font-size: 13px; }

.dash-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #F8F0FC;
  margin-bottom: 6px;
}

.dash-card-desc {
  font-size: 11px;
  color: #9D8BB8;
  line-height: 1.5;
  margin-bottom: 8px;
}

.dash-card-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.dash-cap-tag {
  font-size: 10px;
  background: rgba(199,125,255,0.1);
  color: #C77DFF;
  border: 1px solid rgba(199,125,255,0.2);
  border-radius: 6px;
  padding: 1px 7px;
}

.dash-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(46,26,84,0.5);
}

.dash-card-phase {
  font-size: 10px;
  color: #5A3B7A;
}

/* ── Dashboard card enrichie (compliance, market, deps, adr) ───────────── */

.dash-card-compliance {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.dash-comp-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: rgba(110,231,183,0.07);
  color: #6ee7b7;
  border: 1px solid rgba(110,231,183,0.2);
  border-radius: 4px;
  padding: 1px 6px;
}

.dash-card-market {
  font-size: 10px;
  color: #5A3B7A;
  margin-bottom: 4px;
  font-style: italic;
}

.dash-card-deps {
  font-size: 10px;
  color: #60a5fa;
  margin-bottom: 4px;
  font-family: monospace;
}

.dash-card-adrs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 6px;
}

.dash-adr-tag {
  font-size: 9px;
  color: #818cf8;
  background: rgba(129,140,248,0.08);
  border: 1px solid rgba(129,140,248,0.18);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ── Dashboard status card variants (Module 1.5c) ───────────────────────── */

.dash-agent-card.status-soon {
  opacity: 0.62;
  position: relative;
}
.dash-agent-card.status-soon::after {
  content: 'SOON';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f59e0b;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 3px;
  padding: 1px 5px;
}

.dash-agent-card.status-deprecated {
  opacity: 0.45;
  filter: grayscale(40%);
}

.dash-agent-card.status-archived {
  opacity: 0.28;
  filter: grayscale(80%);
  pointer-events: none;
}

/* ── Clearances matricielle (Module 1.5b) ────────────────────────────────── */

.clearances-view { display: flex; flex-direction: column; gap: 8px; }

.clearance-group {
  border: 1px solid #2E1A54;
  border-radius: 8px;
  overflow: hidden;
}

.clearance-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  background: #251447;
  user-select: none;
  transition: background 0.15s;
}

.clearance-header:hover { background: rgba(157,78,221,0.08); }

.clearance-icon { font-size: 16px; flex-shrink: 0; }

.clearance-label {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #F8F0FC;
}

.clearance-count { font-size: 12px; color: #9D8BB8; }

.clearance-toggle {
  font-size: 10px;
  color: #5A3B7A;
  transition: transform 0.2s;
}

.clearance-header.open .clearance-toggle { transform: rotate(90deg); }

.clearance-body {
  padding: 12px 18px 18px;
  border-top: 1px solid #2E1A54;
  background: rgba(26,11,46,0.5);
  transition: none;
}

.clearance-body.hidden { display: none; }

.clr-user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.clr-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(46,26,84,0.4);
  font-size: 12px;
}
.clr-user-row:last-child { border-bottom: none; }

.clr-empty { font-size: 12px; color: #5A3B7A; font-style: italic; margin: 0; }

/* Level colors */
.clearance-group.level-secret      { border-color: rgba(239,68,68,0.35); }
.clearance-group.level-secret      .clearance-header { border-left: 3px solid #ef4444; }
.clearance-group.level-confidentiel { border-color: rgba(251,191,36,0.35); }
.clearance-group.level-confidentiel .clearance-header { border-left: 3px solid #fbbf24; }
.clearance-group.level-interne     { border-color: rgba(96,165,250,0.35); }
.clearance-group.level-interne     .clearance-header { border-left: 3px solid #60a5fa; }
.clearance-group.level-public      { border-color: rgba(34,197,94,0.35); }
.clearance-group.level-public      .clearance-header { border-left: 3px solid #22c55e; }

/* ── Permissions groupées (Module 1.5b) ──────────────────────────────────── */

#perm-groups { display: flex; flex-direction: column; gap: 6px; }

.perm-group {
  border: 1px solid #2E1A54;
  border-radius: 8px;
  overflow: hidden;
}

.perm-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  background: #251447;
  user-select: none;
  transition: background 0.12s;
}

.perm-group-header:hover { background: rgba(199,125,255,0.07); }

.perm-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #C77DFF;
  flex: 1;
}

.perm-group-count { font-size: 11px; color: #9D8BB8; }

.perm-group-toggle {
  font-size: 10px;
  color: #5A3B7A;
  transition: transform 0.2s;
}

.perm-group-header.open .perm-group-toggle { transform: rotate(90deg); }

.perm-group-body { border-top: 1px solid #2E1A54; }
.perm-group-body.hidden { display: none; }

/* ── Roles système/custom (Module 1.5b) ──────────────────────────────────── */

.roles-view { display: flex; flex-direction: column; }

.roles-section { margin-bottom: 32px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #C77DFF;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2E1A54;
}

.section-title svg { width: 15px; height: 15px; flex-shrink: 0; }

.count-badge {
  font-size: 12px;
  font-weight: 400;
  color: #9D8BB8;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Agents catalog ──────────────────────────────────────────────────────── */

.ag-tier-group {
  margin-bottom: 24px;
}

.ag-tier-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 10px;
}

.ag-tier-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #5A3B7A;
}

.ag-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}

.ag-wake-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(199,125,255,0.08);
  border: 1px solid rgba(199,125,255,0.2);
  color: #9D8BB8;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── Module 2 — Navigation filter ──────────────────────────────────────────── */

.nav-hidden { display: none !important; }

/* ── Module 2 — User badge header ──────────────────────────────────────────── */

.user-badge-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-badge-name {
  font-size: 13px;
  font-weight: 500;
  color: #F8F0FC;
}

.user-badge-role {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #C77DFF;
  font-weight: 700;
}

.user-signout-btn {
  background: transparent;
  border: 1px solid #2E1A54;
  color: #9D8BB8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.user-signout-btn:hover {
  border-color: #7B2CBF;
  color: #C77DFF;
}

/* ── Module 2 — Dashboard welcome ──────────────────────────────────────────── */

.dash-welcome {
  padding: 32px 32px 20px;
  border-bottom: 1px solid #2E1A54;
  flex-shrink: 0;
}

.dash-welcome-title {
  font-size: 26px;
  font-weight: 500;
  color: #F8F0FC;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.dash-welcome-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-role-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: rgba(157,78,221,0.18);
  color: #C77DFF;
  border: 1px solid rgba(157,78,221,0.3);
  border-radius: 4px;
}

.user-clr-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(34,197,94,0.1);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 4px;
}

.user-tenant-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  color: #5A3B7A;
  border: 1px solid #2E1A54;
  border-radius: 4px;
}

/* ── Module 2 — Dashboard widgets grid ─────────────────────────────────────── */

.dash-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding: 24px 32px;
}

.dash-widget {
  background: #251447;
  border: 1px solid #2E1A54;
  border-radius: 8px;
  padding: 18px 20px;
}

.dash-widget-error {
  border-color: rgba(239,68,68,0.2);
}

.dash-widget-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #C77DFF;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-widget-empty {
  font-size: 13px;
  color: #5A3B7A;
  font-style: italic;
}

.dash-widget-link {
  font-size: 11px;
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}

.dash-widget-link:hover { text-decoration: underline; }

.dash-widget-stats {
  display: flex;
  gap: 24px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dash-stat-val {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.dash-stat-label {
  font-size: 11px;
  color: #5A3B7A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Module 2 — Alert rows inside widgets ───────────────────────────────────── */

.dash-alert-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-alert-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(46,26,84,0.5);
  font-size: 12px;
}

.dash-alert-row:last-child { border-bottom: none; }

.dash-alert-sev {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dash-alert-type {
  color: #9D8BB8;
  font-family: monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-alert-svc {
  font-size: 11px;
  color: #5A3B7A;
  white-space: nowrap;
}

/* ── Module 2 — Section separator ──────────────────────────────────────────── */

.dash-section-separator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px 8px;
  border-top: 1px solid #2E1A54;
  margin-top: 8px;
}

.dash-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #5A3B7A;
}

/* ── Module 3.1 — Modal ──────────────────────────────────────────────────────── */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.p0-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(10, 8, 15, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .12s ease;
}

.p0-modal-panel {
  background: #1A0E2E;
  border: 1px solid #3B1F5E;
  border-radius: 12px;
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.p0-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #2A1845;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.p0-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #F8F0FC;
  margin: 0;
}

.p0-modal-close {
  background: none;
  border: none;
  color: #9D8BB8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background .12s, color .12s;
}
.p0-modal-close:hover { color: #F8F0FC; background: #2A1845; }

.p0-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.p0-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #2A1845;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.p0-modal-btn {
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}

.p0-modal-cancel {
  background: transparent;
  border-color: #3B1F5E;
  color: #9D8BB8;
}
.p0-modal-cancel:hover { border-color: #9D8BB8; color: #F8F0FC; }

.p0-modal-confirm {
  background: #7B2CBF;
  color: #fff;
  border-color: #9D4EDD;
}
.p0-modal-confirm:hover { background: #9D4EDD; }
.p0-modal-confirm.danger { background: #7f1d1d; border-color: #ef4444; }
.p0-modal-confirm.danger:hover { background: #991b1b; }

.p0-modal-message {
  color: #C9B8E8;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ── Module 3.1 — Form fields inside modal ───────────────────────────────────── */

.p0-form-row { margin-bottom: 14px; }

.p0-form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #9D8BB8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.p0-form-input, .p0-form-select {
  width: 100%;
  padding: 8px 12px;
  background: #0A080F;
  border: 1px solid #3B1F5E;
  border-radius: 6px;
  color: #F8F0FC;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.p0-form-input:focus, .p0-form-select:focus { border-color: #9D4EDD; }
.p0-form-input::placeholder { color: #5A3B7A; }

.p0-form-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 6px;
  display: none;
}

/* ── Module 3.1 — Toast ──────────────────────────────────────────────────────── */

#p0-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.p0-toast-visible { opacity: 1 !important; transform: translateY(0) !important; }
.p0-toast-success { background: #14532d; color: #86efac; border: 1px solid #166534; }
.p0-toast-error   { background: #7f1d1d; color: #fca5a5; border: 1px solid #991b1b; }
.p0-toast-info    { background: #1e1b4b; color: #a5b4fc; border: 1px solid #312e81; }

/* ── Module 3.1 — Action buttons in drawer ───────────────────────────────────── */

.p0-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.p0-action-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(199,125,255,.3);
  transition: background .15s, border-color .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  color: #C77DFF;
}
.p0-action-btn:hover { background: rgba(199,125,255,.08); border-color: rgba(199,125,255,.55); }

.p0-action-default { background: #1e1b4b22; border-color: #312e81; color: #a5b4fc; }
.p0-action-default:hover { background: #312e81; }

.p0-action-ok     { background: #14532d22; border-color: #166534; color: #86efac; }
.p0-action-ok:hover { background: #14532d; }

.p0-action-warn   { background: #78350f22; border-color: #92400e; color: #fcd34d; }
.p0-action-warn:hover { background: #78350f; }

.p0-action-danger { background: #7f1d1d22; border-color: #991b1b; color: #fca5a5; }
.p0-action-danger:hover { background: #7f1d1d; }

/* ── Module 1.5d — Status filter chips (Dashboard) ──────────────────────────── */

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 32px 16px;
}

.chip {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  border-color: #C77DFF;
  color: #E0AAFF;
}

.chip.active {
  background: #7B2CBF;
  color: #fff;
  border-color: #9D4EDD;
}

.chip-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}

.chip:not(.active) .chip-count {
  background: rgba(157, 78, 221, 0.12);
  color: var(--text-muted);
}

/* ── AGT-1.4 — Dashboard ZTA 4-counter strip ─────────────────────────────────── */
.dash-zta-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0 28px;
}
.dash-zta-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  background: #251447;
  border: 1px solid #2E1A54;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dash-zta-counter:hover {
  background: #2E1A54;
  border-color: #4A2878;
}
.dash-zta-val {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.dash-zta-label {
  font-size: 11px;
  color: #9D8BB8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}
@media (max-width: 640px) {
  .dash-zta-counters { grid-template-columns: repeat(2, 1fr); }
}
