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

:root {
  --primary: #0d9488; /* Emerald Teal */
  --primary-hover: #0f766e;
  --primary-glow: rgba(13, 148, 136, 0.1);
  --secondary: #0f172a;
  --sidebar-bg: #ffffff;
  --sidebar-active: rgba(13, 148, 136, 0.08);
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --border: #edf2f7;
  --text-main: #334155;
  --text-muted: #64748b;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.12);
  --warning: #ea580c;
  --danger: #e11d48;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-premium: 0 4px 20px -2px rgba(0, 0, 0, 0.02), 0 2px 8px -1px rgba(0, 0, 0, 0.02);
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  display: flex;
}

/* Sidebar Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--text-main);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 0 12px;
}

.sidebar-brand i {
  color: var(--primary);
  font-size: 1.6rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Menu Category Titles like reference image */
.menu-category-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 18px;
  margin-bottom: 8px;
  padding-left: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #64748b;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.sidebar-link:hover {
  color: var(--primary);
  background-color: rgba(13, 148, 136, 0.04);
}

.sidebar-link.active {
  color: var(--primary);
  background-color: var(--sidebar-active);
  box-shadow: inset 3px 0 0 var(--primary);
  border-radius: var(--radius-md);
  font-weight: 700;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 40px;
  background: radial-gradient(at 0% 0%, #f0fdfa 0px, transparent 50%), var(--bg-app);
}

/* Card Styling - Flat Premium Clean Mockup Style */
.card-premium {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding: 24px;
}

.card-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(13, 148, 136, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.02);
  border-color: #cbd5e1;
}

/* Metric Cards */
.metric-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.metric-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-icon-primary {
  background-color: var(--primary-glow);
  color: var(--primary);
}

.metric-icon-success {
  background-color: var(--success-glow);
  color: var(--success);
}

.metric-icon-warning {
  background-color: rgba(234, 88, 12, 0.12);
  color: var(--warning);
}

.metric-icon-info {
  background-color: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.metric-info {
  flex: 1;
}

.metric-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
}

/* 3D Tank Cylinder Widget */
.tank-visual-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

.tank-cylinder {
  width: 140px;
  height: 220px;
  position: relative;
  background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
  border-radius: 70px / 20px;
  box-shadow: inset 0 10px 20px rgba(0,0,0,0.1), 0 15px 30px rgba(0,0,0,0.05);
  overflow: hidden;
  border: 1.5px solid #94a3b8;
}

/* 3D Tank Glass Cap */
.tank-cylinder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 70%, transparent 100%);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}

/* Inner Liquid Container */
.tank-liquid-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
}

.tank-liquid {
  width: 100%;
  position: relative;
  transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 50%, #0369a1 100%);
  box-shadow: 0 -4px 15px rgba(56, 189, 248, 0.5);
  animation: pulse-glow 3s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.4)); }
  100% { filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.7)); }
}

.tank-liquid-top {
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 20px;
  background: radial-gradient(ellipse at center, #7dd3fc 0%, #38bdf8 80%, #0284c7 100%);
  border-radius: 50%;
  z-index: 5;
}

/* Waves */
.tank-wave {
  position: absolute;
  top: -12px;
  left: 0;
  width: 200%;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V120H0V0C26.9,8.75,55.05,17.2,87.6,22.07,172.9,34.8,245.42,50.4,321.39,56.44Z' fill='%2338bdf8' opacity='0.7'%3E%3C/path%3E%3C/svg%3E") repeat-x;
  background-size: 100px 14px;
  animation: wave-anim 6s linear infinite;
  z-index: 4;
}

/* Calibration Line Overlay */
.tank-calibration {
  position: absolute;
  top: 40px;
  bottom: 30px;
  right: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 8;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  pointer-events: none;
  opacity: 0.75;
}

.calibration-mark {
  display: flex;
  align-items: center;
  gap: 4px;
}

.calibration-mark::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.5px;
  background-color: #475569;
}

.tank-percentage-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--secondary);
  border: 1px solid rgba(226, 232, 240, 0.8);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Custom Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.success {
  background-color: #d1fae5;
  color: #065f46;
}

.status-pill.danger {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Custom Primary Buttons */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: all 0.25s ease;
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #0369a1 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

/* Form Controls */
.form-control-custom {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

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

/* Tables */
.table-custom {
  background: transparent;
}

.table-custom th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border);
}

.table-custom td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.9rem;
}

.table-custom tr:hover td {
  background-color: #f8fafc;
}

/* Sidebar Toggle & Collapse Classes */
.sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed {
  transform: translateX(-260px);
}
.main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.main-content.expanded {
  margin-left: 0;
}

#sidebarToggle {
  transition: all 0.2s ease;
}
#sidebarToggle:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Mobile Responsive Bottom Navigation */
@media (max-width: 768px) {
  body {
    display: block; /* Disable side-by-side flex placement on mobile */
  }
  
  .sidebar {
    width: 100% !important;
    height: 70px !important;
    flex-direction: row !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 12px !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    justify-content: space-around !important;
    align-items: center !important;
    transform: none !important; /* Disable slide collapse on mobile */
  }
  
  .sidebar-brand {
    display: none !important;
  }
  
  .sidebar-menu {
    flex-direction: row !important;
    width: 100% !important;
    justify-content: space-around !important;
    gap: 0 !important;
    margin: 0 !important;
  }
  
  .sidebar-link {
    flex-direction: column !important;
    gap: 4px !important;
    font-size: 0.65rem !important;
    padding: 8px 12px !important;
    align-items: center !important;
    color: #94a3b8 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  .sidebar-link i {
    font-size: 1.25rem !important;
    margin: 0 !important;
  }
  
  .sidebar-link.active {
    color: var(--primary) !important;
    background-color: transparent !important;
    box-shadow: none !important;
  }
  
  .sidebar-link.active span {
    font-weight: 700;
    color: var(--primary);
  }

  .sidebar-link span {
    font-size: 0.68rem;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 24px 16px 90px 16px !important; /* Extra bottom padding to avoid nav overlap */
  }
  
  #sidebarToggle {
    display: none !important; /* Hide collapse toggle in bottom nav layout */
  }

  .app-container {
    flex-direction: column !important;
  }

  .metric-card {
    padding: 16px !important;
    gap: 12px !important;
  }
  
  .metric-icon-wrapper {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.25rem !important;
  }
  
  .metric-value {
    font-size: 1.35rem !important;
  }

  /* Scale cylinder tank size down for side-by-side column view on small screens */
  .tank-cylinder {
    width: 100px !important;
    height: 160px !important;
    border-radius: 50px / 14px !important;
  }
  
  .tank-cylinder::before {
    height: 20px !important;
  }
  
  .tank-percentage-badge {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
  }
  
  .tank-calibration {
    font-size: 0.55rem !important;
    right: 8px !important;
    top: 30px !important;
    bottom: 20px !important;
  }
}

/* Overriding Bootstrap Badge styles for modern clean visual look */
.badge {
  font-weight: 700 !important;
  border-radius: 30px !important;
  padding: 6px 12px !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  text-shadow: none !important;
}
.badge.bg-primary {
  background-color: var(--primary-glow) !important;
  color: var(--primary) !important;
  border-color: rgba(13, 148, 136, 0.25) !important;
}
.badge.bg-success {
  background-color: var(--success-glow) !important;
  color: var(--success) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}
.badge.bg-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #d97706 !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}
.badge.bg-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}
.badge.bg-info {
  background-color: rgba(6, 182, 212, 0.1) !important;
  color: #0891b2 !important;
  border-color: rgba(6, 182, 212, 0.25) !important;
}
.badge.bg-secondary {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}
.badge.bg-light {
  background-color: #f8fafc !important;
  color: #64748b !important;
  border-color: #edf2f7 !important;
}