/* ───── Presence dot (online/offline) ───── */
.presence-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  vertical-align: middle;
  position: relative;
}
.presence-on {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: presencePulse 1.6s ease-out infinite;
}
.presence-off {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
@keyframes presencePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ───── Balance button в таблице водителей ───── */
.balance-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px;
  border: 1px solid rgba(255, 193, 7, 0.3);
  background: rgba(255, 193, 7, 0.08);
  color: #B8860B;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 13px;
}
.balance-btn:hover {
  background: #FFC107; color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}
.balance-btn.balance-neg {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}
.balance-btn.balance-neg:hover {
  background: #ef4444; color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.balance-amt { font-variant-numeric: tabular-nums; }
.balance-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #FFC107; color: #000;
  font-weight: 800; font-size: 12px;
  line-height: 1;
}
.balance-btn.balance-neg .balance-plus { background: #ef4444; color: #fff; }
.balance-btn:hover .balance-plus { background: #000; color: #FFC107; }
.balance-btn.balance-neg:hover .balance-plus { background: #fff; color: #ef4444; }

/* ───── Topup Modal ───── */
.tup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: tupFade 0.2s ease;
}
@keyframes tupFade { from { opacity: 0; } to { opacity: 1; } }

.tup-modal {
  position: relative;
  background: #0f1419;
  color: #e5e7eb;
  border-radius: 16px;
  max-width: 480px; width: 100%;
  border: 1px solid rgba(255, 193, 7, 0.2);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  animation: tupSlide 0.25s ease;
}
@keyframes tupSlide { from { transform: translateY(15px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.tup-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); color: #fff;
  border: 0; cursor: pointer; font-size: 22px; line-height: 1;
  transition: all 0.2s; z-index: 2;
}
.tup-close:hover { background: rgba(239, 68, 68, 0.4); transform: rotate(90deg); }

.tup-title {
  padding: 24px 28px 14px;
  font-size: 20px; font-weight: 800; color: #fff;
}
.tup-target {
  margin: 0 24px 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), transparent);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 10px;
}
.tup-target-name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.tup-target-balance { font-size: 13px; color: #94a3b8; }
.tup-pos { color: #4ade80; }
.tup-neg { color: #fca5a5; }

#tup-form { padding: 0 24px 20px; }
.tup-label {
  display: block; margin: 12px 0 6px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #94a3b8; font-weight: 600;
}
.tup-input {
  width: 100%; padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid #1f2937;
  color: #fff;
  border-radius: 9px;
  font-family: inherit; font-size: 14px;
  transition: border 0.15s;
}
.tup-input:focus {
  outline: none;
  border-color: #FFC107;
  background: rgba(255, 255, 255, 0.07);
}
/* #19: опции нативного <select> наследуют color:#fff и рисуются белым по
   белому системному фону (нал/карта/перевод не видно). Задаём тёмный фон. */
.tup-input option { background: #1a2230; color: #e5e7eb; }
.tup-amount-big {
  font-size: 20px; font-weight: 700; text-align: center;
  padding: 14px; letter-spacing: 0.5px;
}
.tup-quick {
  display: flex; gap: 6px; margin-top: 8px;
  flex-wrap: wrap;
}
.tup-quick button {
  flex: 1; min-width: 60px;
  padding: 7px 10px;
  background: rgba(255, 193, 7, 0.1); color: #FFC107;
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 6px; cursor: pointer;
  font-weight: 700; font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}
.tup-quick button:hover { background: #FFC107; color: #000; }

.tup-error {
  margin-top: 12px; padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 8px;
  font-size: 13px;
}

.tup-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 18px;
}
.tup-btn {
  padding: 11px 22px;
  border-radius: 9px; border: 0;
  font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.tup-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tup-btn-yellow { background: #FFC107; color: #000; }
.tup-btn-yellow:hover:not(:disabled) { background: #B8860B; color: #fff; box-shadow: 0 4px 14px rgba(255, 193, 7, 0.4); }
.tup-btn-ghost { background: transparent; color: #cbd5e1; border: 1px solid #1f2937; }
.tup-btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* ───── Receipt вид ───── */
.tup-receipt {
  margin: 0 24px;
  padding: 24px;
  background: #fff;
  color: #111;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', -apple-system, sans-serif;
  /* punched edge effect */
  position: relative;
}
.tup-receipt::before,
.tup-receipt::after {
  content: '';
  position: absolute; left: 0; right: 0;
  height: 10px;
  background: radial-gradient(circle at 5px 0px, transparent 5px, #fff 5.5px) 0 0 / 14px 10px repeat-x;
}
.tup-receipt::before { top: -1px; transform: rotate(180deg); }
.tup-receipt::after { bottom: -1px; }

.tup-receipt-header {
  text-align: center;
  border-bottom: 2px dashed #FFC107;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.tup-receipt-logo {
  font-size: 20px; font-weight: 900;
  letter-spacing: 2px;
  color: #FFC107;
  text-shadow: 1px 1px 0 #000;
}
.tup-receipt-title {
  font-size: 13px; color: #475569;
  margin-top: 4px; text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tup-receipt-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.tup-receipt-row span { color: #64748b; }
.tup-receipt-row strong { color: #0f172a; font-weight: 700; }
.tup-receipt-no strong {
  font-family: 'Courier New', monospace; letter-spacing: 1px;
  background: #fef3c7; padding: 2px 8px; border-radius: 4px;
}
.tup-receipt-divider {
  border-top: 1px dashed #cbd5e1;
  margin: 8px 0;
}
.tup-receipt-amount strong {
  font-size: 18px; color: #16a34a;
}
.tup-receipt-final {
  padding: 10px 12px; margin: 6px -12px;
  background: rgba(255, 193, 7, 0.15);
  border-radius: 6px;
  border-left: 4px solid #FFC107;
}
.tup-receipt-final strong { font-size: 17px; }

.tup-receipt-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px dashed #FFC107;
  text-align: center;
  font-size: 13px; color: #475569;
}
.tup-receipt-footer p { margin: 4px 0; }

/* Print mode */
@media print {
  body * { visibility: hidden; }
  #tup-receipt-printable, #tup-receipt-printable * { visibility: visible; }
  #tup-receipt-printable {
    position: absolute; left: 0; top: 0;
    box-shadow: none; margin: 0;
  }
}
