/* ==========================================================================
   NORVAILE CLIENT PORTAL STYLESHEET (FULL-WIDTH FLUID LAYOUT & HIGH CONTRAST)
   Cybersecurity & AI Client Environment
   ========================================================================== */

:root {
  /* Brand Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-rgb: 37, 99, 235;
  --primary-soft: rgba(37, 99, 235, 0.18);
  
  --cyan: #22d3ee;
  --cyan-rgb: 34, 211, 238;
  --cyan-soft: rgba(34, 211, 238, 0.16);
  
  --navy: #08101f;
  --navy-surface: #0f1d34;
  --navy-surface-light: #162644;
  --navy-border: rgba(255, 255, 255, 0.12);
  --navy-border-hover: rgba(34, 211, 238, 0.45);
  
  --on-navy: #ffffff;
  --on-navy-muted: #cbd5e1;
  --on-navy-dim: #94a3b8;
  
  /* Status Colors */
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.18);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.18);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.18);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.18);
  
  /* Body & Surface for Portal */
  --portal-bg: #070c18;
  --card-bg: #0d172a;
  --card-border: rgba(255, 255, 255, 0.10);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 20px rgba(34, 211, 238, 0.25);
  --shadow-glow-blue: 0 0 20px rgba(37, 99, 235, 0.35);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* Base resets & Contrast Enforcement */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.portal-body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--portal-bg) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: #ffffff !important;
  font-family: 'Sora', sans-serif;
}

p, span, div {
  color: inherit;
}

.text-muted,
.text-muted-nv {
  color: #94a3b8 !important;
}

.text-white {
  color: #ffffff !important;
}

.text-cyan {
  color: var(--cyan) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.font-display {
  font-family: 'Sora', sans-serif;
}

.font-mono {
  font-family: 'IBM Plex Mono', monospace;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* ==========================================================================
   FLUID FULL-WIDTH LAYOUT SHELL
   ========================================================================== */
.portal-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Main Content Full Width Stretcher */
.portal-main {
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100% - 270px);
  display: flex;
  flex-direction: column;
  background-color: var(--portal-bg) !important;
  min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.portal-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--navy);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: 72px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--navy-border);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff !important;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.18rem 0.5rem;
  background: rgba(34, 211, 238, 0.18);
  color: var(--cyan) !important;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 99px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b !important;
  padding: 1rem 0.85rem 0.4rem;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: #cbd5e1 !important;
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
  transition: all 0.18s ease;
}

.portal-nav-item i {
  width: 20px;
  font-size: 1rem;
  text-align: center;
  color: #94a3b8;
  transition: color 0.18s ease;
}

.portal-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff !important;
}

.portal-nav-item:hover i {
  color: var(--cyan);
}

.portal-nav-item.active {
  background: rgba(37, 99, 235, 0.22);
  color: #ffffff !important;
  border-left: 3px solid var(--cyan);
}

.portal-nav-item.active i {
  color: var(--cyan);
}

.nav-counter {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: var(--primary);
  color: #ffffff !important;
}

.nav-counter.pulse {
  background: var(--cyan);
  color: #08101f !important;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}

/* Sidebar Organization Card */
.sidebar-footer {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--navy-border);
  background: rgba(0, 0, 0, 0.25);
}

.org-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.org-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff !important;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.org-meta {
  flex: 1;
  min-width: 0;
}

.org-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-tier {
  font-size: 0.72rem;
  color: var(--cyan) !important;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.portal-topbar {
  width: 100%;
  height: 72px;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--navy-border);
  color: #fff !important;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.portal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8 !important;
}

.portal-breadcrumb a {
  color: #94a3b8 !important;
}
.portal-breadcrumb a:hover {
  color: var(--cyan) !important;
}
.portal-breadcrumb .active-crumb {
  color: #ffffff !important;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.security-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  color: var(--success) !important;
  font-weight: 600;
}

.security-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.topbar-action-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  color: #cbd5e1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.topbar-action-btn:hover {
  color: #ffffff !important;
  border-color: var(--cyan);
}

.action-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--cyan);
  border-radius: 50%;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  cursor: pointer;
}

.user-avatar-small {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Page Content Container */
.portal-content {
  width: 100%;
  padding: 2rem 2.5rem;
  flex: 1 1 auto;
}

/* Page Banner / Header */
.portal-page-header {
  width: 100%;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.92rem;
  color: #94a3b8 !important;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.nv-card {
  width: 100%;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  color: #ffffff !important;
}

.nv-card:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.nv-card.glow-hover:hover {
  border-color: rgba(34, 211, 238, 0.45) !important;
  box-shadow: 0 8px 30px -10px rgba(34, 211, 238, 0.2);
}

.card-header-nv {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title-nv {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title-nv i {
  color: var(--cyan) !important;
}

/* Stat Cards */
.stat-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff !important;
  line-height: 1.1;
  margin: 0.35rem 0;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8 !important;
}

.stat-sub {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-icon-blue {
  background: var(--primary-soft);
  color: #60a5fa !important;
  border: 1px solid rgba(37, 99, 235, 0.4);
}

.stat-icon-cyan {
  background: var(--cyan-soft);
  color: var(--cyan) !important;
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.stat-icon-green {
  background: var(--success-soft);
  color: var(--success) !important;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.stat-icon-warning {
  background: var(--warning-soft);
  color: var(--warning) !important;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   VISUAL TIMELINE & MILESTONES COMPONENT
   ========================================================================== */
.project-timeline-container {
  width: 100%;
  position: relative;
  padding: 1.5rem 0 0.5rem;
}

.milestones-track {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.milestones-track::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 1;
}

.milestones-track-progress {
  position: absolute;
  top: 20px;
  left: 30px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  z-index: 2;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  transition: width 0.5s ease;
}

.milestone-node {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  max-width: 180px;
}

.milestone-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

/* Completed Node */
.milestone-node.completed .milestone-circle {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: 3px solid #08101f;
  box-shadow: 0 0 0 2px var(--primary);
}

/* Active / Current Node */
.milestone-node.active .milestone-circle {
  background: var(--cyan) !important;
  color: #08101f !important;
  border: 3px solid #08101f;
  box-shadow: 0 0 0 3px var(--cyan), 0 0 20px var(--cyan);
  animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
  0% { box-shadow: 0 0 0 3px var(--cyan), 0 0 10px rgba(34, 211, 238, 0.5); }
  50% { box-shadow: 0 0 0 3px var(--cyan), 0 0 25px rgba(34, 211, 238, 0.9); }
  100% { box-shadow: 0 0 0 3px var(--cyan), 0 0 10px rgba(34, 211, 238, 0.5); }
}

/* Pending / Future Node */
.milestone-node.pending .milestone-circle {
  background: var(--navy-surface) !important;
  color: #94a3b8 !important;
  border: 3px solid #08101f;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.milestone-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: 0.25rem;
}

.milestone-node.pending .milestone-name {
  color: #94a3b8 !important;
}

.milestone-date {
  font-size: 0.75rem;
  color: #94a3b8 !important;
  font-family: 'IBM Plex Mono', monospace;
}

.milestone-node.active .milestone-date {
  color: var(--cyan) !important;
  font-weight: 700;
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge-nv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-nv-success {
  background: var(--success-soft) !important;
  color: var(--success) !important;
  border: 1px solid rgba(34, 197, 94, 0.4) !important;
}

.badge-nv-primary {
  background: var(--primary-soft) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(37, 99, 235, 0.4) !important;
}

.badge-nv-cyan {
  background: var(--cyan-soft) !important;
  color: var(--cyan) !important;
  border: 1px solid rgba(34, 211, 238, 0.4) !important;
}

.badge-nv-warning {
  background: var(--warning-soft) !important;
  color: var(--warning) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.badge-nv-danger {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.badge-nv-dark {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-nv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nv-primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-nv-primary:hover {
  background: var(--primary-hover) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-nv-cyan {
  background: var(--cyan) !important;
  color: #08101f !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.35);
}

.btn-nv-cyan:hover {
  background: #67e8f9 !important;
  color: #08101f !important;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.5);
}

.btn-nv-outline {
  background: transparent !important;
  border: 1px solid var(--navy-border) !important;
  color: #cbd5e1 !important;
}

.btn-nv-outline:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

.btn-nv-outline.active {
  background: rgba(37, 99, 235, 0.2) !important;
  border-color: var(--cyan) !important;
  color: #ffffff !important;
}

.btn-nv-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-nv:disabled,
.btn-nv[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ==========================================================================
   TABLES (OVERRIDING BOOTSTRAP DEFAULTS)
   ========================================================================== */
.nv-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.nv-table, .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  --bs-table-bg: transparent !important;
  --bs-table-color: #ffffff !important;
  color: #ffffff !important;
  margin-bottom: 0;
}

.nv-table th, .table th {
  background: rgba(255, 255, 255, 0.03) !important;
  color: #94a3b8 !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--navy-border) !important;
}

.nv-table td, .table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  font-size: 0.88rem;
  vertical-align: middle;
  background: transparent !important;
}

.nv-table tr:hover td, .table tr:hover td {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ==========================================================================
   FORM CONTROLS & SELECTS
   ========================================================================== */
.form-group-nv {
  margin-bottom: 1rem;
}

.form-label-nv {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1 !important;
  margin-bottom: 0.4rem;
}

.form-control-nv,
.form-control,
.form-select {
  width: 100%;
  background-color: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: #ffffff !important;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-control-nv::placeholder,
.form-control::placeholder {
  color: #64748b !important;
  opacity: 1;
}

.form-control-nv:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2) !important;
  background-color: var(--navy-surface) !important;
  color: #ffffff !important;
}

select.form-control-nv option,
select.form-select option {
  background-color: #0f1d34 !important;
  color: #ffffff !important;
  padding: 8px;
}

/* 2FA Code Input Boxes */
.tfa-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.8rem 0 1.5rem 0;
}

.tfa-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  background: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: var(--cyan) !important;
  border-radius: var(--radius-md);
  outline: none;
}

.tfa-box:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.4) !important;
}

/* ==========================================================================
   MODALS & ALERTS
   ========================================================================== */
.modal-content {
  background-color: #0d172a !important;
  border: 1px solid var(--navy-border) !important;
  border-radius: var(--radius-lg);
  color: #ffffff !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
  border-bottom: 1px solid var(--navy-border) !important;
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--navy-border) !important;
  padding: 1.25rem 1.5rem;
}

.alert-dark {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   MESSAGING & COMMUNICATION
   ========================================================================== */
.chat-shell {
  width: 100%;
  display: flex;
  height: 72vh;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-sidebar {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-search-header {
  padding: 1rem;
  border-bottom: 1px solid var(--navy-border);
  flex-shrink: 0;
}

.chat-conversations {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-thread-item {
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.chat-thread-item .user-avatar-small {
  flex-shrink: 0;
}

.chat-thread-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chat-thread-item .text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.chat-thread-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-thread-item.active {
  background: rgba(37, 99, 235, 0.16);
  border-left: 3px solid var(--cyan);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 64px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--navy-border);
  background: rgba(0, 0, 0, 0.2);
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  max-width: 75%;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: #ffffff !important;
  border-bottom-left-radius: 2px;
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: var(--primary) !important;
  color: #ffffff !important;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
}

.chat-input-field {
  flex: 1;
  background: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: #ffffff !important;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
}

.chat-input-field:focus {
  border-color: var(--cyan) !important;
}

/* ==========================================================================
   SYSTEM STATUS & MONITORS
   ========================================================================== */
.monitor-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.monitor-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #ffffff !important;
}

.monitor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.monitor-ping-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
}

.ping-bar {
  flex: 1;
  background: var(--success);
  border-radius: 2px;
  min-height: 8px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.ping-bar:hover {
  opacity: 1;
}

.ping-bar.degraded {
  background: var(--warning);
}

.ping-bar.down {
  background: var(--danger);
}

/* ==========================================================================
   PROGRESS BARS
   ========================================================================== */
.nv-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.nv-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan)) !important;
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ==========================================================================
   LOGIN & AUTH CARDS
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 50% 10%, rgba(37, 99, 235, 0.15) 0%, rgba(8, 16, 31, 0) 60%), #070c18;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: var(--navy) !important;
  border: 1px solid var(--navy-border) !important;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.7);
  position: relative;
  color: #ffffff !important;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
}

.auth-brand-logo {
  width: 52px;
  height: 52px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.25);
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 992px) {
  .portal-sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.6);
  }
  
  .portal-sidebar.open {
    transform: translateX(0);
  }
  
  .portal-main {
    width: 100% !important;
  }
  
  .mobile-toggle-btn {
    display: flex;
  }
  
  .portal-content {
    padding: 1.25rem;
  }
  
  .portal-topbar {
    padding: 0 1.25rem;
  }
  
  .milestones-track {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .milestones-track::before,
  .milestones-track-progress {
    display: none;
  }
  
  .milestone-node {
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    text-align: left;
    gap: 1rem;
  }
  
  .milestone-circle {
    margin-bottom: 0;
  }
  
  .chat-shell {
    flex-direction: column;
    height: auto;
  }
  
  .chat-sidebar {
    width: 100%;
    height: 250px;
  }
}

/* ==========================================================================
   PROJECT MANAGEMENT & DETAILS EXTENSIONS
   ========================================================================== */

/* 5-Step Lifecycle Tracker */
.lifecycle-stepper {
  width: 100%;
  position: relative;
  margin: 1.5rem 0;
}

.lifecycle-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
  position: relative;
}

@media (max-width: 1200px) {
  .lifecycle-track {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
  }
}

@media (max-width: 768px) {
  .lifecycle-track {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.lifecycle-step-card {
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  cursor: pointer;
}

.lifecycle-step-card:hover {
  transform: translateY(0);
  border-color: var(--cyan);
}

.lifecycle-step-card.completed {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, var(--navy-surface) 100%);
}

.lifecycle-step-card.completed:hover {
  border-color: #22c55e;
}

.lifecycle-step-card.active {
  border-color: var(--cyan);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.12) 0%, var(--navy-surface) 100%);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.lifecycle-step-card.active:hover {
  border-color: var(--cyan);
}

.lifecycle-step-card.pending {
  opacity: 0.65;
  border-style: dashed;
}

.lifecycle-step-card.pending:hover {
  border-color: #64748b;
  opacity: 1;
}

.lifecycle-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.step-num-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.lifecycle-step-card.completed .step-num-pill {
  background: var(--success);
  color: #08101f;
}

.lifecycle-step-card.active .step-num-pill {
  background: var(--cyan);
  color: #08101f;
  box-shadow: 0 0 12px var(--cyan);
}

.lifecycle-step-card.pending .step-num-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid var(--navy-border);
}

.step-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: 0.35rem;
}

.step-meta {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.4;
}

.step-date-tag {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.72rem;
  font-family: 'IBM Plex Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* File Upload & Dropzone */
.pm-dropzone {
  border: 2px dashed rgba(34, 211, 238, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(15, 29, 52, 0.4);
  padding: 2.6rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.pm-dropzone:hover,
.pm-dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.15);
}

.dropzone-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.file-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.file-type-tag {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid var(--navy-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-type-tag.active,
.file-type-tag:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: var(--cyan);
  color: #ffffff;
}

/* Asset / Document List Item */
.asset-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--navy-border);
  margin-bottom: 0.65rem;
  transition: all 0.2s ease;
}

.asset-item-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(34, 211, 238, 0.3);
}

.asset-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.asset-icon-image {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.asset-icon-doc {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.asset-icon-archive {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.asset-icon-code {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

/* Key-Value Details Grid */
.detail-grid-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(15, 29, 52, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--navy-border);
}

.detail-item-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.detail-item-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

/* Financial Stat Tile */
.financial-metric-card {
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.financial-metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.financial-metric-card.border-primary-accent::after {
  background: var(--primary);
}

.financial-metric-card.border-success-accent::after {
  background: var(--success);
}

.financial-metric-card.border-warning-accent::after {
  background: var(--warning);
}

.financial-metric-card.border-cyan-accent::after {
  background: var(--cyan);
}

/* ==========================================================================
   DATATABLES DARK THEME OVERRIDES
   ========================================================================== */
.dataTables_wrapper {
  color: var(--text-main);
  padding: 0.5rem 0;
  width: 100%;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right;
}

.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  color: #94a3b8;
}

.dataTables_wrapper .dataTables_length select {
  background-color: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: #ffffff !important;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.82rem;
  margin: 0 0.4rem;
}

.dataTables_wrapper .dataTables_filter input {
  background-color: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: #ffffff !important;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
  min-width: 200px;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2) !important;
}

.dataTables_wrapper .dataTables_info {
  color: #94a3b8 !important;
  font-size: 0.82rem;
  padding-top: 1rem;
  font-family: 'IBM Plex Mono', monospace;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .pagination {
  margin: 0;
  gap: 4px;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link {
  background-color: var(--navy-surface) !important;
  border: 1px solid var(--navy-border) !important;
  color: #cbd5e1 !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .page-item:hover .page-link {
  background-color: rgba(37, 99, 235, 0.2) !important;
  border-color: var(--cyan) !important;
  color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #64748b !important;
  cursor: not-allowed;
}

table.dataTable thead > tr > th.dt-orderable-asc,
table.dataTable thead > tr > th.dt-orderable-desc,
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc {
  cursor: pointer;
  position: relative;
}

table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::after {
  opacity: 0.5;
  color: var(--cyan);
}

/* ==========================================================================
   BOOTSTRAP TOOLTIPS MATCHING CARD BORDERS (100% SOLID)
   ========================================================================== */
.tooltip,
.tooltip.show {
  opacity: 1 !important;
}

.tooltip-inner {
  opacity: 1 !important;
  background-color: #0b1526 !important;
  color: #ffffff !important;
  border: 1px solid var(--cyan) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  padding: 0.65rem 0.95rem !important;
  border-radius: var(--radius-md) !important;
  max-width: 280px !important;
  line-height: 1.5 !important;
  text-align: center;
}

/* 1. Completed Steps (Green Border) */
.tooltip-completed .tooltip-inner {
  background-color: #0b1526 !important;
  border-color: #22c55e !important;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25) !important;
}
.tooltip-completed.bs-tooltip-top .tooltip-arrow::before,
.tooltip-completed.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
  border-top-color: #22c55e !important;
  opacity: 1 !important;
}
.tooltip-completed.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip-completed.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
  border-bottom-color: #22c55e !important;
  opacity: 1 !important;
}

/* 2. Active Step (Cyan Border) */
.tooltip-active .tooltip-inner {
  background-color: #0b1526 !important;
  border-color: #22d3ee !important;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25) !important;
}
.tooltip-active.bs-tooltip-top .tooltip-arrow::before,
.tooltip-active.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
  border-top-color: #22d3ee !important;
  opacity: 1 !important;
}
.tooltip-active.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip-active.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
  border-bottom-color: #22d3ee !important;
  opacity: 1 !important;
}

/* 3. Pending Steps (Slate / Gray Border) */
.tooltip-pending .tooltip-inner {
  background-color: #0b1526 !important;
  border-color: #64748b !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}
.tooltip-pending.bs-tooltip-top .tooltip-arrow::before,
.tooltip-pending.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
  border-top-color: #64748b !important;
  opacity: 1 !important;
}
.tooltip-pending.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip-pending.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
  border-bottom-color: #64748b !important;
  opacity: 1 !important;
}

/* =========================================================================
   USER PROFILE DROPDOWN MENU
   ========================================================================= */
.nv-dropdown-menu {
  background-color: #0c1527 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  border-radius: var(--radius-md, 10px) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
  min-width: 220px !important;
  padding: 0.5rem 0 !important;
  margin-top: 0.5rem !important;
}

.nv-dropdown-menu .dropdown-item {
  color: #cbd5e1 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  padding: 0.5rem 1rem !important;
  transition: all 0.2s ease !important;
}

.nv-dropdown-menu .dropdown-item:hover,
.nv-dropdown-menu .dropdown-item:focus {
  background-color: rgba(34, 211, 238, 0.1) !important;
  color: #ffffff !important;
}

.nv-dropdown-menu .dropdown-item.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}

.user-profile-menu.dropdown-toggle::after {
  display: none !important;
}

/* Password Toggle Eye Button */
.btn-toggle-password {
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s ease;
  z-index: 5;
  outline: none;
}

.btn-toggle-password:hover,
.btn-toggle-password:focus {
  color: var(--cyan) !important;
}




