/* ==========================================================================
   BAM-1022 Dust Monitoring Dashboard - Master Comprehensive Stylesheet
   Buriram Rajabhat University (BRU) • อาคาร 22 วิทยาศาสตร์สุขภาพ
   ========================================================================== */

:root {
  /* Surface & Background Palette */
  --bg-body: #060a14;
  --bg-primary: #0a0f1d;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(22, 34, 60, 0.95);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-glow: rgba(56, 189, 248, 0.35);

  /* Typography & Hierarchy */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent & Status Colors */
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent-cyan: #06b6d4;
  --accent-purple: #818cf8;

  /* Thai PCD AQI Colors */
  --aqi-blue: #0284c7;
  --aqi-blue-bg: rgba(2, 132, 199, 0.15);
  --aqi-green: #059669;
  --aqi-green-bg: rgba(5, 150, 105, 0.15);
  --aqi-yellow: #d97706;
  --aqi-yellow-bg: rgba(217, 119, 6, 0.15);
  --aqi-orange: #ea580c;
  --aqi-orange-bg: rgba(234, 88, 12, 0.15);
  --aqi-red: #dc2626;
  --aqi-red-bg: rgba(220, 38, 38, 0.15);

  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Prompt', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.95) 0px, transparent 70%);
  background-attachment: fixed;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ==========================================================================
   Top Header Navigation
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  flex-wrap: wrap;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand-text h1 span {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-left: 6px;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 9999px;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.custom-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
}

.firebase-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 9999px;
  font-size: 0.8rem;
  color: #38bdf8;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.quick-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

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

.system-time-card {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Top Alert Banner Section
   ========================================================================== */
.banner-section {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  padding: 24px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.aqi-badge-large {
  min-width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #0284c7, #0369a1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
}

.aqi-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.aqi-scale-label {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.05em;
}

.banner-info {
  flex: 1;
  min-width: 280px;
}

.banner-status-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 8px;
}

.banner-info h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.banner-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.banner-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
}

/* ==========================================================================
   KPI Metrics Grid
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.metric-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.pm25-icon { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.flow-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.temp-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.rh-icon { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.bp-icon { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.wind-icon { background: rgba(236, 72, 153, 0.15); color: #ec4899; }

.card-title h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.sub-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.metric-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 10px;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', sans-serif;
  color: #fff;
  line-height: 1;
}

.metric-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.metric-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.metric-badge.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.metric-badge.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.metric-badge.yellow { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.metric-badge.cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.metric-badge.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* ==========================================================================
   Histograms & Analytics Charts
   ========================================================================== */
.charts-section {
  margin-bottom: 24px;
}

.charts-grid-layout {
  display: grid;
  grid-template-columns: 1.7fr 1.3fr;
  gap: 20px;
}

@media (max-width: 980px) {
  .charts-grid-layout {
    grid-template-columns: 1fr;
  }
}

.chart-box-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.chart-box-header {
  background: rgba(30, 41, 59, 0.6);
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 10px;
}

.chart-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.chart-header-left h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-header-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'Prompt', sans-serif;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Time Filter Segmented Pills (UX/UI Standard) */
.time-filter-wrapper {
  display: flex;
  align-items: center;
}

.time-filter-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--card-border);
  padding: 3px;
  border-radius: 9999px;
  gap: 2px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-filter-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  outline: none;
}

.time-filter-pill .filter-icon {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.time-filter-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.time-filter-pill:hover .filter-icon {
  opacity: 1;
}

.time-filter-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

.time-filter-pill.active .filter-icon {
  opacity: 1;
  color: #ffffff;
}

/* Custom Date Range Bar */
.custom-date-bar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  padding: 10px 22px;
  border-bottom: 1px solid var(--card-border);
  animation: fadeInDown 0.25s ease-out;
}

.custom-date-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.date-input-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.date-input-item label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-size: 0.78rem;
}

.date-input-item label i {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.date-input-field {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Prompt', sans-serif;
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
}

.date-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.btn-custom-date-apply {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-custom-date-apply:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.btn-custom-date-apply i {
  width: 14px;
  height: 14px;
}

.btn-custom-date-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-custom-date-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-custom-date-close i {
  width: 15px;
  height: 15px;
}

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

/* Stats Summary Sub-strip */
.chart-stats-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.45);
  padding: 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', 'Prompt', sans-serif;
}

.stat-pill-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--text-muted);
}

.stat-pill-lbl {
  color: var(--text-dim);
  font-size: 0.74rem;
}

.stat-pill-val {
  font-weight: 600;
}

.text-primary { color: #38bdf8 !important; }
.text-warning { color: #f59e0b !important; }
.text-success { color: #10b981 !important; }
.text-danger  { color: #ef4444 !important; }

.chart-box-body {
  padding: 20px;
  height: 280px;
  position: relative;
}

/* ==========================================================================
   Station Geolocation & Google Maps Section
   ========================================================================== */
.map-station-section {
  margin-bottom: 24px;
}

.map-section-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.map-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-title-wrap h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.map-title-wrap p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.map-grid-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .map-grid-layout {
    grid-template-columns: 1fr;
  }
}

.map-iframe-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.map-floating-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  color: #fff;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.geo-details-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.geo-meta-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.geo-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.geo-lbl {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.geo-val {
  font-weight: 600;
  color: #fff;
}

.text-cyan {
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

.map-campus-spots h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.spot-chip {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: #fff;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.spot-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.spot-sub {
  font-size: 0.72rem;
  color: #38bdf8;
}

/* ==========================================================================
   AQI Standards Guide
   ========================================================================== */
.standards-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.section-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-with-icon i {
  color: #f59e0b;
}

.title-with-icon h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.standard-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.aqi-bands-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.aqi-band-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.band-color-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.band-green .band-color-strip { background: #0284c7; }
.band-yellow .band-color-strip { background: #059669; }
.band-orange .band-color-strip { background: #d97706; }
.band-red .band-color-strip { background: #ea580c; }
.band-purple .band-color-strip { background: #dc2626; }

.band-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.band-level {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
}

.band-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.band-green .band-name { color: #38bdf8; }
.band-yellow .band-name { color: #10b981; }
.band-orange .band-name { color: #f59e0b; }
.band-red .band-name { color: #f97316; }
.band-purple .band-name { color: #ef4444; }

.band-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.band-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ==========================================================================
   Export Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #151f32;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 90%;
  max-width: 480px;
  color: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: all 0.25s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ==========================================================================
   Responsive & Adaptive Media Queries (All Devices & Viewports)
   ========================================================================== */

/* 1. Tablet & Medium Screens (<= 1024px) */
@media (max-width: 1024px) {
  .app-container {
    padding: 16px 18px 48px;
  }

  .charts-grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .map-grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }

  .chart-box-body {
    height: 260px;
  }
}

/* 2. Small Tablets & Large Mobiles (<= 768px) */
@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px 40px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }

  .brand-section {
    justify-content: flex-start;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .brand-text p {
    font-size: 0.75rem;
  }

  .header-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .control-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .custom-select {
    width: 100%;
  }

  .firebase-status-badge {
    justify-content: center;
    width: 100%;
  }

  .quick-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .quick-action-buttons .btn-secondary {
    justify-content: center;
  }

  .system-time-card {
    justify-content: center;
  }

  /* Banner Section Mobile */
  .banner-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 16px;
  }

  .aqi-badge-large {
    width: 110px;
    height: 110px;
    min-width: 110px;
  }

  .aqi-number {
    font-size: 3rem;
  }

  .banner-info {
    min-width: 100%;
  }

  .banner-info h2 {
    font-size: 1.15rem;
  }

  .banner-info p {
    font-size: 0.85rem;
  }

  .banner-meta-row {
    justify-content: center;
    gap: 6px;
  }

  .meta-pill {
    font-size: 0.72rem;
    padding: 4px 8px;
  }

  /* Metric Cards Mobile Grid */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .metric-card {
    padding: 14px;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .card-title h3 {
    font-size: 0.82rem;
  }

  .sub-label {
    display: none;
  }

  /* Chart Box Mobile Header & Filters */
  .chart-box-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .time-filter-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .time-filter-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .time-filter-pill {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 0.74rem;
  }

  .custom-date-bar {
    padding: 12px 16px;
  }

  .custom-date-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .date-input-item {
    width: 100%;
    justify-content: space-between;
  }

  .date-input-field {
    flex: 1;
    max-width: 200px;
  }

  .btn-custom-date-apply {
    width: 100%;
    justify-content: center;
    padding: 8px;
  }

  .chart-stats-strip {
    padding: 8px 16px;
    gap: 8px;
    font-size: 0.72rem;
  }

  .chart-box-body {
    height: 230px;
    padding: 12px;
  }

  /* Map and Geolocation */
  .map-section-card {
    padding: 16px;
  }

  .map-iframe-container iframe {
    height: 240px !important;
  }

  /* AQI Bands */
  .standards-section {
    padding: 16px;
  }

  .aqi-bands-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* 3. Small Mobile Devices (<= 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 8px 10px 30px;
  }

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

  .metric-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .card-top {
    margin-bottom: 0;
  }

  .metric-value-wrapper {
    margin: 0;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-text h1 span {
    display: inline-block;
    margin-top: 4px;
    margin-left: 0;
  }

  .chart-box-body {
    height: 200px;
  }

  .modal-box {
    padding: 20px 16px;
  }
}

/* 4. Touch Screen and High-DPI optimizations */
@media (hover: none) and (pointer: coarse) {
  .time-filter-pill,
  .btn-secondary,
  .btn-primary,
  .btn-icon {
    min-height: 38px;
  }
}

/* ==========================================================================
   DATA SOURCE BADGES & USER SESSION MANAGEMENT
   ========================================================================== */

.data-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.data-source-badge.mode-migrate {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #38BDF8;
}

.data-source-badge.mode-real {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.source-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.source-pulse-dot.active.is-migrate {
  background: #38BDF8;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: pulseCyan 2s infinite;
}

.source-pulse-dot.active.is-real {
  background: #10B981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseCyan {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* User Session Container & Pills */
.user-session-container {
  display: inline-flex;
  align-items: center;
}

.user-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(8px);
}

.user-session-pill.is-admin {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
}

.user-session-pill.is-admin i {
  color: #F59E0B;
}

.user-session-pill.is-guest {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
}

.btn-session-logout {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  margin-left: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-session-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

.btn-session-switch {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38BDF8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-session-switch:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
}

/* Modals & Dialogs Enhancement */
.auth-modal-box {
  max-width: 440px;
}

.data-source-modal-box {
  max-width: 620px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.modal-title-with-icon h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.auth-modal-desc, .settings-modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.auth-error-alert {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.85rem;
  margin-bottom: 16px;
  animation: fadeIn 0.2s ease-in-out;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.btn-guest {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-guest:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38BDF8;
}

.auth-guest-hint {
  font-size: 0.75rem;
  margin-top: 10px;
  text-align: center;
}

/* Source Selection Cards Grid */
.source-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.source-card-label {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  padding: 14px 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.source-card-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.source-card-label:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.7);
}

.source-card-label.selected {
  border-color: #38BDF8;
  background: rgba(14, 165, 233, 0.1);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2);
}

.source-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.source-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-icon-wrap.icon-migrate {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
}

.source-icon-wrap.icon-real {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.source-card-title-wrap {
  flex: 1;
}

.source-card-title-wrap h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.source-badge-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.source-radio-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: inline-block;
  transition: all 0.2s;
  position: relative;
}

.source-card-label.selected .source-radio-check {
  border-color: #38BDF8;
  background: #38BDF8;
}

.source-card-label.selected .source-radio-check::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f172a;
}

.source-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 10px;
  line-height: 1.45;
}

.source-meta-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 6px;
}

.source-meta-stats strong {
  color: #ffffff;
}

.source-mqtt-info {
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #64748b;
}

/* Pre-check Section in Settings Modal */
.precheck-summary-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  margin-bottom: 20px;
}

.precheck-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.btn-xs {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
}

.precheck-result-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  max-height: 180px;
  overflow-y: auto;
}

.precheck-loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
}

.precheck-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.precheck-item {
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.precheck-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.precheck-item-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.precheck-item-desc {
  color: #94a3b8;
  font-size: 0.74rem;
}

.status-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.status-tag.ready {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.status-tag.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
}

.status-tag.error {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.modal-footer-row {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   Web Application UX/UI Enhancements
   - User Session Pills (Admin & Guest)
   - Data Source Status Badge
   - Toast Notifications
   - High-End Interactive Components
   ========================================================================== */

/* User Session Profile Container */
.user-session-container {
  display: flex;
  align-items: center;
}

.user-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 4px 12px 4px 6px;
  font-size: 0.82rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.user-session-pill:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.85);
}

.user-session-pill.is-admin {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.85));
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.15);
}

.user-session-pill.is-guest {
  border-color: rgba(56, 189, 248, 0.25);
}

.user-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.user-session-pill.is-admin .user-avatar-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1e1b4b;
}

.user-name-tag {
  font-weight: 600;
  color: #f8fafc;
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-role-badge.role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.user-role-badge.role-guest {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-session-switch, .btn-session-logout {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-session-switch:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.btn-session-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

/* Data Source Mode Badge in Header */
.data-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.data-source-badge.mode-migrate {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.data-source-badge.mode-real {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.source-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.source-pulse-dot.is-migrate {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseBlue 2s infinite;
}

.source-pulse-dot.is-real {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseBlue {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.8); opacity: 0.5; }
}

@keyframes pulseGreen {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 10px #10b981; }
  50% { transform: scale(1.25); opacity: 0.7; box-shadow: 0 0 18px #10b981; }
}

/* Toast Notification Floating Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 48px);
}

.toast-item {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast-item.toast-closing {
  animation: toastSlideOut 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-top: 1px;
}

.toast-item.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.toast-item.toast-info .toast-icon {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

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

.toast-item.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #ffffff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  width: 100%;
  animation: toastTimer linear forwards;
}

.toast-item.toast-success .toast-progress { background: #10b981; }
.toast-item.toast-warning .toast-progress { background: #f59e0b; }
.toast-item.toast-error .toast-progress { background: #ef4444; }

@keyframes toastTimer {
  from { width: 100%; }
  to { width: 0%; }
}

/* Responsive Web Application Enhancements */
@media (max-width: 1024px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .header-controls {
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px 40px;
  }

  .header-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .quick-action-buttons {
    flex-wrap: wrap;
  }

  .quick-action-buttons a, .quick-action-buttons button {
    flex: 1;
    justify-content: center;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
  }
}

