@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #F8F9FA;
  --header-bg: #2E2E33;
  --text-color: #A1A7B1;
  --text-muted: #6c757d;
  --heading-color: #2E2E33;
  --link-color: #2D9CDB;
  --link-hover: #4E7D96;
  --accent: #7AE0C9;
  --alert-color: #FF5F5F;
  --shadow: rgba(46, 46, 51, 0.1);
  --base-font-size: 10px;  /* Reduced by 3 sizes from 13px */
  --small-font-size: 8px;  /* Reduced by 3 sizes from 11px */
  --large-font-size: 12px; /* Reduced by 3 sizes from 15px */
  --heading-font-size: 15px; /* Reduced by 3 sizes from 18px */
  --subheading-font-size: 12px; /* Reduced by 3 sizes from 15px */
  --icon-font-size: 1rem; /* Reduced by 3 sizes from 1.2rem */
  --button-font-size: 10px; /* Reduced by 3 sizes from 13px */
  --table-font-size: 10px; /* Reduced by 3 sizes from 13px */
  --form-font-size: 10px; /* Reduced by 3 sizes from 13px */
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 0;
}

main {
  padding: 2rem;
}

h1 {
  font-size: 21px; /* Reduced by 3 sizes from 24px */
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--heading-color);
}

h2 {
  font-size: 17px; /* Reduced by 3 sizes from 20px */
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--heading-color);
}

h3 {
  font-size: 15px; /* Reduced by 3 sizes from 18px */
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--heading-color);
}

h4 {
  font-size: 13px; /* Reduced by 3 sizes from 16px */
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
}

h5 {
  font-size: 11px; /* Reduced by 3 sizes from 14px */
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
}

h6 {
  font-size: 10px; /* Reduced by 3 sizes from 16px */
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
}

p {
  font-size: 10px; /* Reduced by 3 sizes from 13px */
  line-height: 1.5;
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

small {
  font-size: 8px; /* Reduced by 3 sizes from 11px */
  color: var(--text-muted);
}

.btn {
  font-size: 10px; /* Reduced by 3 sizes from 13px */
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-sm {
  font-size: 11px; /* Reduced from 14px */
  padding: 0.375rem 0.75rem;
}

.btn-lg {
  font-size: 15px; /* Reduced from 18px */
  padding: 0.75rem 1.5rem;
}

.form-control {
  font-size: 13px; /* Reduced from 16px */
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: white;
  transition: border-color 0.2s ease;
}

.form-label {
  font-size: 13px; /* Reduced from 16px */
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.form-text {
  font-size: 11px; /* Reduced from 14px */
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.table {
  font-size: 13px; /* Reduced from 16px */
}

.table th {
  font-size: 13px; /* Reduced from 16px */
  font-weight: 600;
}

.table td {
  font-size: 13px; /* Reduced from 16px */
}

.nav-link {
  font-size: 13px; /* Reduced from 16px */
}

.sidebar-nav .nav-link {
  font-size: 13px; /* Reduced from 16px */
}

.page-header h1 {
  font-size: 24px; /* Reduced from 28px */
}

.page-header p {
  font-size: 13px; /* Reduced from 16px */
}

.section-header h3 {
  font-size: 18px; /* Reduced from 22px */
}

.section-header .section-description {
  font-size: 13px; /* Reduced from 16px */
}

.dashboard-card-label {
  font-size: 11px; /* Reduced from 14px */
}

.dashboard-card-value {
  font-size: 18px; /* Reduced from 22px */
}

.command-option-card h4 {
  font-size: 16px; /* Reduced from 20px */
}

.command-option-card p {
  font-size: 13px; /* Reduced from 16px */
}

.sensor-card h4 {
  font-size: 16px; /* Reduced from 20px */
}

.sensor-value {
  font-size: 18px; /* Reduced from 22px */
}

.sensor-time {
  font-size: 13px; /* Reduced from 16px */
}

.action-icon {
  font-size: 1.2rem; /* Keep relative sizing for icons */
}

.area-actions .action-icon {
  font-size: 1.2rem; /* Keep relative sizing for icons */
}

.users-table th {
  font-size: 13px; /* Reduced from 16px */
}

.users-table td {
  font-size: 13px; /* Reduced from 16px */
}

.info-label {
  font-size: 11px; /* Reduced from 14px */
}

.info-value {
  font-size: 13px; /* Reduced from 16px */
}

.empty-state h4 {
  font-size: 18px; /* Reduced from 22px */
}

.empty-state p {
  font-size: 13px; /* Reduced from 16px */
}

.page-footer p {
  font-size: 11px; /* Reduced from 14px */
}

/* === Additional Font Size Reductions === */
.sidebar {
  font-size: 13px; /* Reduced from 16px */
}

.sidebar-brand {
  font-size: 18px; /* Reduced from 22px */
}

.sidebar-nav .nav-item {
  font-size: 13px; /* Reduced from 16px */
}

.navbar-brand {
  font-size: 18px; /* Reduced from 22px */
}

.navbar-nav .nav-link {
  font-size: 13px; /* Reduced from 16px */
}

.dropdown-menu {
  font-size: 13px; /* Reduced from 16px */
}

.dropdown-item {
  font-size: 13px; /* Reduced from 16px */
}

.modal-title {
  font-size: 18px; /* Reduced from 22px */
}

.modal-body {
  font-size: 13px; /* Reduced from 16px */
}

.alert {
  font-size: 13px; /* Reduced from 16px */
}

.badge {
  font-size: 11px; /* Reduced from 14px */
}

.card-title {
  font-size: 16px; /* Reduced from 20px */
}

.card-text {
  font-size: 13px; /* Reduced from 16px */
}

.list-group-item {
  font-size: 13px; /* Reduced from 16px */
}

.pagination .page-link {
  font-size: 13px; /* Reduced from 16px */
}

.tooltip {
  font-size: 11px; /* Reduced from 14px */
}

.popover-title {
  font-size: 16px; /* Reduced from 22px */
}

.popover-content {
  font-size: 13px; /* Reduced from 16px */
}

.input-group-text {
  font-size: 13px; /* Reduced from 16px */
}

.custom-control-label {
  font-size: 13px; /* Reduced from 16px */
}

.custom-select {
  font-size: 13px; /* Reduced from 16px */
}

.text-muted {
  font-size: 11px; /* Reduced from 14px */
}

.lead {
  font-size: 15px; /* Reduced from 18px */
}

.display-1 {
  font-size: 36px; /* Reduced from 42px */
}

.display-2 {
  font-size: 32px; /* Reduced from 38px */
}

.display-3 {
  font-size: 28px; /* Reduced from 34px */
}

.display-4 {
  font-size: 24px; /* Reduced from 30px */
}

a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
}

label {
  display: block;
  margin-top: 1rem;
}

/* Forms */
form {
  max-width: 400px;
}
.input-field {
  padding: 0.5rem;
  border: 1px solid var(--text-color);
  border-radius: 4px;
  width: 100%;
  max-width: 300px;
  margin-top: 0.25rem;
  color: var(--text-color);
  background-color: white;
}
.btn-primary {
  padding: 0.9rem 1.25rem;
  background-color: var(--link-color);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: 100%;
  max-width: 400px;
}
.btn-primary:hover {
  background-color: var(--link-hover);
}
.btn-secondary {
  padding: 0.6rem 1.2rem;
  background-color: transparent;
  border: 1px solid var(--link-color);
  color: var(--link-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background-color: var(--link-color);
  color: white;
}

/* Flash messages */
.flashes {
  margin: 1rem 2rem;
  padding: 1rem;
  background-color: var(--accent);
  border-left: 4px solid var(--link-color);
  color: var(--heading-color);
  box-shadow: 0 1px 3px var(--shadow);
}
.flashes ul {
  margin: 0;
  padding-left: 1.2rem;
}
.flashes li {
  list-style-type: disc;
}
.error {
  color: var(--alert-color);
  font-weight: bold;
}

/* Login Styles */
.login-container {
  background-color: rgba(46, 46, 51, 0.95) !important;
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px var(--shadow);
  max-width: 480px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(4px);
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}
.login-title {
  margin-bottom: 2rem;
  font-size: 1.8rem;
  color: #F8F9FA !important;
}
.login-inline-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.input-glass {
  width: 100%;
  max-width: 400px;
  padding: 0.9rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 30px;
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(8px);
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.input-glass::placeholder {
  color: rgba(255, 255, 255, 0.8);
}
.login-btn {
  width: 100%;
  max-width: 400px;
  margin-top: 1rem;
  padding: 0.9rem 1.25rem;
  font-size: 1rem;
  border-radius: 30px;
}

/* Animation Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Dashboard Layout === */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
  overflow-y: auto; /* Allow vertical scrolling */
}

/* Ensure body allows sticky positioning */
body {
  margin: 0;
  padding-top: 60px; /* Account for fixed header height */
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

/* === Top Navigation Styles === */
.top-nav {
  background-color: #2E2E33;
  color: #F8F9FA;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  width: 100% !important;
  height: 60px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0; /* Prevent shrinking in flex container */
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 60px;
}

/* Logo Section */
.nav-logo {
  display: flex;
  align-items: center;
  padding: 0.5rem;
}

.logo-img {
  width: 36px;
  height: auto;
}

/* Navigation Menu */
.top-nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: #F8F9FA;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Logout Section */
.nav-logout {
  display: flex;
  align-items: center;
}

.logout-link {
  color: #F8F9FA;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.logout-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Menu Icons */
.menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.menu-label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* === Icon Size === */
.menu-icon {
  font-size: 1rem;
}

/* === Main Content === */
.dashboard-content {
  flex: 1;
  padding: 1rem;
  position: relative;
  overflow-y: auto;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 0.5rem;
  }
  
  .nav-link, .logout-link {
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
  }
  
  .menu-label {
    font-size: 0.8rem;
  }
  
  .dashboard-content {
    padding: 0.75rem;
  }
}

@media (max-width: 600px) {
  .top-nav-menu {
    gap: 0.25rem;
  }
  
  .nav-link, .logout-link {
    padding: 0.3rem 0.4rem;
  }
  
  .menu-label {
    font-size: 0.75rem;
  }
  
  .logo-img {
    width: 28px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 0.25rem;
  }
  
  .nav-link, .logout-link {
    padding: 0.25rem 0.3rem;
  }
  
  .menu-label {
    font-size: 0.7rem;
  }
  
  .menu-icon {
    font-size: 0.9rem;
  }
}

/* === Dashboard Overview Cards === */
.dashboard-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  flex: 1;
  min-width: 220px;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-family: 'Lato', sans-serif;
}

.dashboard-card-label {
  color: #3B5896;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.dashboard-card-value {
  font-size: 18px;
  color: #2B2D42;
}

.dashboard-card-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dashboard-card-link:hover {
  color: var(--link-color);
}

/* === Dashboard Card Header with Actions === */
.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.dashboard-card-header-content {
  flex: 1;
}

.dashboard-card-header-actions {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.dashboard-card-header h3 {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
}

.dashboard-card-header p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
}

/* === Responsive Dashboard Card Header === */
@media (max-width: 768px) {
  .dashboard-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .dashboard-card-header-actions {
    margin-top: 0;
  }
}

.dashboard-card-content {
  width: 100%;
}

/* Ensure forms in dashboard cards take full width */
.dashboard-card .settings-form,
.dashboard-card form,
.dashboard-card .form-section,
.dashboard-card .form-group,
.dashboard-card .form-control {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}

/* Override global form width constraint for dashboard forms */
.dashboard-card form,
.dashboard-cards form,
.dashboard-content form {
  max-width: none !important;
  width: 100% !important;
}

/* Ensure form elements inside dashboard cards are full width */
.dashboard-card input,
.dashboard-card select,
.dashboard-card textarea,
.dashboard-card .form-control {
  width: 100% !important;
  max-width: none !important;
}

/* Full-width stacked cards for edit/create area pages */
.edit-area-cards .dashboard-cards {
  display: block;
  flex-wrap: none;
}

.edit-area-cards .dashboard-card {
  flex: none;
  width: 100%;
  margin-bottom: 1.5rem;
}

.edit-area-cards .dashboard-card:last-child {
  margin-bottom: 0;
}

/* Dashboard Button Styles using color palette */
.btn-primary {
  background-color: #2D9CDB !important;
  border-color: #2D9CDB !important;
  color: white !important;
  transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #1a7bb3 !important;
  border-color: #1a7bb3 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(45, 156, 219, 0.3);
}

.btn-cancel {
  background-color: #A1A7B1 !important;
  border-color: #A1A7B1 !important;
  color: white !important;
  transition: all 0.3s ease;
  text-decoration: none !important;
  display: inline-block !important;
}

.btn-cancel:hover,
.btn-cancel:focus,
.btn-cancel:active {
  background-color: #FF5F5F !important;
  border-color: #FF5F5F !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 95, 95, 0.3);
  text-decoration: none !important;
}

.btn-danger {
  background-color: #FF5F5F !important;
  border-color: #FF5F5F !important;
  color: white !important;
  transition: all 0.3s ease;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
  background-color: #e54545 !important;
  border-color: #e54545 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 95, 95, 0.3);
}

/* Ensure consistent button text colors */
.btn-primary,
.btn-cancel,
.btn-danger {
  text-decoration: none !important;
}

.btn-primary:hover,
.btn-cancel:hover,
.btn-danger:hover {
  text-decoration: none !important;
}

/* Force Cancel button styling */
a.btn-cancel,
button.btn-cancel {
  background-color: #A1A7B1 !important;
  border-color: #A1A7B1 !important;
  color: white !important;
  border-radius: 0.375rem !important;
  padding: 0.5rem 1rem !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  text-decoration: none !important;
  display: inline-block !important;
  font-weight: 400 !important;
  text-align: center !important;
  vertical-align: middle !important;
  cursor: pointer !important;
  user-select: none !important;
  border: 1px solid transparent !important;
  transition: all 0.3s ease !important;
}

a.btn-cancel:hover,
button.btn-cancel:hover {
  background-color: #FF5F5F !important;
  border-color: #FF5F5F !important;
  color: white !important;
  text-decoration: none !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(255, 95, 95, 0.3) !important;
}

/* Notes field sizing for edit/create area forms */
.edit-area-cards textarea#notes {
  min-height: 80px;
  resize: vertical;
}

.edit-area-cards .form-group {
  margin-bottom: 1.5rem;
}

/* Sensors table styling (matching areas table) */
.sensors-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

/* Removed conflicting table styling - using the corrected rules below */

/* Sensor row styling */
.sensor-row {
  /* Remove transition to prevent interference with table hover */
}

.sensor-row.sensor-inactive {
  opacity: 0.7;
  background-color: #f8f9fa;
}

.sensor-row.sensor-inactive:hover {
  opacity: 0.9;
  background-color: #e9ecef;
}

.sensor-name strong {
  color: #2B2D42;
  font-size: 1.1rem;
}

.sensor-area .area-name {
  font-weight: 500;
  color: #2B2D42;
  background: #e3f2fd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.hardware-type {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hardware-type-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--heading-color);
}

.hardware-icon {
  font-size: 1.1rem;
}

.hardware-config-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 1.5rem;
  border-left: 2px solid #e0e0e0;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

.config-key {
  color: #6c757d;
  font-weight: 500;
  min-width: fit-content;
}

.config-value {
  color: var(--text-color);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  background: #f8f9fa;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  border: 1px solid #e9ecef;
}

/* === Responsive Hardware Type Layout === */
@media (max-width: 768px) {
  .hardware-config-details {
    padding-left: 1rem;
    border-left-width: 1px;
  }
  
  .config-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .config-key {
    min-width: auto;
  }
  
  .config-value {
    width: 100%;
    word-break: break-all;
  }
}

/* Entities list styling */
.entities-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.entity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.entity-name {
  font-weight: 500;
  color: #2B2D42;
}

.entity-type {
  background: #e9ecef;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #6c757d;
}

.entity-unit {
  color: #6c757d;
  font-size: 0.9rem;
}

.entity-actions {
  margin-left: auto;
}

/* Status badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.action-buttons .btn {
  margin: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 4px;
}

.action-buttons .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Area Overview Cards Styling */
.area-status {
  margin: 0.5rem 0;
  text-align: center;
}

.area-controls {
  margin: 0.5rem 0;
  text-align: center;
}

.area-actions {
  margin-top: 0.5rem;
  text-align: center;
}

.area-controls .btn {
  margin: 0.25rem;
  min-width: 80px;
}

.area-actions .btn {
  margin: 0.25rem;
  min-width: 80px;
}

/* Status badges for areas */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-armed {
  background-color: #FF5F5F;
  color: white;
}

.status-disarmed {
  background-color: #7AE0C9;
  color: white;
}

/* Ensure area cards in gateway commands grid look good */
.gateway-commands-grid .command-option-card {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gateway-commands-grid .command-option-card h4 {
  margin-bottom: 0.5rem;
  text-align: center;
}

.gateway-commands-grid .command-option-card p {
  text-align: center;
  margin-bottom: 1rem;
}

/* Area management table styling */
.area-name strong {
  color: #2B2D42;
  font-weight: 600;
}

.area-description {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sensor-count a, .output-count a {
  text-decoration: none;
  font-weight: 500;
}

.sensor-count a:hover, .output-count a:hover {
  text-decoration: underline;
}

.action-buttons .btn {
  margin: 0.25rem;
  min-width: 60px;
}

/* === Site Table === */
.sites-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lato', sans-serif;
}

.sites-table thead {
  background: #F3F3F3;
}

.sites-table th,
.sites-table td {
  padding: 0.75rem;
  color: #2B2D42;
  text-align: left;
}

.sites-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.site-settings-button {
  background: #3B5896;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s ease;
}

.site-settings-button:hover {
  background: #2B2D42;
}

/* === Users Table === */
.users-table-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 2rem;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lato', sans-serif;
}

.users-table thead {
  background: #F3F3F3;
}

.users-table th,
.users-table td {
  padding: 0.75rem;
  color: #2B2D42;
  text-align: left;
}

.users-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.users-table tr:hover {
  background-color: #f8f9fa;
}

/* === Page Header & Footer === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e0e0e0;
}

.text-muted {
  color: #6c757d;
  font-size: 14px;
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
}

.empty-state p {
  margin: 0 0 1.5rem 0;
  color: #6c757d;
}

/* === Filters Section === */
.filters-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filters-container h3 {
  margin: 0 0 1rem 0;
  color: var(--heading-color);
  font-size: 1.1rem;
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group-wide {
  grid-column: span 2;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.filter-group select,
.filter-group input {
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(45, 156, 219, 0.1);
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid #e0e0e0;
}

/* === Events Table === */
.events-table-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.table-header h3 {
  margin: 0;
  color: var(--heading-color);
  font-size: 1.1rem;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lato', sans-serif;
}

.events-table thead {
  background: #F3F3F3;
}

.events-table th,
.events-table td {
  padding: 1rem 0.75rem;
  color: #2B2D42;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.events-table th {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.events-table tr:hover {
  background-color: #f8f9fa;
}

.event-row {
  transition: background-color 0.2s ease;
}

.event-time {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  color: #6c757d;
  white-space: nowrap;
}

.event-site {
  min-width: 200px;
}

.site-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-name {
  font-weight: 500;
  color: var(--heading-color);
}

.site-id {
  font-size: 0.8rem;
  color: #6c757d;
  font-family: 'Monaco', 'Menlo', monospace;
}

.event-type {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  color: var(--text-color);
  max-width: 200px;
  word-break: break-word;
}

.event-category {
  min-width: 120px;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  min-width: 80px;
}

.category-alarm {
  background-color: #fef3c7;
  color: #92400e;
}

.category-restore {
  background-color: #d1fae5;
  color: #065f46;
}

.category-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.category-alerts {
  background-color: #fecaca;
  color: #991b1b;
}

.event-source {
  font-size: 0.85rem;
  color: #6c757d;
  max-width: 120px;
  word-break: break-word;
}

.event-details {
  max-width: 300px;
  word-break: break-word;
  line-height: 1.4;
}

/* === Export Button === */
.btn-export {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-export:hover {
  background-color: #218838;
  color: white;
}

/* === Pagination === */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.pagination-info {
  color: #6c757d;
  font-size: 0.9rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 2.5rem;
  text-align: center;
}

.pagination-link:hover {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

.pagination-current {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background-color: var(--link-color);
  color: white;
  border-radius: 4px;
  min-width: 2.5rem;
  text-align: center;
  font-weight: 500;
}

.pagination-ellipsis {
  padding: 0.5rem 0.25rem;
  color: #6c757d;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* === Date Inputs === */
.filter-group input[type="date"] {
  font-family: inherit;
  position: relative;
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.filter-group input[type="date"]::-webkit-inner-spin-button,
.filter-group input[type="date"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-group input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

.filter-group input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.filter-group input[type="date"]::-webkit-datetime-edit-text {
  padding: 0 2px;
}

.filter-group input[type="date"]::-webkit-datetime-edit-month-field,
.filter-group input[type="date"]::-webkit-datetime-edit-day-field,
.filter-group input[type="date"]::-webkit-datetime-edit-year-field {
  padding: 0 2px;
}

/* === Settings Page === */
.settings-section {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  gap: 1rem;
}

.section-header h3 {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
}

.section-header-content {
  flex: 1;
}

.section-header-actions {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.section-description {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
}

/* === Control Areas Container === */
.control-areas-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: center;
}

.control-areas-container .command-option-card {
  flex: 0 0 auto;
  min-width: 250px;
  max-width: 350px;
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .section-header-actions {
    margin-top: 0;
  }
  
  .control-areas-container .command-option-card {
    min-width: 100%;
    max-width: none;
  }
}

.settings-form {
  margin-bottom: 1rem;
  width: 100%;
}

.full-width-form {
  width: 100%;
  max-width: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: start;
  width: 100%;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  color: var(--text-color);
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(45, 156, 219, 0.1);
}

.form-select {
  cursor: pointer;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
}

.form-help {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #6c757d;
  font-style: italic;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: 0;
}

/* === Timeout Info Card === */
.timeout-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.info-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-content h4 {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1rem;
}

.info-content ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #6c757d;
  font-size: 0.9rem;
}

.info-content li {
  margin-bottom: 0.25rem;
}

/* === Account Info Grid === */
.account-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.info-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.info-value {
  font-size: 1rem;
  color: var(--heading-color);
  font-weight: 500;
}

/* === Flash Messages === */
.flashes-container {
  margin-bottom: 2rem;
}

.flash-message {
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--accent);
  border-left: 4px solid var(--link-color);
  color: var(--heading-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* === Session Warning Banner === */
.session-warning {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  animation: slideDown 0.3s ease-out;
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
}

.warning-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
  font-weight: 500;
}

.warning-dismiss {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.warning-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* === Site Detail Page === */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.action-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.action-card:hover {
  background: white;
  border-color: var(--link-color);
  box-shadow: 0 4px 12px rgba(45, 156, 219, 0.15);
  transform: translateY(-2px);
}

.action-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8f9fa;
  border-color: #dee2e6;
}

.action-card.disabled:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  box-shadow: none;
  transform: none;
}

.action-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.action-content h4 {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1.1rem;
}

.action-content p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* === Gateway Info Grid === */
.gateway-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* === Sensors Grid === */
.sensors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.sensor-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sensor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.sensor-header h4 {
  margin: 0;
  color: var(--heading-color);
  font-size: 1.1rem;
}

.sensor-status {
  font-size: 0.8rem;
  color: #28a745;
  font-weight: 500;
}

.sensor-data {
  margin-bottom: 1rem;
}

.sensor-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 0.25rem;
}

.sensor-time {
  font-size: 0.9rem;
  color: #6c757d;
}

.sensor-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* === Coming Soon Card === */
.coming-soon-card {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px dashed #dee2e6;
  border-radius: 16px;
  margin: 1rem 0;
}

.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.coming-soon-card h4 {
  margin: 0 0 1rem 0;
  color: var(--heading-color);
  font-size: 1.5rem;
}

.coming-soon-card p {
  margin: 0 0 1rem 0;
  color: #6c757d;
  font-size: 1rem;
  line-height: 1.6;
}

.coming-soon-card ul {
  text-align: left;
  max-width: 400px;
  margin: 1rem auto;
  padding-left: 1.5rem;
}

.coming-soon-card li {
  margin-bottom: 0.5rem;
  color: #6c757d;
}

.coming-soon-note {
  margin-top: 1.5rem !important;
  padding: 1rem;
  background: rgba(45, 156, 219, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(45, 156, 219, 0.2);
  color: var(--link-color) !important;
}

/* === Dashboard Button Updates === */
.configure-gateway-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  background: var(--link-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}

.configure-gateway-button:hover {
  background: #1e88e5;
  color: white;
  text-decoration: none;
}

/* === Gateway Configuration Grid === */
.gateway-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.config-option-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.config-option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.config-option-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.config-option-card h4 {
  margin: 0 0 0.75rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
  font-weight: 600;
}

.config-option-card p {
  margin: 0 0 1.5rem 0;
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.4;
}

.config-option-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.config-option-link:hover {
  background: var(--primary-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

/* === Gateway Commands Grid === */
.gateway-commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-template-rows: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.command-option-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.command-option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--warning-color);
}

.command-option-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.command-option-card h4 {
  margin: 0 0 0.75rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
  font-weight: 500;
}

.command-option-card p {
  margin: 0 0 1.5rem 0;
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.4;
}

.command-option-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--warning-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.command-option-link:hover {
  background: var(--warning-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

.command-option-disabled {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #6c757d;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Ensure command option links work as buttons */
.command-option-link {
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: var(--warning-color);
  color: white;
  text-decoration: none;
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.command-option-link:hover {
  background: var(--warning-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #6c757d;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h4 {
  margin: 0 0 1rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* === Sites Page === */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.site-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.site-card:hover {
  border-color: var(--link-color);
  box-shadow: 0 4px 12px rgba(45, 156, 219, 0.15);
  transform: translateY(-2px);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.site-header h4 {
  margin: 0;
  color: var(--heading-color);
  font-size: 1.2rem;
}

.site-status {
  font-size: 0.8rem;
  color: #28a745;
  font-weight: 500;
}

.site-info {
  margin-bottom: 1.5rem;
}

.site-id {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.site-timezone {
  font-size: 0.9rem;
  color: #6c757d;
}

.site-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-actions .btn {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

/* === Timezone Note === */
.timezone-note {
  color: #6c757d;
  font-size: 0.8rem;
  font-style: italic;
}

/* === Site Settings Grid === */
.site-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* === User Actions === */
.user-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.action-icon {
  display: inline-block;
  padding: 0.5rem;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--link-color);
  border-radius: 6px;
  transition: all 0.2s ease;
  background: rgba(45, 156, 219, 0.1);
}

.action-icon:hover {
  background: rgba(45, 156, 219, 0.2);
  color: var(--link-color);
  transform: scale(1.1);
}

/* === User Info Grid === */
.user-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* === Notification Preferences === */
.notifications-form {
  width: 100%;
  max-width: none;
  display: block;
}

.notifications-form .notification-area-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Override any form element width constraints */
.notifications-form,
.notifications-form * {
  max-width: none !important;
}

/* Ensure the form container doesn't constrain width */
.notifications-form {
  min-width: 100%;
  width: 100%;
  max-width: none;
  display: block;
}

/* === Header with Inline Controls === */
.header-with-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.header-content {
  flex: 1;
}

.header-controls {
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.inline-site-form {
  margin: 0;
}

.inline-site-form .form-select {
  min-width: 250px;
  padding: 0.5rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  font-size: 0.95rem;
}

/* === Global Controls === */
.global-controls {
  margin-bottom: 2rem;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.section-heading {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-description {
  margin: 0 0 1.5rem 0;
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.4;
}

.global-toggle-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.global-toggle-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.global-toggle-buttons .btn {
  font-size: 0.85rem;
  padding: 0.75rem 0.5rem;
  min-width: auto;
  white-space: nowrap;
  text-align: center;
}

.global-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
}

.global-actions .btn {
  min-width: 160px;
  padding: 0.75rem 1.5rem;
}

.site-selection-form {
  margin-bottom: 1rem;
}

.notification-legend {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  justify-content: center;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  min-width: 140px;
}

.legend-icon {
  font-size: 1.5rem;
}

.legend-text {
  font-size: 0.9rem;
  color: var(--heading-color);
  font-weight: 600;
}

.legend-description {
  font-size: 0.8rem;
  color: #6c757d;
  text-align: center;
  line-height: 1.3;
}

.notification-area-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: block;
}

.notification-area-card:last-child {
  margin-bottom: 0;
}

.area-card-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--link-color);
}

.area-card-title {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.area-card-description {
  margin: 0;
  color: #6c757d;
  font-size: 1rem;
  font-style: italic;
}

.notification-types-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notification-type-row {
  display: grid;
  grid-template-columns: 2fr 3fr 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.notification-type-row:hover {
  background: white;
  border-color: var(--link-color);
  box-shadow: 0 2px 8px rgba(45, 156, 219, 0.15);
}

.notification-type-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-type-name {
  font-weight: 600;
  color: var(--heading-color);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notification-type-severity {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  display: inline-block;
  align-self: flex-start;
}

.notification-channels-header {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  text-align: center;
  justify-content: center;
}

.channel-header {
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  padding: 0.25rem;
  min-width: 60px;
}

.severity-critical {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.severity-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.severity-emergency {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
  font-weight: 600;
}

.severity-info {
  background: rgba(45, 156, 219, 0.1);
  color: var(--link-color);
  border: 1px solid rgba(45, 156, 219, 0.2);
}

.notification-type-description {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
}

.notification-channels-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.channels-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #495057;
  padding: 0.25rem;
}

.notification-channels-checkboxes {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.checkbox-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #f8f9fa;
  transition: all 0.2s ease;
  min-width: 110px;
}

.checkbox-option:hover {
  background: white;
  border-color: var(--link-color);
  box-shadow: 0 2px 8px rgba(45, 156, 219, 0.15);
}

.checkbox-option input[type="checkbox"] {
  margin-right: 0.75rem;
  transform: scale(1.2);
}

.checkbox-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  user-select: none;
}

/* === Mobile === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    width: 240px;
  }

  .sidebar.collapsed {
    transform: translateX(0);
  }

  .dashboard-content {
    padding: 1rem;
  }

  .sidebar-toggle {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    background-color: #2E2E33;
    border-radius: 8px;
  }

  .page-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .users-table {
    font-size: 14px;
  }

  .users-table th,
  .users-table td {
    padding: 0.5rem;
  }

  .dashboard-cards {
    flex-direction: column;
  }

  .dashboard-card {
    min-width: auto;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-group-wide {
    grid-column: span 1;
  }

  .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions .btn {
    width: 100%;
    text-align: center;
  }

  .export-info {
    margin-top: 0.5rem;
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
  }

  /* Settings mobile adjustments */
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .account-info-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    flex-direction: column;
    text-align: center;
  }

  .settings-section {
    padding: 1rem;
  }

  /* Session warning mobile adjustments */
  .warning-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .warning-dismiss {
    align-self: flex-end;
  }

  /* Site detail mobile adjustments */
  .action-grid {
    grid-template-columns: 1fr;
  }

  .gateway-info-grid {
    grid-template-columns: 1fr;
  }

  .sensors-grid {
    grid-template-columns: 1fr;
  }

  .action-card {
    flex-direction: column;
    text-align: center;
  }

  .coming-soon-card {
    padding: 2rem 1rem;
  }

  .coming-soon-card ul {
    max-width: none;
  }

  .configure-gateway-button {
    display: block;
    margin: 0.5rem 0 0 0;
    text-align: center;
  }

  .gateway-config-grid,
  .gateway-commands-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .config-option-card,
  .command-option-card {
    padding: 1rem;
  }

  .config-option-icon,
  .command-option-icon {
    font-size: 2rem;
  }

  /* Sites page mobile adjustments */
  .sites-grid {
    grid-template-columns: 1fr;
  }

  .site-actions {
    flex-direction: column;
  }

  .site-actions .btn {
    min-width: auto;
  }

  /* Site settings grid mobile adjustments */
  .site-settings-grid {
    grid-template-columns: 1fr;
  }

  /* Edit site page mobile adjustments */
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* User actions mobile adjustments */
  .user-actions {
    flex-direction: column;
    gap: 0.25rem;
  }

  .action-icon {
    padding: 0.75rem;
    font-size: 1.4rem;
  }

  /* User info grid mobile adjustments */
  .user-info-grid {
    grid-template-columns: 1fr;
  }

  /* Notification preferences mobile adjustments */
  .notification-legend {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .legend-item {
    min-width: auto;
    padding: 0.75rem;
  }

  .notification-area-card {
    padding: 1.5rem;
  }

  .notification-type-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }

  .notification-type-header {
    align-items: center;
  }

  .notification-channels-header {
    order: -1;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .notification-channels-checkboxes {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .header-with-controls {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .header-controls {
    margin-top: 0;
  }

  .inline-site-form .form-select {
    min-width: auto;
    width: 100%;
  }

  .global-controls {
    padding: 1.5rem;
  }

  .global-toggle-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .global-toggle-buttons .btn {
    padding: 0.75rem 0.25rem;
    font-size: 0.8rem;
  }

  .global-actions {
    flex-direction: column;
  }

  .global-actions .btn {
    min-width: auto;
    width: 100%;
  }

  .checkbox-option {
    min-width: auto;
    justify-content: center;
    width: 100%;
  }

  .table-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .events-table {
    font-size: 14px;
  }

  .events-table th,
  .events-table td {
    padding: 0.5rem;
  }

  .event-site {
    min-width: auto;
  }

  .category-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    min-width: 60px;
  }

  .pagination-container {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pagination-pages {
    justify-content: center;
  }

  .pagination-link,
  .pagination-current {
    min-width: 2rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* === Area Management Styles === */
.area-name strong { 
  display: block; 
  margin-bottom: 0.25rem; 
}

.area-name .text-muted { 
  font-size: 0.875rem; 
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-armed {
  background-color: var(--danger-color);
  color: white;
}

.status-disarmed {
  background-color: var(--success-color);
  color: white;
}

.status-scheduled {
  background-color: var(--warning-color);
  color: white;
}

.auto-features .badge {
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.delays .small {
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.device-counts .small {
  margin-bottom: 0.25rem;
}

.created-info .small {
  margin-bottom: 0.25rem;
}

.created-info .smaller {
  font-size: 0.75rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.action-buttons .btn {
  min-width: auto;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.action-buttons form {
  margin: 0;
}

/* Ensure delete modal is hidden by default but can be shown by Bootstrap */
#deleteAreaModal {
  display: none;
}

#deleteAreaModal.show {
  display: block;
}

/* Info items styling */
.info-item {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.info-label {
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.info-value {
  display: block;
  color: var(--heading-color);
  font-size: 1rem;
}

/* Status badges for areas */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-armed {
  background-color: #FF5F5F;
  color: white;
}

.status-badge.status-disarmed {
  background-color: #7AE0C9;
  color: white;
}

/* Disabled button styling */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Delete confirmation input validation styling */
#deleteConfirmationInput.is-valid {
  border-color: #7AE0C9;
  box-shadow: 0 0 0 0.2rem rgba(122, 224, 201, 0.25);
}

#deleteConfirmationInput.is-invalid {
  border-color: #FF5F5F;
  box-shadow: 0 0 0 0.2rem rgba(255, 95, 95, 0.25);
}

#deleteConfirmationInput.is-valid:focus {
  border-color: #7AE0C9;
  box-shadow: 0 0 0 0.2rem rgba(122, 224, 201, 0.25);
}

#deleteConfirmationInput.is-invalid:focus {
  border-color: #FF5F5F;
  box-shadow: 0 0 0 0.2rem rgba(255, 95, 95, 0.25);
}

/* Timestamp display styling */
.info-value small {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: block;
}

.info-value small.text-muted {
  color: #6c757d !important;
}

/* Timestamp and timezone layout */
.info-value div[id*="Timestamp"] {
  margin-bottom: 0.25rem;
  font-weight: 500;
}

/* Form layout improvements */
.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section h4 {
  margin-bottom: 1.5rem;
  color: var(--heading-color);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
  display: block;
}

.form-group .form-control {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease;
}

.form-group .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check {
  padding: 1rem;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.form-check:hover {
  background: #e9ecef;
  border-color: var(--primary-color);
}

.form-check-input:checked + .form-check-label {
  color: var(--primary-color);
  font-weight: 600;
}

/* Timezone dropdown styling */
select optgroup {
  font-weight: 600;
  color: var(--primary-color);
  background-color: #f8f9fa;
}

select optgroup option {
  font-weight: 400;
  color: var(--text-color);
  background-color: white;
  padding-left: 1rem;
}

select optgroup option:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Coming Soon Card Styling */
.coming-soon-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.coming-soon-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.coming-soon-header {
  margin-bottom: 1.5rem;
}

.coming-soon-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.coming-soon-header h5 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.coming-soon-text {
  color: #6c757d;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
  text-align: center;
  width: 100%;
}

.coming-soon-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 1.2rem;
}

.feature-item span:last-child {
  font-weight: 500;
  color: #495057;
  font-size: 0.95rem;
}

/* Custom Three-Colored Squares Icon for Areas */
.areas-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 1.2em;
  vertical-align: middle;
}

.areas-icon .square {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.areas-icon .square-1 {
  background-color: #FF5F5F;
}

.areas-icon .square-2 {
  background-color: #4E7D96;
}

.areas-icon .square-3 {
  background-color: #A1A7B1;
}

/* Ensure delete confirmation modal is properly styled */
#deleteConfirmationModal .modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

#deleteConfirmationModal .modal-content {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#deleteConfirmationModal .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#deleteConfirmationModal .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Tips Grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.tip-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.tip-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.tip-content h5 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
}

.tip-content p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Form Sections */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section h4 {
  margin: 0 0 1rem 0;
  color: var(--heading-color);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Responsive stats grid for smaller screens */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

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

/* Threshold indicator styling */
.threshold-indicator {
    display: inline-block;
    margin-right: 8px;
    font-size: 14px;
    color: #FF6B35;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.threshold-indicator:hover {
    animation: none;
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

/* Entity settings form and other dashboard forms should be full width */
#thresholdForm,
.dashboard-card form,
.dashboard-cards form {
  max-width: none !important;
  width: 100% !important;
}

/* Ensure all form elements in dashboard are full width */
.dashboard-card input,
.dashboard-card select,
.dashboard-card textarea,
.dashboard-card .form-control,
.dashboard-cards input,
.dashboard-cards select,
.dashboard-cards textarea,
.dashboard-cards .form-control {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}

/* Override the global form constraint for dashboard pages */
.dashboard-content form,
.dashboard-layout form {
  max-width: none !important;
  width: 100% !important;
}

/* Entity settings form action buttons */
#thresholdForm .row:last-child {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

#thresholdForm .btn {
  margin: 0;
  height: 48px;
  font-size: 1rem;
  font-weight: 500;
}

/* Ensure buttons are properly aligned in the actions row */
#thresholdForm .row:last-child .col-md-6 {
  display: flex;
  align-items: center;
}

#thresholdForm .row:last-child .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Site cards with different states */
.site-card-pending {
  opacity: 0.8;
  border: 2px dashed #dee2e6;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.site-card-pending:hover {
  opacity: 1;
  border-color: #ffc107;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.site-status-pending {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.gateway-info {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #e3f2fd;
  border-radius: 4px;
  border: 1px solid #bbdefb;
  font-size: 0.9rem;
}

.gateway-status {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #fff3cd;
  border-radius: 4px;
  border: 1px solid #ffeaa7;
  font-size: 0.9rem;
}

.text-warning {
  color: #856404 !important;
  font-weight: 500;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.sites-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.sites-section h4 {
  margin: 0 0 0.5rem 0;
  color: var(--heading-color);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-state-actions {
  margin-top: 1.5rem;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-actions ul {
  margin: 1rem 0 0 0;
  padding-left: 1.5rem;
  text-align: left;
}

.empty-state-actions li {
  margin-bottom: 0.5rem;
  color: #6c757d;
  line-height: 1.4;
}

/* Disabled primary button styling */
.btn-primary:disabled,
.btn-primary[disabled] {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
  transform: none !important;
  box-shadow: none !important;
}

/* === Area Actions Styling === */
.area-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.action-icons-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  min-height: 2.5rem;
}

.area-actions .action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--link-color);
  border-radius: 6px;
  transition: all 0.2s ease;
  background: rgba(45, 156, 219, 0.1);
  border: none;
  cursor: pointer;
  line-height: 1;
}

.area-actions .action-icon:hover {
  background: rgba(45, 156, 219, 0.2);
  color: var(--link-color);
  transform: scale(1.1);
}

.area-actions .action-icon.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  width: 2rem;
  height: 2rem;
}

.area-actions .action-icon.disabled:hover {
  transform: none;
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.area-actions .delete-icon {
  background: rgba(255, 95, 95, 0.1);
  color: #FF5F5F;
  width: 2rem;
  height: 2rem;
}

.area-actions .delete-icon:hover {
  background: rgba(255, 95, 95, 0.2);
  color: #FF5F5F;
}

/* === Table Alignment Fixes === */
.users-table td {
  vertical-align: middle;
}

.users-table .area-actions {
  vertical-align: middle;
}

/* Ensure consistent button sizing across all action types */
.area-actions .action-icon,
.area-actions .action-icon.disabled,
.area-actions .delete-icon {
  box-sizing: border-box;
  flex-shrink: 0;
}

/* === Sensor Table Column Widths === */
.sensors-table th:nth-child(1), /* Sensor Name */
.sensors-table td:nth-child(1) {
  width: 15%; /* Reduced from ~30% to 15% (50% reduction) */
  max-width: 200px;
}

.sensors-table th:nth-child(2), /* Hardware Type */
.sensors-table td:nth-child(2) {
  width: 20%;
  min-width: 180px;
}

.sensors-table th:nth-child(3), /* Entities */
.sensors-table td:nth-child(3) {
  width: 35%;
  min-width: 250px;
}

.sensors-table th:nth-child(4), /* Area */
.sensors-table td:nth-child(4) {
  width: 10%;
  min-width: 100px;
}

.sensors-table th:nth-child(5), /* Monitoring */
.sensors-table td:nth-child(5) {
  width: 10%;
  min-width: 100px;
}

.sensors-table th:nth-child(6), /* Actions */
.sensors-table td:nth-child(6) {
  width: 10%;
  min-width: 120px;
}

/* === Sensor Actions Styling === */
.sensor-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sensor-actions .action-icons-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  min-height: 2.5rem;
}

.sensor-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

.sensor-actions .btn:hover {
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
}

.sensor-actions .btn:focus {
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.sensor-actions .btn:active {
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Additional sensor action button styling */
.sensor-actions .btn-outline-secondary {
  color: #6c757d !important;
  background-color: rgba(108, 117, 125, 0.1) !important;
}

.sensor-actions .btn-outline-secondary:hover {
  color: #6c757d !important;
  background-color: rgba(108, 117, 125, 0.2) !important;
  transform: scale(1.1);
}

.sensor-actions .btn-outline-danger {
  color: #FF5F5F !important;
  background-color: #f8f9fa !important;
}

.sensor-actions .btn-outline-danger:hover {
  color: #FF5F5F !important;
  background-color: #e9ecef !important;
  transform: scale(1.1);
}

.sensor-actions .btn-outline-success {
  color: #7AE0C9 !important;
  background-color: #f8f9fa !important;
}

.sensor-actions .btn-outline-success:hover {
  color: #7AE0C9 !important;
  background-color: #e9ecef !important;
  transform: scale(1.1);
}

/* === Fix for Table Row Separator Lines === */
.sensors-table {
  border-collapse: collapse;
  border-spacing: 0;
}

.sensors-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.sensors-table tr:last-child {
  border-bottom: none;
}

.sensors-table td {
  padding: 1rem 0.75rem;
  border: none;
  background: transparent;
}

.sensor-actions {
  /* No background override needed */
}

.sensor-actions .action-icons-container {
  padding: 0.5rem 0;
}

.sensor-actions .btn {
  /* No background override needed */
}

/* Ensure proper table structure and prevent border overflow */
.sensors-table-container {
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sensors-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.sensors-table thead th {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  padding: 1rem 0.75rem;
  text-align: left;
}

.sensors-table tr:hover {
  background-color: #f8f9fa;
}

/* Fix for any remaining border issues */
.sensors-table td,
.sensors-table th {
  vertical-align: top;
  border: none;
}

.sensors-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
}

.sensors-table tbody tr:last-child {
  border-bottom: none;
}

/* === Sensor Name Column Optimization === */
.sensor-name {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.sensor-name strong {
  display: block;
  margin-bottom: 0.25rem;
}

.sensor-name small {
  display: block;
  line-height: 1.3;
  margin-bottom: 0.1rem;
}

/* === Checkbox Field Layout === */
.checkbox-field {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  margin-top: 0.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
}

.checkbox-field input[type="checkbox"] {
  margin: 0 !important;
  margin-top: 0.125rem !important;
  flex-shrink: 0 !important;
  order: -1 !important; /* Ensure checkbox comes first */
}

.checkbox-label {
  line-height: 1.4 !important;
  color: var(--text-color) !important;
  font-size: 0.9rem !important;
  flex: 1 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* === Cancel Button Styling === */
.btn-cancel {
  background-color: #6c757d;
  border-color: #6c757d;
  color: white;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-cancel:hover {
  background-color: #5a6268;
  border-color: #545b62;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-cancel:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* === Override Bootstrap and Existing Form Styles === */
.dashboard-card .checkbox-field {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  margin-top: 0.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.dashboard-card .checkbox-field input[type="checkbox"] {
  margin: 0 !important;
  margin-top: 0.125rem !important;
  flex-shrink: 0 !important;
  order: -1 !important;
  width: auto !important;
  height: auto !important;
}

.dashboard-card .checkbox-field .checkbox-label {
  line-height: 1.4 !important;
  color: var(--text-color) !important;
  font-size: 0.9rem !important;
  flex: 1 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
}

/* === Ensure Page Header Layout Works === */
.page-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  margin-bottom: 2rem !important;
  gap: 1rem !important;
}

.page-header .header-content {
  flex: 1 !important;
}

.page-header .header-actions {
  flex-shrink: 0 !important;
  margin-top: 0.25rem !important;
}

/* === Ensure Cancel Button Styling === */
.btn-cancel {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
  border-radius: 6px !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  display: inline-block !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer !important;
  width: 100% !important;
}

.btn-cancel:hover {
  background-color: #5a6268 !important;
  border-color: #545b62 !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.btn-cancel:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

/* === Debug and Force Override Styles === */
/* Force checkbox layout to work */
.dashboard-card .form-group .checkbox-field,
.dashboard-card .checkbox-field {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  margin-top: 0.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative !important;
}

.dashboard-card .form-group .checkbox-field input[type="checkbox"],
.dashboard-card .checkbox-field input[type="checkbox"] {
  margin: 0 !important;
  margin-top: 0.125rem !important;
  flex-shrink: 0 !important;
  order: -1 !important;
  width: auto !important;
  height: auto !important;
  position: relative !important;
  z-index: 1 !important;
}

.dashboard-card .form-group .checkbox-field .checkbox-label,
.dashboard-card .checkbox-field .checkbox-label {
  line-height: 1.4 !important;
  color: var(--text-color) !important;
  font-size: 0.9rem !important;
  flex: 1 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Override any Bootstrap form-check styles */
.dashboard-card .form-check,
.dashboard-card .checkbox-field.form-check {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  margin-top: 0.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.dashboard-card .form-check-input,
.dashboard-card .checkbox-field.form-check-input {
  margin: 0 !important;
  margin-top: 0.125rem !important;
  flex-shrink: 0 !important;
  order: -1 !important;
  width: auto !important;
  height: auto !important;
}

.dashboard-card .form-check-label,
.dashboard-card .checkbox-field .form-check-label {
  line-height: 1.4 !important;
  color: var(--text-color) !important;
  font-size: 0.9rem !important;
  flex: 1 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
}

/* === Sensor Details Styling === */
.sensor-details {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 1rem;
  border-left: 4px solid #2D9CDB;
  margin-top: 0.5rem;
}

.sensor-details .detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sensor-details .detail-item:last-child {
  margin-bottom: 0;
}

.sensor-details .detail-item strong {
  color: #495057;
  min-width: 140px;
  flex-shrink: 0;
  font-weight: 600;
}

.sensor-details .detail-item span {
  flex: 1;
  line-height: 1.4;
  color: #6c757d;
}

.sensor-details .detail-item em {
  font-style: italic;
  color: #6c757d;
}

/* Responsive adjustments for sensor details */
@media (max-width: 768px) {
  .sensor-details .detail-item {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .sensor-details .detail-item strong {
    min-width: auto;
  }
}

/* === Gateway Configuration Styling === */
.gateway-info {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 1.5rem;
  border-left: 4px solid #7AE0C9;
}

.gateway-info .info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.gateway-info .info-item:last-child {
  margin-bottom: 0;
}

.gateway-info .info-item strong {
  color: #495057;
  min-width: 160px;
  flex-shrink: 0;
  font-weight: 600;
}

.gateway-info .info-item span {
  flex: 1;
  color: #6c757d;
}

.config-actions {
  margin-top: 1.5rem;
}

.config-actions .btn {
  margin-bottom: 0.5rem;
}

.config-actions .form-text {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Responsive adjustments for gateway info */
@media (max-width: 768px) {
  .gateway-info .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .gateway-info .info-item strong {
    min-width: auto;
  }
  
  .config-actions .col-md-6 {
    margin-bottom: 1rem;
  }
}

/* === Area Management Table Styling === */
.sensor-count a,
.output-count a {
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.sensor-count a:hover {
  background-color: rgba(45, 156, 219, 0.1);
  transform: translateY(-1px);
}

.output-count a:hover {
  background-color: rgba(122, 224, 201, 0.1);
  transform: translateY(-1px);
}

.sensor-count a.text-primary {
  color: #2D9CDB !important;
}

.sensor-count a.text-muted {
  color: #6c757d !important;
}

.output-count a.text-success {
  color: #7AE0C9 !important;
}

.output-count a.text-muted {
  color: #6c757d !important;
}

/* === Sensor Dashboard Styles === */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.dashboard-header h1 {
  margin: 0;
  color: #2c3e50;
  font-size: 2.5em;
}

.dashboard-stats {
  display: flex;
  gap: 20px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  min-width: 120px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9em;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sites Grid */
.sites-grid {
  display: grid;
  gap: 30px;
}

.site-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border: 1px solid #e8e8e8;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.site-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.8em;
}

.site-status {
  text-align: right;
}

.gateway-info {
  margin-top: 8px;
}

.gateway-info small {
  display: block;
  color: #666;
  margin: 2px 0;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gateway-online {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.gateway-offline {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.sensor-online {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.sensor-offline {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Areas Container */
.areas-container {
  display: grid;
  gap: 25px;
}

.area-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e9ecef;
}

.area-section h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 1.3em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sensors Grid */
.sensors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.sensor-card {
  background: white;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
  transition: transform 0.15s ease;
}

.sensor-card:hover {
  transform: translateY(-1px);
}

.sensor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.sensor-header h4 {
  margin: 0;
  color: #495057;
  font-size: 1.1em;
}

.sensor-type {
  margin-bottom: 15px;
}

.sensor-type small {
  color: #6c757d;
  font-style: italic;
}

/* Entities List */
.entities-list {
  display: grid;
  gap: 12px;
}

.entity-value {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e9ecef;
}

.entity-name {
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.entity-value-display {
  margin-bottom: 8px;
}

.value {
  font-size: 1.2em;
  font-weight: bold;
  color: #28a745;
}

.value-text {
  font-size: 1.1em;
  color: #6c757d;
}

.no-value {
  font-style: italic;
  color: #adb5bd;
}

.last-reading {
  text-align: right;
}

.last-reading small {
  color: #6c757d;
  font-size: 0.8em;
}

.no-entities, .no-areas {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.empty-state h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.empty-state p {
  color: #6c757d;
  margin-bottom: 25px;
  font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .dashboard-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .sensors-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    min-width: 100px;
    padding: 15px;
  }
}

/* === Dashboard-Specific Button Styles === */
.dashboard-container .btn {
  /* Reset to default button styles for dashboard */
  background: var(--btn-bg, #007bff);
  border: var(--btn-border, 1px solid #007bff);
  color: var(--btn-color, white);
  padding: var(--btn-padding, 0.5rem 1rem);
  border-radius: var(--btn-radius, 6px);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.dashboard-container .btn:hover {
  background: var(--btn-hover-bg, #0056b3);
  border-color: var(--btn-hover-border, #0056b3);
  transform: translateY(-1px);
}

.dashboard-container .btn-primary {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.dashboard-container .btn-primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

.dashboard-container .btn-secondary {
  background: #6c757d;
  border-color: #6c757d;
  color: white;
}

.dashboard-container .btn-secondary:hover {
  background: #545b62;
  border-color: #545b62;
}

.dashboard-container .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Dashboard card action buttons */
.dashboard-container .card-header .btn {
  background: #6c757d;
  border-color: #6c757d;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.dashboard-container .card-header .btn:hover {
  background: #545b62;
  border-color: #545b62;
}

/* Dashboard area control buttons */
.dashboard-container .arm-btn {
  background: #6c757d;
  border-color: #6c757d;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-container .arm-btn:hover {
  background: #545b62;
  border-color: #545b62;
  transform: translateY(-1px);
}

/* Dashboard specific button classes */
.dashboard-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.dashboard-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.dashboard-arm-btn {
  background: #6c757d;
  border: 1px solid #6c757d;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-arm-btn:hover {
  background: #545b62;
  border-color: #545b62;
  transform: translateY(-1px);
}

.dashboard-view-all-btn {
  background: #6c757d;
  border: 1px solid #6c757d;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  cursor: pointer;
}

.dashboard-view-all-btn:hover {
  background: #545b62;
  border-color: #545b62;
  transform: translateY(-1px);
}

/* Dashboard disarm button */
.dashboard-disarm-btn {
  background: #dc3545;
  border: 1px solid #dc3545;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-disarm-btn:hover {
  background: #c82333;
  border-color: #c82333;
  transform: translateY(-1px);
}

/* Dashboard notifications */
.dashboard-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-notification.show {
  transform: translateX(0);
}

.dashboard-notification.success {
  background: #28a745;
  border-left: 4px solid #1e7e34;
}

.dashboard-notification.error {
  background: #dc3545;
  border-left: 4px solid #c82333;
}

.dashboard-notification.info {
  background: #17a2b8;
  border-left: 4px solid #138496;
}

/* Dashboard area status indicators */
.area-status.armed {
  background: #dc3545;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.area-status.disarmed {
  background: #28a745;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.sites-full-width {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.site-full-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.site-info h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.site-details {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.gateway-details {
  opacity: 0.9;
  font-size: 0.8rem;
}

.site-actions .dashboard-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-actions .dashboard-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.site-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.site-info-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #e9ecef;
  border-bottom: 1px solid #dee2e6;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #495057;
}

.card-count {
  background: #6c757d;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.card-content {
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Areas Card Styles */
.area-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

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

.area-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

.area-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.area-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.area-status.armed {
  background: #dc3545;
  color: white;
}

.area-status.disarmed {
  background: #28a745;
  color: white;
}

.arm-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
}

.area-sensors {
  font-size: 0.9rem;
}

.sensor-count {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.sensor-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sensor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.sensor-name {
  font-weight: 500;
}

.sensor-status {
  font-size: 0.8rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.sensor-status.online {
  background: #d4edda;
  color: #155724;
}

.sensor-status.offline {
  background: #f8d7da;
  color: #721c24;
}

/* Sensors Card Styles */
.sensor-item-detailed {
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

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

.sensor-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

.area-name {
  font-size: 0.8rem;
  color: #6c757d;
  background: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

.sensor-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sensor-type {
  font-size: 0.8rem;
  color: #6c757d;
}

.sensor-reading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.reading-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #495057;
}

.reading-time {
  font-size: 0.8rem;
  color: #6c757d;
}

.sensor-threshold {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.threshold-name {
  color: #495057;
  font-weight: 500;
}

.threshold-type {
  background: #e9ecef;
  color: #495057;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

/* Events Card Styles */
.event-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

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

.event-type {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
}

.event-severity {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.event-severity.critical {
  background: #f8d7da;
  color: #721c24;
}

.event-severity.warning {
  background: #fff3cd;
  color: #856404;
}

.event-severity.info {
  background: #d1ecf1;
  color: #0c5460;
}

.event-message {
  font-size: 0.9rem;
  color: #495057;
  margin-bottom: 0.5rem;
}

.event-time {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.empty-state p {
  margin: 0;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .site-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .site-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .site-card-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .site-details {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Entity Cards Grid - Global Entity View */
.entity-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
  max-width: none;
}

/* Entity Card Styles - Dark Theme */
.entity-cards-grid .flip-card {
  background-color: transparent;
  border-radius: 18px;
  width: 280px;
  height: 210px;
  padding: 0; /* transparent container, no padding so faces can fill */
  box-shadow: none; /* shadow will be on faces */
  position: relative;
  display: block;
  font-family: "Source Sans Pro", sans-serif;
  border: none;
  color: #ffffff;
  text-align: left;
  overflow: visible;
  perspective: 1000px;
}

.entity-cards-grid .entity-card {
  background-color: transparent;
  border-radius: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  box-shadow: none;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: "Source Sans Pro", sans-serif;
  border: none;
  color: #ffffff;
  text-align: left;
  overflow: visible;
}

/* Shared face chrome so both front and back look like the original card */
.entity-cards-grid .entity-card-face {
  background-color: #2e2e33;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  position: absolute;
  inset: 0;
}

/* 3D flip layout */
.entity-cards-grid .flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.entity-cards-grid .flip-card-front,
.entity-cards-grid .flip-card-back {
  position: absolute;
  inset: 0;
  margin: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
  background-color: #2e2e33; /* face visuals */
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Apply the face chrome to both faces */
.entity-cards-grid .flip-card-front,
.entity-cards-grid .flip-card-back {
  /* face visuals */
}
.entity-cards-grid .flip-card-front.entity-card { /* add face chrome via existing class */
}
.entity-cards-grid .flip-card-back.entity-card { /* add face chrome via existing class */
}

/* Back starts rotated */
.entity-cards-grid .flip-card-back {
  transform: rotateY(180deg) translateZ(0);
}

/* Flipped state */
.entity-cards-grid .flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.entity-cards-grid .entity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
  padding-bottom: 0;
  flex-shrink: 0;
}

.entity-cards-grid .entity-card-title {
  color: #ffffff;
  font-size: 14px;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 500;
  line-height: 20px;
}

.entity-cards-grid .entity-card-title div:first-child {
  font-weight: bold;
}

.entity-cards-grid .entity-unit {
  background-color: #a1a7b1;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.entity-cards-grid .entity-unit:hover {
  background-color: #8a9099;
  transform: scale(1.05);
}

.entity-cards-grid .entity-value-large {
  color: #ffffff;
  font-size: 67px;
  font-family: "Source Sans Pro", sans-serif;
  line-height: 88px;
  text-align: center;
  margin: 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  min-height: 0;
  position: relative;
}

.entity-cards-grid .entity-value-large .waiting-data {
  color: #a1a7b1;
  font-style: italic;
  font-size: 1.4rem;
}

.entity-cards-grid .entity-thresholds {
  position: absolute;
  bottom: 2.5rem;
  left: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  color: #a1a7b1;
  text-align: center;
  pointer-events: none;
}

.entity-cards-grid .threshold-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  padding: 2px 0;
}

.entity-cards-grid .threshold-name {
  font-weight: 500;
  color: #a1a7b1;
}

.entity-cards-grid .threshold-condition {
  color: #a1a7b1;
  font-family: "Source Sans Pro", sans-serif;
}

.entity-cards-grid .no-thresholds {
  text-align: center;
  color: #a1a7b1;
  font-style: italic;
  font-size: 0.8rem;
}

.entity-cards-grid .entity-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.entity-cards-grid .entity-info-btn {
  color: #f8f9fa;
  background: none;
  border: none;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.entity-cards-grid .entity-info-btn img {
  width: 18px;
  height: 18px;
}

.entity-cards-grid .entity-info-btn:hover {
  transform: scale(1.1);
}

.entity-cards-grid .entity-updated {
  color: #f8f9fa;
  font-size: 0.7rem;
  font-family: "Source Sans Pro", sans-serif;
}

/* Entity offline status */
.entity-cards-grid .entity-offline-status {
  color: #ffffff; /* Changed to white to match sensor/entity name color */
  font-size: 14px;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

/* Entity footer icons container */
.entity-cards-grid .entity-footer-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Entity offline icon */
.entity-cards-grid .entity-offline-icon {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

/* Offline entity card background - Multiple selectors to ensure it works */
.entity-cards-grid .flip-card.offline .entity-card-face {
  background-color: #FF5F5F !important;
}

.entity-cards-grid .offline .entity-card-face {
  background-color: #FF5F5F !important;
}

.entity-cards-grid .flip-card.offline .flip-card-front .entity-card-face {
  background-color: #FF5F5F !important;
}

.entity-cards-grid .flip-card.offline .flip-card-back .entity-card-face {
  background-color: #FF5F5F !important;
}

/* Even more specific selector */
.entity-cards-grid .flip-card[class*="offline"] .entity-card-face {
  background-color: #FF5F5F !important;
}

/* Override the flip-card-front/back background for offline cards */
.entity-cards-grid .flip-card.offline .flip-card-front {
  background-color: #FF5F5F !important;
}

.entity-cards-grid .flip-card.offline .flip-card-back {
  background-color: #FF5F5F !important;
}

/* Maximum specificity for offline cards */
.entity-cards-grid .flip-card.offline .flip-card-front,
.entity-cards-grid .flip-card.offline .flip-card-back {
  background-color: #FF5F5F !important;
}

.entity-cards-grid .info-icon {
  font-style: normal;
}

/* Empty state */
.empty-entities {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
}

.empty-state {
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 2rem;
  color: #6c757d;
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: #495057;
}

/* Area Cards Grid - Same styling as Entity Cards */
.area-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
  max-width: none;
}

/* Area Card Styles - Same as Entity Cards */
.area-cards-grid .flip-card {
  background-color: transparent;
  border-radius: 18px;
  width: 280px;
  height: 210px;
  padding: 0;
  box-shadow: none;
  position: relative;
  display: block;
  font-family: "Source Sans Pro", sans-serif;
  border: none;
  color: #ffffff;
  text-align: left;
  overflow: visible;
  perspective: 1000px;
}

.area-cards-grid .area-card {
  background-color: transparent;
  border-radius: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  box-shadow: none;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: "Source Sans Pro", sans-serif;
  border: none;
  color: #ffffff;
  text-align: left;
  overflow: visible;
}

/* Area Card Face Chrome - Same as entity cards */
.area-cards-grid .area-card-face {
  background-color: #2e2e33;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  position: absolute;
  inset: 0;
}

/* Area Card 3D flip layout */
.area-cards-grid .flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.area-cards-grid .flip-card-front,
.area-cards-grid .flip-card-back {
  position: absolute;
  inset: 0;
  margin: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.area-cards-grid .flip-card-back {
  transform: rotateY(180deg) translateZ(0);
}

.area-cards-grid .flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.area-cards-grid .area-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex-shrink: 0;
}

.area-cards-grid .area-card-title {
  color: #ffffff;
  font-size: 14px;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 500;
  line-height: 20px;
}

.area-cards-grid .area-card-title div:first-child {
  font-weight: bold;
}

.area-cards-grid .area-status-icon {
  background-color: #a1a7b1;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.area-cards-grid .area-status-icon:hover {
  background-color: #8a9099;
  transform: scale(1.05);
}

.area-cards-grid .area-status-icon img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

.area-cards-grid .area-status-large {
  color: #ffffff;
  font-size: 47px;
  font-family: "Source Sans Pro", sans-serif;
  line-height: 62px;
  text-align: center;
  margin: 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  min-height: 0;
  position: relative;
}

.area-cards-grid .area-action-button {
  background: none;
  border: none;
  border-radius: 0;
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5rem auto;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.area-cards-grid .area-action-button:hover {
  transform: scale(1.05);
}

.area-cards-grid .area-action-button img {
  width: 60px;
  height: 60px;
  display: block;
  object-fit: contain;
}

/* Loading spinner animation for area buttons */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Generic back content styles for both entity and area cards */
.entity-back-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
  justify-content: center;
  padding-top: 0.5rem;
  min-height: 0;
}

.back-text-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.125rem 0;
}

.back-text-label {
  color: #a1a7b1;
  font-size: 0.85rem;
  font-weight: 500;
}

.back-text-value {
  color: #ffffff;
  font-size: 0.85rem;
}

.back-text-value a {
  color: #2D9CDB;
  text-decoration: none;
}

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

/* Responsive grid is now handled automatically with auto-fit */
