/* Security page styles */

.sec-pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.sec-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sec-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  display: grid; place-items: center;
  margin-bottom: 6px;
}
.sec-pillar h3 { margin: 4px 0; }
.sec-pillar p { font-size: 14px; color: var(--text-muted); margin: 0 0 12px; line-height: 1.55; }
.sec-row {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 10px 0;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  align-items: baseline;
}
.sec-row > span:first-child { color: var(--text-muted); }
.sec-row code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  padding: 2px 8px;
  border-radius: 5px;
}
.sec-code {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  margin: 4px 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .sec-pillars { grid-template-columns: 1fr; }
}

/* Audit log */
.audit-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  overflow-x: auto;
}
.audit-header, .audit-row {
  display: grid;
  grid-template-columns: 110px 1fr 1.2fr 1.6fr 110px;
  gap: 16px;
  padding: 14px 24px;
  align-items: center;
  font-size: 13px;
}
.audit-header {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.audit-row { border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-row .mono { color: var(--text-soft); }
.audit-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audit-tag.read { background: var(--info-bg); color: var(--info); }
.audit-tag.edit { background: var(--warning-bg); color: var(--warning); }
.audit-tag.export { background: #FEE2E2; color: #B91C1C; }
.audit-tag.send, .audit-tag.sync { background: var(--teal-wash); color: var(--teal-deep); }
.audit-tag.login { background: var(--success-bg); color: var(--success); }

@media (max-width: 760px) {
  .audit-header, .audit-row { grid-template-columns: 1fr 1.5fr; }
  .audit-header > span:nth-child(n+3), .audit-row > span:nth-child(n+3) { display: none; }
}

/* Roles */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.role-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.role-card ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px;
}
.role-card li { display: flex; gap: 8px; align-items: baseline; }
.role-card li .ok { color: var(--teal); }
.role-card li .muted { color: var(--border-strong); }
.role-card--custom {
  background: linear-gradient(180deg, var(--teal-wash) 0%, #fff 100%);
  border-color: rgba(25,173,197,0.2);
}

@media (max-width: 1080px) {
  .roles-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 760px) {
  .roles-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .roles-grid { grid-template-columns: 1fr; }
}

/* =========================
   Network globe
   ========================= */
.globe-wrap {
  position: relative;
  margin: 32px auto 0;
  max-width: 1100px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(25,173,197,0.18), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(167,139,250,0.12), transparent 55%),
    #0A0F1A;
  border: 1px solid rgba(255,255,255,0.06);
}
#network-globe-canvas {
  width: 100%;
  min-height: 380px;
  display: block;
}
#network-globe-canvas canvas { display: block; }

.globe-legend {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(11, 19, 32, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  z-index: 2;
}
.globe-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.globe-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.globe-legend-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.globe-legend-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-family: var(--font-mono);
  line-height: 1.2;
  margin-top: 2px;
}

.globe-hint {
  position: absolute;
  bottom: 14px;
  right: 16px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  z-index: 2;
}

@media (max-width: 640px) {
  .globe-legend { top: 10px; left: 10px; padding: 8px 10px; }
  .globe-legend-name { font-size: 11.5px; }
  .globe-legend-sub { font-size: 10px; }
}

/* Backup-mesh additions for globe legend */
.globe-dot--sm {
  width: 7px !important;
  height: 7px !important;
  box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.18) !important;
}
.globe-legend-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 2px;
}
.globe-legend-line {
  align-items: center;
  gap: 10px;
}
.globe-line-sample {
  display: inline-block;
  width: 28px;
  height: 2px;
  background-image: linear-gradient(90deg, #F472B6 50%, transparent 50%);
  background-size: 6px 2px;
  background-repeat: repeat-x;
  border-radius: 1px;
  animation: globe-line-pulse 1.2s linear infinite;
  flex-shrink: 0;
}
@keyframes globe-line-pulse {
  0%   { background-position: 0 0;   opacity: 0.5; }
  50%  {                              opacity: 1;   }
  100% { background-position: 12px 0; opacity: 0.5; }
}
