/* ════════════════════════════════════════════════════════════
   AUTHENTICATED CENTRAL ANALYTICS HUB STYLES
   Modern Top Horizontal Navigation & Enterprise UI Architecture
   ════════════════════════════════════════════════════════════ */

#auth-portal-container {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* FROZEN / STICKY HEADER BAR (TWO-TIER HEADER WITH COMPACT MENU BELOW TOP SECTION) */
/* FROZEN / STICKY HEADER BAR (TWO-TIER HEADER: DARK TOP SECTION & LIGHT BLUE MENU BAR) */
.hub-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 10000 !important;
  background: linear-gradient(135deg, #0B1727 0%, #0F2744 50%, #111C38 100%) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25) !important;
  padding: 0 !important;
  box-shadow: 0 4px 20px rgba(11, 23, 39, 0.4) !important;
  transition: var(--transition);
}

.header-container,
.header-top-row {
  max-width: 100% !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
}

/* MODERN LIGHT BLUE MENU BAR SECTION BELOW TOP SECTION WITH LIGHT OUTLINE */
.header-nav-row {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 50%, #F1F5F9 100%) !important;
  border-top: 1px solid #BFDBFE !important;
  border-bottom: 1px solid #BFDBFE !important;
  padding: 3px 8px !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08) !important;
}

.header-nav-row .nav-item {
  color: #0F172A !important;
  font-weight: 700 !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
  background: #FFFFFF !important;
  border: 1px solid #BFDBFE !important;
  transition: all 0.2s ease !important;
  font-size: 11.5px !important;
  cursor: pointer !important;
  box-shadow: var(--shadow-sm) !important;
}

.header-nav-row .nav-item:hover {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

.header-nav-row .nav-item.active {
  background: linear-gradient(135deg, #2563EB, #1D4ED8) !important;
  color: #FFFFFF !important;
  border-color: #1D4ED8 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .header-nav-row {
  background: rgba(255, 255, 255, 0.015);
}

.header-nav-row .top-nav-bar {
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #FFF;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 9.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-search {
  flex: 1;
  max-width: 360px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 5.5px 70px 5.5px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2.5px var(--primary-light);
}

.search-shortcut {
  position: absolute;
  right: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 1px 5px;
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* NOTIFICATIONS DROPDOWN POPOVER */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-rose);
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.notif-menu-popover {
  display: none;
  position: absolute;
  right: 0;
  top: 42px;
  width: 290px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.notif-menu-popover.active {
  display: block;
  animation: fadeInDown 0.2s ease;
}

.notif-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.badge-sm {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.notif-list {
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.notif-icon {
  font-size: 16px;
}

.notif-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.notif-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

.btn-logout-icon:hover {
  background: linear-gradient(135deg, #E11D48 0%, #BE123C 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.5) !important;
  transform: scale(1.08) !important;
}

/* ════════════════════════════════════════════════════════════
   TOP HORIZONTAL NAVIGATION BAR (.top-nav-bar)
   ════════════════════════════════════════════════════════════ */
.top-nav-bar {
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.top-nav-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.app-sidebar {
  display: flex;
  align-items: center;
  width: 100%;
}

.horizontal-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 1px 0;
}

/* TOP NAV SUBMENU / DROPDOWN MEGA-MENUS */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--border-glow);
}

.nav-item.active {
  background: var(--primary);
  color: #FFFFFF !important;
  border: 1px solid var(--primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  font-weight: 800;
}

.nav-item .icon {
  font-size: 15px;
}

.nav-arrow {
  font-size: 9px;
  opacity: 0.7;
  margin-left: 4px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.nav-dropdown-wrapper {
  position: relative;
  overflow: visible !important;
}

.nav-arrow {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

.nav-dropdown-wrapper:hover .nav-arrow,
.nav-dropdown-wrapper.open .nav-arrow {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--primary, #3B82F6);
}

.top-nav-bar,
.sidebar-group,
.horizontal-nav-group,
.header-nav-row {
  overflow: visible !important;
}

.nav-dropdown-wrapper .nav-submenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 230px;
  background: var(--bg-card, #FFFFFF);
  border: 1.5px solid var(--border-glow, #BFDBFE);
  border-radius: 12px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 6px 16px -2px rgba(15, 23, 42, 0.08);
  padding: 6px;
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Invisible bridge so hover state never breaks between button & menu */
.nav-dropdown-wrapper .nav-submenu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
}

.nav-dropdown-wrapper:hover .nav-submenu,
.nav-dropdown-wrapper.open .nav-submenu,
.nav-submenu.open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.subnav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-main, #0F172A);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.subnav-item:hover {
  color: #2563EB;
  background: rgba(37, 99, 235, 0.08);
  transform: translateX(4px);
}

.subnav-item:active {
  transform: translateX(2px) scale(0.98);
}

.subnav-item.active {
  color: #2563EB;
  font-weight: 800;
  background: rgba(37, 99, 235, 0.12);
  border-left: 3px solid #2563EB;
}

/* MAIN BODY & COMPACT LAYOUT WRAPPER */
.hub-main {
  flex: 1;
  padding-top: 84px !important;
  max-width: 100%;
  margin: 0;
  height: calc(100vh - 84px);
  overflow-y: auto;
  box-sizing: border-box;
}

.portal-layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.portal-content-body {
  flex: 1;
  padding: 12px 20px;
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* BREADCRUMB NAVIGATION BAR */
.breadcrumb-nav-bar {
  display: none !important;
}

.bc-item {
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.bc-item:hover {
  color: var(--primary);
}

.bc-sep {
  color: var(--text-dim);
  font-size: 11px;
}

.bc-active {
  color: var(--primary);
  font-weight: 700;
}

/* QUICK ACTIONS & ANNOUNCEMENTS STRIP */
.quick-actions-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.quick-actions-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-actions-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
}

.quick-action-btn {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quick-action-btn:hover {
  background: var(--primary-light);
  border-color: var(--border-glow);
  color: var(--primary);
  transform: translateY(-1px);
}

.announcements-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}

.badge-live {
  background: var(--accent-emerald);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.ticker-text {
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* METRICS & HIGHLIGHTS BANNER (COMPACT 6-KPI ROW) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: #38BDF8;
  box-shadow: 0 8px 20px -4px rgba(56, 189, 248, 0.22);
}

.metric-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.m-icon-1 { background: linear-gradient(135deg, #6366F1, #4F46E5); color: #FFFFFF; }
.m-icon-2 { background: linear-gradient(135deg, #10B981, #059669); color: #FFFFFF; }
.m-icon-3 { background: linear-gradient(135deg, #F59E0B, #D97706); color: #FFFFFF; }
.m-icon-4 { background: linear-gradient(135deg, #F43F5E, #E11D48); color: #FFFFFF; }

.metric-info .val {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.metric-info .lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
}

/* FROZEN CATEGORY FILTER PILLS BAR */
.cat-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.cat-pill {
  padding: 6px 15px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.cat-pill:hover {
  border-color: #2563EB;
  color: #2563EB;
  transform: translateY(-1px);
}

.cat-pill.active {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  border-color: #1D4ED8;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* DASHBOARD CARDS GRID & LIST TABLE */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* DRAG & DROP SORTABLE PLACEHOLDER */
.report-card-placeholder {
  border: 2px dashed #2563EB;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  min-height: 110px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: grab;
  min-height: 115px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.report-card:active {
  cursor: grabbing;
}

.report-card:hover {
  transform: translateY(-3px);
  border-color: #38BDF8;
  box-shadow: 0 10px 24px -4px rgba(56, 189, 248, 0.22);
}

.card-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.18));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.card-badge {
  padding: 2.5px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border-color);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

/* LIST VIEW TABLE */
.reports-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.reports-list-table th {
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}

.list-row {
  background: var(--bg-card);
  transition: var(--transition);
}

.list-row td {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.list-row td:first-child {
  border-left: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.list-row td:last-child {
  border-right: 1px solid var(--border-color);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.list-row:hover {
  transform: translateX(4px);
}

/* ════════════════════════════════════════════════════════════
   MODAL DIALOG BACKDROP & POPUP OVERLAYS
   ════════════════════════════════════════════════════════════ */
.modal-backdrop,
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(11, 15, 25, 0.8) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active,
.modal-backdrop.open,
.modal-overlay.active,
.modal-overlay.open {
  display: flex !important;
  opacity: 1 !important;
}

.modal-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 24px !important;
  width: 460px !important;
  max-width: 90vw !important;
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.18), 0 10px 15px -5px rgba(15, 23, 42, 0.08) !important;
  color: #0F172A !important;
}

.modal-card h1, .modal-card h2, .modal-card h3, .modal-card h4, .modal-card label {
  color: #0F172A !important;
}

.modal-card .form-control,
.modal-card input,
.modal-card select,
.modal-card textarea {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

.modal-card .form-control:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
  background: #FFFFFF !important;
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.modal-card .btn-secondary {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}

.modal-card .btn-secondary:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

@media (max-width: 1200px) { .metrics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px) { .metrics-grid { grid-template-columns: repeat(2, 1fr); } }
