:root {
  --blue:       #1565C0;
  --blue-brand: #1F6FAF;
  --blue-light: #E3F2FD;
  --blue-mid:   #BBDEFB;
  --teal:       #00ACC1;
  --bg:         #F7F9FC;
  --card-bg:    #FFFFFF;
  --red:        #E53935;
  --orange:     #FB8C00;
  --green:      #43A047;
  --text:       #2D2D2D;
  --muted:      #757575;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(15, 23, 42, 0.04);
  --sidebar-w:  240px;
}

.flow-dashboard-shell, .flow-detail-shell { background: #f2f7fb; margin-top: 20px; padding-bottom: 24px; }
.flow-brand-header, .flow-detail-brand-header { background: #0869ad; color: white; padding: 22px 34px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.flow-brand-name { font-size: 25px; font-weight: 800; letter-spacing: .4px; }
.flow-brand-title { font-size: 22px; font-weight: 700; margin-top: 3px; }
.flow-brand-project { font-size: 15px; opacity: .82; white-space: nowrap; }
.flow-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding: 26px 34px 18px; }
.flow-kpi { background: #fff; border: 1px solid #cbdbea; border-radius: 15px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.flow-kpi span { display: block; color: #5d6480; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.flow-kpi strong { display: block; color: #0870bb; font-size: 28px; line-height: 1.25; margin-top: 13px; }
.flow-section-title { color: #20283c; font-size: 22px; font-weight: 800; padding: 0 34px 10px; }
.flow-building-card { background: #fff; border: 1px solid #cbdbea; border-radius: 15px; padding: 16px; cursor: pointer; transition: box-shadow .2s, transform .2s; }
.flow-building-card:hover { box-shadow: 0 8px 22px rgba(15, 71, 115, .12); transform: translateY(-2px); }
.flow-building-card h3 { color: #20283c; font-size: 18px; font-weight: 800; }
.flow-building-card p { color: #737b91; font-size: 12px; margin-top: 2px; }
.flow-status-dot { width: 14px; height: 14px; background: #08a65a; border-radius: 50%; display: block; margin-top: 3px; }
.flow-status-offline { background: #d64545; }
.flow-card-label { color: #70778b; font-size: 13px; margin-top: 13px; }
.flow-card-number { color: #0870bb; font-size: 25px; font-weight: 800; }
.flow-card-flow { color: #178246; font-size: 16px; font-weight: 800; }
.flow-card-total { color: #586174; font-size: 12px; margin-top: 10px; }
.flow-card-offline { border-color: #e9b7b7; }
.flow-detail-shell { padding-bottom: 30px; }
.flow-detail-shell > .settings-card { margin: 0 34px; border-color: #cbdbea; box-shadow: none; }
.flow-detail-kpis { padding-top: 26px; }
.flow-detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 28px; }
.flow-detail-chart, .flow-period-panel { background: #fff; border: 1px solid #cbdbea; border-radius: 15px; padding: 20px; }
.flow-detail-chart h2, .flow-period-panel h2 { color: #20283c; font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.flow-chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flow-chart-heading select { border: 1px solid #cbdbea; border-radius: 8px; padding: 8px 10px; color: #20283c; }
.flow-detail-chart-wrap { height: 380px; }
.flow-period-panel label { display: block; color: #70778b; font-size: 13px; margin-top: 16px; }
.flow-period-panel input { display: block; width: 100%; margin-top: 6px; border: 1px solid #cbdbea; border-radius: 8px; padding: 11px; color: #20283c; }
.flow-period-panel .btn { width: 100%; margin-top: 18px; text-align: center; text-decoration: none; }
.flow-period-result { margin-top: 24px; color: #70778b; font-size: 13px; }
.flow-period-result strong { display: block; color: #0870bb; font-size: 28px; margin-top: 5px; }
.flow-export-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flow-online { color: #079b55 !important; }
.flow-offline { color: #c23b3b !important; }
.flow-updated-at { display: block; color: #70778b; font-size: 11px; font-weight: 400; margin-top: 5px; }
.flow-dashboard-page { background: #f2f7fb; padding-bottom: 28px; }
.flow-history-card { margin: 0 34px 20px; padding: 22px; background: #fff; border: 1px solid #cbdbea; border-radius: 15px; }
.flow-history-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.flow-history-heading h2 { margin: 0; color: #20283c; font-size: 22px; font-weight: 800; }
.flow-history-heading p { margin: 5px 0 0; color: #667085; }
.flow-history-heading strong { color: #1565c0; font-size: 22px; white-space: nowrap; }
.flow-history-controls { display: flex; align-items: flex-end; gap: 16px; }
.flow-history-controls label { display: flex; flex-direction: column; gap: 4px; color: #667085; font-size: 12px; }
.flow-history-controls select { border: 1px solid #cbdbea; border-radius: 7px; padding: 7px 9px; color: #20283c; background: #fff; }
.flow-custom-date input { border: 1px solid #cbdbea; border-radius: 7px; padding: 7px 9px; color: #20283c; background: #fff; }
.flow-custom-apply { padding: 7px 10px; }
.flow-history-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; color: #667085; font-size: 13px; }
.flow-history-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.flow-history-legend-item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.flow-history-chart { height: 220px; display: flex; align-items: flex-end; gap: 4px; margin-top: 20px; padding: 12px 8px 0; border-bottom: 1px solid #b8c7d6; background: repeating-linear-gradient(to top, transparent 0, transparent 54px, #eef2f6 55px); }
.flow-history-column { flex: 1; height: 100%; min-width: 3px; display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.flow-history-bar { width: min(100%, 8px); min-height: 3px; background: #4e73df; border-radius: 3px 3px 0 0; }
.flow-chart-tooltip { position: fixed; z-index: 20; pointer-events: none; display: none; min-width: 210px; padding: 12px 14px; border: 2px solid #b7b9be; border-radius: 7px; background: #fff; color: #666; font-size: 16px; white-space: nowrap; box-shadow: 0 3px 8px rgba(32,40,60,.2); }
.flow-chart-tooltip.visible { display: block; }
.flow-chart-tooltip-date { margin-bottom: 7px; color: #666; font-size: 16px; }
.flow-chart-tooltip-row { display: grid; grid-template-columns: 12px 90px minmax(70px, 130px) auto; align-items: center; gap: 7px; line-height: 1.45; }
.flow-chart-tooltip-row i { width: 12px; height: 12px; border-radius: 50%; }
.flow-chart-progress { height: 7px; background: #f1f0ed; border-radius: 5px; overflow: hidden; }
.flow-chart-progress b { display: block; height: 100%; border-radius: inherit; }
.flow-chart-tooltip-row strong { color: #666; font-size: 17px; }
.flow-history-axis { display: flex; justify-content: space-between; color: #667085; font-size: 12px; margin: 8px 8px 0; }
.flow-page-kpis { padding-top: 0; }
.flow-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 8px 34px 18px; }
.flow-toolbar h2 { color: #20283c; font-size: 22px; font-weight: 800; }
.flow-toolbar p { color: #737b91; font-size: 14px; }
.flow-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flow-toolbar-actions .btn, .flow-compare-heading .btn { text-decoration: none; white-space: nowrap; }
.flow-meter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 0 34px; }
.flow-card-select { display: flex; justify-content: space-between; align-items: center; }
.flow-card-select input { width: 17px; height: 17px; accent-color: #0870bb; }
.flow-card-click { cursor: pointer; }
.flow-compare-table { margin: 0 34px 18px; background: white; border: 1px solid #cbdbea; border-radius: 12px; overflow: auto; }
.flow-compare-table table { width: 100%; border-collapse: collapse; min-width: 640px; }
.flow-compare-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.flow-compare-heading h3 { color: #20283c; font-size: 17px; font-weight: 800; }
.flow-compare-table th, .flow-compare-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #dce6ef; font-size: 14px; }
.flow-compare-table th { background: #dceefd; color: #24334c; font-weight: 800; }
@media (max-width: 1100px) { .flow-meter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .flow-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow-brand-header, .flow-detail-brand-header { padding: 18px 20px; } .flow-section-title { padding-left: 20px; } .flow-detail-shell > .settings-card { margin: 0 20px; } .flow-toolbar { padding-left: 20px; padding-right: 20px; } .flow-meter-grid { padding: 0 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow-compare-table { margin-left: 20px; margin-right: 20px; } .flow-history-card { margin-left: 20px; margin-right: 20px; } }
@media (max-width: 560px) { .flow-kpi-grid { grid-template-columns: 1fr; padding: 18px 14px; } .flow-brand-header, .flow-detail-brand-header { display: block; } .flow-brand-project { margin-top: 8px; } .flow-brand-name { font-size: 20px; } .flow-brand-title { font-size: 17px; } .flow-section-title { padding-left: 14px; } .flow-detail-shell > .settings-card { margin: 0 14px; padding: 10px; } .flow-detail-chart, .flow-period-panel { padding: 15px; } .flow-detail-chart-wrap { height: 280px; } .flow-toolbar { display: block; padding: 8px 14px 18px; } .flow-toolbar button { margin-top: 12px; } .flow-meter-grid { grid-template-columns: 1fr; padding: 0 14px; } .flow-compare-table { margin-left: 14px; margin-right: 14px; } .flow-history-card { margin-left: 14px; margin-right: 14px; padding: 15px; } .flow-history-heading { display: block; } .flow-history-controls { justify-content: space-between; margin-top: 12px; } .flow-history-heading h2, .flow-history-heading strong { font-size: 18px; } .flow-history-chart { height: 180px; gap: 3px; } .flow-export-buttons { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .flow-detail-layout { grid-template-columns: 1fr; } }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  margin: 0;
  line-height: 1.5;
}

/* Login Page */
.login-page {
  background: var(--blue);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 36px 40px 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0 auto 10px;
}

.login-header p {
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  padding: 12px 16px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--blue);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: #FFFFFF;
  border-right: 1px solid #E6EAF0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid #E6EAF0;
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 142px;
  height: auto;
}

.logo-icon {
  flex-shrink: 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.loc-header-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.user-avatar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #98A2B3;
}

.logout-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar nav {
  flex: 1;
  padding: 20px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #667085;
  border-radius: 7px;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #F2F6FB;
  color: var(--blue);
}

.nav-item.active {
  background: #EAF3FB;
  color: var(--blue);
  font-weight: 500;
}

.nav-item .icon {
  font-size: 18px;
}

.location-switcher {
  padding: 20px;
  border-top: 1px solid #E6EAF0;
}

.location-switcher-header {
  font-size: 12px;
  font-weight: 600;
  color: #98A2B3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.loc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #667085;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  transition: all 0.2s;
}

.loc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.loc-dot-active {
  background: #4CAF50;
}

.loc-item:hover {
  background: #F2F6FB;
  color: var(--blue);
}

.loc-item.loc-active {
  background: #EAF3FB;
  color: var(--blue);
  font-weight: 500;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid #E6EAF0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer span {
  color: #667085;
  font-size: 13px;
}

.logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #98A2B3;
  text-decoration: none;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

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

/* Main Content */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 36px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--muted);
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

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

.location-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.location-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.location-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.location-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.location-info p {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0;
}

.location-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #E0E0E0;
}

.view-link {
  color: var(--blue);
  font-weight: 500;
  font-size: 14px;
}

/* Tanks */
.tanks-container {
  min-height: 200px;
}

.tank-section {
  margin-bottom: 32px;
}

.tank-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tanks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 16px;
}

.tank-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e6edf4;
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(28, 61, 91, 0.07);
  padding: 15px 14px 13px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tank-card:hover {
  transform: translateY(-4px);
  border-color: #c5d9eb;
  box-shadow: 0 12px 26px rgba(28, 61, 91, 0.13);
}

.tank-card-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tank-card-header h3 {
  font-size: 15px;
  font-weight: 750;
  color: #202b3d;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  flex: 1;
}

.tank-card-chevron {
  font-size: 16px;
  color: #AAB8C8;
  margin-left: 4px;
}

.tank-card-type {
  width: 100%;
  text-align: left;
  font-size: 11px;
  color: #8290a1;
  letter-spacing: .2px;
  margin-bottom: 12px;
}

.tank-visual {
  width: 100%;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  overflow: visible;
  position: relative;
}

.tank-visual svg {
  width: 112px;
  max-width: 100%;
  height: auto;
  max-height: 90px;
  display: block;
}

.tank-status-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 5px rgba(15, 66, 39, 0.22);
  border: 2px solid #fff;
}

.tank-status-badge svg {
  width: 10px;
  height: 10px;
}

.tank-card-percent {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.4px;
  margin: 4px 0 10px;
}

.tank-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.last-updated {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.last-updated.stale {
  color: var(--red);
  font-weight: 600;
}

.stale-icon {
  width: 12px;
  height: 12px;
  color: var(--red);
  flex-shrink: 0;
}

.tank-card-stale {
  border-left: 4px solid var(--red);
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
}

/* Pump Detail */
.pump-detail-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pump-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.tank-large {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.pump-info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.pump-main-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.main-stat {
  flex: 1;
}

.main-stat-value {
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
}

.main-stat-label {
  font-size: 14px;
  color: var(--muted);
}

.pump-state {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #E0E0E0;
}

.badge-large {
  font-size: 16px;
  padding: 8px 16px;
}

.pump-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
}

.detail-label {
  color: var(--muted);
  font-size: 14px;
}

.detail-value {
  font-weight: 500;
  font-size: 14px;
}

.chart-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.chart-container h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Events */
.events-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.events-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
}

.filter-controls select {
  padding: 10px 16px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.events-table-container {
  overflow-x: auto;
}

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

.events-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid #E0E0E0;
}

.events-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #E0E0E0;
}

.change-badge {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 4px;
}

.direction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
}

.direction-badge.rising {
  background: #E8F5E9;
  color: var(--green);
}

.direction-badge.falling {
  background: #FFEBEE;
  color: var(--red);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #E0E0E0;
}

/* Settings */
.settings-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.settings-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.settings-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.settings-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #E0E0E0;
}

.info-label {
  color: var(--muted);
  font-size: 14px;
}

.info-value {
  font-weight: 500;
  font-size: 14px;
}

.map-container {
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--blue);
  color: white;
}

.btn-primary:hover {
  background: #0D47A1;
}

.btn-secondary {
  background: #E0E0E0;
  color: var(--text);
}

.btn-secondary:hover {
  background: #BDBDBD;
}

.btn-block {
  width: 100%;
}

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

/* Badges */
.badge {
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.badge-red {
  background: #FFEBEE;
  color: var(--red);
}

.badge-orange {
  background: #FFF3E0;
  color: var(--orange);
}

.badge-green {
  background: #E8F5E9;
  color: var(--green);
}

.badge-blue {
  background: #E3F2FD;
  color: var(--blue);
}

/* Utility */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.error {
  text-align: center;
  padding: 40px;
  color: var(--red);
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #FFEBEE;
  color: var(--red);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* Responsive */
@media (max-width: 1024px) {
  .pump-overview,
  .settings-container {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .pump-main-stats {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
    z-index: 1002;
  }
  
  .mobile-menu-toggle.menu-open {
    display: none !important;
  }
  
  .mobile-menu-overlay.mobile-open {
    display: block;
    z-index: 1001;
  }
  
  .main-content {
    margin-left: 0;
    padding: 64px 16px 16px;
  }
  
  .locations-grid {
    grid-template-columns: 1fr;
  }
  
  .tanks-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  
  .events-controls {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-box {
    min-width: 100%;
  }
  
  .events-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .events-table {
    min-width: 600px;
  }
  
  .tank-stats {
    flex-direction: column;
    gap: 8px;
  }
  
  .tank-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .pump-state {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .main-stat-value {
    font-size: 28px;
  }
  
  .tank-large {
    padding: 24px;
    min-height: 200px;
  }
  
  .pagination {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .page-header h1 {
    font-size: 24px;
  }
  
  .location-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .detail-row {
    flex-direction: column;
    gap: 4px;
  }
  
  .settings-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px;
    margin: 16px;
  }
  
  .login-header h1 {
    font-size: 28px;
  }
  
  .tank-card,
  .location-card {
    padding: 16px;
  }
  
  .pump-info-card,
  .chart-container,
  .settings-card {
    padding: 16px;
  }
  
  .main-stat-value {
    font-size: 24px;
  }
  
  .tank-visual {
    height: 80px;
    margin-bottom: 12px;
  }

  .tank-visual svg {
    max-height: 80px;
  }
  
  .badge-large {
    font-size: 14px;
    padding: 6px 12px;
  }
}
