/* ====================================================================
   RUIJIE CLOUD OTA HUB - ENTERPRISE SIDEBAR CONSOLE THEME
   Dual Theme Specification: Cyber-NOC Dark & Enterprise Cloud Light
   ==================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --sidebar-width: 270px;
  --header-height: 56px;
  --statusbar-height: 30px;
  --transition-speed: 0.2s;

  /* Ruijie Accents */
  --ruijie-blue: #0284c7;
  --ruijie-blue-bright: #0066ff;
  --ruijie-blue-glow: rgba(0, 102, 255, 0.35);
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.35);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.35);
  --rose: #ef4444;
  --rose-glow: rgba(239, 68, 68, 0.35);
}

/* --------------------------------------------------------------------
   DARK THEME (Default Ruijie Cyber-NOC)
   -------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-base: #060a14;
  --bg-surface: #0b1222;
  --bg-sidebar: #090f1d;
  --bg-card: rgba(13, 20, 36, 0.88);
  --bg-card-hover: rgba(20, 32, 58, 0.98);
  --bg-item-active: rgba(2, 132, 199, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.25);
  --border-ruijie: rgba(2, 132, 199, 0.4);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --input-bg: #070c18;
  --table-stripe: rgba(255, 255, 255, 0.02);
  --table-hover: rgba(0, 240, 255, 0.06);

  --bg-radial: radial-gradient(circle at 10% 10%, rgba(2, 132, 199, 0.12) 0%, transparent 45%),
               radial-gradient(circle at 90% 90%, rgba(0, 240, 255, 0.08) 0%, transparent 45%);
}

/* --------------------------------------------------------------------
   LIGHT THEME (Ruijie Reyee Cloud Crisp Enterprise)
   -------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-base: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-item-active: rgba(2, 132, 199, 0.1);
  --border-subtle: #e2e8f0;
  --border-glow: rgba(2, 132, 199, 0.4);
  --border-ruijie: rgba(2, 132, 199, 0.4);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.03);
  --input-bg: #f8fafc;
  --table-stripe: rgba(0, 0, 0, 0.015);
  --table-hover: rgba(2, 132, 199, 0.05);

  --bg-radial: radial-gradient(circle at 10% 10%, rgba(2, 132, 199, 0.04) 0%, transparent 45%),
               radial-gradient(circle at 90% 90%, rgba(0, 240, 255, 0.03) 0%, transparent 45%);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Custom Sleek Scrollbar - flush against the right edge */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 199, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 132, 199, 0.5);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.45);
}

body.noc-body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: var(--bg-radial);
  background-attachment: fixed;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ====================================================================
   TOP NAVBAR / HEADER
   ==================================================================== */
.noc-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

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

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  width: 30px;
  height: 30px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}
[data-theme="light"] .brand-logo-icon {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: var(--ruijie-blue);
}
.brand-logo-icon svg { width: 17px; height: 17px; }

.brand-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.brand-highlight { color: var(--ruijie-blue-bright); }
[data-theme="dark"] .brand-highlight { color: var(--cyan); }

.brand-subtitle {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 400;
}

.live-pill {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: live-pulse 1.8s infinite;
}

@keyframes live-pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.cloud-status-badge {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid var(--border-ruijie);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ruijie-blue);
}
[data-theme="dark"] .cloud-status-badge {
  color: var(--cyan);
}

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

.clock-widget { text-align: right; }
.clock-time {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1;
}
.clock-date {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.theme-toggle-btn:hover {
  border-color: var(--ruijie-blue);
  color: var(--ruijie-blue);
}

/* User Auth & Logout Widget */
.user-auth-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--rose);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-speed);
}
.btn-logout:hover {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
  transform: translateY(-1px);
}

.action-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.action-btn:hover {
  background: var(--input-bg);
  color: var(--text-main);
  border-color: var(--ruijie-blue);
}

/* ====================================================================
   NOC LAYOUT: LEFT SIDEBAR + MAIN CONTENT
   ==================================================================== */
.noc-layout-wrapper {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height) - var(--statusbar-height));
  min-height: calc(100vh - var(--header-height) - var(--statusbar-height));
  position: relative;
  overflow: hidden;
}

/* Left Sidebar */
.noc-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: calc(100vh - var(--header-height) - var(--statusbar-height));
  position: sticky;
  top: var(--header-height);
  transition: width var(--transition-speed), transform var(--transition-speed);
}

.noc-sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sidebar-add {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  color: var(--ruijie-blue);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-speed);
}
.btn-sidebar-add:hover {
  background: var(--ruijie-blue);
  color: #fff;
  border-color: var(--ruijie-blue);
}
[data-theme="dark"] .btn-sidebar-add {
  color: var(--cyan);
}
[data-theme="dark"] .btn-sidebar-add:hover {
  background: var(--cyan);
  color: #060a14;
}

.btn-ruijie-outline {
  background: transparent;
  border: 1px dashed var(--border-ruijie);
  color: var(--ruijie-blue);
  font-weight: 700;
  padding: 9px 12px;
}
.btn-ruijie-outline:hover {
  background: rgba(2, 132, 199, 0.1);
  border-style: solid;
  border-color: var(--ruijie-blue);
}
[data-theme="dark"] .btn-ruijie-outline {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.4);
}
[data-theme="dark"] .btn-ruijie-outline:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--cyan);
}

.info-banner {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid var(--border-ruijie);
  color: var(--ruijie-blue);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  margin-bottom: 12px;
}
[data-theme="dark"] .info-banner {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.3);
}


.sidebar-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.6px;
}

.sidebar-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(2, 132, 199, 0.15);
  color: var(--ruijie-blue);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-ruijie);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

/* Sidebar Nav Items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  text-decoration: none;
  color: var(--text-main);
}

.sidebar-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.sidebar-item.active {
  background: var(--bg-item-active);
  border-color: var(--border-ruijie);
  color: var(--text-main);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--ruijie-blue-bright);
  border-radius: 2px;
}
[data-theme="dark"] .sidebar-item.active::before {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.sidebar-item-icon {
  width: 30px;
  height: 30px;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.sidebar-item-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.sidebar-item.active .sidebar-item-icon {
  color: var(--ruijie-blue);
  border-color: var(--border-ruijie);
  background: rgba(2, 132, 199, 0.1);
}
[data-theme="dark"] .sidebar-item.active .sidebar-item-icon {
  color: var(--cyan);
  border-color: var(--border-glow);
  background: rgba(0, 240, 255, 0.1);
}

.sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.sidebar-item-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  margin-top: 2px;
  color: var(--text-dim);
}

.sidebar-pill {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  padding: 0 4px;
  border-radius: 2px;
  font-weight: 600;
}
.sidebar-pill.prod {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
}
.sidebar-pill.uat {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
}

/* ====================================================================
   MAIN CONTENT AREA
   ==================================================================== */
.noc-main-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 22px 28px 48px;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - var(--header-height) - var(--statusbar-height));
  box-sizing: border-box;
}

.noc-content-container {
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* Project Header Bar */
.project-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.project-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-avatar {
  width: 42px;
  height: 42px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid var(--border-ruijie);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ruijie-blue);
}
[data-theme="dark"] .platform-avatar {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--border-glow);
  color: var(--cyan);
}
.platform-avatar svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.project-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-name-row h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.project-slug-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--ruijie-blue);
}
[data-theme="dark"] .project-slug-badge { color: var(--cyan); }

.project-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Ruijie Segmented Tabs */
.segmented-channel-tabs {
  display: flex;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 3px;
}

.seg-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-speed);
}
.seg-tab:hover { color: var(--text-main); }
.seg-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.prod-dot { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.uat-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

/* Promote Alert */
.promote-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  gap: 16px;
  box-shadow: var(--card-shadow);
}

.promote-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.promote-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
}
.promote-left h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 2px;
}
.promote-left p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.btn-promote {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #070c18;
  font-weight: 700;
  border: none;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}
.btn-promote:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ====================================================================
   NOC 2-COLUMN SPLIT GRID
   ==================================================================== */
.noc-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 980px) {
  .noc-grid-split {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ruijie-blue);
}
[data-theme="dark"] .panel-icon {
  color: var(--cyan);
}
.panel-title h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.channel-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.4px;
}
.prod-pill {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid var(--emerald);
}
.uat-pill {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  border: 1px solid var(--amber);
}

/* Telemetry Tiles */
.metric-tiles-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.metric-tile {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.metric-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--ruijie-blue-bright);
}
[data-theme="dark"] .metric-value {
  color: var(--cyan);
}
.cyan-glow {
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.metric-value-sub {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Meta Table */
.meta-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.78rem;
  margin-bottom: 18px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 6px;
}

.meta-label { color: var(--text-dim); }
.meta-val {
  color: var(--text-main);
  font-weight: 500;
  text-align: right;
  max-width: 65%;
  word-break: break-all;
}

.mono { font-family: var(--font-mono); font-size: 0.72rem; }
.copyable { cursor: pointer; transition: color 0.15s; }
.copyable:hover { color: var(--ruijie-blue); }
[data-theme="dark"] .copyable:hover { color: var(--cyan); }

.badge-mandatory {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-optional {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Changelog */
.changelog-container { margin-bottom: 18px; }
.sub-header-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.changelog-container pre {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

.action-row { margin-bottom: 18px; }

/* Endpoints Panel */
.endpoints-panel {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.endpoint-group { margin-bottom: 10px; }
.endpoint-group label {
  display: block;
  font-size: 0.66rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}

.input-with-copy { display: flex; gap: 6px; }
.input-with-copy input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--ruijie-blue-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 10px;
}
[data-theme="dark"] .input-with-copy input { color: var(--cyan); }

.btn-copy {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy:hover {
  background: var(--ruijie-blue);
  color: #fff;
  border-color: var(--ruijie-blue);
}

/* ====================================================================
   FORM STYLING
   ==================================================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field { margin-bottom: 12px; }
.form-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}
.req { color: var(--rose); }

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  transition: all var(--transition-speed);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ruijie-blue);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

select { cursor: pointer; }
.field-hint { font-size: 0.65rem; color: var(--text-dim); margin-top: 3px; display: block; }

/* Ruijie Dropzone */
.ruijie-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.ruijie-dropzone:hover, .ruijie-dropzone.dragover {
  border-color: var(--ruijie-blue);
  background: rgba(2, 132, 199, 0.04);
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ruijie-blue);
  margin-bottom: 6px;
}
[data-theme="dark"] .drop-icon {
  color: var(--cyan);
}
.drop-text { font-size: 0.76rem; font-weight: 600; color: var(--text-main); }
.drop-hint { font-size: 0.66rem; color: var(--text-dim); margin-top: 2px; }

.checkbox-field { margin-bottom: 14px; }
.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Upload Progress */
.progress-box { margin-bottom: 12px; }
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ruijie-blue);
  margin-bottom: 4px;
}
[data-theme="dark"] .progress-header { color: var(--cyan); }

.progress-track {
  height: 6px;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #0066ff 100%);
  transition: width 0.15s ease;
}
[data-theme="dark"] .progress-bar-fill {
  background: linear-gradient(90deg, #0284c7 0%, #00f0ff 100%);
}

/* ====================================================================
   BUTTONS
   ==================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.btn-ruijie {
  background: linear-gradient(135deg, #0284c7 0%, #0066ff 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
}
.btn-ruijie:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0052cc 100%);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--ruijie-blue);
  color: var(--ruijie-blue);
}

.btn-block { width: 100%; }
.btn-sm {
  padding: 4px 10px;
  font-size: 0.68rem;
}

.channel-pill.prod-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.channel-pill.uat-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.auth-gate-box {
  background: var(--input-bg);
  border: 1px dashed var(--border-ruijie);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
}
.gate-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  margin-bottom: 8px;
}
.auth-gate-box h5 { font-size: 0.85rem; color: var(--ruijie-blue); margin-bottom: 4px; }
[data-theme="dark"] .auth-gate-box h5 { color: var(--cyan); }
.auth-gate-box p { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 12px; }

.placeholder-box {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-dim);
}
.placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.icon-2d {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  flex-shrink: 0;
}
.placeholder-box p { font-size: 0.78rem; color: var(--text-muted); }
.placeholder-box small { font-size: 0.68rem; }

/* ====================================================================
   TABLES
   ==================================================================== */
.history-panel { margin-top: 20px; }
.table-responsive { overflow-x: auto; }

.noc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.noc-table th {
  text-align: left;
  padding: 9px 12px;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.noc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.noc-table tr:hover td {
  background: var(--table-hover);
}

/* ====================================================================
   MODALS & TOAST
   ==================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop.active { display: flex; }

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-ruijie);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: popIn 0.18s ease;
}

@keyframes popIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-title h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

.error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--rose);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  margin-top: 10px;
}

.ruijie-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--ruijie-blue);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.2s ease;
  z-index: 2000;
  pointer-events: none;
}
[data-theme="dark"] .ruijie-toast {
  border-color: var(--cyan);
}
.ruijie-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .noc-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: var(--statusbar-height);
    left: 0;
    z-index: 90;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    height: calc(100vh - var(--header-height) - var(--statusbar-height));
  }
  .noc-sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .noc-main-content {
    padding: 16px 16px 32px;
  }
}

/* ====================================================================
   FIXED BOTTOM STATUS BAR
   ==================================================================== */
.noc-status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--statusbar-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.68rem;
  color: var(--text-dim);
  z-index: 100;
  user-select: none;
  backdrop-filter: blur(10px);
}
[data-theme="dark"] .noc-status-bar {
  background: rgba(9, 15, 29, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .noc-status-bar {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(2, 132, 199, 0.15);
}

.status-bar-left,
.status-bar-center,
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-bar-brand {
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="dark"] .status-bar-brand {
  color: #94a3b8;
}
[data-theme="light"] .status-bar-brand {
  color: #334155;
}

.status-indicator-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  display: inline-block;
  animation: pulseLive 2s infinite;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-divider {
  color: var(--border-subtle);
  opacity: 0.7;
}

@media (max-width: 900px) {
  .status-bar-center {
    display: none;
  }
}

/* ====================================================================
   DOWNLOAD TELEMETRY & IP AUDIT LOG MODAL
   ==================================================================== */
.dl-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 768px) {
  .dl-metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dl-metric-card {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.dl-metric-card .label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.dl-metric-card .val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--ruijie-blue-bright);
}
[data-theme="dark"] .dl-metric-card .val {
  color: var(--cyan);
}

.dl-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.dl-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dl-search-input {
  width: 240px !important;
  padding: 6px 10px !important;
  font-size: 0.72rem !important;
}

.dl-pill-btn {
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.dl-pill-btn:hover {
  color: var(--text-main);
  border-color: var(--border-ruijie);
}
.dl-pill-btn.active {
  background: var(--ruijie-blue);
  color: #fff;
  border-color: var(--ruijie-blue);
}
[data-theme="dark"] .dl-pill-btn.active {
  background: var(--cyan);
  color: #060a14;
  border-color: var(--cyan);
}

.ip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ruijie-blue-bright);
}
[data-theme="dark"] .ip-chip {
  background: rgba(0, 240, 255, 0.08);
  color: var(--cyan);
}
.btn-mini-copy {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 10px;
  padding: 0 2px;
}
.btn-mini-copy:hover {
  color: var(--text-main);
}

