/*──────────────────────────────────────────────
  styles.css — Cleaned & Unified Stylesheet
──────────────────────────────────────────────*/

/*──────────────────────────────────────────────
  :root — CSS Variables
──────────────────────────────────────────────*/
:root {
  /* Core Colors & Shadows */
  --section-bg:          #a7b4b8;
  --section-fg:          #232323;
  --text-dark:           #202B39;
  --text-light:          #ffffff;
  --text-policeBlue:     #215A69;
  --text-yankeesBlue:    #202B39;
  --text-gunmetal:       #2A3439;
  --text-darkSlateGray:  #375152;
  --text-dimGray:        #696969;
  --text-linkblue:       #00bfff;
  --text-linkbluebright: #0096FF;
  --section-shadow:       0 4px 16px #00000012;

  /* Form Inputs */
  --input-bg:             #dde2e4;
  --input-fg:             #232323;
  --input-border:         #b6bdc5;
  --input-focus-border:   #2368a2;
  --input-focus-bg:       #ffffff;
  --label-color:          #222222;

  /* Navigation & Buttons */
  --nav-bg:               #202B39;
  --nav-hover-bg:         #375152;
  --nav-fg:               #ffffff;
  --nav-shadow:           0 2px 8px #2368a21a;
  --signout-bg:           #ad2626;
  --signout-hover-bg:     #ff2222;

  /* Tables */
  --table-bg:             #ebeeef;
  --table-th-bg:          #2f383b;
  --table-th-fg:          #ffffff;
  --table-hover-bg:       #e8f0fc;
  --table-border:         #cccccc;

  /* Alerts */
  --danger:               #aa0000;
  --warning:              #ffc400;

  /* Background & Logo */
  --background-image:     url('../images/background.jpeg');
  --logo-image:           url('../images/logo.png');
}

/*──────────────────────────────────────────────
  Global Base Styles
──────────────────────────────────────────────*/
body {
  background: var(--background-image) no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text-default, #232323);
  padding-top: 60px; /* Account for fixed header */
}

/*──────────────────────────────────────────────
  Layout
──────────────────────────────────────────────*/
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.page-layout {
  display: block;
  margin: 0;
}

.main-content {
  padding: 2rem;
}

/*──────────────────────────────────────────────
  Navigation Bar
──────────────────────────────────────────────*/
.top-bar {
  width: 100vw;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--text-yankeesBlue);
  color: var(--nav-fg);
  box-shadow: var(--nav-shadow);
  position: fixed;
  top: 0;
  z-index: 1000;
  padding: 0 1rem;
  box-sizing: border-box;
}

.top-bar .left,
.top-bar .right {
  display: flex;
  align-items: center;
}

.top-bar img {
  max-height: 40px;
  margin-right: 1rem;
}

/*──────────────────────────────────────────────
  Buttons
──────────────────────────────────────────────*/
button,
.button {
  background: var(--nav-bg);
  color: var(--nav-fg);
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--nav-shadow);
  transition: background 0.15s;
  display: inline-block;
}

button:hover,
.button:hover {
  background: var(--nav-hover-bg);
}

.button.force {
  background-color: #ff9800;
  margin-top: 1rem;
}

.button.force:hover {
  background-color: #f57c00;
}

/*──────────────────────────────────────────────
  Menu Buttons
──────────────────────────────────────────────*/
.menu-button {
  background: transparent;
  color: var(--nav-fg);
  border: none;
  margin: 0 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.5rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.menu-button:hover {
  background: var(--nav-hover-bg);
}

/*──────────────────────────────────────────────
  Mobile Menu Styles
──────────────────────────────────────────────*/
.mobile-menu-toggle {
  display: none;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--nav-fg);
  margin: 4px 0;
  transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--section-fg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 9;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav .menu-button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav .menu-button:last-child {
  border-bottom: none;
}

.mobile-selection-panel {
  display: none;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

.mobile-selection-panel.active {
  display: block;
}

.mobile-selection-panel .selection-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mobile-selection-panel .selection-row:last-child {
  margin-bottom: 0;
}

.mobile-selection-panel label {
  font-size: 0.9rem;
  color: var(--nav-fg);
  font-weight: 500;
}

.mobile-selection-panel select {
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-fg);
  font-size: 1rem;
}

.mobile-user-info {
  display: none;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: var(--nav-fg);
  font-size: 0.9rem;
}

.mobile-user-info.active {
  display: block;
}

/*──────────────────────────────────────────────
  Input & Select Panels
──────────────────────────────────────────────*/
.selection-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin-right: 1rem;
}

.selection-panel label {
  font-size: 0.9rem;
  color: var(--nav-fg);
  white-space: nowrap;
}

.selection-panel select {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-fg);
}

/*──────────────────────────────────────────────
  Table Layouts (Unified)
──────────────────────────────────────────────*/
.table-container {
  overflow-x: auto;
  background: var(--gradient-neutral);
  padding: 1rem;
  border-radius: 12px;
  color: var(--text-light);
  box-shadow: var(--section-shadow);
}

/* Modern transparent container for card-based layouts */
.table-container-transparent {
  overflow-x: visible !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

table,
#historicalTable {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Segoe UI', sans-serif;
  background: var(--table-bg);
  color: var(--text-dark);
  margin-top: 1rem;
}

th, td,
#historicalTable th,
#historicalTable td {
  border: 1px solid var(--table-border);
  padding: 0.75rem;
  text-align: center;
  vertical-align: middle;
}

th,
#historicalTable thead th {
  background: var(--text-yankeesBlue) !important;
  color: var(--table-th-fg) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}

#historicalTable tbody tr:hover,
table tbody tr:hover {
  background-color: var(--table-hover-bg);
}

.scroll-wrapper {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--table-border);
}

/*──────────────────────────────────────────────
  Haul Status Indicators
──────────────────────────────────────────────*/
.status-complete {
  color: #28a745 !important;
  font-weight: bold;
}

.status-in-progress {
  color: #ffc107 !important;
  font-weight: bold;
}

.status-incomplete {
  color: #dc3545 !important;
  font-weight: bold;
}

.status-unknown {
  color: #6c757d !important;
  font-weight: bold;
}

/*──────────────────────────────────────────────
  Modern Loader Overlay (Global)
──────────────────────────────────────────────*/
#loaderOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4); /* modern semi-transparent overlay */
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-message-box {
  background: var(--gradient-neutral);
  color: var(--text-light);
  padding: 2rem;
  border-radius: var(--modern-border-radius);
  box-shadow: var(--modern-card-shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  max-width: 400px;
  word-break: break-word;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--modern-transition);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(52, 152, 219, 0.2);
  border-left: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

/*──────────────────────────────────────────────
  Miscellaneous
──────────────────────────────────────────────*/
.loading-text {
  font-size: 1.1rem;
  color: #333333;
}

.card {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--section-shadow);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

/*──────────────────────────────────────────────
  Tab Buttons (New)
──────────────────────────────────────────────*/
.tab-button {
  background: #2368a2; /* blue for contrast on section-bg */
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--section-shadow);
  margin: 0.5rem 0.5rem 0.5rem 0;
  transition: background 0.15s, color 0.15s;
  display: inline-block;
}

.tab-button:hover {
  background: #174a7a;
  color: #fff;
}

/*──────────────────────────────────────────────
  Admin Modal Actions (New)
──────────────────────────────────────────────*/
.adminModalActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px; /* Reduced from default (e.g. 16px or more) for tighter spacing */
  margin-top: 24px;
}

.adminModalActions .adminCancelBtn,
.adminModalActions .adminSaveBtn {
  margin: 0; /* Remove extra margin if present */
}

/*──────────────────────────────────────────────
  New Entry Modals (Admin & User Consoles)
──────────────────────────────────────────────*/
/* For form entry modals (used in admin and user consoles) */
.newEntry {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 8px; /* Tighten or loosen spacing as needed */
  margin-top: 16px;
}

.newEntry button {
  min-width: 90px;
  margin: 0 4px;
  padding: 8px 16px;
  font-size: 1rem;
}

/* You can further customize .newEntry for modal backgrounds, borders, etc. */

/*──────────────────────────────────────────────
  Account Tab - Modern Card Layout (Snapshot Style)
──────────────────────────────────────────────*/
/* Add modern variables from snapshot page */
:root {
  --modern-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --modern-card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
  --modern-border-radius: 12px;
  --modern-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Card background gradients */
  --gradient-alert: linear-gradient(135deg, rgba(255, 25, 0, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
  --gradient-normal: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
  --gradient-info: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
  --gradient-neutral: linear-gradient(180deg, rgba(149, 165, 166, 0.1) 0%, rgba(182, 208, 255, 0.95) 60%);
}

.account-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1rem;
  margin-top: 1rem;
}

/*──────────────────────────────────────────────
  Main Content Cards - Unified Styling
──────────────────────────────────────────────*/
.mainContentCards {
  background: var(--gradient-neutral);
  border-radius: var(--modern-border-radius);
  box-shadow: var(--modern-card-shadow);
  transition: var(--modern-transition);
  backdrop-filter: blur(10px);
  border: 1px solid #0000001a;
  overflow: hidden;
}

.mainContentCards:hover {
  transform: translateY(-5px);
  box-shadow: var(--modern-card-shadow-hover);
}

.mainContentCards .account-card-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mainContentCards .account-card-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

.mainContentCards .account-card-body {
  padding: 1rem 1.5rem 1.5rem;
}

.mainContentCards .account-field-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: var(--modern-transition);
}

.mainContentCards .account-field-item:last-child {
  border-bottom: none;
}

.mainContentCards .account-field-item:hover {
  background: rgba(0, 0, 0, 0.05);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 6px;
}

.mainContentCards .field-label {
  font-weight: 500;
  color: var(--text-light);
  font-size: 1.1rem;
  flex: 1;
}

.mainContentCards .field-value {
  font-weight: 600;
  color: var(--text-dark);
  text-align: right;
  font-size: 1.1rem;
  max-width: 50%;
  word-break: break-word;
}

.mainContentCards .field-value a {
  color: var(--text-linkblue);
  text-decoration: none;
  font-weight: 500;
}

.mainContentCards .field-value a:hover {
  text-decoration: underline;
}

/* Let telemetry map handle all colors - only override Online status to green */
.mainContentCards .field-value.alert-value {
  /* Optimized for instant background application */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  text-align: center;
  
  /* Pre-allocate padding to prevent layout shift */
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  color: white !important;
  line-height: 1;
  
  /* Instant transition for background changes */
  transition: transform 0.1s ease-out, filter 0.1s ease-out;
  
  /* Use transform instead of box-shadow animation for better performance */
  will-change: transform;
  backface-visibility: hidden;
  
  /* Force background to render immediately */
  background-color: var(--alert-color, currentColor);
}

/* Enhanced animation using transform for better performance */
.mainContentCards .field-value.alert-value:not(.status-online) {
  animation: smooth-alert-pulse 2s infinite ease-in-out;
}

.mainContentCards .field-value.alert-value.status-online {
  background: linear-gradient(135deg, #4caf50, #2e7d32) !important;
  animation: smooth-online-pulse 2s infinite ease-in-out;
}

/* Optimized animations using transform for GPU acceleration */
@keyframes smooth-alert-pulse {
  0%, 100% { 
    transform: scale(1);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.02);
    filter: brightness(1.1);
  }
}

@keyframes smooth-online-pulse {
  0%, 100% { 
    transform: scale(1);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.02);
    filter: brightness(1.1);
  }
}

/* Loading and error states */
.account-loading-card, .account-error-card {
  background: var(--gradient-neutral);
  border-radius: var(--modern-border-radius);
  box-shadow: var(--modern-card-shadow);
  padding: 2rem;
  text-align: center;
  margin: 2rem auto;
  max-width: 400px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.account-loading-card p, .account-error-card {
  margin: 0.5rem 0 0;
  color: #ffffff;
  font-weight: 500;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(52, 152, 219, 0.2);
  border-left: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/*──────────────────────────────────────────────
  Hauler Cards (Modern Card-Based Layout)
──────────────────────────────────────────────*/
.hauler-cards-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem;
  padding: 1rem 0;
  width: 100%;
  max-width: 800px; /* Limit width for better readability */
  margin: 0 auto; /* Center the cards */
  /* Force single column - override any inherited grid behavior */
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

.hauler-cards-container .mainContentCards {
  width: 100% !important; /* Ensure cards take full width of container */
  max-width: 800px; /* Additional safety limit for individual cards */
  /* Force cards to be block elements in single column */
  display: block !important;
  flex: none !important;
  grid-column: unset !important;
  grid-row: unset !important;
}

.hauler-card {
  background: var(--gradient-neutral);
  border-radius: var(--modern-border-radius);
  box-shadow: var(--modern-card-shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--modern-transition);
  overflow: hidden;
}

.hauler-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/*─────────────────────────────────────────────────
  DOWNTIME TAB - MODERN CARD LAYOUT
──────────────────────────────────────────────────*/
.downtime-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  width: 100%;
}

.downtime-cards-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem;
  padding: 1rem 0;
  width: 100%;
  max-width: 800px; /* Limit width for better readability */
  margin: 0 auto; /* Center the cards */
  /* Force single column - override any inherited grid behavior */
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

.downtime-cards-container .mainContentCards {
  width: 100% !important; /* Ensure cards take full width of container */
  max-width: 800px; /* Additional safety limit for individual cards */
  /* Force cards to be block elements in single column */
  display: block !important;
  flex: none !important;
  grid-column: unset !important;
  grid-row: unset !important;
}

/* 3-column interior grid for downtime fields */
.downtime-cards-container .account-card-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

.downtime-cards-container .account-field-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: var(--modern-transition);
}

.downtime-cards-container .field-label {
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.downtime-cards-container .field-value {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1rem;
  word-break: break-word;
}

/* Override global status classes for downtime cards with inline styles */
.downtime-cards-container .downtime-card-status {
  color: white !important; /* Ensure white text on status badges */
}

/* Mobile/Small screen overrides for downtime cards */
@media (max-width: 768px) {
  .downtime-cards-container .account-card-body {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }
  
  .downtime-cards-container .account-card {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
  }

  .downtime-cards-container .account-field-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Special styling for top downtime card with pulse */
.top-downtime-card {
  position: relative;
}

.downtime-card-status {
  display: inline-block;
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.downtime-card-duration {
  font-weight: bold;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.hauler-card-header {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hauler-card-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hauler-card-date {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Responsive design */
/* Large tablets and small desktops: 3 columns */
@media (max-width: 1200px) {
  .account-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

/* Medium tablets: 2 columns */
@media (max-width: 900px) {
  .account-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.75rem;
  }
}

/* Mobile and small tablets: 1 column */
@media (max-width: 768px) {
  .account-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
  }
  
  .account-card-header {
    padding: 1rem 1.25rem 0.5rem;
  }
  
  .account-card-header h3 {
    font-size: 1.3rem;
  }
  
  .account-card-body {
    padding: 0.75rem 1.25rem 1.25rem;
  }
  
  /* Keep field and value on same line for mobile - plenty of room */
  .account-field-item {
    /* Remove flex-direction: column to keep same-line layout */
    padding: 0.5rem 0; /* Slightly reduce padding for mobile */
  }
  
  .field-value {
    text-align: right; /* Keep right alignment */
    max-width: 60%; /* Allow a bit more space for values */
  }
}

@media (max-width: 480px) {
  .account-cards-grid {
    padding: 0.25rem;
    gap: 0.75rem;
  }
  
  .account-card-header h3 {
    font-size: 1.3rem;
  }
  
  .field-label, .field-value {
    font-size: 1.1rem;
  }
}

/*──────────────────────────────────────────────
  Mobile Navigation (tablets and phones)
──────────────────────────────────────────────*/
@media (max-width: 768px) {
  .top-bar {
    position: fixed;
    padding: 0 1rem;
    height: 60px;
  }

  .top-bar .left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  /* Logo positioned on the left */
  .top-bar .left img {
    position: absolute;
    left: 0;
    max-height: 35px;
    margin-right: 0;
  }

  /* Page title centered */
  .top-bar .left span {
    text-align: center;
    flex: 1;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
  }

  /* Hamburger menu positioned on the right */
  .mobile-menu-toggle {
    position: absolute;
    right: 0;
    display: block;
    padding: 0.5rem;
    margin: 0;
    background: transparent;
    border: none;
    color: var(--nav-fg);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-menu-toggle:hover {
    background: var(--nav-hover-bg);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--nav-fg);
    margin: 4px auto;
    transition: 0.3s;
  }

  .top-bar .left .menu-button {
    display: none;
  }

  .top-bar .right {
    display: none;
  }

  .mobile-selection-panel.active,
  .mobile-user-info.active {
    display: block;
  }

  .main-content {
    padding: 0.5rem;
  }

  /* Make tables more mobile-friendly */
  .table-container {
    padding: 0.75rem;
    margin: 0;
    border-radius: 8px;
  }
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  /* Account tab heading should be white against background */
  #account .table-container h2 {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  }

  /* Mobile Home Table - Match sub-table styling exactly */
  #home table {
    min-width: unset;
    width: 100%;
    background: var(--table-bg);
    border: 1px solid var(--table-border);
    border-radius: 0;
    margin-bottom: 1rem;
  }

  #home table thead {
    display: table-header-group;
  }

  #home table thead th {
    background: var(--text-yankeesBlue) !important;
    color: var(--table-th-fg) !important;
    border: 1px solid var(--table-border);
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: bold;
  }

  #home table tbody {
    display: table-row-group;
  }

  #home table tbody tr {
    display: table-row;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    overflow: visible;
  }

  #home table tbody td {
    display: table-cell;
    border: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    padding: 0.5rem 0.75rem;
    position: static;
    text-align: left;
    background: var(--table-bg);
    word-break: break-word;
  }

  #home table tbody td:last-child {
    border-bottom: 1px solid var(--table-border);
  }

  /* Ensure alert colors work with proper table styling */
  #home table tbody td[style*="background-color"] {
    color: #fff !important;
  }

  /* Override table container for home on mobile */
  #home .table-container {
    padding: 0.75rem !important;
    overflow-x: visible !important;
  }

  /* Mobile section padding */
  .section-padding {
    padding: 0.5rem 0 !important;
  }

  /* Improve form elements on mobile */
  input[type="date"],
  input[type="time"],
  select,
  button {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 0 0.5rem;
  }

  .top-bar img {
    max-height: 32px;
    margin-right: 0.5rem;
  }

  .main-content {
    padding: 0.5rem;
  }

  .table-container {
    padding: 0.5rem;
  }

  /* Stack date/time inputs vertically on very small screens */
  .date-time-controls {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .date-time-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
  }

  .date-time-row label {
    font-weight: 500;
    margin-bottom: 0.25rem;
  }

  .date-time-row input {
    width: 100%;
  }
}

/*──────────────────────────────────────────────
  Snapshot Card (Desktop Style)
──────────────────────────────────────────────*/
.snapshot-card {
  background-color: var(--snapshot-card-bg,);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--section-shadow);
  text-align: center;
  max-width: 500px;
  width: 100%;
  margin: 2rem auto;
}

/*──────────────────────────────────────────────
  Snapshot‑Page Mobile Tweaks (only under 700px)
──────────────────────────────────────────────*/
@media (max-width: 700px) {
  /* Center the card by killing main‑content padding */
  body.snapshot-page .main-content {
    padding: 0;
  }

  /* Make your card fill viewport minus a tiny gutter */
  body.snapshot-page .snapshot-card {
    width: calc(100% - 1rem);
    max-width: none;
    min-width: 0;
    margin: 0.5rem auto;
    padding: 0.5rem;
  }

  /* Stretch the snapshot tables to match the card */
  body.snapshot-page .snapshot-section-table {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Full‑width selects/dropdowns in the card */
  body.snapshot-page .snapshot-card select,
  body.snapshot-page .snapshot-card .snapshot-dropdown {
    width: 100%;
    margin: 0.25rem 0;
    padding: 0.4rem;
  }
}

/*──────────────────────────────────────────────
  Snapshot‑Page Top‑Bar Simplification (only under 600px)
──────────────────────────────────────────────*/
@media (max-width: 600px) {
  /* hide the “Snapshot” title and welcome text, leave only logo + Sign Out */
  body.snapshot-page .top-bar .left span,
  body.snapshot-page .top-bar .right #welcomeUser {
    display: none;
  }
  /* you’ll still get the logo on the left and the Sign Out button on the right */
}

/*──────────────────────────────────────────────
  Historical Table Headers (Sticky + Filter Icons)
──────────────────────────────────────────────*/
#historicalTable thead th {
  background: var(--text-yankeesBlue) !important;
  color: var(--table-th-fg) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  border: 1px solid var(--table-border) !important;
  vertical-align: middle;
}

/*──────────────────────────────────────────────
  Sticky Columns for Historical Table
──────────────────────────────────────────────*/
/* Ensure table can scroll horizontally */
#historicalTable {
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

/* First column (DeviceID) */
#historicalTable th.sticky-col-1,
#historicalTable td.sticky-col-1 {
  position: -webkit-sticky !important;
  position: sticky !important;
  left: 0 !important;
  z-index: 1 !important;
  background: var(--text-yankeesBlue) !important;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  white-space: nowrap;
  min-width: 200px;
}

/* Second column (Device Timestamp) */
#historicalTable th.sticky-col-2,
#historicalTable td.sticky-col-2 {
  position: -webkit-sticky !important;
  position: sticky !important;
  left: 165px !important;
  z-index: 1 !important;
  background: var(--text-yankeesBlue) !important;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  white-space: nowrap;
  min-width: 180px;
}

/* Third column (Device Raw Data) */
#historicalTable th.sticky-col-3,
#historicalTable td.sticky-col-3 {
  position: -webkit-sticky !important;
  position: sticky !important;
  left: 345px !important;
  z-index: 1 !important;
  background: var(--text-yankeesBlue) !important;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  white-space: nowrap;
  min-width: 150px;
}

/* Header cells need higher z-index and explicit positioning */
#historicalTable th.sticky-col-1,
#historicalTable th.sticky-col-2,
#historicalTable th.sticky-col-3 {
  z-index: 3 !important;
  position: -webkit-sticky !important;
  position: sticky !important;
}

/* Data cells use background color from theme */
#historicalTable td.sticky-col-1,
#historicalTable td.sticky-col-2,
#historicalTable td.sticky-col-3 {
  background: var(--table-bg) !important;
}

/* Force positioning context for the scroll container */
.scroll-wrapper {
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
}

/*──────────────────────────────────────────────
  User Status Indicators
──────────────────────────────────────────────*/
.status-enabled {
  color: #28a745;
  font-weight: bold;
}

.status-disabled {
  color: #dc3545;
  font-weight: bold;
}

/*──────────────────────────────────────────────
  Action Button Variants
──────────────────────────────────────────────*/
.button-warning {
  background-color: #ffc107;
  color: #212529;
  border: 1px solid #ffc107;
}

.button-warning:hover {
  background-color: #e0a800;
  border-color: #d39e00;
}

.button-success {
  background-color: #28a745;
  color: white;
  border: 1px solid #28a745;
}

.button-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.button-danger {
  background-color: #dc3545;
  color: white;
  border: 1px solid #dc3545;
}

.button-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

/*──────────────────────────────────────────────
  Tables
──────────────────────────────────────────────*/

/*──────────────────────────────────────────────
  Hauler Cards (Mobile)
──────────────────────────────────────────────*/
.hauler-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}

.hauler-card {
  background: var(--table-bg);
  border: 1px solid var(--table-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease;
}

.hauler-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.hauler-card-header {
  background: var(--text-yankeesBlue);
  color: var(--table-th-fg);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hauler-card-status {
  font-weight: bold;
  font-size: 1rem;
}

.hauler-card-action button {
  background: #007bff;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hauler-card-action button:hover {
  background: #0056b3;
}

.hauler-card-body {
  padding: 1rem;
}

.hauler-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}

.hauler-card-row:last-child {
  border-bottom: none;
}

.hauler-card-label {
  font-weight: 600;
  color: #495057;
  flex: 0 0 40%;
  font-size: 0.9rem;
}

.hauler-card-value {
  flex: 1;
  text-align: right;
  font-size: 0.9rem;
  color: #212529;
}

.hauler-card-value input {
  width: 80px;
  padding: 0.25rem;
  border: 1px solid var(--input-border);
  border-radius: 3px;
  font-size: 0.9rem;
  text-align: right;
}

/* Status color classes for cards */
.hauler-card .status-in-progress {
  color: #ffc107 !important;
}

.hauler-card .status-complete {
  color: #28a745 !important;
}

.hauler-card .status-incomplete {
  color: #dc3545 !important;
}

.hauler-card .status-unknown {
  color: #6c757d !important;
}

/* Hauler Cards: Responsive Layout */
.hauler-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}

/* Hide table - using cards only */
#haulerTableContainer table {
  display: none !important;
}

/* Desktop: Grid layout with multiple columns */
@media (min-width: 769px) {
  .hauler-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
  }
  
  .hauler-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
  }
  
  .hauler-card-label {
    font-weight: 600;
    color: #495057;
    flex: 0 0 45%;
    font-size: 0.9rem;
  }
  
  .hauler-card-value {
    flex: 1;
    text-align: right;
    font-size: 0.9rem;
    color: #212529;
  }
}

/* Mobile: Single column with field/value on same line */
@media (max-width: 768px) {
  .hauler-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .hauler-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #dee2e6;
  }
  
  .hauler-card-label {
    font-weight: 600;
    color: #495057;
    flex: 1;
    font-size: 0.85rem;
  }
  
  .hauler-card-value {
    flex: 0 0 auto;
    text-align: right;
    font-size: 0.85rem;
    color: #212529;
    margin-left: 0.5rem;
  }
}

/*──────────────────────────────────────────────
  Admin Cards (Mobile) - Customer, User, Device
──────────────────────────────────────────────*/
.admin-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}

.admin-card {
  background: var(--table-bg);
  border: 1px solid var(--table-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease;
}

.admin-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.admin-card-header {
  background: var(--text-yankeesBlue);
  color: var(--table-th-fg);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-card-title {
  font-weight: bold;
  font-size: 1rem;
}

.admin-card-action button {
  background: #007bff;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-left: 0.5rem;
}

.admin-card-action button:first-child {
  margin-left: 0;
}

.admin-card-action button:hover {
  background: #0056b3;
}

.admin-card-action button.adminSaveEditBtn {
  background: #28a745;
  margin-right: 0.5rem;
}

.admin-card-action button.adminSaveEditBtn:hover {
  background: #218838;
}

.admin-card-action button.adminCancelEditBtn {
  background: #6c757d;
}

.admin-card-action button.adminCancelEditBtn:hover {
  background: #5a6268;
}

.admin-card-action button.button-warning {
  background: #ffc107;
  color: #212529;
}

.admin-card-action button.button-warning:hover {
  background: #e0a800;
}

.admin-card-action button.button-success {
  background: #28a745;
}

.admin-card-action button.button-success:hover {
  background: #218838;
}

.admin-card-action button.button-danger {
  background: #dc3545;
}

.admin-card-action button.button-danger:hover {
  background: #c82333;
}

.admin-card-body {
  padding: 1rem;
}

.admin-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}

.admin-card-row:last-child {
  border-bottom: none;
}

.admin-card-label {
  font-weight: 600;
  color: #495057;
  flex: 0 0 35%;
  font-size: 0.9rem;
}

.admin-card-value {
  flex: 1;
  text-align: right;
  font-size: 0.9rem;
  color: #212529;
}

.admin-card-value input,
.admin-card-value select {
  width: 100%;
  max-width: 200px;
  padding: 0.25rem;
  border: 1px solid var(--input-border);
  border-radius: 3px;
  font-size: 0.9rem;
  text-align: right;
}

.admin-card-value a {
  color: #28a745;
  text-decoration: none;
  font-weight: 600;
}

.admin-card-value a:hover {
  text-decoration: underline;
  color: #1e7e34;
}

/* Customer ID links in card headers */
.admin-card-title a.customer-id-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
}

.admin-card-title a.customer-id-link:hover {
  text-decoration: underline;
  color: #f8f9fa;
}

/* Customer ID links in tables */
.main-table a.customer-id-link {
  color: #28a745;
  text-decoration: none;
  font-weight: 600;
}

.main-table a.customer-id-link:hover {
  text-decoration: underline;
  color: #1e7e34;
}

/* Groups display in user cards */
.admin-card-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.admin-card-group-tag {
  background: #e9ecef;
  color: #495057;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
  border: 1px solid #ced4da;
}

/* Desktop: Hide cards, show table */
@media (min-width: 769px) {
  .admin-cards-container {
    display: none;
  }
}

/* Mobile: Hide table, show cards for admin tables */
@media (max-width: 768px) {
  #customerTableWrap table,
  #userTableWrap table,
  #deviceTableWrap table,
  #historicalTable {
    display: none;
  }
}

/*──────────────────────────────────────────────
  Historical Cards (Mobile)
──────────────────────────────────────────────*/
.historical-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}

.historical-card {
  background: var(--table-bg);
  border: 1px solid var(--table-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease;
}

.historical-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.historical-card-header {
  background: var(--text-yankeesBlue);
  color: var(--table-th-fg);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.historical-card-device {
  font-weight: bold;
  font-size: 1rem;
}

.historical-card-timestamp {
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.historical-card-body {
  padding: 1rem;
}

.historical-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}

.historical-card-row:last-child {
  border-bottom: none;
}

.historical-card-label {
  font-weight: 600;
  color: #495057;
  flex: 0 0 40%;
  font-size: 0.9rem;
}

.historical-card-value {
  flex: 1;
  text-align: right;
  font-size: 0.9rem;
  color: #212529;
}

.historical-card-value a {
  color: #28a745;
  text-decoration: none;
  font-weight: 600;
}

.historical-card-value a:hover {
  text-decoration: underline;
  color: #1e7e34;
}

/* Field filter dropdown for mobile */
.historical-mobile-filter {
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--table-bg);
  border: 1px solid var(--table-border);
  border-radius: 8px;
}

.historical-mobile-filter label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
  color: #495057;
}

.historical-mobile-filter select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: white;
  font-size: 0.9rem;
}

/* Desktop: Hide cards, show table */
@media (min-width: 769px) {
  .historical-cards-container,
  .historical-mobile-filter {
    display: none;
  }
}

/* Extra small screens: Stack action buttons */
@media (max-width: 480px) {
  .admin-card-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .admin-card-action {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .admin-card-action button {
    margin-left: 0;
    flex: 1;
    min-width: 80px;
  }
}

/*──────────────────────────────────────────────
  Hauler Tab Specific Styles
──────────────────────────────────────────────*/

/* Hauler status styling */
.hauler-card-status {
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9em;
  display: inline-block;
}

.status-started {
  background: linear-gradient(135deg, #ffc400, #ffb000);
  color: #000;
  animation: pulse 2s infinite;
}

.status-completed {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
}

.status-incomplete {
  background: linear-gradient(135deg, #f44336, #c62828);
  color: white;
  animation: pulse 2s infinite;
}

.status-unknown {
  background: linear-gradient(135deg, #666, #444);
  color: white;
}

/* Hauler edit buttons */
.hauler-edit-button {
  background: linear-gradient(135deg, #007acc, #005a99);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9em;
  margin: 2px;
}

.hauler-edit-button:hover {
  background: linear-gradient(135deg, #0066bb, #004488);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

/* Edit button group in header */
.edit-button-group {
  display: flex;
  gap: 5px;
  align-items: center;
}

/* Alert value animation for haul data */
.alert-value {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/*──────────────────────────────────────────────
  Hauler Tab - Uses mainContentCards with specific overrides
──────────────────────────────────────────────*/

/* Hauler cards use mainContentCards base styling */
.hauler-container .mainContentCards .account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.hauler-card-action {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Desktop grid layout for hauler cards only */
@media (min-width: 769px) {
  .hauler-container .mainContentCards .account-card-body {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    align-items: start;
  }
  
  .hauler-container .mainContentCards .account-field-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    border-bottom: none;
  }
  
  .hauler-container .mainContentCards .field-label {
    font-weight: 600;
    font-size: 0.85em;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    white-space: nowrap;
  }
  
  .hauler-container .mainContentCards .field-value {
    font-weight: 500;
    font-size: 0.95em;
  }
}

/* Mobile responsive adjustments for hauler cards only */
@media (max-width: 768px) {
  .hauler-container .mainContentCards .account-field-item {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
  }
  
  .hauler-container .mainContentCards .field-label {
    margin-bottom: 0 !important;
    font-weight: 600;
  }
  
  .hauler-container .mainContentCards .field-value {
    text-align: right;
  }
  
  .hauler-edit-button {
    padding: 6px 12px;
    font-size: 0.8em;
  }
}

/*──────────────────────────────────────────────
  Home Tab - Modern Card Layout (using mainContentCards)
──────────────────────────────────────────────*/
.home-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
  gap: 1.5rem;
  max-width: 100%;
  margin: 0;
}

.home-cards-container .mainContentCards {
  width: 100%;
  max-width: none;
  min-width: 600px;
}

.home-card-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  font-weight: normal;
}

/* Desktop grid layout for home cards */
@media (min-width: 769px) {
  .home-cards-container .account-card-body {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.9rem;
    align-items: stretch;
  }
  
  /* When showing all fields, use single column cards with 10-column inner grid */
  .home-cards-container.show-all-fields {
    grid-template-columns: 1fr !important;
    max-width: none;
    width: 100%;
    margin: 0;
  }
  
  .home-cards-container.show-all-fields .mainContentCards {
    min-width: unset;
    width: 100%;
    max-width: none;
  }
  
  .home-cards-container.show-all-fields .account-card-body {
    grid-template-columns: repeat(10, 1fr) !important;
    gap: 0.7rem;
  }
  
  .home-cards-container.show-all-fields .account-field-item {
    padding: 0.6rem 0.3rem;
    min-height: 3.8rem;
  }
  
  .home-cards-container.show-all-fields .field-label {
    font-size: 0.8rem !important;
  }
  
  .home-cards-container.show-all-fields .field-value {
    font-size: 0.9rem !important;
  }
  
  .home-cards-container .account-field-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.7rem 0.4rem;
    min-height: 4.2rem;
    transition: background 0.2s ease;
  }
  
  .home-cards-container .field-label {
    font-weight: 500;
    color: var(--text-light) !important;
    font-size: 0.85rem !important;
    margin-bottom: 0.4rem;
    text-align: center;
    flex: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .home-cards-container .field-value {
    font-weight: 600;
    color: var(--text-dark) !important;
    font-size: 0.95rem !important;
    text-align: center;
    word-break: break-word;
    max-width: none;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
  }
}

/* Medium desktop - slightly larger text and spacing */
@media (min-width: 1000px) {
  .home-cards-container .account-card-body {
    gap: 1rem;
  }
  
  .home-cards-container .account-field-item {
    padding: 0.75rem 0.5rem;
    min-height: 4.5rem;
  }
  
  .home-cards-container .field-label {
    font-size: 0.9rem !important;
    white-space: normal;
  }
  
  .home-cards-container .field-value {
    font-size: 1rem !important;
  }
  
  /* Show all fields adjustments for medium desktop */
  .home-cards-container.show-all-fields .account-card-body {
    gap: 0.8rem;
  }
  
  .home-cards-container.show-all-fields .account-field-item {
    padding: 0.65rem 0.4rem;
    min-height: 4rem;
  }
  
  .home-cards-container.show-all-fields .field-label {
    font-size: 0.85rem !important;
  }
  
  .home-cards-container.show-all-fields .field-value {
    font-size: 0.95rem !important;
  }
}

/* Large desktop - optimal sizing for 5 columns */
@media (min-width: 1300px) {
  .home-cards-container .account-card-body {
    gap: 1.2rem;
  }
  
  .home-cards-container .account-field-item {
    padding: 0.8rem 0.6rem;
    min-height: 5rem;
  }
  
  .home-cards-container .field-label {
    font-size: 0.95rem !important;
  }
  
  .home-cards-container .field-value {
    font-size: 1.1rem !important;
  }
  
  /* Show all fields adjustments for large desktop */
  .home-cards-container.show-all-fields .account-card-body {
    gap: 1rem;
  }
  
  .home-cards-container.show-all-fields .account-field-item {
    padding: 0.7rem 0.5rem;
    min-height: 4.2rem;
  }
  
  .home-cards-container.show-all-fields .field-label {
    font-size: 0.9rem !important;
  }
  
  .home-cards-container.show-all-fields .field-value {
    font-size: 1rem !important;
  }
}

/* Mobile responsive adjustments for home cards */
@media (max-width: 768px) {
  .home-cards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .home-cards-container .mainContentCards {
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
  }
  
  .home-cards-container .account-card-body {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  
  .home-cards-container .account-field-item {
    /* Override layout only, inherit typography from mainContentCards */
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
  }
  
  .home-cards-container .field-label {
    /* Inherit color and font from mainContentCards, override layout */
    font-weight: 500;
    color: var(--text-light) !important;
    font-size: 1.1rem !important;
    margin-bottom: 0;
    text-align: left;
    flex: 1;
  }
  
  .home-cards-container .field-value {
    /* Inherit color and font from mainContentCards, override layout */
    font-weight: 600;
    color: var(--text-dark) !important;
    font-size: 1.1rem !important;
    text-align: right;
    word-break: break-word;
    max-width: 50%;
  }
  
  .home-cards-container .account-field-item:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/*──────────────────────────────────────────────
  Device Icon Styling
──────────────────────────────────────────────*/
.device-icon {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
  vertical-align: middle;
  /* Removed white filter - let icon display in natural colors */
}

/* Responsive device icon sizing */
@media (max-width: 768px) {
  .device-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.4rem;
  }
}

@media (max-width: 480px) {
  .device-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.3rem;
  }
}
