/* ==============================================================================
   ARA DIGITAL NETWORK - SB ADMIN 2 CUSTOM ENHANCEMENTS
   Modern Dark Cyber Accents, Live Badges & Lightweight Terminal Styling
   ============================================================================== */

:root {
  --ara-primary: #0D5D9A;
  --ara-secondary: #00d2ff;
  --ara-dark: #0a1322;
  --ara-card-bg: #101c30;
  --ara-gold: #ffaa00;
  --ara-red: #ff3366;
  --ara-green: #00f076;
  --ara-purple: #9d4edd;
}

/* Custom Dark Theme Elements */
body.bg-theme-dark {
  background-color: #050b14;
  color: #e2e8f0;
}

.sidebar-dark.bg-gradient-primary {
  background-color: #08162b;
  background-image: linear-gradient(180deg, #091a33 10%, #050b14 100%);
  border-right: 1px solid rgba(0, 210, 255, 0.12);
}

.sidebar-brand-text {
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sidebar User Panel Styling */
.sidebar-user-panel {
  transition: all 0.2s ease-in-out;
}
.sidebar.toggled .sidebar-user-panel {
  padding: 8px 2px !important;
  margin: 6px 4px !important;
}
.sidebar.toggled .sidebar-user-panel #sidebarUserFullName,
.sidebar.toggled .sidebar-user-panel #sidebarUsernameTag,
.sidebar.toggled .sidebar-user-panel #sidebarUserRoleBadge {
  display: none !important;
}
.sidebar.toggled .sidebar-user-panel img {
  width: 32px !important;
  height: 32px !important;
}

/* Custom Live Status Pill in Topbar */
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 118, 0.1);
  border: 1px solid rgba(0, 240, 118, 0.35);
  color: var(--ara-green);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pulse-circle {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--ara-green);
  box-shadow: 0 0 10px var(--ara-green);
  animation: pulseLive 1.8s infinite ease-in-out;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* Role Badges */
.badge-role {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge-role-superadmin {
  background: rgba(255, 170, 0, 0.15);
  color: var(--ara-gold);
  border: 1px solid rgba(255, 170, 0, 0.4);
}
.badge-role-admin {
  background: rgba(0, 210, 255, 0.15);
  color: var(--ara-secondary);
  border: 1px solid rgba(0, 210, 255, 0.4);
}
.badge-role-operator {
  background: rgba(0, 240, 118, 0.15);
  color: var(--ara-green);
  border: 1px solid rgba(0, 240, 118, 0.4);
}

/* Enhanced Cards */
.card {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
  border-radius: 0.65rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22);
}

.border-left-primary { border-left: 0.25rem solid #0D5D9A !important; }
.border-left-success { border-left: 0.25rem solid #00f076 !important; }
.border-left-info    { border-left: 0.25rem solid #00d2ff !important; }
.border-left-warning { border-left: 0.25rem solid #ffaa00 !important; }
.border-left-danger  { border-left: 0.25rem solid #ff3366 !important; }

/* Status Badges */
.badge-status-pending   { background-color: #ffeeba; color: #856404; font-weight: 600; }
.badge-status-survey    { background-color: #b8daff; color: #004085; font-weight: 600; }
.badge-status-instalasi { background-color: #e2d9f3; color: #432874; font-weight: 600; }
.badge-status-aktif     { background-color: #c3e6cb; color: #155724; font-weight: 600; }
.badge-status-batal     { background-color: #f5c6cb; color: #721c24; font-weight: 600; }

/* Lightweight Live Terminal (Terminal Stream Style) */
.terminal-container {
  background: #02060d;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.terminal-topbar {
  background: #061122;
  padding: 10px 16px;
  border-bottom: 1px solid #1a2a40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.terminal-stream-window {
  height: 480px;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  background: #02060d;
  color: #f1f5f9;
}

.log-entry-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  transition: background 0.15s;
  word-break: break-all;
}
.log-entry-row:hover {
  background: rgba(0, 210, 255, 0.08);
}

.log-entry-time { color: #64748b; font-size: 11px; flex-shrink: 0; }
.log-entry-tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.log-entry-method { font-weight: 700; color: #94a3b8; flex-shrink: 0; }
.log-entry-status { font-weight: 700; flex-shrink: 0; }
.log-entry-latency { color: #64748b; font-size: 11px; flex-shrink: 0; }
.log-entry-ip { color: #7dd3fc; font-size: 11px; flex-shrink: 0; }
.log-entry-msg { color: #e2e8f0; flex-grow: 1; }

.tag-INFO { background: rgba(0, 102, 255, 0.2); color: #38bdf8; }
.tag-WARN { background: rgba(255, 170, 0, 0.2); color: #fbbf24; }
.tag-ERROR { background: rgba(255, 51, 102, 0.2); color: #f43f5e; }
.tag-SECURITY { background: rgba(255, 0, 85, 0.35); color: #ff0055; font-weight: bold; }
.tag-SYSTEM { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.status-ok { color: #00f076; }
.status-warn { color: #ffaa00; }
.status-err { color: #ff3366; }

/* Swagger Protected Frame */
.swagger-box-wrapper {
  width: 100%;
  height: 820px;
  border-radius: 8px;
  border: 1px solid #e3e6f0;
  overflow: hidden;
  background: #ffffff;
}

.swagger-iframe-content {
  width: 100%;
  height: 100%;
  border: none;
}

/* Cyber Threat Alert Siren */
.cyber-siren-alert {
  display: none;
  background: linear-gradient(90deg, rgba(255, 51, 102, 0.15), rgba(255, 51, 102, 0.05));
  border-left: 5px solid #ff3366;
  padding: 14px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  animation: sirenAlertShake 0.4s ease;
}
.cyber-siren-alert.show {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@keyframes sirenAlertShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Custom Scrollbar */
.terminal-stream-window::-webkit-scrollbar {
  width: 6px;
}
.terminal-stream-window::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.3);
  border-radius: 4px;
}
.terminal-stream-window::-webkit-scrollbar-thumb:hover {
  background: var(--ara-secondary);
}

/* Sidebar User Panel Hover & Click Effect */
.sidebar-user-panel {
  transition: all 0.25s ease;
  user-select: none;
}
.sidebar-user-panel:hover {
  background: rgba(0, 210, 255, 0.12) !important;
  border-color: rgba(0, 210, 255, 0.45) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ==============================================================================
   MULTI-LEVEL ACCORDION SIDEBAR (UP TO 4 LEVELS: KATEGORI -> MENU -> SUB -> SUB-SUB)
   ============================================================================== */
.collapse-item-nested {
  position: relative;
  margin-bottom: 2px;
}

.collapse-sub-trigger {
  font-weight: 700 !important;
  color: #4e73df !important;
  cursor: pointer;
  padding: 0.45rem 0.85rem !important;
  margin: 0 0.4rem !important;
  border-radius: 0.35rem;
  text-decoration: none !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.collapse-sub-trigger:hover {
  background-color: #eaecf4 !important;
  color: #224abe !important;
}

.collapse-sub-trigger .sub-chevron {
  transition: transform 0.2s ease;
  font-size: 0.65rem;
  color: #858796;
}

.collapse-sub-trigger[aria-expanded="true"] .sub-chevron {
  transform: rotate(90deg);
  color: #4e73df;
}

/* Level 4 Nested Container */
.collapse-level4 {
  background: #f8f9fc;
  border-left: 2px solid #4e73df;
  margin: 0.2rem 0.4rem 0.4rem 1.1rem;
  border-radius: 0.25rem;
  padding: 0.2rem 0;
}

/* Level 4 Sub-Sub Menu Item */
.collapse-subitem {
  font-size: 0.78rem !important;
  padding: 0.32rem 0.75rem !important;
  margin: 0.1rem 0.25rem !important;
  color: #5a5c69 !important;
  display: block;
  text-decoration: none !important;
  border-radius: 0.25rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.collapse-subitem:hover {
  background-color: #eaecf4 !important;
  color: #4e73df !important;
  font-weight: 700;
  padding-left: 0.95rem !important;
}

.collapse-subitem.active {
  color: #4e73df !important;
  font-weight: 700;
  background-color: #e3e6f0 !important;
}

/* Live Chart Containers */
.chart-area {
  position: relative;
  height: 320px;
  width: 100%;
}

.chart-pie {
  position: relative;
  height: 250px;
  width: 100%;
}

