/* TBSS2 Coupons - Saffron / Cream / Gold Theme */

.tbss2-wrap {
  font-family: 'Poppins', 'Noto Sans Telugu', sans-serif;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 60px;
  background: #FFF9EE;
  color: #4A2E00;
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(180,120,20,0.12);
}

.tbss2-wrap * { box-sizing: border-box; }

.tbss2-header { text-align: center; margin-bottom: 26px; }
.tbss2-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #C1440E;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
  line-height: 1.3;
}
.tbss2-sub {
  font-size: 16px;
  font-weight: 600;
  color: #B8860B;
  margin: 0;
}

.tbss2-home-buttons { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }

.tbss2-btn {
  border: none;
  border-radius: 12px;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.4;
}
.tbss2-btn:active { transform: scale(0.97); }

.tbss2-btn-primary {
  background: linear-gradient(135deg, #FF9933, #E8720C);
  color: #fff;
  box-shadow: 0 3px 8px rgba(232,114,12,0.35);
}
.tbss2-btn-secondary {
  background: #FFF3D6;
  color: #A05A00;
  border: 2px solid #E8B84B;
}
.tbss2-btn-admin {
  background: #FDF0E0;
  color: #8B4513;
  border: 2px dashed #D4AF37;
}
.tbss2-btn-small { padding: 8px 14px; font-size: 14px; }
.tbss2-btn-full { width: 100%; margin-top: 10px; }
.tbss2-btn-link { background: transparent; color: #B8860B; text-decoration: underline; font-weight: 500; }

.tbss2-btn-sub { display: block; font-size: 12px; font-weight: 400; opacity: 0.85; margin-top: 3px; }

.tbss2-back {
  background: none;
  border: none;
  color: #B8860B;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  padding: 0;
}

h2 {
  font-size: 19px;
  color: #C1440E;
  font-weight: 700;
  margin: 0 0 16px;
  text-align: center;
}

.tbss2-form { display: flex; flex-direction: column; }
.tbss2-form label {
  font-size: 13.5px;
  font-weight: 600;
  color: #8B5A00;
  margin: 14px 0 6px;
}
.tbss2-hint { font-size: 11.5px; font-weight: 400; color: #B8860B; }

.tbss2-input {
  border: 2px solid #F0D9A6;
  background: #FFFDF7;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: #4A2E00;
  width: 100%;
}
.tbss2-input:focus { outline: none; border-color: #E8720C; background: #fff; }
.tbss2-uppercase { text-transform: uppercase; }

.tbss2-triplet { display: flex; gap: 8px; }
.tbss2-mini { width: 60px; text-align: center; }
.tbss2-mini-wide { flex: 1; text-align: center; letter-spacing: 2px; }

.tbss2-inline-row { display: flex; gap: 8px; align-items: center; }
.tbss2-inline-row .tbss2-input { flex: 1; }

.tbss2-autocomplete-wrap { position: relative; }
.tbss2-autocomplete-list {
  position: relative;
  background: #fff;
  border: 1px solid #F0D9A6;
  border-radius: 10px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.tbss2-autocomplete-list.show { display: block; }
.tbss2-autocomplete-item {
  padding: 11px 14px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid #FBEFD6;
}
.tbss2-autocomplete-item:last-child { border-bottom: none; }
.tbss2-autocomplete-item:hover, .tbss2-autocomplete-item:active { background: #FFF3D6; }
.tbss2-autocomplete-item small { display: block; color: #B8860B; font-size: 12px; }

.tbss2-selected-area {
  margin-top: 8px;
  display: inline-block;
  background: #E9F7EA;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
}

.tbss2-pincode-toggle { margin-top: 10px; }

.tbss2-msg {
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  margin-top: 10px;
  min-height: 0;
}
.tbss2-msg.error { color: #C62828; background: #FDECEA; border: 1px solid #F5C6C2; padding: 10px 12px; border-radius: 8px; }
.tbss2-msg.success { color: #2E7D32; background: #E9F7EA; border: 1px solid #A5D6A7; padding: 10px 12px; border-radius: 8px; }

/* ===== Modal / Preview ===== */
.tbss2-modal-overlay {
  position: fixed; inset: 0; background: rgba(74,46,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 16px;
}
.tbss2-modal {
  background: #FFFDF7;
  border-radius: 16px;
  padding: 26px 22px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.tbss2-preview-box { font-size: 20px; line-height: 2; font-weight: 600; color: #4A2E00; }
.tbss2-preview-box .tbss2-pv-label { font-size: 13px; color: #B8860B; font-weight: 500; display: block; margin-top: 12px; }
.tbss2-preview-box .tbss2-pv-value { font-size: 22px; font-weight: 700; }
.tbss2-modal-buttons { display: flex; gap: 12px; margin-top: 22px; }
.tbss2-modal-buttons .tbss2-btn { flex: 1; }

/* ===== QR result ===== */
.tbss2-result-box { text-align: center; }
.tbss2-coupon-id { font-size: 15px; color: #B8860B; font-weight: 700; letter-spacing: 1px; }
.tbss2-qr-canvas { display: flex; justify-content: center; margin: 18px 0; padding: 16px; background: #fff; border-radius: 14px; border: 2px solid #F0D9A6; }
.tbss2-permanent-note { font-size: 13.5px; color: #8B5A00; background: #FFF3D6; padding: 10px 14px; border-radius: 10px; margin: 14px 0; }
.tbss2-result-buttons { display: flex; gap: 12px; margin: 14px 0; }
.tbss2-result-buttons .tbss2-btn { flex: 1; }

/* ===== Admin ===== */
.tbss2-admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tbss2-admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tbss2-tab-btn {
  flex: 1; padding: 10px; border: none; border-radius: 10px;
  background: #FFF3D6; color: #A05A00; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 14px;
}
.tbss2-tab-btn.active { background: #E8720C; color: #fff; }

#tbss2-scanner-region { margin-top: 16px; border-radius: 12px; overflow: hidden; border: 2px solid #F0D9A6; }

.tbss2-scan-result { margin-top: 18px; }
.tbss2-scan-card {
  border-radius: 14px; padding: 18px; text-align: center;
}
.tbss2-scan-card.verified { background: #E9F7EA; border: 2px solid #66BB6A; }
.tbss2-scan-card.already { background: #FFF3E0; border: 2px solid #FFA726; }
.tbss2-scan-card.invalid { background: #FDECEA; border: 2px solid #EF5350; }
.tbss2-scan-icon { font-size: 46px; margin-bottom: 6px; }
.tbss2-scan-name { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.tbss2-scan-detail { font-size: 14px; color: #6B4E00; margin: 2px 0; }
.tbss2-scan-status-badge {
  display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 14px;
}
.tbss2-scan-status-badge.green { background: #2E7D32; color: #fff; }
.tbss2-scan-status-badge.orange { background: #EF6C00; color: #fff; }
.tbss2-scan-buttons { display: flex; gap: 10px; margin-top: 16px; }
.tbss2-scan-buttons .tbss2-btn { flex: 1; }

.tbss2-stats-row { display: flex; gap: 10px; margin-bottom: 16px; }
.tbss2-stat-box { flex: 1; background: #FFF3D6; border-radius: 10px; padding: 12px; text-align: center; }
.tbss2-stat-box .num { font-size: 22px; font-weight: 700; color: #C1440E; }
.tbss2-stat-box .lbl { font-size: 11px; color: #8B5A00; font-weight: 600; }

.tbss2-filter-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.tbss2-filter-bar select {
  border: 2px solid #F0D9A6; border-radius: 8px; padding: 8px; font-family: inherit; background: #fff;
}
.tbss2-filter-bar input {
  flex: 1; border: 2px solid #F0D9A6; border-radius: 8px; padding: 8px 10px; font-family: inherit;
}

.tbss2-table-wrap { overflow-x: auto; }
.tbss2-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbss2-table th {
  background: #FFE9B8; color: #8B5A00; text-align: left; padding: 8px; font-size: 12px;
}
.tbss2-table td {
  padding: 8px; border-bottom: 1px solid #F5E5C0; word-break: break-word;
}
.tbss2-status-pill { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.tbss2-status-pill.delivered { background: #E9F7EA; color: #2E7D32; }
.tbss2-status-pill.pending { background: #FFF3E0; color: #EF6C00; }
.tbss2-status-pill.approved { background: #E9F7EA; color: #2E7D32; }
.tbss2-status-pill.rejected { background: #FDECEA; color: #C62828; }

.tbss2-bulk-bar {
  display: flex; align-items: center; gap: 10px; background: #FFF3D6;
  border: 1px solid #E8B84B; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px; font-weight: 600; color: #8B5A00; flex-wrap: wrap;
}
.tbss2-btn-approve { background: #2E7D32; color: #fff; }
.tbss2-btn-reject { background: #EF6C00; color: #fff; }
.tbss2-btn-delete { background: #C62828; color: #fff; }
.tbss2-btn-edit { background: #E8720C; color: #fff; }
.tbss2-btn-view { background: #FFF3D6; color: #A05A00; border: 1px solid #E8B84B; }

.tbss2-row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.tbss2-row-actions button {
  border: none; border-radius: 6px; padding: 5px 8px; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit;
}

.tbss2-inline-edit-row td { background: #FFFBF0; padding: 12px 8px; }
.tbss2-inline-edit-grid { display: flex; flex-direction: column; gap: 8px; }
.tbss2-inline-edit-grid input {
  border: 2px solid #F0D9A6; border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; width: 100%;
}
.tbss2-inline-edit-buttons { display: flex; gap: 8px; margin-top: 4px; }
.tbss2-inline-edit-buttons button {
  flex: 1; border: none; border-radius: 8px; padding: 8px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
}

#tbss2-camera-msg.error { margin-top: 12px; }
.tbss2-manual-entry { margin-top: 14px; background: #FFF3D6; border-radius: 10px; padding: 12px 14px; }

#tbss2-scanner-region { min-height: 260px; }
#tbss2-view-qr { display: flex; justify-content: center; margin-top: 14px; }

@media (max-width: 480px) {
  .tbss2-wrap { padding: 18px 12px 50px; border-radius: 0; }
  .tbss2-header h1 { font-size: 19px; }
}
