/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --primary: #ffb300;
  --primary-dark: #ff8f00;
  --accent: #fff8e1;

  --bg: #f8f9fa;
  --card: #ffffff;
  --text-main: #1a1d1f;
  --text-light: #6f767e;
  --border: #efefef;

  --blue: #e3f2fd;
  --blue-text: #2196f3;
  --green: #e8f5e9;
  --green-text: #4caf50;
  --red: #ffebee;
  --red-text: #f44336;
  --purple: #f3e5f5;
  --purple-text: #9c27b0;

  --radius-xl: 32px;
  --radius-lg: 20px;
  --radius-md: 12px;

  --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.03);

  --nav-height: 80px;
}

[data-theme="dark"] {
  --bg: #111315;
  --card: #1a1d1f;
  --text-main: #efefef;
  --text-light: #9a9fa5;
  --border: #272b30;
  --accent: #272b30;
  --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  padding-bottom: 110px;
  transition: background 0.3s ease;
}

/* =========================================
   2. LOGIN SCREEN
   ========================================= */
.login-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: hidden;
}

.login-blobs {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
}
.blob-1 {
  width: 300px;
  height: 300px;
  background: #ffb300;
  top: -100px;
  left: -50px;
}
.blob-2 {
  width: 250px;
  height: 250px;
  background: #ff6d00;
  bottom: 20%;
  right: -50px;
}

.login-content {
  position: relative;
  z-index: 100;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 50px 30px;
  border-radius: 40px;
  color: white;
  text-align: center;
  width: 100%;
  max-width: 400px;
  animation: zoomIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.logo-anim {
  font-size: 60px;
  color: var(--primary);
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}
.logo-anim i {
  animation: float 3s ease-in-out infinite;
}
.yolk-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: var(--primary);
  filter: blur(30px);
  opacity: 0.5;
  z-index: -1;
}

.login-content h1 {
  font-size: 32px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -1px;
}
.dot {
  color: var(--primary);
}
.login-content p {
  color: #aaa;
  margin: 10px 0 30px;
  font-weight: 300;
}

.google-btn {
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  background: white;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 101;
}
.google-btn:active {
  transform: scale(0.98);
}

/* =========================================
   3. APP HEADER
   ========================================= */
.top-bar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.user-info small {
  display: block;
  color: var(--text-light);
  font-size: 12px;
}
.user-info h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  position: relative;
  cursor: pointer;
}
.dot-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #ff4444;
  border-radius: 50%;
}
.profile-pic img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

/* =========================================
   4. MODALS & LOCATION LIST
   ========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  padding: 20px;
}
.modal-content {
  background: var(--card);
  width: 100%;
  max-width: 320px;
  padding: 25px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  color: var(--text-main);
}
.modal-content h3 {
  margin: 0 0 20px;
  text-align: center;
}
.input-group {
  margin-bottom: 15px;
}
.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 5px;
}
.input-group input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
  font-family: inherit;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
.cancel-btn {
  background: var(--bg);
  color: var(--text-light);
}
.save-btn {
  background: var(--primary);
  color: #000;
}

/* Location Modal Specifics */
.location-content {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg);
  padding: 10px 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}
.search-bar input {
  border: none;
  background: transparent;
  margin-left: 10px;
  width: 100%;
  color: var(--text-main);
}
.location-list {
  overflow-y: auto;
  flex: 1;
}
.location-item {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.location-item:hover {
  background: var(--bg);
}
.location-item i {
  margin-right: 10px;
  color: var(--primary);
}

/* =========================================
   5. NOTIFICATIONS PAGE STYLES
   ========================================= */
.notif-page-list {
  padding: 0 24px;
}
.notif-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  display: flex;
  gap: 15px;
  border: 1px solid var(--border);
}
.notif-icon {
  width: 40px;
  height: 40px;
  background: var(--purple);
  color: var(--purple-text);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-content .msg {
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--text-main);
}
.notif-content .time {
  font-size: 11px;
  color: var(--text-light);
}
.empty-msg {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
}

/* =========================================
   6. PAGES
   ========================================= */
.hero-card {
  margin: 10px 24px;
  padding: 25px;
  background: linear-gradient(135deg, #1a1d1f 0%, #2c3035 100%);
  border-radius: var(--radius-xl);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.hero-text {
  z-index: 2;
}
.tag {
  background: var(--primary);
  color: #000;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hero-text h2 {
  margin: 10px 0 15px;
  font-size: 22px;
  line-height: 1.2;
}
.hero-text button {
  background: white;
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 13px;
}
.hero-img {
  font-size: 80px;
  position: absolute;
  right: -10px;
  bottom: -20px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.stats-row {
  display: flex;
  gap: 15px;
  padding: 20px 24px;
}
.stat-card {
  flex: 1;
  background: var(--card);
  padding: 15px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-card);
}
.stat-card i {
  font-size: 20px;
  color: var(--text-light);
}
.stat-card.highlight i {
  color: var(--primary);
}
.stat-card b {
  display: block;
  font-size: 18px;
  color: var(--text-main);
}
.stat-card span {
  font-size: 12px;
  color: var(--text-light);
}

.section-header {
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.section-header h3 {
  margin: 0;
  font-size: 18px;
}

.mini-order {
  margin: 0 24px;
  background: var(--card);
  padding: 15px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--border);
}
.icon-box {
  width: 40px;
  height: 40px;
  background: var(--green);
  color: var(--green-text);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-order .details {
  flex: 1;
}
.mini-order h4 {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
}
.mini-order small {
  color: var(--text-light);
  font-size: 11px;
}
.mini-order .price {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.page-title {
  padding: 0 24px;
  margin: 10px 0 20px;
  font-size: 24px;
}

/* Product Grid */
.product-grid {
  padding: 0 24px;
  display: grid;
  gap: 15px;
}
.product-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: var(--shadow-card);
}
.prod-img-wrapper {
  background: var(--accent);
  border-radius: var(--radius-md);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 15px;
}
.prod-emoji {
  font-size: 60px;
}
.prod-details h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.prod-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}
.price-row {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 15px;
}
.price-row span {
  font-size: 14px;
  color: var(--primary-dark);
  margin-right: 2px;
}

.action-row {
  display: flex;
  gap: 15px;
  align-items: center;
}
.qty-control {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  flex: 1;
  justify-content: space-between;
}
.qty-control button {
  width: 30px;
  height: 30px;
  border: none;
  background: white;
  border-radius: 8px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.qty-control span {
  font-size: 14px;
  font-weight: 600;
  width: 20px;
  text-align: center;
}
.add-btn {
  flex: 2;
  padding: 12px;
  background: var(--text-main);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

/* Settings */
.settings-section {
  background: var(--card);
  margin: 0 24px 20px;
  border-radius: var(--radius-lg);
  padding: 5px 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}
.settings-header {
  margin: 15px 20px 5px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  font-weight: 700;
}
.setting-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: none;
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-item.clickable:active {
  background: var(--bg);
}
.icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 16px;
}
/* Icon Colors */
.color-blue {
  background: var(--blue);
  color: var(--blue-text);
}
.color-green {
  background: var(--green);
  color: var(--green-text);
}
.color-orange {
  background: #fff3e0;
  color: #ff9800;
}
.color-teal {
  background: #e0f2f1;
  color: #009688;
}
.color-purple {
  background: var(--purple);
  color: var(--purple-text);
}

.setting-item .text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.arrow {
  color: #ccc;
  font-size: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.minimal-select {
  border: none;
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  font-size: 13px;
  text-align: right;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--card);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  color: var(--text-light);
  transition: 0.3s;
}
.nav-item i {
  font-size: 22px;
  transition: 0.3s;
}
.nav-item.active {
  color: var(--primary-dark);
}
.page {
  display: none !important;
  opacity: 0;
  transition: opacity 0.3s;
  padding-bottom: 20px;
}
.page.active {
  display: block !important;
  opacity: 1;
  animation: fadeIn 0.3s ease-out;
}

/* =========================================
   7. FLOATING WHATSAPP BUTTON (NEW)
   ========================================= */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 100px; /* Above nav bar */
  right: 20px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.3s;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float:active {
  transform: scale(0.9);
}

/* =========================================
   8. WALLET & NEW PAYMENT STYLES
   ========================================= */

/* Wallet Card on Home Screen */
.wallet-card-home {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  margin: 0 24px 20px;
  box-shadow: 0 10px 30px -5px rgba(46, 125, 50, 0.3);
  position: relative;
  overflow: hidden;
}

.wallet-card-home::after {
  content: "\f555"; /* FontAwesome Wallet Icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 100px;
  opacity: 0.1;
  transform: rotate(-20deg);
}

.wallet-label {
  font-size: 12px;
  opacity: 0.8;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.wallet-amount {
  font-size: 32px;
  font-weight: 700;
  margin: 5px 0;
}
.wallet-note {
  font-size: 11px;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

/* Payment Modal Breakdown */
.payment-summary {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
}
.pay-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: #555;
}
.pay-row.total {
  font-weight: 700;
  color: #000;
  border-top: 1px dashed #ccc;
  padding-top: 10px;
  margin-top: 5px;
  font-size: 15px;
}
.pay-row.wallet-deduction {
  color: #2e7d32;
  font-weight: 600;
}

/* =========================================
   WALLET UI STYLES (NEW)
   ========================================= */
.wallet-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-card);
  border: 1px solid #c8e6c9;
  cursor: pointer;
  transition: 0.2s ease;
}

.wallet-badge:active {
  transform: scale(0.95);
}

.wallet-badge i {
  font-size: 14px;
}

#walletDeductionText {
  background: #e8f5e9;
  padding: 6px;
  border-radius: 6px;
  text-align: center;
}

/* Payment Summary Layout */
.pay-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 13px;
}
.pay-row.total {
  font-weight: 700;
  border-top: 1px dashed #ccc;
  padding-top: 8px;
  margin-top: 5px;
  font-size: 15px;
}
.pay-row.wallet-deduction {
  color: #2e7d32;
  font-weight: 600;
}
.add-btn {
  background: var(--text-main);
  color: var(--bg);
}

[data-theme="dark"] .add-btn {
  background: var(--primary);
  color: #000;
}
.qty-control button {
  background: var(--card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

[data-theme="dark"] .qty-control button {
  background: #2a2e33;
  color: #fff;
  border: 1px solid #3a3f45;
}
.modal-content,
.modal-content * {
  color: var(--text-main);
}
.modal-content p,
.modal-content small,
.modal-content span {
  color: var(--text-light);
}
.agent-number {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: 1px;
}

[data-theme="dark"] .agent-number {
  color: #000;
}
.payment-summary,
.payment-summary * {
  color: var(--text-main);
}

.payment-summary .pay-row {
  color: var(--text-light);
}

.payment-summary .total {
  color: var(--text-main);
  font-weight: 700;
}
[data-theme="dark"] {
  color-scheme: dark;
}
[data-theme="dark"] .modal-content {
  color: gray !important;
}

[data-theme="dark"] .modal-content * {
  color: inherit !important;
}
#mpesa-modal p:first-of-type {
  color: #4caf50 !important;
}
#payBtn {
  color: #fff !important;
}
#topup-modal p:first-of-type {
  color: #4caf50 !important;
}
[data-theme="dark"] #topupBtn {
  color: #fff !important;
}
/* =========================
   MODAL CLOSE / CANCEL BUTTON
========================= */
.modal-content .cancel-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;

    margin-top: 12px;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* LIGHT MODE */
body:not(.dark) .modal-content .cancel-btn {
    background: #f5f5f5;
    color: #F44336;
    border: 1px solid #eee;
}

/* DARK MODE */
body.dark .modal-content .cancel-btn {
    background: #2a2a2a;
    color: #ff6b6b;
    border: 1px solid #444;
}

/* HOVER EFFECT */
.modal-content .cancel-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* =========================================
   9. CUSTOM ALERT POPUP STYLES
   ========================================= */
#custom-alert-modal {
  z-index: 999999; /* Ensure it stays above everything, even other modals */
}

.custom-alert-box {
  text-align: center;
  max-width: 320px;
  padding: 30px 24px;
  border-radius: var(--radius-xl); /* Uses your existing curvy border variable */
  background: var(--card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  
  /* The bouncy pop-in animation */
  animation: alertPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes alertPopIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#custom-alert-icon {
  font-size: 55px;
  margin-bottom: 15px;
  /* Adds a subtle floating/breathing effect to the icon */
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

#custom-alert-title {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 22px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

#custom-alert-msg {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 25px;
  line-height: 1.5;
  white-space: pre-wrap; /* Keeps your formatting intact */
}

.alert-btn {
  width: 100%;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Make the button feel tactile when tapped */
.alert-btn:active {
  transform: scale(0.96);
}

#alert-actions-choice {
    margin-top: 10px;
}

#alert-actions-choice .cancel-btn {
    background: var(--border); /* Greyscale for the secondary option */
    color: var(--text-main);
     }


.custom-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7); /* Dim the background */
    align-items: center;
    justify-content: center;
}



.modal-header h3 {
    margin: 10px 0;
    color: #fff;
}

.modal-content p {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 15px;
}

#phone-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #222;
    color: white;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-cancel {
    background: transparent;
    color: #4CAF50; /* Green text like your buttons */
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-ok {
    background: transparent;
    color: #4CAF50;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

/* Ensure the backdrop covers everything */
#phone-modal.custom-modal {
    display: none;
    position: fixed;
    z-index: 10001; /* High z-index to stay on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* Unique Container - Adaptive to Light/Dark */
.phone-modal-container {
    background-color: #ffffff; /* Default Light */
    color: #333333;           /* Default Dark Text */
    padding: 25px;
    border-radius: 16px;
    width: 85%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid #ddd;
}

.phone-modal-title {
    margin: 10px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1d1f; /* Force dark in light mode */
}

.phone-modal-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Dark Mode Overrides */
[data-theme="dark"] .phone-modal-container {
    background-color: #1a1d1f; /* Matches your dark theme cards */
    color: #ffffff;
    border-color: #333;
}

[data-theme="dark"] .phone-modal-title {
    color: #ffffff;
}

[data-theme="dark"] .phone-modal-text {
    color: #ccc;
}

/* Input Styling */
#phone-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 2px solid #eee;
    background: #f8f9fa;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
    transition: 0.3s;
}

[data-theme="dark"] #phone-input {
    background: #272b30;
    border-color: #3f444a;
    color: white;
}

#phone-input:focus {
    border-color: #ffb300;
    outline: none;
}

/* Button Styling */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-ok {
    background: #ffb300; /* Your brand gold */
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
}

[data-theme="dark"] .btn-cancel {
    background: #333;
    color: #bbb;
}


/* Specifically target the phone modal text for visibility */
#phone-modal h3 {
    color: #1a1d1f !important; /* Force dark text in light mode */
}

#phone-modal p {
    color: #444444 !important; /* Force readable grey in light mode */
}

/* Flip colors only when Dark Mode is active */
[data-theme="dark"] #phone-modal h3 {
    color: #ffffff !important;
}

[data-theme="dark"] #phone-modal p {
    color: #cccccc !important;
}


/* Fix visibility for the Master Alert Modal (Location/Errors/Success) */
#custom-alert-modal #custom-alert-title {
    color: #1a1d1f !important; /* Dark in light mode */
}

#custom-alert-modal #custom-alert-msg {
    color: #444444 !important; /* Dark in light mode */
}

/* Dark Mode Overrides for the Master Alert */
[data-theme="dark"] #custom-alert-modal #custom-alert-title {
    color: #ffffff !important;
}

[data-theme="dark"] #custom-alert-modal #custom-alert-msg {
    color: #cccccc !important;
}

/* Ensure the alert background matches the theme */
[data-theme="dark"] #custom-alert-modal .modal-content {
    background-color: #1a1d1f !important;
    border: 1px solid #333 !important;
}

/* --- FIXED RED CANCEL BUTTONS FOR DARK MODE --- */

/* This targets the M-Pesa Modal Cancel Button */
[data-theme="dark"] #mpesa-modal .cancel-btn, 
[data-theme="dark"] #mpesa-modal .btn-cancel {
    color: #ff5252 !important;
    font-weight: 800 !important;
    background: rgba(255, 82, 82, 0.1) !important; /* Subtle red background */
}

/* This targets the Top-Up Modal Cancel Button */
[data-theme="dark"] #topup-modal .cancel-btn, 
[data-theme="dark"] #topup-modal .btn-cancel {
    color: #ff5252 !important;
    font-weight: 800 !important;
    background: rgba(255, 82, 82, 0.1) !important;
}

/* Hover effect to make it feel interactive */
[data-theme="dark"] #mpesa-modal .btn-cancel:hover,
[data-theme="dark"] #topup-modal .btn-cancel:hover {
    background: rgba(255, 82, 82, 0.2) !important;
    color: #ff1744 !important;
}

/* Force identical button sizes in the Custom Confirm Modal */
#alert-actions-choice {
    display: flex;
    gap: 12px; /* Smooth spacing between the two buttons */
    width: 100%;
}

#alert-actions-choice button {
    flex: 1; /* This forces BOTH buttons to take up exactly 50% of the space */
    margin: 0; 
    padding: 14px 5px; /* Adjust padding to fit */
    white-space: nowrap; /* Stops text from breaking into two lines */
    font-size: 14px; /* Perfectly sized text for mobile */
}

/* Specifically target the Save button in the profile modal */
#profile-modal #saveProfileBtn {
    width: 120px !important;    /* Force a specific width */
    padding: 10px 0 !important; /* Fixed padding */
    font-size: 14px !important;
    display: inline-block !important;
}

/* Make the Cancel button match exactly */
#profile-modal .cancel-btn {
    width: 120px !important;    /* Same width as Save button */
    padding: 10px 0 !important; 
    font-size: 14px !important;
    display: inline-block !important;
}

/* Ensure they sit side-by-side without jumping */
#profile-modal .modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#saveProfileBtn {
    all: unset; /* This resets the button completely */
    width: 130px;
    height: 20px;
    background-color: #FFB300;
    color: black;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#profile-modal .cancel-btn {
    all: unset;
    width: 130px;
    height: 20px;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-red {
  background: var(--red);
  color: var(--red-text);
}

.button-group {
    display: flex;
    gap: 15px; /* Adds space between the Share and Export buttons */
    justify-content: flex-start; 
}

.btn-share, .btn-export {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    /* Add your specific button sizing and border-radius here */
}

/* =========================================
   10. ACCOUNT STATEMENT PAGE STYLES
   ========================================= */

/* Statement Summary Dashboard */
.statement-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 20px;
}

.summary-box {
    background: var(--card);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.summary-box small {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.summary-box .amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

/* The Official Table Style */
.statement-container {
    margin: 0 20px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden; /* Keeps table corners rounded */
    box-shadow: var(--shadow-soft);
}

.statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.statement-table th {
    background: var(--bg);
    color: var(--text-light);
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 10px;
}

.statement-table td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

/* Status Badges in Table */
.status-pill {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-paid { background: var(--green); color: var(--green-text); }
.status-wallet { background: var(--blue); color: var(--blue-text); }

/* Statement Action Buttons */
.statement-actions {
    display: flex;
    gap: 10px;
    padding: 20px 24px;
}

.btn-export-pdf {
    flex: 1;
    background: var(--primary);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.btn-share-statement {
    width: 50px;
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Dark Mode Fine-Tuning for Table */
[data-theme="dark"] .statement-table th {
    background: #272b30;
    color: #9a9fa5;
}

[data-theme="dark"] .summary-box {
    background: #1a1d1f;
}

/* Empty State */
.no-data {
    text-align: center;
    padding: 40px 20px;
}
.no-data i {
    font-size: 50px;
    color: var(--border);
    margin-bottom: 15px;
}

/* =========================================
   11. PDF PREVIEW / PRINT AREA (HIDDEN)
   ========================================= */
/* This area is only used to format the logic before PDF generation */
#statementPreviewArea {
    display: none; /* Keep hidden on main screens */
    margin-top: 20px;
}

.official-header {
    border-left: 5px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 20px;
}

.official-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
}

/* =========================================
   CLEAN DARK MODE STATEMENT FIX
   ========================================= */

[data-theme="dark"] .statement-container {
    background: #1a1d1f !important;
    border-color: #272b30 !important;
}

/* Force the Table Headers to be visible */
[data-theme="dark"] .statement-table th {
    background: #272b30 !important;
    color: #9a9fa5 !important;
    border-bottom: 2px solid #3a3f45 !important;
}

/* Force the Table Data (The words) to be Bright White */
[data-theme="dark"] .statement-table td {
    color: #ffffff !important; 
    border-bottom: 1px solid #272b30 !important;
}

/* Fix the Summary Box Text */
[data-theme="dark"] .summary-box {
    background: #1a1d1f !important;
    border: 1px solid #272b30 !important;
}

[data-theme="dark"] .summary-box .amount {
    color: #ffffff !important;
}

/* Ensure the Status Pills "Pop" */
[data-theme="dark"] .status-paid {
    background: rgba(76, 175, 80, 0.2) !important;
    color: #4caf50 !important;
}

[data-theme="dark"] .status-wallet {
    background: rgba(33, 150, 243, 0.2) !important;
    color: #2196f3 !important;
}

/* =========================================
   FIX BACKGROUNDS FOR STATEMENT IN DARK MODE
   ========================================= */

/* 1. Change background for "Account Statement" summary boxes */
[data-theme="dark"] .summary-box {
    background-color: #1a1d1f !important; /* Darker grey to match theme */
    border: 1px solid #272b30 !important;  /* Darker border */
}

/* 2. Change background for the whole table container */
[data-theme="dark"] .statement-container {
    background-color: #1a1d1f !important;
    border-color: #272b30 !important;
}

/* 3. Specifically target the "Mpesa Date, Code" header columns background */
[data-theme="dark"] .statement-table th {
    background-color: #212427 !important; /* Slightly lighter than the card for contrast */
    color: #9a9fa5 !important;           /* Subtle text for the headers */
    border-bottom: 2px solid #272b30 !important;
}

/* 4. Ensure the table rows (td) also have the dark background */
[data-theme="dark"] .statement-table td {
    background-color: transparent !important; /* Let the container color show through */
    border-bottom: 1px solid #272b30 !important;
}

/* 5. Fix the "No Data" icon area background */
[data-theme="dark"] .no-data {
    background-color: #1a1d1f !important;
}

/* =========================================
   FINAL "WHITE BAR" REMOVAL 
   ========================================= */

[data-theme="dark"] .page-title {
    background-color: var(--bg) !important;
    color: #ffffff !important;
    margin: 0 !important; /* Removes any gap */
    padding: 20px 24px !important;
}

/* This targets the white bar behind the Back Arrow and Title */
[data-theme="dark"] .statement-header, 
[data-theme="dark"] div:has(> .page-title) {
    background-color: var(--bg) !important;
}

/* This targets the white bar in the Table Headers */
[data-theme="dark"] .statement-table thead,
[data-theme="dark"] .statement-table tr:first-child,
[data-theme="dark"] .statement-table th {
    background-color: #272b30 !important; /* Darker grey header */
    color: #9a9fa5 !important;
    border: none !important;
}

/* Ensures the entire statement container stays dark */
[data-theme="dark"] .statement-container {
    background-color: #1a1d1f !important;
    border: 1px solid #272b30 !important;
}

/* Works for BOTH systems */
[data-theme="dark"] .page-title,
body.dark .page-title {
    background-color: var(--bg) !important;
    color: var(--text-main) !important;
}

/* Table header fix */
[data-theme="dark"] .statement-table th,
body.dark .statement-table th {
    background-color: #272b30 !important;
    color: #9a9fa5 !important;
    border-bottom: 2px solid #3a3f45 !important;
}

/* Container fix */
[data-theme="dark"] .statement-container,
body.dark .statement-container {
    background-color: #1a1d1f !important;
    border-color: #272b30 !important;
}

/* UNIVERSAL DARK FIX */
[data-theme="dark"] .statement-table,
[data-theme="dark"] .statement-table thead,
[data-theme="dark"] .statement-table tr,
[data-theme="dark"] .statement-table th,
[data-theme="dark"] .statement-table td,
body.dark .statement-table,
body.dark .statement-table thead,
body.dark .statement-table tr,
body.dark .statement-table th,
body.dark .statement-table td {
    background-color: transparent !important;
}

/* Header */
[data-theme="dark"] .statement-table th,
body.dark .statement-table th {
    background-color: #272b30 !important;
}

/* Container */
[data-theme="dark"] .statement-container,
body.dark .statement-container {
    background-color: #1a1d1f !important;
}

.pdf-notif {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    color: var(--text-color);
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    min-width: 220px;
}

#pdfNotifText {
    font-size: 14px;
    font-weight: 500;
}

#pdfNotifActions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.notif-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.notif-btn.cancel {
    background: transparent;
    color: var(--text-color);
}

.notif-btn.view {
    background: #FFB300;
    color: black;
    font-weight: 600;
}
