/* ── Dashboard navigation tabs ──────────────────── */
.dash-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dash-nav-link {
  padding: 6px 14px;
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 600;
  color: rgba(45, 36, 24, .70);
  text-decoration: none;
  transition: .18s;
}

.dash-nav-link:hover {
  background: rgba(45, 36, 24, .14);
  color: var(--dark);
}

.dash-nav-link.active {
  background: rgba(45, 36, 24, .18);
  color: var(--dark);
}

/* ── Flash messages ──────────────────────────────── */
.flash {
  padding: 11px 16px;
  border-radius: var(--rs);
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.flash-success {
  background: rgba(58, 158, 80, .10);
  border: 1.5px solid rgba(58, 158, 80, .28);
  color: var(--green);
}

.flash-error {
  background: rgba(217, 64, 64, .08);
  border: 1.5px solid rgba(217, 64, 64, .28);
  color: var(--red);
}

html[data-theme="dark"] .flash-success {
  background: rgba(58, 158, 80, .14);
  border-color: rgba(58, 158, 80, .30);
}

html[data-theme="dark"] .flash-error {
  background: rgba(217, 64, 64, .12);
  border-color: rgba(217, 64, 64, .30);
}

/* ── Login page centering ────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 20px 0;
}

.tg-widget-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

/* ── Form elements ───────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.input-field {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--rs);
  border: 1.5px solid var(--border);
  background: var(--bg-card2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--dark);
  transition: .18s;
  outline: none;
}

.input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

html[data-theme="dark"] .input-field {
  background: #311F0E;
  border-color: rgba(245, 200, 66, .18);
  color: #EEE0B8;
}

html[data-theme="dark"] .input-field:focus {
  border-color: var(--gold);
}

/* ── Amount presets ──────────────────────────────── */
.amount-presets {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.preset-btn {
  padding: 7px 14px;
  border-radius: var(--rs);
  border: 1.5px solid var(--border);
  background: var(--bg-card2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  transition: .18s;
}

.preset-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

html[data-theme="dark"] .preset-btn {
  background: #311F0E;
  border-color: rgba(245, 200, 66, .18);
  color: #EEE0B8;
}

html[data-theme="dark"] .preset-btn:hover {
  border-color: var(--gold);
  background: rgba(245, 200, 66, .12);
}

/* ── Payment method options ──────────────────────── */
.method-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.method-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--rs);
  border: 1.5px solid var(--border);
  background: var(--bg-card2);
  cursor: pointer;
  transition: .18s;
}

.method-option:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.method-option input[type="radio"] {
  accent-color: var(--dark);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.method-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.method-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.method-desc {
  font-size: 12px;
  color: var(--muted);
}

html[data-theme="dark"] .method-option {
  background: #311F0E;
  border-color: rgba(245, 200, 66, .18);
}

html[data-theme="dark"] .method-option:has(input:checked) {
  background: rgba(245, 200, 66, .10);
  border-color: rgba(245, 200, 66, .40);
}

html[data-theme="dark"] .method-name { color: #EEE0B8; }

/* ── Duration buttons ────────────────────────────── */
.duration-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--rs);
  border: 1.5px solid var(--border);
  background: var(--bg-card2);
  font-family: inherit;
  cursor: pointer;
  transition: .18s;
  text-align: left;
}

.duration-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.duration-btn:disabled,
.duration-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.duration-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
}

.duration-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

.duration-hint {
  font-size: 11px;
  color: var(--red);
  font-weight: 500;
  display: block;
  margin-top: 2px;
  width: 100%;
}

html[data-theme="dark"] .duration-btn {
  background: #311F0E;
  border-color: rgba(245, 200, 66, .18);
}

html[data-theme="dark"] .duration-btn:hover:not(:disabled) {
  background: rgba(245, 200, 66, .10);
  border-color: rgba(245, 200, 66, .40);
}

html[data-theme="dark"] .duration-title,
html[data-theme="dark"] .duration-price { color: #EEE0B8; }

/* ── Action buttons on home ──────────────────────── */
.dash-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-action-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--rs);
  border: 1.5px solid var(--border);
  background: var(--bg-card2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  text-decoration: none;
  transition: .18s;
  width: 100%;
}

.dash-action-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dash-action-btn--primary {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--white);
}

.dash-action-btn--primary:hover {
  background: #1a0f08;
  border-color: #1a0f08;
  color: var(--white);
}

.dash-action-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

html[data-theme="dark"] .dash-action-btn {
  background: #311F0E;
  border-color: rgba(245, 200, 66, .18);
  color: #EEE0B8;
}

html[data-theme="dark"] .dash-action-btn:hover {
  background: rgba(245, 200, 66, .10);
  border-color: rgba(245, 200, 66, .40);
}

html[data-theme="dark"] .dash-action-btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
}

html[data-theme="dark"] .dash-action-btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

/* ── Transaction list ────────────────────────────── */
.tx-list {
  display: flex;
  flex-direction: column;
}

.tx-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.tx-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.tx-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.tx-desc {
  font-size: 13px;
  color: var(--dark);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 14px;
  font-weight: 700;
}

.tx-credit {
  color: var(--green);
}

.tx-debit {
  color: var(--red);
}

.tx-balance {
  font-size: 11px;
  color: var(--muted);
}

html[data-theme="dark"] .tx-desc { color: #EEE0B8; }

/* ── Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.page-btn {
  padding: 7px 16px;
  border-radius: var(--rs);
  border: 1.5px solid var(--border);
  background: var(--bg-card2);
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  transition: .18s;
}

.page-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.page-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

html[data-theme="dark"] .page-btn {
  background: #311F0E;
  border-color: rgba(245, 200, 66, .18);
  color: #EEE0B8;
}

/* ── Loading spinner ──────────────────────────────── */
.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #F5C842;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-hidden {
  display: none;
}

html[data-theme="dark"] .loader {
  border-color: rgba(245, 200, 66, .12);
  border-top-color: #F5C842;
}

/* ── Global blocker/loader ────────────────────────── */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s ease;
}

.loader-p-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  background: var(--bg-card);
  padding: 30px 40px;
  border-radius: var(--rs);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 90%;
  border: 1.5px solid var(--border);
}

.loader-spinner {
  border: 4.5px solid var(--border);
  border-top: 4.5px solid var(--gold);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 15px;
}

.loader-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

html[data-theme="dark"] .loader-content {
  background: #251B12;
  border-color: rgba(245, 200, 66, .18);
}
html[data-theme="dark"] .loader-spinner {
  border-color: rgba(245, 200, 66, .12);
  border-top-color: var(--gold);
}
html[data-theme="dark"] .loader-text { color: #EEE0B8; }
