@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   THRUSTON CORE DESIGN SYSTEM • BRAND COLOR #800dff
   ========================================================================== */

:root {
  /* Brand Colors */
  --brand-primary: #800dff;
  --brand-primary-rgb: 128, 13, 255;
  --brand-light: #9d3aff;
  --brand-glow: rgba(128, 13, 255, 0.25);
  --brand-subtle: rgba(128, 13, 255, 0.08);
  --brand-border: rgba(128, 13, 255, 0.25);

  /* Neutrals & Dark Surfaces */
  --bg-main: #0c0d12;
  --bg-sidebar: #0f1118;
  --bg-header: rgba(15, 17, 24, 0.85);
  --bg-card: #131520;
  --bg-card-hover: #171a27;
  --bg-subtle: rgba(255, 255, 255, 0.03);

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: var(--brand-primary);

  /* Status Colors */
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.1);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.1);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.1);

  /* Typography */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-brand: #c084fc;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Dimensions */
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* Minimal Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   LAYOUT: SIDEBAR & MAIN CONTAINER
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-smooth);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--brand-light);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.65rem 0.65rem 0.25rem 0.65rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: #ffffff;
}

.nav-link.active {
  background: var(--brand-subtle);
  color: var(--brand-light);
  font-weight: 600;
  border-left: 2px solid var(--brand-primary);
}

.nav-link.active .nav-icon {
  color: var(--brand-light);
}

.nav-icon {
  width: 18px;
  font-size: 1rem;
  display: inline-flex;
  justify-content: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-quick-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-success);
}

.status-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Main Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.mobile-toggle {
  display: none;
  font-size: 1.1rem;
  color: var(--text-secondary);
  padding: 0.35rem;
}

.header-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb-active {
  color: #ffffff;
  font-weight: 600;
}

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

.telemetry-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.btn-logout {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.2rem;
  transition: color var(--transition-fast);
}

.btn-logout:hover {
  color: var(--status-danger);
}

/* Page Content Container */
.page-content {
  padding: 1.75rem;
  flex: 1;
}

/* ==========================================================================
   MINIMAL COMPONENTS: HERO, STATS, PANELS, TABLES
   ========================================================================== */

/* Clean Hero Banner */
.hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-title span {
  color: var(--brand-light);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.hero-metrics {
  display: flex;
  gap: 1.5rem;
}

.hero-metric-item {
  text-align: right;
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ffffff;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.stat-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-light);
  font-size: 0.95rem;
}

.stat-icon-purple {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: var(--brand-light);
}

.stat-icon-green {
  background: var(--status-success-bg);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--status-success);
}

.stat-icon-amber {
  background: var(--status-warning-bg);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--status-warning);
}

.stat-icon-rose {
  background: var(--status-danger-bg);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--status-danger);
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.stat-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Minimal Panels */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-bottom: 1.5rem;
}

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

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title i {
  color: var(--brand-light);
}

/* Card & Server Card Components */
.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all var(--transition-fast);
}

.server-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.server-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.server-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.server-node {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Grids */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.online {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.status-badge.offline {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

/* Minimal Progress Track */
.metric-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.metric-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.metric-meta span:first-child {
  color: var(--text-secondary);
}

.metric-meta span:last-child {
  font-family: var(--font-mono);
  font-weight: 500;
  color: #ffffff;
}

.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  transition: width 0.4s ease;
}

.progress-fill.purple {
  background: var(--brand-light);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.cyber-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cyber-table th {
  padding: 0.75rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.cyber-table td {
  padding: 0.85rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.cyber-table tr:hover td {
  background: var(--bg-subtle);
  color: #ffffff;
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--brand-light);
  border: 1px solid var(--border-color);
}

/* Buttons & Inputs */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: #ffffff;
  font-weight: 500;
  font-size: 0.82rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.input-cyber {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-cyber:focus {
  border-color: var(--brand-primary);
}

/* Toast System */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9999;
}

.cyber-toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  min-width: 260px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cyber-toast.success {
  border-left: 3px solid var(--status-success);
}
.cyber-toast.error {
  border-left: 3px solid var(--status-danger);
}
.cyber-toast.info {
  border-left: 3px solid var(--brand-primary);
}

/* Modal */
.cyber-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cyber-modal.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.2s ease;
  overflow: hidden;
}

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

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM & MOBILE OFF-CANVAS
   ========================================================================== */

/* Dark Backdrop Overlay for Mobile Sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 95;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open {
  overflow: hidden;
}

/* Mobile Sidebar Close Button */
.sidebar-close-btn {
  display: none;
  margin-left: auto;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
}

/* Polished Mobile Burger Toggle */
.mobile-toggle {
  display: none;
  font-size: 1.15rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brand-border);
}

/* Responsive Footer */
.dashboard-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card);
  margin-top: auto;
}

.dashboard-footer-links {
  display: flex;
  gap: 1.25rem;
}

.dashboard-footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.dashboard-footer-links a:hover {
  color: var(--brand-light);
}

/* Responsive Page Header Row */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-row h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header-row p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

/* Responsive Reviews Score Container */
.reviews-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.reviews-score-block {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.reviews-score-num {
  text-align: center;
  padding-right: 2rem;
  border-right: 1px solid var(--border-color);
}

.reviews-score-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 250px;
  flex: 1;
}

/* Responsive Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.table-responsive::-webkit-scrollbar {
  height: 5px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
}

.table-search-input {
  max-width: 320px;
  width: 100%;
}

/* ==========================================================================
   BREAKPOINTS: DESKTOP & TABLET
   ========================================================================== */

/* Large Tablets & Medium Screens (901px - 1199px) */
@media (max-width: 1199px) {
  .grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

/* Mobile & Tablet Drawer Transition (< 900px) */
@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    z-index: 100;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .grid-2col, .grid-3col {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 1.25rem;
  }

  .app-header {
    padding: 0 1.25rem;
  }

  .reviews-score-block {
    gap: 1.5rem;
    width: 100%;
  }

  .reviews-score-num {
    padding-right: 1.5rem;
  }
}

/* Tablet Portrait & Large Smartphones (< 768px) */
@media (max-width: 768px) {
  .hero-banner {
    padding: 1.25rem;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .hero-metrics {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
  }

  .hero-metric-item {
    text-align: left;
  }

  .hero-title {
    font-size: 1.3rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.45rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .panel-header > div,
  .panel-header > .btn-secondary {
    width: 100%;
  }

  .table-search-input {
    max-width: 100%;
    width: 100%;
  }

  .reviews-summary-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .reviews-score-num {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1rem;
    width: 100%;
    text-align: center;
  }

  .reviews-score-bars {
    width: 100%;
    min-width: 100%;
  }

  .dashboard-footer {
    flex-direction: column;
    gap: 0.85rem;
    text-align: center;
    padding: 1.25rem;
  }

  .dashboard-footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .cyber-modal {
    padding: 1rem;
  }

  .modal-dialog {
    max-width: 100%;
  }
}

/* Smartphone Portrait (< 640px) */
@media (max-width: 640px) {
  .app-header {
    padding: 0 0.85rem;
    height: 58px;
  }

  .header-breadcrumbs {
    font-size: 0.8rem;
    gap: 0.25rem;
  }

  .header-breadcrumbs span:first-child {
    display: none; /* Hide parent brand name to preserve space */
  }

  .header-breadcrumbs i {
    display: none;
  }

  .header-right {
    gap: 0.5rem;
  }

  .telemetry-chip {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }

  /* Keep icons on telemetry chips, condense text */
  .telemetry-chip span {
    font-size: 0.7rem;
  }

  #telemetry-uptime {
    display: none; /* Hide uptime text on very small screens, keep icon */
  }

  .user-profile {
    padding: 0.2rem 0.45rem;
    gap: 0.35rem;
  }

  .user-name {
    display: none; /* Show avatar only on mobile to avoid header collision */
  }

  .page-content {
    padding: 0.85rem;
  }

  .glass-panel {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
  }

  .cyber-toast {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  .btn-primary, .btn-secondary {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  .page-header-row h2 {
    font-size: 1.25rem;
  }
}

/* Extra Small Phones (< 400px) */
@media (max-width: 400px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 1.35rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .telemetry-chip {
    display: none; /* Hide telemetry chips on ultra-compact screens */
  }
}
