/* ==========================================================================
   NG SHELTER DIWALI EXPENSES — MOBILE-FIRST CLEAN PASTEL THEME
   Engineered for 99% Smartphone Usage (iOS & Android Optimized)
   ========================================================================== */

:root {
  --bg-page: #fbf9f5;
  --bg-card: #ffffff;
  --bg-input: #fdfcfb;
  --bg-subtle: #f5f0e8;

  --pastel-gold: #f59e0b;
  --pastel-gold-light: #fef3c7;
  --pastel-orange: #f97316;
  --pastel-orange-light: #ffedd5;
  --pastel-green: #10b981;
  --pastel-green-light: #d1fae5;
  --pastel-red: #ef4444;
  --pastel-red-light: #fee2e2;
  --pastel-blue: #3b82f6;
  --pastel-blue-light: #dbeafe;
  --pastel-purple: #8b5cf6;
  --pastel-purple-light: #ede9fe;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-light: #e8e2d8;
  --border-focus: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(180, 150, 120, 0.12);
  --shadow-lg: 0 12px 28px rgba(180, 150, 120, 0.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.45;
  padding: 16px 12px 100px; /* 100px bottom padding for sticky mobile bar */
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

/* ==========================================================================
   HEADER (COMPACT & MOBILE-FIRST)
   ========================================================================== */
.header {
  text-align: center;
  margin-bottom: 16px;
  padding: 4px 0;
}

.diya-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pastel-gold-light);
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #fde68a;
  margin-bottom: 8px;
}

.header h1 {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   HERO SUMMARY CARD (MOBILE-OPTIMIZED)
   ========================================================================== */
.summary-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffbf4 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-left {
  display: flex;
  flex-direction: column;
}

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

.summary-amount {
  font-size: 34px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 2px 0;
}

.summary-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.summary-right {
  display: flex;
  align-items: center;
}

.stat-pill {
  background: var(--bg-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-light);
  min-width: 80px;
}

.stat-pill-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-pill-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   1-GLANCE CATEGORY SUMMARY (HORIZONTAL FLICK SCROLL ON MOBILE)
   ========================================================================== */
.category-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.cat-summary-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-pills-row {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-pills-row::-webkit-scrollbar {
  display: none;
}

.cat-spend-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-pill-name {
  font-weight: 600;
  color: var(--text-main);
}

.cat-pill-val {
  font-weight: 800;
  color: #b45309;
}

/* ==========================================================================
   CARD WRAPPER
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   QUICK SUGGESTION CHIPS (HORIZONTAL SCROLL ON MOBILE)
   ========================================================================== */
.quick-chips-row {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-chips-row::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.chip-btn:active {
  background: var(--pastel-gold-light);
  color: #92400e;
  border-color: #fde68a;
  transform: scale(0.96);
}

/* ==========================================================================
   FORM INPUTS — 16PX FONT (STOPS IOS SAFARI AUTO-ZOOM)
   ========================================================================== */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

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

.form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* IMPORTANT: 16px minimum prevents iOS automatic zoom on focus */
.form-control {
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-main);
  width: 100%;
  min-height: 48px; /* Large 48px thumb target */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Amount field has prominent styling */
.amount-input {
  font-weight: 700;
  font-size: 18px !important;
  color: #b45309;
}

/* ==========================================================================
   CAMERA & BILL PHOTO UPLOAD
   ========================================================================== */
.bill-upload-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dashed var(--border-light);
  padding-top: 14px;
  margin-top: 6px;
}

.file-upload-btn-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff8eb;
  border: 1.5px dashed var(--pastel-gold);
  color: #92400e;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 48px;
  text-align: center;
  width: 100%;
  transition: all 0.15s ease;
}

.file-upload-btn-label:active {
  background: #fde68a;
  transform: scale(0.98);
}

.bill-preview-box {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--pastel-green-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.bill-preview-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bill-preview-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #6ee7b7;
}

.bill-preview-text {
  font-size: 12px;
  font-weight: 700;
  color: #065f46;
}

.bill-preview-remove {
  background: #ffffff;
  border: 1px solid #fca5a5;
  color: var(--pastel-red);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Save Button */
.btn-submit-expense {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  width: 100%;
  min-height: 50px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-submit-expense:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

/* ==========================================================================
   EXPENSES CARDS (CLEAN MOBILE CARDS)
   ========================================================================== */
.expense-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.expense-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.expense-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cat-sweets { background: var(--pastel-gold-light); }
.cat-lights { background: var(--pastel-orange-light); }
.cat-food { background: var(--pastel-green-light); }
.cat-music { background: var(--pastel-purple-light); }
.cat-decor { background: #fce7f3; }
.cat-prizes { background: var(--pastel-blue-light); }
.cat-general { background: var(--bg-subtle); }

.expense-title-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.expense-item-amount {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  white-space: nowrap;
}

.expense-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.expense-tags-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.payment-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.tag-society {
  background: var(--pastel-green-light);
  color: #065f46;
}

.tag-pending-reimburse {
  background: var(--pastel-orange-light);
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.tag-settled-reimburse {
  background: var(--pastel-green-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.btn-toggle-reimburse {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  min-height: 28px;
}

.btn-toggle-reimburse:active {
  background: var(--pastel-green-light);
  color: #065f46;
}

.expense-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.bill-thumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pastel-blue-light);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  min-height: 28px;
}

.bill-thumb-btn:active {
  background: #bfdbfe;
}

.delete-btn {
  background: #ffffff;
  border: 1px solid #fee2e2;
  color: var(--pastel-red);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
}

.delete-btn:active {
  background: var(--pastel-red-light);
}

/* Empty Box */
.empty-box {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-box-icon {
  font-size: 36px;
  margin-bottom: 6px;
}

/* ==========================================================================
   STICKY MOBILE BOTTOM BAR (THUMB-FRIENDLY)
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.mobile-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  flex: 1;
  text-decoration: none;
  white-space: nowrap;
}

.btn-nav-whatsapp {
  background: #25d366;
  color: #ffffff;
}

.btn-nav-add {
  background: #f59e0b;
  color: #ffffff;
}

.btn-nav-more {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-light);
  flex: 0 0 auto;
  padding: 10px 12px;
}

/* More Actions Popover on Mobile */
.more-actions-tray {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 16px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
  min-width: 190px;
}

.more-actions-tray.active {
  display: flex;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.tray-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.tray-btn:active {
  background: var(--bg-subtle);
}

/* ==========================================================================
   PHOTO VIEWER MODAL (FULL SCREEN MOBILE SHEET)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 12px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close-btn {
  background: var(--bg-subtle);
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body-img-wrap {
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  overflow-y: auto;
}

.modal-full-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast-box {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  z-index: 3000;
  text-align: center;
  white-space: nowrap;
  animation: dropIn 0.25s ease;
}

@keyframes dropIn {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   PRINT STYLES FOR NOTICE BOARD
   ========================================================================== */
.notice-board-printable {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    padding: 0 !important;
  }
  .container > *:not(.notice-board-printable), .mobile-bottom-nav, .more-actions-tray, .toast-box {
    display: none !important;
  }
  .notice-board-printable {
    display: block !important;
    padding: 20px 30px;
    font-family: Arial, sans-serif;
  }
  .notice-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .notice-title {
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
  }
  .notice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 12px;
  }
  .notice-table th, .notice-table td {
    border: 1px solid #444;
    padding: 8px 10px;
    text-align: left;
  }
  .notice-table th {
    background: #f0f0f0;
  }
  .notice-signatures {
    margin-top: 45px;
    display: flex;
    justify-content: space-between;
  }
  .sig-line {
    border-top: 1px solid #000;
    width: 160px;
    text-align: center;
    padding-top: 6px;
    font-size: 11px;
  }
}
