/* ============================================================
   TambakMonitor - Premium Dark Aquatic Theme
   Sistem Monitoring Kualitas Air Tambak Udang Vaname
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-primary:    #070B14;
  --bg-secondary:  #0D1426;
  --bg-card:       rgba(15, 22, 45, 0.85);
  --bg-card-hover: rgba(20, 30, 60, 0.95);
  --bg-sidebar:    #0A0F20;

  --accent:        #00D4FF;
  --accent-dim:    rgba(0, 212, 255, 0.15);
  --accent-glow:   0 0 20px rgba(0, 212, 255, 0.35);

  --success:       #00E87A;
  --success-dim:   rgba(0, 232, 122, 0.12);
  --warning:       #FFB800;
  --warning-dim:   rgba(255, 184, 0, 0.12);
  --danger:        #FF4560;
  --danger-dim:    rgba(255, 69, 96, 0.12);
  --info:          #7C5CFC;
  --info-dim:      rgba(124, 92, 252, 0.12);

  --text-primary:   #E8EEFF;
  --text-secondary: #8894B8;
  --text-muted:     #4A5578;

  --border:         rgba(0, 212, 255, 0.12);
  --border-strong:  rgba(0, 212, 255, 0.25);

  --sidebar-width:  260px;
  --topbar-height:  74px;
  --radius:         16px;
  --radius-sm:      10px;
  --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Animated Background Gradient ---- */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,212,255,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(124,92,252,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 60% 50%, rgba(0,232,122,0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0%   { opacity: 0.6; transform: scale(1) rotate(0deg); }
  100% { opacity: 1;   transform: scale(1.05) rotate(1deg); }
}

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1050;
  backdrop-filter: blur(20px);
  transition: var(--transition);
}

.sidebar-logo {
  height: var(--topbar-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  color: #fff;
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

@media (max-width: 768px) {
  .sidebar-close-btn { display: flex; }
}

.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #00D4FF, #0066FF);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,212,255,0.3);
  flex-shrink: 0;
}

.sidebar-logo .logo-text h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-logo .logo-text span {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 8px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-section-label::before {
  content: '';
  flex: 0 0 16px;
  height: 1px;
  background: var(--border);
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 3px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-item.active::before { transform: scaleY(1); }

.nav-item .nav-icon { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; color: inherit; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: var(--transition);
}

.user-card:hover { background: rgba(255,255,255,0.06); }

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #0066FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info .user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: rgba(7, 11, 20, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar-title h1 { 
  font-size: 18px; 
  font-weight: 700; 
  color: var(--text-primary); 
  line-height: 1.2;
  margin: 0;
}
.topbar-title .breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

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

.btn-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-dim);
}

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: pulse 2s infinite;
}

/* ---- Page Content ---- */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), var(--accent-glow);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-body { padding: 20px 24px 24px; }

/* ---- Sensor Cards ---- */
.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.sensor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}

.sensor-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transition: var(--transition);
}

.sensor-card.status-warning::before  { background: var(--warning); }
.sensor-card.status-critical::before { background: var(--danger); }
.sensor-card.status-info::before     { background: var(--info); }
.sensor-card.status-normal::before   { background: var(--success); }

.sensor-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.sensor-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sensor-icon { font-size: 16px; }

.sensor-value {
  font-size: 36px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  margin-bottom: 4px;
  transition: var(--transition);
}

.sensor-card.status-normal   .sensor-value { color: var(--success); }
.sensor-card.status-info     .sensor-value { color: var(--info); }
.sensor-card.status-warning  .sensor-value { color: var(--warning); }
.sensor-card.status-critical .sensor-value { color: var(--danger); animation: pulseValue 1.5s ease-in-out infinite; }

.sensor-unit { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.sensor-range {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.sensor-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.sensor-status-badge.normal   { background: var(--success-dim);  color: var(--success); }
.sensor-status-badge.info     { background: var(--info-dim);     color: var(--info); }
.sensor-status-badge.warning  { background: var(--warning-dim);  color: var(--warning); }
.sensor-status-badge.critical { background: var(--danger-dim);   color: var(--danger); }

.sensor-card .bg-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
  opacity: 0.06;
  pointer-events: none;
  color: var(--accent);
}

/* ============================================================
   KOLAM SUMMARY CARDS (Dashboard)
   ============================================================ */
.kolam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.kolam-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  color: inherit;
}

.kolam-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, var(--accent-dim) 100%);
  opacity: 0;
  transition: var(--transition);
}

.kolam-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), var(--accent-glow);
  color: inherit;
}

.kolam-card:hover::after { opacity: 1; }

.kolam-card.status-critical {
  border-color: rgba(255,69,96,0.3);
  animation: cardPulseDanger 2s ease-in-out infinite;
}

.kolam-card.status-warning  { border-color: rgba(255,184,0,0.25); }

.kolam-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.kolam-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.kolam-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kolam-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kolam-mini-param {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.kolam-mini-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.kolam-mini-val {
  font-size: 20px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.kolam-mini-val.normal   { color: var(--success); }
.kolam-mini-val.warning  { color: var(--warning); }
.kolam-mini-val.critical { color: var(--danger); }
.kolam-mini-val.info     { color: var(--info); }

.kolam-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-status::before { content: '●'; font-size: 8px; }

.badge-status.normal   { background: var(--success-dim); color: var(--success); border: 1px solid rgba(0,232,122,0.25); }
.badge-status.info     { background: var(--info-dim);    color: var(--info);    border: 1px solid rgba(124,92,252,0.25); }
.badge-status.warning  { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(255,184,0,0.25); }
.badge-status.critical { background: var(--danger-dim);  color: var(--danger);  border: 1px solid rgba(255,69,96,0.3);  animation: pulse 2s infinite; }
.badge-status.no-data  { background: rgba(74,85,120,0.2); color: var(--text-muted); border: 1px solid rgba(74,85,120,0.3); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, #00D4FF, #0088CC);
  color: #000;
  box-shadow: 0 4px 15px rgba(0,212,255,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,212,255,0.4);
  color: #000;
}

.btn-success {
  background: linear-gradient(135deg, #00E87A, #00AA55);
  color: #000;
  box-shadow: 0 4px 15px rgba(0,232,122,0.3);
}

.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,232,122,0.4); color: #000; }

.btn-danger {
  background: linear-gradient(135deg, #FF4560, #CC0033);
  color: white;
  box-shadow: 0 4px 15px rgba(255,69,96,0.3);
}

.btn-danger:hover { transform: translateY(-2px); color: white; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* Feed buttons */
.feed-btn-group { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); 
  gap: 12px; 
}

.feed-btn {
  background: rgba(0,232,122,0.1);
  border: 1px solid rgba(0,232,122,0.25);
  color: var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feed-btn:hover {
  background: rgba(0,232,122,0.2);
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,232,122,0.2);
}

.feed-btn .duration { font-size: 20px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.feed-btn.locked    { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

.chart-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-range-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.chart-range-btn.active,
.chart-range-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-list { display: flex; flex-direction: column; gap: 10px; }

.notif-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover { background: rgba(255,255,255,0.05); border-color: var(--border-strong); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-item.level-CRITICAL { border-left: 3px solid var(--danger); background: var(--danger-dim); }
.notif-item.level-WARNING  { border-left: 3px solid var(--warning); background: var(--warning-dim); }
.notif-item.level-INFO     { border-left: 3px solid var(--info); }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.level-CRITICAL .notif-icon { background: var(--danger-dim); color: var(--danger); }
.level-WARNING  .notif-icon { background: var(--warning-dim); color: var(--warning); }
.level-INFO     .notif-icon { background: var(--info-dim); color: var(--info); }

.notif-content { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.notif-pesan { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.notif-saran { font-size: 11px; color: var(--accent); margin-top: 5px; font-style: italic; }
.notif-meta  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  transition: var(--transition);
  margin-bottom: 10px;
}

.checklist-item:hover { background: rgba(255,255,255,0.04); }
.checklist-item.done  { background: var(--success-dim); border-color: rgba(0,232,122,0.2); }
.checklist-item.skipped { opacity: 0.5; }

.checklist-cb {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
}

.checklist-item.done .checklist-cb {
  background: var(--success);
  border-color: var(--success);
  color: #000;
  font-size: 12px;
}

.checklist-item.done .checklist-cb::after { content: '✓'; font-weight: 800; }

.checklist-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.checklist-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.checklist-item.done .checklist-label { text-decoration: line-through; color: var(--text-muted); }

.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  flex: 1;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #00D4FF);
  border-radius: 20px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: shimmer 2s infinite;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  background: rgba(0,212,255,0.06);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-secondary); }

/* ============================================================
   TABLE
   ============================================================ */
.table-custom { width: 100%; border-collapse: collapse; }

.table-custom thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: rgba(255,255,255,0.02);
}

.table-custom tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.table-custom tbody tr:hover td { background: rgba(0,212,255,0.04); color: var(--text-primary); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,212,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(124,92,252,0.06) 0%, transparent 60%),
    var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(13, 20, 38, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 48px 40px;
  backdrop-filter: blur(40px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,255,0.1);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #00D4FF, #0055AA);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 24px rgba(0,212,255,0.3);
}

.login-logo h1 { font-size: 22px; font-weight: 800; }
.login-logo p  { font-size: 12px; color: var(--text-muted); }

.login-card .alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
}
.login-card .alert-error   { background: var(--danger-dim); border: 1px solid rgba(255,69,96,0.3); color: var(--danger); }
.login-card .alert-success { background: var(--success-dim); border: 1px solid rgba(0,232,122,0.3); color: var(--success); }

/* ============================================================
   STAT COUNTERS
   ============================================================ */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.cyan   { background: rgba(0,212,255,0.12); color: var(--accent); }
.stat-icon.green  { background: var(--success-dim);   color: var(--success); }
.stat-icon.yellow { background: var(--warning-dim);   color: var(--warning); }
.stat-icon.red    { background: var(--danger-dim);    color: var(--danger); }

.stat-val  { font-size: 28px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   DIVIDER / MISC
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

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

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  width: 32px; height: 32px;
  background: var(--accent-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--accent);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,69,96,0.4); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 8px rgba(255,69,96,0); }
}

@keyframes pulseValue {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

@keyframes cardPulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,96,0); }
  50%       { box-shadow: 0 0 20px rgba(255,69,96,0.2); }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

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

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

.fade-in  { animation: fadeIn  0.4s ease forwards; }
.slide-in { animation: slideIn 0.3s ease forwards; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideToast 0.35s ease forwards;
  pointer-events: all;
}

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

.toast.critical { border-left: 4px solid var(--danger); }
.toast.warning  { border-left: 4px solid var(--warning); }
.toast.success  { border-left: 4px solid var(--success); }
.toast.info     { border-left: 4px solid var(--info); }

.toast-icon { font-size: 22px; flex-shrink: 0; }
.toast-msg  { font-size: 13px; line-height: 1.4; }
.toast-title { font-weight: 700; margin-bottom: 2px; }

/* ============================================================
   BATTERY & RSSI Indicators
   ============================================================ */
.battery-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.battery-icon { font-size: 18px; }
.battery-icon.high   { color: var(--success); }
.battery-icon.medium { color: var(--warning); }
.battery-icon.low    { color: var(--danger); animation: pulse 1.5s infinite; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: rgba(0,212,255,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.4); }

/* ============================================================
   RESPONSIVE DESIGN SYSTEM & MOBILE FINISHING
   Comprehensive Multi-Device Breakpoints (1200px, 992px, 768px, 576px, 400px)
   ============================================================ */

/* Universal Mobile Overflow & Layout Protection */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.app-layout {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.main-content {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

/* ---- Large Tablet & Small Desktop (<= 1200px) ---- */
@media (max-width: 1200px) {
  .sensor-grid { grid-template-columns: repeat(2, 1fr); }
  .kolam-grid  { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ---- Medium Tablet (<= 992px) ---- */
@media (max-width: 992px) {
  :root { --sidebar-width: 220px; }
  .welfare-grid { grid-template-columns: 1fr !important; }
  .feeding-main-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .setting-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .hero-card { padding: 24px 20px; }
  .hero-title { font-size: 22px; }
  .hero-kpi-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 12px;
  }
  .hero-kpi-divider { display: none !important; }
}

/* ---- Mobile & Small Tablet (<= 768px) ---- */
@media (max-width: 768px) {
  /* Off-canvas Sidebar */
  .sidebar { 
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open { 
    transform: translateX(0); 
    z-index: 1050;
    box-shadow: 0 0 60px rgba(0,0,0,0.85), 0 0 30px rgba(0, 212, 255, 0.2); 
  }
  .main-content { margin-left: 0; width: 100%; }
  .page-content { padding: 16px 12px; width: 100%; box-sizing: border-box; }

  /* Grids & Cards */
  .sensor-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sensor-card { padding: 16px 14px; border-radius: 12px; }
  .sensor-value { font-size: 26px; }
  .sensor-unit { font-size: 11.5px; }
  .sensor-range { font-size: 10px; flex-wrap: wrap; gap: 4px; }
  .sensor-status-badge { font-size: 10px; padding: 2px 8px; }
  .human-param-hint { font-size: 10.5px; line-height: 1.35; margin-top: 6px; padding-top: 6px; }

  .kolam-grid  { grid-template-columns: 1fr; gap: 14px; }
  .kolam-card  { padding: 18px 16px; }
  .stat-row    { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Topbar Mobile Layout */
  .topbar { 
    padding: 8px 12px; 
    min-height: 58px;
    height: auto;
    gap: 10px;
  }
  .topbar-title {
    min-width: 0;
    padding: 2px 0;
  }
  .topbar-title h1 {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-title .breadcrumb {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .greeting-badge {
    display: none !important;
  }
  .operator-chip {
    padding: 4px 8px;
    gap: 6px;
  }
  .operator-chip > div > div:last-child {
    display: none;
  }
  #clock-display #clock-date {
    display: none;
  }
  .hamburger { 
    display: flex !important;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  /* Hero Card Mobile Finish */
  .hero-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .hero-title {
    font-size: 19px;
    line-height: 1.3;
    margin-bottom: 8px;
  }
  .hero-subtitle {
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 14px;
  }
  .hero-img-badge {
    display: none !important;
  }
  .hero-badge,
  .live-stream-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
  .hero-bg-overlay {
    background: 
      linear-gradient(180deg, 
        rgba(6, 10, 22, 0.76) 0%, 
        rgba(6, 10, 22, 0.85) 55%, 
        rgba(6, 10, 22, 0.94) 100%
      );
  }
  .hero-bg-img {
    opacity: 0.75;
  }
  .hero-kpi-row {
    padding: 10px 12px;
    margin-bottom: 14px;
    gap: 10px;
  }
  .hero-kpi-val { font-size: 15px; }
  .hero-kpi-label { font-size: 10px; }
  .hero-kpi-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }

  /* Section Header */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  .section-title { font-size: 15px; }

  /* Banners & Cards */
  .kolam-welfare-banner,
  .welfare-card,
  .checklist-spirit-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 14px;
  }
  .kolam-welfare-banner > div:last-child,
  .welfare-card > div:last-child {
    width: 100%;
  }
  .kolam-welfare-banner .btn,
  .welfare-card .btn {
    width: 100%;
    justify-content: center;
  }
  .shrimp-mood-box,
  .spirit-avatar {
    width: 44px;
    height: 44px;
    font-size: 20px;
    border-radius: 12px;
  }
  .kolam-header-meta {
    text-align: left !important;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
    margin-top: 4px;
  }

  /* Charts Mobile Scaling */
  .chart-container {
    height: 250px !important;
  }
  #chart-loading {
    height: 250px !important;
  }
  .card-header {
    padding: 14px 14px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-body {
    padding: 14px 14px 16px;
  }
  .chart-toolbar {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .chart-toolbar::-webkit-scrollbar { display: none; }
  .chart-range-btn {
    padding: 5px 10px;
    font-size: 11.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Table Cell Padding */
  .table-custom thead th {
    padding: 9px 10px;
    font-size: 10px;
    white-space: nowrap;
  }
  .table-custom tbody td {
    padding: 10px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* ---- Small Mobile Devices (<= 576px) ---- */
@media (max-width: 576px) {
  .page-content { padding: 12px 8px; }

  /* Sensor Grid: 1 column for pristine clarity on phones */
  .sensor-grid { grid-template-columns: 1fr; gap: 10px; }
  .kolam-mini-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .kolam-mini-param { padding: 8px 10px; }
  .kolam-mini-val { font-size: 18px; }

  /* Topbar ultra-compact */
  .operator-chip { display: none !important; }
  #clock-display { display: none !important; }
  .topbar-actions { gap: 6px; }
  .btn-icon { width: 34px; height: 34px; font-size: 14px; }

  /* Hero Actions Grid */
  .hero-content .d-flex.gap-12.mt-16 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .hero-content .d-flex.gap-12.mt-16 .btn {
    width: 100%;
    justify-content: center;
    padding: 9px 10px;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }

  /* Quick Nav Touch Bar */
  .quick-nav-bar { padding: 8px 10px; }
  .quick-nav-inner { gap: 6px; }
  .quick-nav-inner .btn-sm { padding: 5px 10px; font-size: 11px; }

  /* Feeding Controls */
  .feed-btn-group {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .feed-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  .feed-btn .duration { font-size: 18px; }
  .feeding-custom-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .feeding-custom-row #custom-durasi {
    max-width: 100% !important;
    width: 100%;
  }
  .feeding-custom-row .btn {
    width: 100%;
    justify-content: center;
  }

  /* Checklist Mobile Ergonomics */
  .checklist-item {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .checklist-item .checklist-content {
    flex: 1 1 calc(100% - 36px) !important;
  }
  .checklist-actions {
    width: 100%;
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
    margin-top: 2px;
  }
  .checklist-actions .btn {
    padding: 5px 12px;
    font-size: 11px;
  }

  /* Setting Page Form Optimization */
  .setting-grid form div[style*="grid-template-columns:1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  .schedule-add-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .schedule-add-form select,
  .schedule-add-form input,
  .schedule-add-form button {
    width: 100% !important;
  }

  /* Notifications Filter & Stats */
  .notif-item { padding: 12px; gap: 10px; }
  .notif-icon { width: 32px; height: 32px; font-size: 13px; }

  /* Humanized Modals */
  .tambak-modal-overlay { padding: 10px; }
  .tambak-modal-card {
    border-radius: 14px;
    width: 100%;
    max-height: 90vh;
  }
  .tambak-modal-header { padding: 14px 16px 10px; gap: 12px; }
  .tambak-modal-avatar { width: 42px; height: 42px; font-size: 22px; }
  .tambak-modal-title { font-size: 16px; }
  .tambak-modal-body { padding: 12px 16px; font-size: 13px; }
  .tambak-modal-telemetry-box {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 8px;
  }
  .telemetry-label { font-size: 10px; }
  .telemetry-val { font-size: 14px; }
  .tambak-modal-actions {
    padding: 12px 16px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .tambak-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Toasts */
  .toast-container {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: calc(100vw - 20px);
  }
  .toast {
    max-width: 100%;
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* ---- Ultra-Compact Phones (<= 400px) ---- */
@media (max-width: 400px) {
  .hero-kpi-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .hero-content .d-flex.gap-12.mt-16 {
    grid-template-columns: 1fr !important;
  }
  .stat-row {
    grid-template-columns: 1fr !important;
  }
  .tambak-modal-telemetry-box {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
}

.hamburger {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}
.hamburger:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 16, 0.78);
  z-index: 1040;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.sidebar-overlay.visible { display: block; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-accent   { color: var(--accent); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-danger   { color: var(--danger); }
.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary  { color: var(--text-primary); }
.text-mono     { font-family: 'JetBrains Mono', monospace; }
.fw-bold       { font-weight: 700; }
.fw-extra      { font-weight: 800; }
.d-flex        { display: flex; }
.d-block       { display: block; }
.align-center  { align-items: center; }
.align-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }
.gap-4         { gap: 4px; }
.gap-6         { gap: 6px; }
.gap-8         { gap: 8px; }
.gap-10        { gap: 10px; }
.gap-12        { gap: 12px; }
.gap-14        { gap: 14px; }
.gap-16        { gap: 16px; }
.gap-20        { gap: 20px; }
.gap-24        { gap: 24px; }
.mb-0          { margin-bottom: 0; }
.mb-4          { margin-bottom: 4px; }
.mb-6          { margin-bottom: 6px; }
.mb-8          { margin-bottom: 8px; }
.mb-12         { margin-bottom: 12px; }
.mb-16         { margin-bottom: 16px; }
.mb-20         { margin-bottom: 20px; }
.mb-24         { margin-bottom: 24px; }
.mb-28         { margin-bottom: 28px; }
.mb-32         { margin-bottom: 32px; }
.mt-4          { margin-top: 4px; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.p-0           { padding: 0; }
.w-100         { width: 100%; }
.overflow-x-auto { overflow-x: auto; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.position-relative { position: relative; }

/* Real-Time Live Streaming Badges & Animation */
.live-stream-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 232, 122, 0.08);
  border: 1px solid rgba(0, 232, 122, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--success);
  text-transform: uppercase;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(0, 232, 122, 0.7);
  animation: pulseLiveStream 1.8s infinite;
}

@keyframes pulseLiveStream {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 232, 122, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 232, 122, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 232, 122, 0);
  }
}

/* ============================================================
   QUICK NAV BAR (kolam.php horizontal scroll nav)
   ============================================================ */
.quick-nav-bar {
  background: rgba(10, 16, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: var(--radius);
  padding: 10px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quick-nav-bar::-webkit-scrollbar { display: none; }

.quick-nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.quick-nav-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin-right: 4px;
  flex-shrink: 0;
}

.quick-nav-feed-btn {
  background: rgba(0, 232, 122, 0.12);
  border: 1px solid rgba(0, 232, 122, 0.35);
  color: var(--success);
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
}

.quick-nav-feed-btn:hover {
  background: rgba(0, 232, 122, 0.22);
  border-color: var(--success);
  color: var(--success);
  transform: translateY(-1px);
}

/* ============================================================
   HERO BANNER COMPONENT WITH BACKGROUND IMAGE
   ============================================================ */
.hero-card {
  background: #070D1D;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: var(--radius);
  padding: 38px 42px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), 0 0 35px rgba(0, 212, 255, 0.16);
  display: block;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.hero-card:hover {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.65), 0 0 45px rgba(0, 212, 255, 0.25);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Subtle glass light-flare shimmer sweep effect across hero banner */
.hero-card::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -120%;
  width: 50%;
  height: 220%;
  background: linear-gradient(
    75deg, 
    transparent 30%, 
    rgba(0, 212, 255, 0.08) 48%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(0, 212, 255, 0.06) 54%, 
    transparent 70%
  );
  transform: rotate(22deg);
  pointer-events: none;
  z-index: 1;
  animation: heroCardShimmer 11s ease-in-out infinite;
}

@keyframes heroCardShimmer {
  0%   { left: -120%; opacity: 0; }
  8%   { opacity: 1; }
  32%  { left: 160%; opacity: 0; }
  100% { left: 160%; opacity: 0; }
}

/* Background Image Layer & Overlay */
.hero-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Aquatic cyan ambient glow pulsing in top-right */
.hero-bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 55% at 85% 28%, rgba(0, 212, 255, 0.18) 0%, rgba(0, 232, 122, 0.05) 45%, transparent 75%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: heroGlowPulse 8s ease-in-out infinite alternate;
}

@keyframes heroGlowPulse {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.04); }
}

/* Background Image - Clearly Visible with cinematic subtle Ken Burns effect */
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 1;
  filter: brightness(0.96) contrast(1.06) saturate(1.15);
  transform-origin: 60% 40%;
  animation: heroKenBurns 22s ease-in-out infinite alternate;
  transition: opacity 0.5s ease, filter 0.5s ease;
}

.hero-card:hover .hero-bg-img {
  opacity: 1;
  filter: brightness(1.02) contrast(1.10) saturate(1.20);
}

@keyframes heroKenBurns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.045) translate(-0.8%, -0.6%);
  }
  100% {
    transform: scale(1.025) translate(0.6%, 0.4%);
  }
}

/* Intelligent Multi-layer Gradient Overlay:
   - Gentle smooth protection on the left for crisp text contrast
   - Highly transparent on the right so the background image is crystal-clear
   - Subtle vertical vignettes for seamless edge integration */
.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, 
      rgba(5, 9, 20, 0.82) 0%, 
      rgba(5, 9, 20, 0.62) 36%, 
      rgba(7, 13, 28, 0.20) 72%, 
      rgba(7, 13, 28, 0.04) 100%
    ),
    linear-gradient(0deg, 
      rgba(6, 10, 20, 0.60) 0%, 
      rgba(6, 10, 20, 0.15) 35%, 
      transparent 65%
    ),
    linear-gradient(180deg, 
      rgba(6, 10, 20, 0.30) 0%, 
      transparent 20%
    );
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 212, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.95);
}

.hero-subtitle {
  font-size: 14px;
  color: rgba(230, 240, 255, 0.92);
  line-height: 1.6;
  margin-bottom: 22px;
  max-width: 800px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.hero-kpi-row {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hero-kpi-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-kpi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
}
.hero-kpi-icon.green  { background: var(--success-dim); color: var(--success); }
.hero-kpi-icon.yellow { background: var(--warning-dim); color: var(--warning); }
.hero-kpi-icon.red    { background: var(--danger-dim);  color: var(--danger); }
.hero-kpi-icon.cyan   { background: rgba(0,212,255,0.1); color: var(--accent); }

.hero-kpi-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.hero-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

.hero-kpi-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-img-badge {
  background: rgba(10, 18, 38, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-img-badge-icon {
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 992px) {
  .hero-card {
    padding: 24px 20px;
  }
  .hero-title {
    font-size: 22px;
  }
  .hero-kpi-row {
    width: 100%;
    justify-content: space-between;
  }
}

/* ============================================================
   HUMANIZED UI ENHANCEMENTS (POND MOOD & SHRIMP WELFARE)
   ============================================================ */
.greeting-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 184, 0, 0.12);
  border: 1px solid rgba(255, 184, 0, 0.3);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warning);
  line-height: 1.2;
}

.operator-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(13, 20, 38, 0.85);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.operator-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00D4FF, #7C5CFC);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.welfare-card {
  background: linear-gradient(135deg, rgba(13, 25, 48, 0.95) 0%, rgba(10, 20, 40, 0.9) 100%);
  border: 1px solid rgba(0, 232, 122, 0.25);
  border-radius: var(--radius);
  padding: 22px 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.welfare-card.warning {
  border-color: rgba(255, 184, 0, 0.35);
  background: linear-gradient(135deg, rgba(35, 25, 15, 0.95) 0%, rgba(20, 15, 10, 0.9) 100%);
}

.welfare-card.critical {
  border-color: rgba(255, 69, 96, 0.4);
  background: linear-gradient(135deg, rgba(35, 15, 20, 0.95) 0%, rgba(25, 10, 15, 0.9) 100%);
}

.shrimp-mood-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(0, 232, 122, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--success);
  flex-shrink: 0;
  animation: floatShrimp 3s ease-in-out infinite;
}

.welfare-card.warning .shrimp-mood-box {
  background: rgba(255, 184, 0, 0.15);
  color: var(--warning);
}

.welfare-card.critical .shrimp-mood-box {
  background: rgba(255, 69, 96, 0.15);
  color: var(--danger);
}

@keyframes floatShrimp {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

.human-meaning-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.18);
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 4px;
}

.tips-card {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.08) 0%, rgba(0, 212, 255, 0.05) 100%);
  border: 1px dashed rgba(124, 92, 252, 0.35);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tips-icon {
  font-size: 20px;
  color: var(--info);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(124, 92, 252, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   HUMANIZED MODAL SYSTEM (Warm & Farmer-Friendly)
   ============================================================ */
.tambak-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 24, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.tambak-modal-card {
  background: linear-gradient(145deg, #0d162d 0%, #080e1e 100%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 212, 255, 0.15);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.tambak-modal-overlay.active .tambak-modal-card {
  transform: translateY(0) scale(1);
}

.tambak-modal-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tambak-modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(0, 232, 122, 0.15);
  border: 1px solid rgba(0, 232, 122, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  animation: floatShrimp 3s ease-in-out infinite;
}

.tambak-modal-avatar.warning {
  background: rgba(255, 184, 0, 0.15);
  border-color: rgba(255, 184, 0, 0.3);
}

.tambak-modal-avatar.critical {
  background: rgba(255, 69, 96, 0.15);
  border-color: rgba(255, 69, 96, 0.3);
}

.tambak-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tambak-modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.tambak-modal-body {
  padding: 20px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tambak-modal-telemetry-box {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.telemetry-item {
  text-align: center;
}

.telemetry-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.telemetry-val {
  font-size: 16px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.tambak-modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================================
   KOLAM WELFARE & PARAMETER HINTS
   ============================================================ */
.kolam-welfare-banner {
  background: linear-gradient(135deg, rgba(13, 26, 48, 0.9) 0%, rgba(8, 16, 32, 0.95) 100%);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.kolam-welfare-banner.normal {
  border-color: rgba(0, 232, 122, 0.3);
  background: linear-gradient(135deg, rgba(10, 32, 24, 0.9) 0%, rgba(6, 18, 16, 0.95) 100%);
}

.kolam-welfare-banner.warning {
  border-color: rgba(255, 184, 0, 0.35);
  background: linear-gradient(135deg, rgba(32, 24, 12, 0.9) 0%, rgba(20, 14, 8, 0.95) 100%);
}

.kolam-welfare-banner.critical {
  border-color: rgba(255, 69, 96, 0.4);
  background: linear-gradient(135deg, rgba(36, 12, 16, 0.9) 0%, rgba(22, 8, 10, 0.95) 100%);
}

.human-param-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

/* ============================================================
   CHECKLIST SPIRIT BANNER (Motivational)
   ============================================================ */
.checklist-spirit-banner {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.12) 0%, rgba(0, 212, 255, 0.08) 100%);
  border: 1px solid rgba(124, 92, 252, 0.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.spirit-avatar {
  font-size: 26px;
  color: var(--info);
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(124, 92, 252, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(124, 92, 252, 0.3);
}

.spirit-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.spirit-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   FEEDING SCHEDULE & GUIDE CARDS
   ============================================================ */
.feeding-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.petambak-wisdom-quote {
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 12px 0;
}

/* ============================================================
   COMPACT SENSOR SUMMARY CARD
   ============================================================ */
.compact-summary-card {
  overflow: hidden;
}

.compact-sensor-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-top: 1px solid var(--border);
}

.compact-sensor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px 12px;
  gap: 4px;
  border-right: 1px solid var(--border);
  text-align: center;
  transition: background 0.18s;
  position: relative;
}

.compact-sensor-item:last-child {
  border-right: none;
}

.compact-sensor-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.compact-sensor-icon {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 2px;
}

.compact-sensor-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.compact-sensor-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.compact-sensor-unit {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 1px;
  vertical-align: baseline;
}

.compact-sensor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Tablet: 4 columns */
@media (max-width: 900px) {
  .compact-sensor-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .compact-sensor-item:nth-child(4n) {
    border-right: none;
  }
  .compact-sensor-item:nth-child(n+5) {
    border-top: 1px solid var(--border);
  }
}

/* Mobile: 2 columns, scrollable */
@media (max-width: 576px) {
  .compact-sensor-grid {
    grid-template-columns: repeat(2, 1fr);
    overflow-x: unset;
  }
  .compact-sensor-item {
    padding: 12px 6px 10px;
    border-right: 1px solid var(--border);
  }
  .compact-sensor-item:nth-child(even) {
    border-right: none;
  }
  .compact-sensor-item:nth-child(n+3) {
    border-top: 1px solid var(--border);
  }
  .compact-sensor-value {
    font-size: 18px;
  }
  .compact-sensor-icon {
    font-size: 16px;
  }
  /* Hide the detailed sensor grid on mobile, show only compact card */
  .sensor-grid {
    display: none !important;
  }
  .compact-summary-card {
    margin-bottom: 0 !important;
  }
}
