:root {
  --primary: #0284c7;
  --primary-dark: #075985;
  --primary-light: #38bdf8;
  --accent: #0ea5e9;
  --white: #ffffff;
  --off-white: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
  --grad-primary: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --grad-info: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --grad-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  background-image:
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.05) 0px, transparent 50%);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  padding-top: 72px;
  /* Height of the fixed navbar */
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top left, #075985, #0284c7);
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm66-3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-46-34c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm20-40c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm52 64c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-76 10c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm54-46c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zM24 5c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28 22c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.5;
  animation: drift 60s linear infinite;
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }

  to {
    transform: translate(-50px, -50px);
  }
}

.login-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow: hidden;
  max-width: 450px;
  width: 100%;
  z-index: 10;
}

.login-header {
  background: transparent;
  padding: 40px 30px 20px;
  text-align: center;
}

.login-header h1 {
  color: var(--primary-dark);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.login-body {
  padding: 0 40px 40px;
}

/* Layout */
.navbar-custom {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  z-index: 1050;
  /* Higher than bootstrap default */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
}

.navbar-custom .navbar-brand {
  color: var(--primary-dark) !important;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  transition: all 0.3s ease;
  position: sticky;
  top: 72px;
  /* Height of the sticky navbar */
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar .nav-link {
  color: var(--text-muted);
  padding: 0.875rem 1.5rem;
  margin: 0.25rem 1rem;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar .nav-link:hover {
  background: var(--off-white);
  color: var(--primary);
}

.sidebar .nav-link.active {
  background: var(--primary);
  color: var(--white) !important;
  box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.3);
}

.main-content {
  padding: 2.5rem;
  background-color: transparent;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
}

/* Stat Cards */
.stat-card {
  background: var(--white);
  border-radius: 24px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: var(--primary);
  opacity: 0.03;
  border-radius: 0 0 0 100%;
  z-index: -1;
}

.stat-card .stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.stat-card.bg-primary {
  background: var(--grad-primary) !important;
  border: none;
}

.stat-card.bg-success {
  background: var(--grad-success) !important;
  border: none;
}

.stat-card.bg-warning {
  background: var(--grad-warning) !important;
  border: none;
}

.stat-card.bg-info {
  background: var(--grad-info) !important;
  border: none;
}

.stat-card.bg-danger {
  background: var(--grad-danger) !important;
  border: none;
}

.stat-card[class*="bg-"] .stat-value,
.stat-card[class*="bg-"] .stat-label,
.stat-card[class*="bg-"] .stat-icon i {
  color: var(--white) !important;
}

.card-pro {
  background: var(--white);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-pro:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.glass-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.avatar-pro {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.stat-card.bg-primary .stat-value,
.stat-card.bg-primary .stat-label {
  color: var(--white);
}

/* Tables */
.table {
  margin-bottom: 0;
}

.table thead th {
  background: var(--off-white);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
}

/* Badges */
.badge {
  padding: 0.5em 1em;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: capitalize;
}

.badge-paid {
  background: #d1fae5;
  color: #065f46;
}

.badge-unpaid {
  background: #fef3c7;
  color: #92400e;
}

.badge-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.badge-pending {
  background: #f3f4f6;
  color: #374151;
}

.badge-success {
  background: #dcfce7;
  color: #065f46;
  font-weight: 700;
}

.badge-warning {
  background: #fef9c3;
  color: #92400e;
  font-weight: 700;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

/* Modal icon used in Consumers -> Edit Account header */
.modal-app-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 14px 30px -16px rgba(2, 132, 199, 0.55);
}

.modal-app-icon i {
  color: #fff;
  font-size: 20px;
}

/* Buttons */
.btn {
  border-radius: 12px;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  border: none;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.3);
}

/* Modal */
.modal-content {
  border-radius: 24px;
  border: none;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.modal-title {
  font-weight: 700;
  color: var(--text);
}

/* Compact list filter bar (Users, Meter Readings) — one line on xl, readable size */
.list-filter-form .card-body {
  border-color: var(--border) !important;
}

.list-filter-form .form-control,
.list-filter-form .form-select {
  min-height: 2.5rem;
  font-size: 0.9rem;
}

.list-filter-form .input-group-text {
  min-height: 2.5rem;
}

.list-filter-form .btn.rounded-pill {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}