:root {
  --bg-primary: #060911;
  --bg-secondary: #0a101d;
  --bg-card: rgba(16, 24, 40, 0.75);
  --bg-card-hover: rgba(28, 41, 68, 0.85);
  --bg-input: #080d1a;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --gold-gradient: linear-gradient(135deg, #f59e0b, #d4af37);
  
  --primary-blue: #0284c7;
  --primary-blue-glow: rgba(2, 132, 199, 0.35);
  --accent-cyan: #38bdf8;
  --accent-teal: #14b8a6;
  
  --water-blue: #0ea5e9;
  --water-deep: #0369a1;
  --water-crest: #7dd3fc;
  
  --status-surplus: #38bdf8;
  --status-near: #34d399;
  --status-normal: #fbbf24;
  --status-low: #fb923c;
  --status-critical: #f87171;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cinzel', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Buttons Base Styling */
button, .btn {
  font-family: var(--font-family);
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: var(--accent-cyan) !important;
  color: #ffffff !important;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7) !important;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
}

/* Header & Top Bar */
.top-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

.brand-title h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title p {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 500;
}

.time-deadline-badge {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 6px 16px;
  border-radius: 8px;
}

.clock-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.clock-date {
  font-size: 11px;
  color: var(--text-muted);
}

.deadline-tag {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: pulse 2s infinite;
}

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

/* Nav Tabs */
.nav-tabs-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav-tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
}

.nav-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}

.nav-tab .tab-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Stat Cards Banner */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(56, 189, 248, 0.12);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.stat-icon.blue { 
  background: rgba(56, 189, 248, 0.14); 
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8; 
}
.stat-icon.green { 
  background: rgba(52, 211, 153, 0.14); 
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399; 
}
.stat-icon.yellow { 
  background: rgba(251, 191, 36, 0.14); 
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24; 
}
.stat-icon.red { 
  background: rgba(248, 113, 113, 0.14); 
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171; 
}

.stat-data h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-data .stat-val {
  font-size: 23px;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-mono);
  margin-top: 3px;
  letter-spacing: -0.3px;
}

.stat-data .stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Action Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.section-title p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Table Style */
.table-wrap {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  background: #0f172a;
  color: #94a3b8;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  border-bottom: 2px solid rgba(56, 189, 248, 0.2);
  font-weight: 800;
  white-space: nowrap;
}

table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  vertical-align: middle;
}

table.data-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

table.data-table tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

/* Inputs in Data Entry Table */
.input-num {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  width: 95px;
  transition: border-color 0.2s;
}

.input-num:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-text {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  width: 100%;
  min-width: 150px;
}

.input-text:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* Progress Fill Bar in Rows */
.level-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
}

.level-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.level-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.level-bar-fill.surplus { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.level-bar-fill.near { background: linear-gradient(90deg, #059669, #34d399); }
.level-bar-fill.normal { background: linear-gradient(90deg, #d97706, #fbbf24); }
.level-bar-fill.low { background: linear-gradient(90deg, #ea580c, #fb923c); }
.level-bar-fill.critical { background: linear-gradient(90deg, #dc2626, #f87171); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.surplus { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.status-badge.near { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-badge.normal { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-badge.low { background: rgba(251, 146, 60, 0.15); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.3); }
.status-badge.critical { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

/* Report Preview Box */
.report-preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .report-preview-container {
    grid-template-columns: 1fr;
  }
}

.whatsapp-box {
  background: #111b21;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.whatsapp-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.wa-preview-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #e9edef;
  white-space: pre-wrap;
  background: #182229;
  padding: 16px;
  border-radius: 8px;
  flex: 1;
  max-height: 480px;
  overflow-y: auto;
  line-height: 1.6;
}

.official-bulletin-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
}

/* Water Gauge Cards (Visual Tab) */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gauge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gauge-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.tank-visual-cylinder {
  height: 140px;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ftl-marker-line {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  border-top: 2px dashed rgba(248, 113, 113, 0.7);
  display: flex;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  color: #f87171;
  font-weight: 700;
}

.water-body {
  width: 100%;
  background: linear-gradient(180deg, var(--water-crest) 0%, var(--water-blue) 40%, var(--water-deep) 100%);
  position: relative;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-wave {
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 8px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 70%);
}

.water-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.water-readout .big-pct {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  font-family: var(--font-mono);
}

.water-readout .sub-level {
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 600;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  width: 90%;
  max-width: 520px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Official Government Table & Print Styles */
.official-gov-table th, .official-gov-table td {
  border: 1px solid #000 !important;
  padding: 5px 6px;
  vertical-align: middle;
}

.official-gov-table tr.grp-hdr {
  background: #e2e8f0 !important;
  font-weight: 900;
  color: #000;
  text-align: left;
  letter-spacing: 0.3px;
  font-size: 12px;
}

.official-gov-table tr.subtotal-row {
  background: #e0f2fe !important;
  font-weight: 800;
  color: #0369a1;
  border-top: 1.5px solid #000 !important;
  border-bottom: 1.5px solid #000 !important;
}

.official-gov-table tr.grandtotal-row {
  background: #fef08a !important;
  font-weight: 900;
  color: #854d0e;
  font-size: 13px;
  border-top: 2px solid #000 !important;
  border-bottom: 2px solid #000 !important;
}

/* Printable PDF View */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .top-header, .nav-tabs-bar, .section-header, .stats-grid, .report-view-switcher, .rpt-view-btn, 
  #report-view-bulletin, #report-view-whatsapp, .toast-msg, .btn, #login-modal, #officer-modal, #tank-modal {
    display: none !important;
  }
  #panel-report {
    display: block !important;
  }
  #report-view-division {
    display: block !important;
  }
  .official-print-document {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .official-gov-table {
    border: 1.5px solid #000 !important;
    width: 100% !important;
  }
  .official-gov-table th, .official-gov-table td {
    border: 1px solid #000 !important;
    color: #000 !important;
    font-size: 11px !important;
  }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (Smartphones & Touch Devices)
   ========================================================================== */

@media (max-width: 900px) {
  /* Header */
  .top-header {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

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

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand-title h1 {
    font-size: 15px;
  }

  .brand-title p {
    font-size: 10.5px;
  }

  .header-controls-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px !important;
    width: 100%;
  }

  #division-switcher-badge,
  #user-profile-badge,
  .time-deadline-badge {
    flex: 1 1 auto;
    padding: 6px 10px;
  }

  /* Navigation Tabs */
  .nav-tabs-bar {
    padding: 0 8px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #0a0f1d;
  }
  .nav-tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    padding: 10px 12px;
    font-size: 12px;
    gap: 6px;
  }

  /* Main Container */
  .main-content {
    padding: 12px 10px 90px 10px;
  }

  /* Stat Cards */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .stat-card {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 10px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 8px;
  }

  .stat-data h4 {
    font-size: 10px;
  }

  .stat-data .stat-val {
    font-size: 17px;
  }

  .stat-data .stat-sub {
    font-size: 10px;
  }

  /* Section Header */
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-title h2 {
    font-size: 16px;
  }

  .entry-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .entry-actions-bar .btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  /* Touch-Friendly Data Table */
  .table-wrap {
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    position: relative;
    max-width: 100vw;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  table.data-table th,
  table.data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Sticky Tank Name Column on Mobile horizontal scroll */
  table.data-table th:nth-child(2),
  table.data-table td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #1e293b;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.45);
    min-width: 140px;
  }

  table.data-table th:nth-child(2) {
    z-index: 3;
    background: #0f172a;
  }

  /* Inputs for Mobile: minimum 16px to prevent iOS Safari auto-zoom */
  .input-num {
    width: 78px;
    min-height: 38px;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 6px;
  }

  .input-text {
    min-height: 38px;
    font-size: 15px;
    padding: 6px 10px;
  }

/* Hide Netlify injected badge / drawer */
div[data-netlify-badge],
iframe[src*="netlify"],
[class*="netlify-badge"],
#netlify-badge,
.netlify-badge,
[data-netlify-deploy-id],
.netlify-feedback-button,
#netlify-drawer-root {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

  /* Floating Mobile Quick Save Bar */
  .mobile-quick-save-bar {
    display: flex !important;
    position: fixed !important;
    bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
    left: 12px !important;
    right: 12px !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.96);
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2);
    backdrop-filter: blur(12px);
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  /* Modals */
  .modal-box {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 88vh !important;
    padding: 16px !important;
    overflow-y: auto;
    border-radius: 14px !important;
  }

  /* WhatsApp & Report Preview on Mobile */
  .report-preview-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .whatsapp-box {
    padding: 12px;
    border-radius: 10px;
  }

  .wa-preview-text {
    max-height: 340px;
    font-size: 12px;
    padding: 12px;
    border-radius: 8px;
  }

  .official-bulletin-box {
    padding: 14px;
  }

  /* Gauges Grid */
  .gauges-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gauge-card {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .header-controls-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  #division-switcher-badge,
  #user-profile-badge,
  .time-deadline-badge {
    width: 100%;
  }

  .stat-card {
    padding: 8px 10px;
  }

  .stat-data .stat-val {
    font-size: 16px;
  }
}

/* ==========================================================================
   ONE-SNAP MOBILE TANK ENTRY CARDS
   ========================================================================== */

.view-mode-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
}

.view-mode-btn.active {
  background: var(--primary-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.tank-entry-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tank-entry-card:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.tank-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tank-card-index {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  min-width: 32px;
  text-align: center;
}

.tank-card-title-group {
  flex: 1;
}

.tank-card-name {
  font-size: 15.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.tank-card-geo {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tank-card-progress-wrap {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
}

.tank-card-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  margin-bottom: 6px;
}

.tank-card-body-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
}

.tank-card-metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.metric-val {
  font-size: 15px;
  font-weight: 800;
  color: #f1f5f9;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.tank-card-input-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.mobile-card-input {
  width: 115px !important;
  min-height: 42px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  text-align: center !important;
  color: #38bdf8 !important;
  background: #090d16 !important;
  border: 1.5px solid #0284c7 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mobile-card-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35) !important;
}

/* Visibility rules by device width */
@media (max-width: 900px) {
  body:not(.view-table-forced) #entry-table-wrap {
    display: none !important;
  }
  body:not(.view-table-forced) #entry-cards-container {
    display: flex !important;
  }

  body.view-table-forced #entry-table-wrap {
    display: block !important;
  }
  body.view-table-forced #entry-cards-container {
    display: none !important;
  }
}

@media (min-width: 901px) {
  body:not(.view-cards-forced) #entry-table-wrap {
    display: block !important;
  }
  body:not(.view-cards-forced) #entry-cards-container {
    display: none !important;
  }

}

/* ==========================================================================
   MOBILE-FRIENDLY ENTRY CONTROLS & FEEDING FILTERS
   ========================================================================== */

.entry-subdiv-bar {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.18), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.entry-subdiv-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-subdiv-select-wrap {
  flex: 1;
  min-width: 240px;
}

.entry-filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.entry-filter-main-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.entry-search-wrap {
  flex: 1;
  min-width: 220px;
}

.entry-dropdowns-grid {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.entry-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entry-filter-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control,
.entry-select-input {
  background: #090d16;
  color: #fff;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 42px;
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.form-control:focus,
.entry-select-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* Horizontal Quick Feeding Chips (Touch-Friendly for Mobile) */
.feeding-chips-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.feeding-chips-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-clear-filters {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-filters:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #f87171;
  color: #f87171;
}

.feeding-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px 2px;
  scrollbar-width: none;
}
.feeding-chips-scroll::-webkit-scrollbar {
  display: none;
}

.feeding-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;
}

.feeding-chip:active {
  transform: scale(0.96);
}

.feeding-chip.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.feeding-chip-count {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  border-radius: 10px;
  color: #94a3b8;
}

.feeding-chip.active .feeding-chip-count {
  background: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-weight: 800;
}

/* Mobile specific overrides (< 768px) */
@media (max-width: 768px) {
  .main-content {
    padding: 10px 10px 85px 10px !important;
  }

  .top-header {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .time-deadline-badge {
    padding: 4px 10px !important;
    gap: 8px !important;
  }

  .clock-time {
    font-size: 13px !important;
  }

  .deadline-tag {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }

  /* Compact 2-Column Stat Cards Grid for Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .stat-card {
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 11px !important;
  }

  .stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
    border-radius: 9px !important;
  }

  .stat-data h4 {
    font-size: 9.5px !important;
    letter-spacing: 0.3px !important;
  }

  .stat-data .stat-val {
    font-size: 17px !important;
  }

  .stat-data .stat-sub {
    font-size: 9.5px !important;
  }

  .entry-subdiv-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  
  .entry-subdiv-select-wrap {
    min-width: 100%;
    width: 100%;
  }

  .entry-filter-panel {
    padding: 12px;
  }

  .entry-filter-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .entry-search-wrap {
    min-width: 100%;
    width: 100%;
  }

  .entry-search-wrap input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    min-height: 44px !important;
    width: 100%;
  }

  .entry-dropdowns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .entry-filter-field {
    width: 100%;
  }

  .form-control,
  .entry-select-input {
    font-size: 15px !important;
    min-height: 44px !important;
    width: 100% !important;
  }

  .entry-filter-status-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .view-mode-toggle {
    width: 100%;
  }

  .view-mode-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
  }

  /* Touch-friendly Tank Card on Mobile */
  .tank-entry-card {
    padding: 12px 14px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  .tank-card-name {
    font-size: 14.5px !important;
  }

  .tank-card-body-row {
    padding: 8px 10px !important;
    gap: 6px !important;
  }

  .storage-saved-pill {
    min-height: 42px !important;
    padding: 6px 12px !important;
    gap: 8px !important;
    touch-action: manipulation;
  }

  .storage-saved-pill .pill-val {
    font-size: 14.5px !important;
  }

  .storage-saved-pill .pill-edit-btn {
    font-size: 11px !important;
    padding: 3px 8px !important;
  }

  .btn {
    min-height: 42px !important;
    touch-action: manipulation;
  }
}

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

/* Mobile Bottom Navigation Dock */
.mobile-bottom-dock {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-dock {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: rgba(6, 9, 17, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
    padding: 4px 6px env(safe-area-inset-bottom, 4px) 6px !important;
    justify-content: space-around !important;
    align-items: center !important;
  }

  .mobile-dock-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 5px 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 2px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-dock-btn:active {
    transform: scale(0.94);
  }

  .mobile-dock-btn.active {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12) !important;
  }

  .dock-icon {
    font-size: 18px;
    line-height: 1;
  }

  .dock-label {
    font-size: 9.5px;
    font-weight: 700;
  }

  .mobile-dock-btn.dock-btn-highlight {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4) !important;
    margin: 0 4px !important;
    padding: 7px 4px !important;
  }

  .mobile-dock-btn.dock-btn-highlight:active {
    transform: scale(0.94);
    background: #0369a1 !important;
  }
}

/* Tank Storage Saved Pill & Click-to-Edit Styles */
.storage-saved-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(2, 132, 199, 0.12);
  border: 1.5px solid #0284c7;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.storage-saved-pill:hover {
  background: rgba(2, 132, 199, 0.24);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}
.storage-saved-pill .pill-val {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 800;
  color: #38bdf8;
}
.storage-saved-pill .pill-edit-btn {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}
.storage-saved-pill:hover .pill-edit-btn {
  background: #0284c7;
  color: #fff;
}
.storage-editor-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

/* Submission Filter Buttons */
.filter-sub-btn {
  transition: all 0.2s;
}

/* Executive & Superintending Engineer Command Banners */
#se-readonly-banner,
#ee-readonly-banner {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Submission Confirmation Badges */
.badge-updated-today {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 2.5px 8px;
  border-radius: 5px;
}

.badge-pending-today {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 2.5px 8px;
  border-radius: 5px;
}

