/* ==========================================================================
   VSIM ADMIN PANEL PWA - DESIGN SYSTEM & STYLESHEET
   Matches reference Admin Dashboard UI with pixel perfection & full responsiveness
   ========================================================================== */

:root {
  /* Core Dark Theme Palettes (Exact match to reference UI) */
  --bg-body: #080c16;
  --bg-sidebar: #0b0f19;
  --bg-card: #0f1523;
  --bg-card-hover: #151c2e;
  --bg-card-secondary: #131a2a;
  --bg-input: #101625;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-light: rgba(255, 255, 255, 0.05);

  /* Accents & Brand Gradients */
  --primary-purple: #6366f1;
  --primary-purple-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --purple-glow: rgba(99, 102, 241, 0.35);
  
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.14);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.14);
  --accent-orange: #f59e0b;
  --accent-orange-bg: rgba(245, 158, 11, 0.14);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.14);
  --accent-purple-bg: rgba(99, 102, 241, 0.14);

  /* Text Typography */
  --text-white: #f8fafc;
  --text-gray: #94a3b8;
  --text-muted: #64748b;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Shadows & Layout Metrics */
  --card-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.5);
  --sidebar-width: 250px;
  --topbar-height: 64px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-secondary: #f8fafc;
  --bg-input: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #6366f1;
  --border-light: rgba(0, 0, 0, 0.06);
  --text-white: #0f172a;
  --text-gray: #475569;
  --text-muted: #94a3b8;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-body);
  color: var(--text-white);
  overflow: hidden;
  font-size: 13.5px;
}

/* Master Layout Grid */
.admin-app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  background: var(--bg-body);
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-brand-header {
  height: var(--topbar-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-v-badge {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-v-badge span {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pwa-chip {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--primary-purple);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-left: 2px;
}

/* Admin User Card in Sidebar */
.sidebar-user-card {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--purple-glow);
}

.user-meta-info {
  display: flex;
  flex-direction: column;
}

.user-name-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-white);
}

.user-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--accent-green);
  font-weight: 600;
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* Navigation Menu */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.nav-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-gray);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.84rem;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-menu-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-white);
}

.nav-menu-link.active {
  background: var(--primary-purple);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--purple-glow);
}

.nav-menu-link svg {
  flex-shrink: 0;
}

.nav-badge-count {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* System Status Footer in Sidebar */
.sidebar-system-status {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-secondary);
}

.system-status-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-gray);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.status-metric-row span:last-child {
  font-weight: 600;
}
.status-metric-row .val-green { color: var(--accent-green); }
.status-metric-row .val-blue { color: var(--accent-blue); }

/* ==========================================================================
   MAIN VIEWPORT & TOPBAR
   ========================================================================== */
.admin-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Topbar */
.admin-topbar {
  height: var(--topbar-height);
  padding: 0 20px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  z-index: 40;
}

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

.btn-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-white);
  cursor: pointer;
}

.topbar-view-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.2px;
  margin-right: 10px;
}

/* Global Search Bar */
.global-search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 36px;
  width: 100%;
  max-width: 480px;
  transition: border-color 0.2s ease;
}

.global-search-container:focus-within {
  border-color: var(--border-focus);
}

.global-search-container input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 0.82rem;
  width: 100%;
}

.global-search-container input::placeholder {
  color: var(--text-muted);
}

/* Topbar Right Controls */
.topbar-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-badge-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-gray);
  cursor: pointer;
}

.btn-export-reports {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-export-reports:hover {
  opacity: 0.9;
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.icon-action-btn .badge-dot-num {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 8px;
  border: 1px solid var(--bg-sidebar);
}

.topbar-admin-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.admin-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-purple);
}

.admin-profile-text {
  display: flex;
  flex-direction: column;
}

.admin-profile-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.1;
}

.admin-profile-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SCREENS & VIEWS CONTAINER
   ========================================================================== */
.admin-views-scrollport {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 30px 18px;
}

.admin-views-scrollport::-webkit-scrollbar {
  width: 6px;
}
.admin-views-scrollport::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.admin-view-screen {
  display: none;
  animation: fadeInView 0.2s ease forwards;
}

.admin-view-screen.active {
  display: block;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Greeting Header */
.dashboard-greeting-bar {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-greeting-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.2px;
}

.dashboard-greeting-sub {
  font-size: 0.78rem;
  color: var(--text-gray);
  margin-top: 1px;
}

.dashboard-greeting-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   HERO METRIC CARDS (ROW 1)
   ========================================================================== */
.hero-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  min-height: 84px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.hero-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

.hero-metric-accent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  color: var(--primary-purple);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.metric-icon-square {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-square.purple { background: var(--accent-purple-bg); color: var(--primary-purple); }
.metric-icon-square.green { background: var(--accent-green-bg); color: var(--accent-green); }
.metric-icon-square.blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
.metric-icon-square.orange { background: var(--accent-orange-bg); color: var(--accent-orange); }

.metric-body-data {
  flex: 1;
}

.metric-label-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 2px;
}

.metric-large-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -0.3px;
  line-height: 1.15;
  margin-bottom: 2px;
}

.metric-trend-pill {
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.metric-trend-pill.positive {
  color: var(--accent-green);
}

/* ==========================================================================
   ROW 2: 3-COLUMN DASHBOARD GRID
   ========================================================================== */
.dashboard-row-3col {
  display: grid;
  grid-template-columns: 1.45fr 1.65fr 1.15fr;
  gap: 10px;
  margin-bottom: 12px;
}

/* ==========================================================================
   ROW 3: 4-COLUMN DASHBOARD GRID
   ========================================================================== */
.dashboard-row-4col {
  display: grid;
  grid-template-columns: 1.2fr 1.15fr 1.05fr 1.1fr;
  gap: 10px;
  margin-bottom: 12px;
}

/* Common Widget Card */
.dashboard-widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 250px;
}

.widget-card-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.widget-header-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-header-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-white);
}

.widget-action-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-purple);
  cursor: pointer;
  text-decoration: none;
}

.widget-action-link:hover {
  text-decoration: underline;
}

.widget-card-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 6px 14px 0 14px;
}

.widget-card-body {
  padding: 10px 14px;
  flex: 1;
}

.widget-card-footer-stats {
  padding: 7px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-gray);
}

.widget-card-footer-stats strong {
  color: var(--text-white);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}

.admin-data-table th {
  padding: 6px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-white);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-data-table tr:hover td {
  background: var(--bg-card-hover);
}

.admin-data-table tr:last-child td {
  border-bottom: none;
}

/* Status Pill Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pill.completed,
.status-pill.paid,
.status-pill.online,
.status-pill.active {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.status-pill.pending {
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
}

.status-pill.approved {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

.status-pill.failed,
.status-pill.offline,
.status-pill.rejected,
.status-pill.cancelled {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

/* Table Button Actions */
.btn-action-small {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-action-small.pay {
  background: var(--primary-purple);
  color: #fff;
}

.btn-action-small.mark-paid {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--accent-green);
}

.btn-action-small.view {
  background: transparent;
  color: var(--text-gray);
  padding: 2px 4px;
}

.btn-action-small.view:hover {
  color: var(--text-white);
  text-decoration: underline;
}

.btn-action-small:hover {
  opacity: 0.85;
}

/* ==========================================================================
   CHARTS & VISUALIZATIONS (SVG POWERED)
   ========================================================================== */
.earnings-chart-container {
  width: 100%;
  height: 140px;
  position: relative;
}

.earnings-breakdown-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.breakdown-stat-box {
  background: var(--bg-card-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  text-align: center;
}

.breakdown-stat-box .title {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.breakdown-stat-box .val {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-white);
}

.breakdown-stat-box .growth {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent-green);
}

/* Donut Investment Chart */
.investment-summary-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
}

.donut-chart-box {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-label .small-tag {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.donut-center-label .amount-tag {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--text-white);
}

.investment-legend-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item-row {
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
}

.legend-dot-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-gray);
  font-weight: 600;
}

.legend-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.legend-item-val {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.68rem;
  margin-left: 13px;
}

/* Bridge Devices List */
.bridge-devices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bridge-device-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.bridge-left-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bridge-network-badge {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--accent-purple-bg);
  color: var(--primary-purple);
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bridge-name-text {
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--text-white);
}

.bridge-phone-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Activity Logs */
.activity-logs-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-log-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
}

.log-left-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.log-dot.success { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.log-dot.info { background: var(--accent-blue); box-shadow: 0 0 6px var(--accent-blue); }
.log-dot.warning { background: var(--accent-orange); }
.log-dot.primary { background: var(--primary-purple); }
.log-dot.danger { background: var(--accent-red); }

.log-time-ago {
  color: var(--text-muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

/* ==========================================================================
   ROW 4: PWA MOBILE PREVIEW (ADMIN PANEL) SHOWCASE
   ========================================================================== */
.pwa-mobile-showcase-section {
  display: none !important;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--card-shadow);
  margin-top: 4px;
}

.pwa-showcase-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 12px;
}

.pwa-mockups-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.pwa-devices-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
}

.pwa-devices-scroll::-webkit-scrollbar {
  height: 4px;
}
.pwa-devices-scroll::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

/* Realistic Phone Frame */
.phone-mockup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.phone-mockup-frame {
  width: 130px;
  height: 230px;
  background: #090d16;
  border: 2px solid #2d3748;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

/* Phone Top Speaker Notch */
.phone-notch {
  width: 40px;
  height: 4px;
  background: #1a202c;
  border-radius: 2px;
  margin: 4px auto 3px auto;
  flex-shrink: 0;
}

.phone-screen-content {
  flex: 1;
  padding: 4px 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 0.58rem;
  background: #090d16;
}

.phone-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-white);
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}

.phone-mini-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 5px;
  padding: 3px 4px;
  margin-bottom: 3px;
}

.phone-mini-bottom-nav {
  margin-top: auto;
  height: 18px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.48rem;
  color: var(--text-muted);
  background: #0b0f19;
  flex-shrink: 0;
}

.phone-label-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-gray);
}

/* PWA Ready Feature Card */
.pwa-ready-card {
  width: 200px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-ready-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-ready-check-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-green-bg);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-ready-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
}

.pwa-ready-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.pwa-features-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-gray);
}

.pwa-features-list span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pwa-features-list span::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: bold;
}

.pwa-browsers-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.browser-icon-pill {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  font-size: 0.65rem;
  color: var(--text-white);
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay-backdrop.open {
  display: flex;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Custom Reusable Confirm & Prompt Dialogs */
.custom-confirm-dialog {
  max-width: 420px;
}

.custom-dialog-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-dialog-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.custom-dialog-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.custom-dialog-icon.primary {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.custom-dialog-message {
  font-size: 0.86rem;
  color: var(--text-gray);
  line-height: 1.5;
  margin: 0;
}

.btn-danger-action {
  background: #dc2626;
  color: #fff;
  border: 1px solid #ef4444;
  border-radius: var(--radius-md);
  font-weight: 700;
  padding: 8px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-danger-action:hover {
  background: #b91c1c;
}

.modal-dialog-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-dialog-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-white);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
}

.modal-dialog-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-form-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-gray);
}

.modal-form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-white);
  outline: none;
  font-size: 0.82rem;
}

.modal-form-input:focus {
  border-color: var(--border-focus);
}

.modal-dialog-footer {
  padding: 12px 18px;
  background: var(--bg-card-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-secondary {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-primary {
  padding: 7px 16px;
  background: var(--primary-purple);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ==========================================================================
   TOAST NOTIFICATIONS HUB
   ========================================================================== */
.admin-toast-hub {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.admin-toast-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-white);
  font-weight: 600;
  font-size: 0.8rem;
  pointer-events: auto;
  animation: slideInToast 0.2s ease;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION (PWA MODE)
   ========================================================================== */
.admin-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 56px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  z-index: 60;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-gray);
  background: none;
  border: none;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
}

.bottom-tab-btn.active {
  color: var(--primary-purple);
}

/* Slide-up "More" Drawer for Mobile */
.mobile-more-drawer {
  position: fixed;
  bottom: -100%;
  left: 0;
  width: 100vw;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  z-index: 70;
  transition: bottom 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-more-drawer.open {
  bottom: 0;
}

.mobile-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.mobile-drawer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1380px) {
  .hero-metrics-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .hero-metric-accent-card {
    display: none;
  }
  .dashboard-row-3col {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-row-4col {
    grid-template-columns: 1fr 1fr;
  }
  .pwa-mockups-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-row-3col,
  .dashboard-row-4col {
    grid-template-columns: 1fr;
  }
  .hero-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100%;
  }

  .admin-sidebar.open {
    left: 0;
  }

  .admin-topbar {
    padding: 0 12px;
  }

  .global-search-container {
    max-width: 160px;
  }

  .date-badge-pill,
  .btn-export-reports,
  .admin-profile-text {
    display: none;
  }

  .admin-views-scrollport {
    padding: 12px 12px 70px 12px;
  }

  .hero-metrics-row {
    grid-template-columns: 1fr;
  }

  .admin-bottom-nav {
    display: flex;
  }
}
