* {
  box-sizing: border-box;
}

/* Same variable names as finals_banking NUI; client sends palette via `theme` in messages. */
:root {
  --fb-primary: #fedc2c;
  --fb-primary-rgb: 254, 220, 44;
  --fb-on-primary: #0a0a0a;
  --fb-primary-dark: #d4b01a;
  --fb-primary-deeper: #9a7d0e;
  --fb-primary-ink: #141205;
  --accent: var(--fb-primary);
}

body {
  margin: 0;
  user-select: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: rgba(0, 0, 0, 0);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.overlay {
  /* background: #0f0f0f00; */
  background: linear-gradient(90deg, rgba(42, 123, 155, 0) 1%, rgba(87, 199, 133, 0) 75%, rgba(237, 221, 83, 0.32) 100%);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 50px;
  position: absolute;
  inset: 0;
}

.card {
  background: #fff;
  width: 420px;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  border: 2px solid #e9e9e9;
}

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.header img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8f8f8;
  border: 1px solid #eee;
}

.title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #111;
}

.subtitle {
  margin: 2px 0 0 0;
  color: #666;
  font-size: 13px;
}

label {
  display: block;
  font-weight: 600;
  margin: 12px 0 6px;
  color: #222;
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
  background: #fafafa;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 3px rgba(var(--fb-primary-rgb), 0.18);
}

/* Custom Dropdown */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  width: 100%;
  padding: 11px 40px 11px 12px;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
  background: #fafafa;
  font-size: 14px;
  font-family: inherit;
  color: #111;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}

.dropdown-selected:hover {
  border-color: var(--fb-primary);
  background: #fff;
}

.dropdown-selected.disabled {
  color: #999;
  cursor: not-allowed;
}

.custom-dropdown.open .dropdown-selected {
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 3px rgba(var(--fb-primary-rgb), 0.18);
  background: #fff;
}

.dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 10px;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.15s ease;
}

.custom-dropdown.open .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: var(--fb-primary);
}

.dropdown-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  margin-top: 4px;
}

.custom-dropdown.open .dropdown-options {
  display: block;
}

.dropdown-option {
  padding: 11px 12px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border-bottom: 1px solid #f5f5f5;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background: #f8f8f8;
  color: var(--fb-primary);
}

.dropdown-option.selected {
  background: rgba(var(--fb-primary-rgb), 0.12);
  color: var(--fb-primary);
  font-weight: 600;
}

.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background: var(--fb-primary);
}

textarea {
  resize: none;
  min-height: 72px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  flex: 1;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--fb-primary);
  color: var(--fb-on-primary);
  box-shadow: 0 12px 30px rgba(var(--fb-primary-rgb), 0.35);
}

.btn.secondary {
  background: #f2f2f2;
  color: #222;
}

.muted {
  color: #666;
  font-size: 13px;
  margin-top: 6px;
}

.hint {
  display: inline-block;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #444;
  margin-top: 6px;
}

.pay-card {
  border-color: #e5e5e5;
}

.pay-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 14px;
}

.reason {
  margin: 2px 0 0 0;
  font-weight: 600;
  color: #1c1c1c;
}

.amount-chip {
  background: var(--fb-primary);
  color: var(--fb-on-primary);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  min-width: 120px;
  text-align: right;
  box-shadow: 0 12px 30px rgba(var(--fb-primary-rgb), 0.35);
}

.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #222;
}

.timer-dot {
  width: 10px;
  height: 10px;
  background: #d9534f;
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(217, 83, 79, 0.08);
}

.pay-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.pay-buttons .btn {
  width: 100%;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}

.checkbox-container input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.checkbox-container span {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.receipt-card {
  border-color: #e5e5e5;
}

.receipt-details {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.receipt-row:last-child {
  margin-bottom: 0;
}

.receipt-label {
  color: #666;
}

.receipt-value {
  font-weight: 600;
  color: #111;
  text-align: right;
}

.receipt-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--fb-primary);
  text-align: center;
  margin: 20px 0;
}

.pay-later-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.invoice-list {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.invoice-row {
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.invoice-row:hover {
  border-color: #ccc;
}

.invoice-row.selected {
  border-color: var(--fb-primary);
  background: rgba(var(--fb-primary-rgb), 0.08);
}

.invoice-row-title {
  font-weight: 600;
  font-size: 14px;
}

.invoice-id {
  color: #888;
  font-size: 12px;
  font-weight: 500;
}

.invoice-row-meta,
.invoice-row-reason {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.invoice-row-amt {
  font-size: 13px;
  margin-top: 6px;
}