/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 15px var(--s6);
  border-radius: var(--r-lg);
  font-size: var(--t-md);
  font-weight: 700;
  letter-spacing: -0.1px;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast);
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur-fast);
}
.btn:active { transform: scale(0.96); }
.btn:active::after { background: rgba(255,255,255,0.12); }

.btn-primary {
  background: var(--text-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(28,25,23,0.25), 0 1px 3px rgba(28,25,23,0.1);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(28,25,23,0.2); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-danger {
  background: var(--due-bg);
  color: var(--due-clr);
}
.btn-success {
  background: var(--running-bg);
  color: var(--running-clr);
}

.btn-full   { width: 100%; }
.btn-sm {
  padding: 9px 15px;
  font-size: var(--t-sm);
  border-radius: var(--r-md);
}
.btn-xs {
  padding: 6px 12px;
  font-size: var(--t-xs);
  border-radius: var(--r-sm);
}
.btn:disabled {
  opacity: 0.38;
  pointer-events: none;
}


/* ═══════════════════════════════════════
   INPUTS
═══════════════════════════════════════ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--s4);
}
.input-label {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.input-field {
  background: var(--bg-input);
  border-radius: var(--r-md);
  padding: 14px var(--s4);
  font-size: var(--t-md);
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  border: 1.5px solid transparent;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.input-field:focus {
  border-color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(28,25,23,0.06);
}
.input-field::placeholder { color: var(--text-hint); font-weight: 400; }
.input-field.error { border-color: var(--due-clr); }

.select-field {
  background: var(--bg-input);
  border-radius: var(--r-md);
  padding: 14px var(--s4);
  font-size: var(--t-md);
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  border: 1.5px solid transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath stroke='%23A8A29E' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
}

textarea.input-field {
  resize: none;
  min-height: 88px;
  line-height: 1.6;
}


/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--shadow-sm);
}

/* ── Chat bubble card ── */
.bubble-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-sm);
  padding: var(--s4);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--s3);
  margin-right: var(--s6);
  position: relative;
  border-left: 3.5px solid var(--border);
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}

.bubble-card.entry-room    { border-left-color: var(--room-clr); }
.bubble-card.entry-pool    { border-left-color: var(--pool-clr); }
.bubble-card.entry-kitchen { border-left-color: var(--kitchen-clr); }
.bubble-card.entry-pvr     { border-left-color: var(--pvr-clr); }

.bubble-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s2);
}
.bubble-type-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.bubble-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.entry-room    .bubble-icon { background: var(--room-bg); }
.entry-pool    .bubble-icon { background: var(--pool-bg); }
.entry-kitchen .bubble-icon { background: var(--kitchen-bg); }
.entry-pvr     .bubble-icon { background: var(--pvr-bg); }

.bubble-title {
  font-size: var(--t-md);
  font-weight: 800;
  letter-spacing: -0.3px;
}
.bubble-time {
  font-size: var(--t-xs);
  color: var(--text-hint);
  font-weight: 500;
  white-space: nowrap;
  margin-top: 2px;
}
.bubble-body {
  font-size: var(--t-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}
.bubble-body .amount {
  font-size: var(--t-lg);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}
.bubble-body .est {
  font-size: var(--t-sm);
  color: var(--running-clr);
  font-weight: 600;
}
.bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
}

/* Payment info strip */
.payment-strip {
  margin-top: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--bg-input);
  border-radius: var(--r-sm);
  font-size: var(--t-xs);
  color: var(--text-secondary);
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}
.payment-strip b { color: var(--text-primary); }


/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.badge .dot {
  width: 6px; height: 6px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.badge-running {
  background: var(--running-bg);
  color: var(--running-clr);
}
.badge-running .dot {
  background: var(--running-clr);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.badge-closed {
  background: var(--closed-bg);
  color: var(--closed-clr);
}
.badge-closed .dot { background: var(--closed-clr); }

.badge-due   { background: var(--due-bg);   color: var(--due-clr); }
.badge-paid  { background: var(--paid-bg);  color: var(--paid-clr); }
.badge-gold  { background: var(--gold-bg);  color: var(--gold); }


/* ═══════════════════════════════════════
   MODAL / BOTTOM SHEET
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,25,23,0.45);
  z-index: 200;
  display: none;
  align-items: flex-end;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.active { display: flex; }

.modal-sheet {
  background: var(--bg-card);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--s4) var(--s4) calc(var(--s7) + var(--sab));
  width: 100%;
  max-height: 94dvh;
  overflow-y: auto;
  animation: sheetUp var(--dur-slow) var(--ease-spring) both;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-strong);
  border-radius: var(--r-pill);
  margin: 0 auto var(--s5);
}

.modal-title {
  font-size: var(--t-2xl);
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: var(--s5);
  line-height: 1.1;
}


/* ═══════════════════════════════════════
   AMOUNT DISPLAY (payment modal)
═══════════════════════════════════════ */
.amount-hero {
  text-align: center;
  padding: var(--s4) 0 var(--s5);
}
.amount-hero .currency-sym {
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--text-hint);
  vertical-align: top;
  line-height: 1;
  margin-top: 8px;
  display: inline-block;
}
.amount-hero .amount-val {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -3px;
  color: var(--text-primary);
  line-height: 1;
}


/* ═══════════════════════════════════════
   SEGMENTED CONTROL
═══════════════════════════════════════ */
.segmented {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 3px;
}
.segment {
  flex: 1;
  padding: 10px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  color: var(--text-hint);
  transition: all var(--dur-md) var(--ease);
  user-select: none;
}
.segment.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}


/* ═══════════════════════════════════════
   CHIP GROUP
═══════════════════════════════════════ */
.chip-group {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}
.chip {
  padding: 9px 16px;
  border-radius: var(--r-pill);
  background: var(--bg-input);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--dur-fast);
  user-select: none;
}
.chip.selected {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}
.chip:active { transform: scale(0.95); }


/* ═══════════════════════════════════════
   PAYMENT MODE SELECTOR
═══════════════════════════════════════ */
.payment-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  margin-bottom: var(--s4);
}
.payment-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--s4) var(--s2);
  border-radius: var(--r-lg);
  background: var(--bg-input);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--dur-md) var(--ease-spring);
  user-select: none;
}
.payment-mode-btn .pm-icon { font-size: 28px; line-height: 1; }
.payment-mode-btn .pm-label {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-hint);
  letter-spacing: 0.3px;
}
.payment-mode-btn.selected {
  border-color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.payment-mode-btn.selected .pm-label { color: var(--text-primary); }
.payment-mode-btn:active { transform: scale(0.95); }


/* ═══════════════════════════════════════
   CUSTOMER CARD
═══════════════════════════════════════ */
.customer-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
  background: var(--bg-card);
  border-radius: var(--r-lg);
  margin-bottom: var(--s2);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  animation: fadeUp var(--dur-md) var(--ease-out) both;
}
.customer-card:active { transform: scale(0.98); box-shadow: none; }

.customer-avatar {
  width: 46px; height: 46px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-lg);
  font-weight: 800;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.customer-name {
  font-size: var(--t-md);
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}
.customer-phone {
  font-size: var(--t-sm);
  color: var(--text-hint);
  font-weight: 500;
}
.customer-card .chevron {
  margin-left: auto;
  color: var(--text-hint);
  font-size: 18px;
}


/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: calc(24px + var(--sab));
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--s2);
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(28,25,23,0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: 600;
  animation: toastPop var(--dur-md) var(--ease-spring);
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  text-overflow: ellipsis;
  overflow: hidden;
}
.toast.error   { background: rgba(220,38,38,0.92); }
.toast.success { background: rgba(22,163,74,0.92); }
@keyframes toastPop {
  from { transform: translateY(16px) scale(0.9); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}


/* ═══════════════════════════════════════
   NOTIFICATION BADGE
═══════════════════════════════════════ */
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--due-clr);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}


/* ═══════════════════════════════════════
   SUMMARY GRID
═══════════════════════════════════════ */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.summary-item {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.summary-item .s-label {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.summary-item .s-value {
  font-size: var(--t-xl);
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1;
}


/* ═══════════════════════════════════════
   AADHAR UPLOAD ZONE
═══════════════════════════════════════ */
.aadhar-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--s7) var(--s4);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-md);
  margin-bottom: var(--s4);
  background: var(--bg-input);
}
.aadhar-zone:active { border-color: var(--text-primary); background: var(--bg-elevated); }
.aadhar-zone.captured {
  border-style: solid;
  border-color: var(--running-clr);
  background: var(--running-bg);
}
.aadhar-zone .az-icon { font-size: 36px; margin-bottom: var(--s2); line-height: 1; }
.aadhar-zone .az-title { font-size: var(--t-md); font-weight: 700; color: var(--text-secondary); }
.aadhar-zone .az-sub { font-size: var(--t-sm); color: var(--text-hint); margin-top: 4px; }
.aadhar-preview-img {
  width: 100%;
  border-radius: var(--r-md);
  max-height: 180px;
  object-fit: cover;
  margin-bottom: var(--s4);
  box-shadow: var(--shadow-sm);
}


/* ═══════════════════════════════════════
   PEOPLE COUNTER
═══════════════════════════════════════ */
.people-counter {
  display: flex;
  align-items: center;
  gap: var(--s4);
  background: var(--bg-input);
  border-radius: var(--r-lg);
  padding: var(--s3);
  margin: var(--s2) 0 var(--s4);
}
.counter-btn {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--bg-card);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  user-select: none;
  flex-shrink: 0;
}
.counter-btn:active { transform: scale(0.88); box-shadow: none; }
.counter-value {
  flex: 1;
  text-align: center;
  font-size: var(--t-3xl);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}


/* ═══════════════════════════════════════
   STAT BLOCK (admin)
═══════════════════════════════════════ */
.stat-block {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s4) var(--s3);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--s3);
}
.stat-block-title {
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.stat-row .sr-label { font-size: var(--t-sm); color: var(--text-secondary); font-weight: 500; }
.stat-row .sr-value { font-size: var(--t-md); font-weight: 800; }

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.admin-row:last-child { border-bottom: none; }
.admin-row:active { background: var(--bg-input); }
.admin-row .ar-label { font-size: var(--t-md); font-weight: 600; }
.admin-row .ar-value { font-size: var(--t-sm); color: var(--text-hint); display: flex; align-items: center; gap: 6px; }
