/* Common Styles for All Themes */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Performance optimizations */
.animate__animated {
  will-change: transform, opacity;
}

.sensor-card {
  contain: layout style;
}


.stat-card {
  contain: layout style;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.container-fluid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.style-selector .dropdown-content,
.profile-selector .dropdown-content {
  max-height: 400px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 1000;
}

/* Force profile selector menu to single column */
.profile-selector .dropdown-content {
  width: 300px !important;
  min-width: 300px !important;
}

.profile-selector .menu {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
  columns: 1 !important;
  column-count: 1 !important;
}

.profile-selector .menu li {
  width: 100% !important;
  display: block !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
  margin-bottom: 0.25rem !important;
}

.profile-selector .menu li:last-child {
  margin-bottom: 0 !important;
}

/* Status Bar */
.status-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
  backdrop-filter: blur(10px);
}

.status-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Status bar center container */
.status-bar-center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

/* Status bar title - hidden by default */
.status-bar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.status-bar-title i {
  width: 20px;
  height: 20px;
}

/* Show title when scrolled */
.status-bar.scrolled .status-bar-title {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Status bar right container (theme switcher + mode indicator) */
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
}

/* Language Switcher Dropdown */
.language-switcher {
  display: flex;
  align-items: center;
}

.language-switcher .dropdown-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.language-switcher .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.language-switcher .dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.language-switcher .dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 180px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.language-switcher .dropdown.active .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.language-switcher .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e2e8f0;
  text-decoration: none;
}

.language-switcher .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.language-switcher .dropdown-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.language-switcher .dropdown-item-flag {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.language-switcher .dropdown-item-text {
  flex: 1;
}

.language-switcher .dropdown-item-text .title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.language-switcher .dropdown-item-check {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  flex-shrink: 0;
}

.language-switcher .dropdown-item-check svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.5px;
}

.language-switcher .dropdown-item.active .dropdown-item-check {
  opacity: 1;
}

/* Theme Switcher Dropdown */
.theme-switcher {
  display: flex;
  align-items: center;
}

.theme-switcher .dropdown-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-switcher .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.theme-switcher .dropdown-toggle svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.2px;
}

.theme-switcher .dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.theme-switcher .dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 180px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.theme-switcher .dropdown.active .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.theme-switcher .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e2e8f0;
  text-decoration: none;
}

.theme-switcher .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-switcher .dropdown-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.theme-switcher .dropdown-item-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-switcher .dropdown-item-icon svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 2.2px;
}

.theme-switcher .dropdown-item-text {
  flex: 1;
}

.theme-switcher .dropdown-item-text .title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.theme-switcher .dropdown-item-check {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  flex-shrink: 0;
}

.theme-switcher .dropdown-item-check svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.5px;
}

.theme-switcher .dropdown-item.active .dropdown-item-check {
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.connection-status.connected {
  color: #22c55e;
}

.mode-indicator {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Notification Bell Dropdown */
.notification-bell {
  display: flex;
  align-items: center;
  position: relative;
}

.notification-bell .bell-button {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.notification-bell .bell-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.notification-bell .bell-button svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.2px;
}

.notification-bell .bell-button.has-alerts {
  animation: bell-shake 0.5s ease-in-out;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-10deg); }
  40%, 80% { transform: rotate(10deg); }
}

.notification-bell .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notification-bell .dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-bell .dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 280px;
  max-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.notification-bell .dropdown.active .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.notification-bell .dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
}

.notification-bell .dropdown-header h4 {
  font-weight: 700;
  font-size: 0.875rem;
  color: #e2e8f0;
  margin: 0;
}

.notification-bell .dropdown-header .clear-btn {
  font-size: 0.75rem;
  color: #60a5fa;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.notification-bell .dropdown-header .clear-btn:hover {
  text-decoration: underline;
}

.notification-bell .notification-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-bell .notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  color: #e2e8f0;
}

.notification-bell .notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification-bell .notification-item.critical {
  border-left: 3px solid #ef4444;
}

.notification-bell .notification-item.warning {
  border-left: 3px solid #f59e0b;
}

.notification-bell .notification-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-bell .notification-item.critical .notification-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.notification-bell .notification-item.warning .notification-icon {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.notification-bell .notification-icon svg {
  width: 16px !important;
  height: 16px !important;
}

.notification-bell .notification-content {
  flex: 1;
  min-width: 0;
}

.notification-bell .notification-title {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
  margin-bottom: 0.125rem;
}

.notification-bell .notification-message {
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.4;
  word-wrap: break-word;
}

.notification-bell .no-notifications {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.notification-bell .no-notifications svg {
  width: 32px !important;
  height: 32px !important;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Header */
.header-section {
  margin-bottom: 2rem;
  position: relative;
  z-index: 50;
}

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

.main-title {
  font-size: 2.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-drops {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  position: relative;
}

.logo-drops .drop {
  position: absolute;
  stroke: none;
  animation: dropBounce 2.8s ease-in-out infinite;
}

.logo-drops .drop-1 {
  width: 30px !important;
  height: 30px !important;
  fill: #1a73e8;
  opacity: 0.6;
  z-index: 3;
  animation-delay: 0s;
}

.logo-drops .drop-2 {
  width: 22px !important;
  height: 22px !important;
  fill: #4a9af5;
  opacity: 0.5;
  z-index: 2;
  transform: translate(-8px, -4px);
  animation-delay: 0.5s;
}

.logo-drops .drop-3 {
  width: 16px !important;
  height: 16px !important;
  fill: #89bffa;
  opacity: 0.35;
  z-index: 1;
  transform: translate(7px, -7px);
  animation-delay: 1s;
}

@keyframes dropBounce {
  0%, 100% { transform: var(--drop-offset, translate(0,0)); }
  25% { transform: var(--drop-offset, translate(0,0)) translateY(-5px); opacity: 0.85; }
  50% { transform: var(--drop-offset, translate(0,0)) translateY(2px); }
}

.logo-drops .drop-1 { --drop-offset: translate(0, 0); }
.logo-drops .drop-2 { --drop-offset: translate(-8px, -4px); }
.logo-drops .drop-3 { --drop-offset: translate(7px, -7px); }

.subtitle {
  font-size: 1.125rem;
  opacity: 0.7;
}

/* Sensors Grid */
.sensors-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.sensor-card {
  padding: 1rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}


.sensor-card.alert-critical {
  animation: shake 0.5s;
  border: 2px solid #ef4444;
}

.sensor-card.alert-warning {
  border: 2px solid #f59e0b;
}

/* Alert header color changes for readability */
.sensor-card.alert-warning .sensor-header {
  color: #f59e0b;  /* Amber */
}

.sensor-card.alert-critical .sensor-header {
  color: #ef4444;  /* Red */
}

.sensor-card.alert-success .sensor-header {
  color: #22c55e;  /* Green */
}

/* Alert modal styling */
.alert-modal-icon {
  color: #f59e0b;
  width: 28px;
  height: 28px;
}

/* Clickable badge cursor */
.cursor-pointer {
  cursor: pointer;
}

.cursor-pointer:hover {
  opacity: 0.9;
}

.sensor-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.sensor-header i {
  width: 16px;
  height: 16px;
}

.sensor-value {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0.25rem 0;
  display: block;
  transition: all 0.15s ease;
  will-change: contents;
  contain: layout style;
}

/* TradingView-style flash effects */
.sensor-value.flash-up {
  animation: flashGreen 0.6s ease-out;
}

.sensor-value.flash-down {
  animation: flashRed 0.6s ease-out;
}

@keyframes flashGreen {
  0% {
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
    transform: scale(1.02);
  }
  100% {
    text-shadow: none;
    transform: scale(1);
  }
}

@keyframes flashRed {
  0% {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    transform: scale(1.02);
  }
  100% {
    text-shadow: none;
    transform: scale(1);
  }
}


.sensor-status {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  transition: color 0.5s ease;
}

.sensor-progress {
  height: 0.5rem;
  border-radius: 0.25rem;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
  will-change: width, background-color;
  contain: layout style paint;
}

/* Control Panel */
.control-panel {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.control-btn {
  flex: 1;
  min-width: 200px;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

/* Rain effect container */
.control-btn .rain-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: 0.75rem;
}

/* Rain drops with white color for active button */
.control-btn.active .rain-drop {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);
  width: 1px;
  height: 60px;
  position: absolute;
  animation: rain-fall 0.7s linear infinite;
}

/* Blue/ocean rain drops on hover */
.control-btn:hover .rain-drop {
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0) 0%, rgba(59, 130, 246, 0.8) 100%);
}

/* Rain fall animation */
@keyframes rain-fall {
  0% {
    transform: translateY(-100%);
    opacity: 1;
  }
  100% {
    transform: translateY(300%);
    opacity: 0.3;
  }
}

/* Ensure button content stays above rain */
.control-btn > * {
  position: relative;
  z-index: 1;
}

.control-btn.active {
  animation: pulse 2s infinite;
}

.control-btn:disabled {
  cursor: default;
  opacity: 1;
}

.control-btn:disabled:hover {
  transform: none;
}

/* Animated dots for watering status */
.dots-animation {
  display: inline-block;
  animation: dots-pulse 1.4s ease-in-out infinite;
}

@keyframes dots-pulse {
  0%, 20% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Chart Section */
.chart-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 1rem;
  contain: layout style;
}

#mainChart {
  contain: layout style paint;
  will-change: auto;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chart-tab {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.875rem;
}

.chart-tab.active {
  font-weight: bold;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
}

/* Events Section */
.events-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 1rem;
  cursor: pointer;
}

.events-section summary {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
}

.events-table th,
.events-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.events-table th {
  font-weight: 600;
  font-size: 0.875rem;
}

.events-table tr {
  transition: background-color 0.3s ease;
}

.events-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* DataTables with Tailwind CSS - Minimal Customizations */
/* Theme-specific colors are defined in minimal.css and minimal-light.css */

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

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

/* ===== Zone Layout ===== */
.zones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.zone-card {
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  contain: layout style;
}

.zone-card.watering {
  border-color: #2563eb;
}

.zone-card {
  position: relative;
  overflow: hidden;
}

.rain-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.rain-drop {
  position: absolute;
  top: -20px;
  width: 2.5px;
  height: 16px;
  background: linear-gradient(to bottom, transparent, rgba(96, 165, 250, 0.8));
  border-radius: 0 0 2px 2px;
  animation: rainFall linear infinite;
}

@keyframes rainFall {
  0% { transform: translateY(-20px); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% { transform: translateY(calc(100vh)); opacity: 0; }
}

/* Ensure zone card content stays above rain */
.zone-header, .zone-average, .zone-sensors, .zone-controls {
  position: relative;
  z-index: 1;
}

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

.zone-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zone-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.zone-title svg, .zone-title i {
  width: 20px;
  height: 20px;
}

.zone-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.valve-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #334155;
  color: #94a3b8;
}

.valve-badge svg, .valve-badge i {
  width: 14px;
  height: 14px;
}

.valve-badge.valve-open {
  background: #1e40af;
  color: #93c5fd;
}

.mode-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #1e3a5f;
  color: #93c5fd;
}

.mode-badge.mode-manual {
  background: #92400e;
  color: #fde68a;
}

/* Zone Average */
.zone-average {
  text-align: center;
  margin-bottom: 1rem;
}

.zone-avg-value {
  font-size: 3rem;
  font-weight: 800;
  color: #3b82f6;
  line-height: 1;
}

.zone-avg-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.zone-progress {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.zone-progress .progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background-color 0.5s ease;
}

.zone-thresholds {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.threshold-low { color: #f97316; }
.threshold-high { color: #22c55e; }

/* Mini Sensors */
.zone-sensors {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mini-sensor {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.mini-sensor.needs-water {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.1);
}

.mini-sensor-label {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.mini-sensor-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}

/* Zone Controls */
.zone-controls {
  display: flex;
  gap: 0.5rem;
}

.zone-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.zone-btn svg, .zone-btn i {
  width: 14px;
  height: 14px;
}

.zone-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.zone-btn-valve.active {
  background: #1e40af;
  border-color: #2563eb;
  color: #93c5fd;
}

.zone-btn-auto.active {
  background: #064e3b;
  border-color: #059669;
  color: #6ee7b7;
}

.zone-btn-settings {
  flex: 0;
  padding: 0.5rem 0.75rem;
}

.zone-btn.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
  /* neutralize daisyui's .loading component (aspect-ratio:1/1 + mask) — class-name collision */
  aspect-ratio: auto;
  background-color: transparent;
  -webkit-mask: none;
  mask: none;
}

.zone-btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  position: absolute;
  right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* DataTables pagination active page override */
.dt-paging a[aria-current="page"] {
  background-color: var(--pagination-active-bg, #1a73e8) !important;
  border-color: var(--pagination-active-bg, #1a73e8) !important;
  color: var(--pagination-active-color, #ffffff) !important;
  -webkit-text-fill-color: var(--pagination-active-color, #ffffff) !important;
}
.dt-paging a:focus, .dt-paging a:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Pump Badge */
.pump-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #334155;
  color: #94a3b8;
}

.pump-badge svg, .pump-badge i {
  width: 14px;
  height: 14px;
}

.pump-badge.pump-on {
  background: #dc2626;
  color: white;
}

/* Language switcher buttons */
.lang-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.lang-btn.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
}

/* Theme switcher buttons */
.theme-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn svg {
  width: 13px !important;
  height: 13px !important;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.theme-btn.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
  .main-title { font-size: 1.5rem; }
  .header-content { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; }
  .zones-grid { grid-template-columns: 1fr; }
  .zone-avg-value { font-size: 2.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}


/* --- Cross-browser dropdown fix: Chrome 69/87 ignore daisyUI's hide rule, so the
   culture dropdown stays open. Force hidden-by-default + show on focus (:focus-within
   is supported since Chrome 60). --- */
.dropdown .dropdown-content { display: none !important; }
.dropdown:focus-within > .dropdown-content,
.dropdown.dropdown-open > .dropdown-content { display: block !important; }
