:root {
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --accent: #16a34a;
  --accent-soft: #dcfce7;
  --accent-text: #15803d;
  --text-main: #111827;
  --text-sub: #6b7280;
  --border-soft: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at top, #f1f5f9 0, #f9fafb 40%, #f9fafb 100%);
  color: var(--text-main);
  min-height: 100vh;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.brand-title {
  margin: 0;
  font-size: 1.4rem;
}

.brand-subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-sub);
  font-size: 0.9rem;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 600;
}

.brand-pill-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--accent);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-chip {
  font-size: 0.8rem;
  color: var(--text-sub);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #22c55e;
}

.top-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--text-sub);
  border: 1px solid var(--border-soft);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #fff;
}

.nav-link-active {
  color: #065f46;
  background: #dcfce7;
  border-color: #86efac;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.single-column {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  }
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.06);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-sub);
  background: #f9fafb;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 62vh;
  overflow-y: auto;
}

.request-card {
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: #fff;
}

.request-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.request-top-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.request-name {
  font-weight: 600;
}

.status-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.status-pending {
  background: #fef9c3;
  color: #854d0e;
}

.status-prepared {
  background: #dcfce7;
  color: #166534;
}

.status-given {
  background: #e5e7eb;
  color: #374151;
}

.notes-row {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.note-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
}

.request-extra {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-sub);
}

.request-controls {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.input-small {
  border: 1px solid var(--border-soft);
  border-radius: 0.45rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  background: #fff;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-secondary {
  background: #f3f4f6;
  color: #111827;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1.5px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.btn-icon:active { transform: scale(0.92); }

.btn-icon-edit {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.btn-icon-edit:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-icon-delete {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}

.btn-icon-delete:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.empty-state {
  margin: 0.6rem 0 0;
  color: var(--text-sub);
  font-size: 0.9rem;
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.summary-section-title {
  font-size: 0.78rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #d1d5db;
  padding: 0.35rem 0;
  font-size: 0.86rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-count {
  font-weight: 600;
}

.summary-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.add-form {
  margin-top: 1rem;
  border-top: 1px dashed #d1d5db;
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.no-border {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 560px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field-label {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.field-help {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.form-tip {
  margin: 0;
  font-size: 0.82rem;
  color: #1f2937;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.6rem;
  padding: 0.55rem 0.65rem;
}

.input-text {
  border: 1px solid var(--border-soft);
  background: #f9fafb;
  border-radius: 0.6rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.input-text:focus {
  outline: 1px solid rgba(22, 163, 74, 0.35);
  border-color: rgba(22, 163, 74, 0.45);
  background: #fff;
}

.input-text:invalid {
  border-color: #fca5a5;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.submit-message {
  min-height: 1.1rem;
  margin: 0;
  color: #166534;
  font-size: 0.82rem;
}

.limits-box {
  margin-top: 0.9rem;
  border-top: 1px dashed #d1d5db;
  padding-top: 0.75rem;
}

.limits-subtitle {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* --- Donut chart --- */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 120px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #374151;
}

.donut-legend-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* --- Progress bar cards --- */
.limits-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.limit-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.6rem 0.7rem;
  background: #fff;
}

.limit-card-disabled {
  opacity: 0.45;
  background: #f3f4f6;
}

/* ── Inline limit indicator below each form input ── */
.field-limit-bar {
  margin-top: 0.25rem;
}
.field-limit-bar:empty { display: none; }
.flb-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}
.flb-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}
.flb-tag {
  font-size: 0.67rem;
  font-weight: 700;
  white-space: nowrap;
}
.flb-nums {
  font-size: 0.65rem;
  color: #6b7280;
  direction: ltr;
  white-space: nowrap;
}
/* Badge appended inline with the field label */
.flb-label-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.limit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.limit-card-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}

.limit-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.limit-tag-ok   { background: #dcfce7; color: #166534; }
.limit-tag-warn { background: #fef9c3; color: #854d0e; }
.limit-tag-full { background: #fee2e2; color: #991b1b; }
.limit-tag-open { background: #eff6ff; color: #1d4ed8; }

.limit-bar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.limit-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.limit-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.75rem;
  color: var(--text-sub);
}

.limit-personal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #fff7ed;
  color: #92400e;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Collapsed request cards ─────────────────────────────────────── */
.req-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-radius: 0.75rem;
  transition: background 0.15s;
  user-select: none;
  outline: none;
}

.req-summary:hover,
.req-summary:focus-visible {
  background: #f1f5f9;
}

.req-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.req-summary-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.req-summary-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.req-summary-phone {
  font-size: 0.75rem;
  color: var(--text-sub);
  direction: ltr;
  text-align: right;
}

.req-summary-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.req-summary-amount {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.req-seq {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 600;
}

.req-chevron {
  font-size: 0.8rem;
  color: var(--text-sub);
  transition: transform 0.2s;
}

.req-expanded .req-chevron {
  transform: rotate(180deg);
}

.req-details {
  padding: 0 0.75rem 0.75rem;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-box {
  background: #fff;
  border-radius: 1rem;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 1.25rem 1.5rem 1.5rem;
}

.modal-box-wide {
  max-width: 640px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-sub);
  padding: 0.2rem 0.4rem;
  border-radius: 0.4rem;
  transition: background 0.15s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

/* ── Limits panel redesign ───────────────────────────────────────── */
.limits-panel {
  margin-top: 1rem;
  border-top: 1px dashed #d1d5db;
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.limits-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.limits-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.limits-panel-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 0.1rem;
}

/* Legend row */
.limits-legend {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 0.15rem;
}

.limits-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-sub);
  font-weight: 500;
}

.ll-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Denomination card */
.ldc {
  border: 1.5px solid #e2e8f0;
  border-left: 4px solid var(--ldc-accent, #6366f1);
  border-radius: 0.6rem;
  padding: 0.65rem 0.75rem 0.6rem;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.18s, border-color 0.18s;
}

.ldc:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.09);
  border-color: #cbd5e1;
}

/* Card header row */
.ldc-hd {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.ldc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.55rem;
  background: var(--lb-bg, #f3f4f6);
  color: var(--lb-fg, #374151);
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
  padding: 0 0.3rem;
  letter-spacing: -0.01em;
  border: 1.5px solid rgba(0,0,0,0.1);
}

.ldc-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.ldc-hint {
  font-size: 0.7rem;
  color: var(--text-sub);
  flex: 1;
}

/* Two-input row inside card */
.ldc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.ldc-field {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.ldc-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ldc-label-total    { color: #6366f1; }
.ldc-label-personal { color: #d97706; }
.ldc-label-stock    { color: #10b981; }

.limits-input {
  width: 100%;
  border: 1.5px solid #d1d5db;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.42rem 0.5rem;
  font-size: 0.88rem;
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
  font-family: inherit;
}

.limits-input:focus {
  outline: none;
  background: #fff;
}

.ldi-total:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.ldi-personal:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.ldi-stock { border-color: #a7f3d0; }
.ldi-stock:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.limits-input::placeholder { color: #d1d5db; }

/* Live usage chip */
.lr-usage-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.06rem 0.38rem;
  border-radius: 999px;
  margin-right: auto;
  display: none;
}

.lr-usage-chip:not(:empty) { display: inline-block; }

.luc-ok   { background: #dcfce7; color: #166534; }
.luc-warn { background: #fef9c3; color: #854d0e; }
.luc-full { background: #fee2e2; color: #991b1b; }
.luc-used { background: #f1f5f9; color: #64748b; }

/* ── Edit-allowed toggle ─────────────────────────────────────────── */
.edit-allowed-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.edit-allowed-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: default;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.edit-allowed-hint {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-sub);
}

.toggle-btn {
  position: relative;
  width: 2.6rem;
  height: 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  padding: 0;
}

.toggle-on  { background: #16a34a; }
.toggle-off { background: #d1d5db; }

.toggle-knob {
  position: absolute;
  top: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s;
}

.toggle-on  .toggle-knob { left: calc(100% - 1.25rem); }
.toggle-off .toggle-knob { left: 0.15rem; }

/* ── Submission success box ──────────────────────────────────────── */
.submit-success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.ssb-icon  { font-size: 2.5rem; line-height: 1; }

.ssb-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.ssb-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-sub);
  max-width: 340px;
}

.ssb-link-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.ssb-link {
  flex: 1;
  font-size: 0.72rem;
  color: #2563eb;
  word-break: break-all;
  text-decoration: none;
  text-align: center;
  direction: ltr;
}

.ssb-link:hover { text-decoration: underline; }

/* ── Copy-link button (shared) ───────────────────────────────────── */
.btn-copy-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.3rem;
  border-radius: 0.35rem;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-copy-link:hover { background: #e2e8f0; }

/* ── Admin: request edit link row ────────────────────────────────── */
.req-edit-link-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  flex-wrap: wrap;
}

.req-edit-link-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-weight: 600;
  white-space: nowrap;
}

.req-edit-link-code {
  flex: 1;
  font-size: 0.68rem;
  color: #2563eb;
  word-break: break-all;
  direction: ltr;
  text-align: left;
}

/* ── Payment status badges (admin cards) ─────────────────────────── */
.req-payment-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.req-pay-status-line,
.req-pay-input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pay-amount-input {
  width: 6rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  text-align: center;
  direction: ltr;
}
.pay-amount-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.req-pay-of {
  font-size: 0.72rem;
  color: var(--text-sub);
  white-space: nowrap;
}

.pay-progress-wrap {
  flex: 1;
  min-width: 60px;
  max-width: 120px;
  height: 5px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.pay-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}
.pay-progress-pct {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.req-payment-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-weight: 600;
  white-space: nowrap;
}

.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.pay-pending       { background: #fef9c3; color: #92400e; }
.pay-confirmed     { background: #dbeafe; color: #1d4ed8; }
.pay-received      { background: #dcfce7; color: #15803d; }
.pay-extra         { background: #ede9fe; color: #6d28d9; }
.pay-extra-pending { background: #fef3c7; color: #b45309; }

.btn-sm-confirm {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 0.4rem;
  background: #16a34a;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-sm-confirm:hover { background: #15803d; }

.btn-sm-unconfirm {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 0.4rem;
  background: #e5e7eb;
  color: #374151;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-sm-unconfirm:hover { background: #d1d5db; }

/* ── Auto-refresh pill (admin) ───────────────────────────────────── */
.auto-refresh-pill {
  font-size: 0.72rem;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 500;
  cursor: default;
  transition: background 0.2s, color 0.2s;
}

/* ── Extra amount notice (edit.php) ─────────────────────────────── */
.extra-amount-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  color: #92400e;
  line-height: 1.4;
}

.extra-amount-notice strong {
  font-weight: 700;
  color: #b45309;
}

/* ── Payment card (edit.php) ─────────────────────────────────────── */
.payment-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payment-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.payment-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.payment-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e40af;
}

.payment-deadline-text {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.payment-amount-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 0.45rem;
  padding: 0.35rem 0.65rem;
  display: inline-block;
}

.payment-transfer-phone {
  font-size: 0.85rem;
  color: #475569;
  margin-top: 0.4rem;
  padding: 0.25rem 0;
}

.payment-transfer-phone strong {
  color: #0f172a;
  font-weight: 700;
}

.payment-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 0.55rem;
}

.payment-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.payment-toggle-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e3a5f;
}

.payment-toggle-hint {
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 500;
}

/* Inside submit success box */
.ssb-payment {
  margin-top: 0.85rem;
  text-align: right;
}

/* ── Save success banner (edit.php inline) ───────────────────────── */
.save-success-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  background: #dcfce7;
  border: 1.5px solid #86efac;
  border-radius: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #15803d;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Session countdown bar ───────────────────────────────────────── */
.session-bar {
  margin: 0 1rem 0.75rem;
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.sb-open    { background: linear-gradient(135deg,#ecfdf5,#f0fdf4); border: 1.5px solid #86efac; }
.sb-pending { background: linear-gradient(135deg,#fff7ed,#fffbeb); border: 1.5px solid #fcd34d; }
.sb-closed  { background: linear-gradient(135deg,#fef2f2,#fff1f2); border: 1.5px solid #fca5a5; }

.sb-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  flex-wrap: wrap;
}

.sb-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sb-icon { font-size: 1.4rem; flex-shrink: 0; }

.sb-texts {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sb-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
}

.sb-status {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 500;
}

.sb-range {
  font-size: 0.75rem;
  color: #64748b;
}

.sb-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 180px;
}

.sb-countdown {
  font-size: 0.82rem;
  color: #1e293b;
  font-weight: 500;
}

.sb-countdown strong { color: #0f766e; font-weight: 700; }
.sb-pending .sb-countdown strong { color: #b45309; }
.sb-closed  .sb-countdown strong { color: #dc2626; }

.sb-progress {
  width: 100%;
  height: 7px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.sb-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.sb-open-fill    { background: linear-gradient(90deg,#34d399,#10b981); }
.sb-pending-fill { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.sb-closed-fill  { background: #ef4444; width:100% !important; }

@media (max-width: 600px) {
  .session-bar { margin: 0 0.5rem 0.6rem; }
  .sb-inner    { gap: 0.6rem; padding: 0.65rem 0.8rem; }
  .sb-right    { align-items: flex-start; min-width: unset; width: 100%; }
}
