/* ── Dashboard styles ── */

body { min-height: 100vh; }

.dash-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ── Spinner ── */
#view-loading { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ── */
#view-login { text-align: center; padding: 80px 0; }
#view-login h1 { font-size: 1.8rem; margin-bottom: 12px; }
#view-login p  { color: var(--text-muted); margin-bottom: 32px; }
.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 28px; background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem; color: var(--text);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; text-decoration: none;
}
.btn-google:hover { border-color: #4285F4; box-shadow: 0 2px 12px rgba(66,133,244,0.15); }
.login-note { margin-top: 20px; font-size: 0.82rem; color: var(--text-muted); }
.login-note a { color: var(--primary); }

/* ── Cards ── */
.dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 16px; }
.dash-card-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; margin-bottom: 16px; }

/* User row */
.user-row { display: flex; align-items: center; gap: 16px; }
.user-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.user-avatar-placeholder { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name  { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Badges */
.sub-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; margin-top: 8px; }
.sub-badge.active   { background: rgba(39,174,96,0.12);  color: #27ae60; }
.sub-badge.expiring { background: rgba(243,156,18,0.12); color: #f39c12; }
.sub-badge.inactive { background: rgba(231,76,60,0.12);  color: #e74c3c; }
.sub-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Usage */
.usage-label-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.usage-bar  { height: 6px; background: var(--bg-alt); border-radius: 3px; overflow: hidden; }
.usage-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.6s ease; }
.usage-fill.warning { background: #e74c3c; }

/* Redeem */
.redeem-row { display: flex; gap: 8px; }
.redeem-input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 0.9rem; font-family: monospace; letter-spacing: 1px; outline: none; transition: border-color 0.15s; }
.redeem-input:focus { border-color: var(--primary); }
.redeem-input::placeholder { letter-spacing: 0; color: var(--text-muted); font-family: inherit; }
.redeem-consent-label { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; color: var(--text-muted); margin-top: 10px; cursor: pointer; line-height: 1.5; }
.redeem-consent-label input[type="checkbox"] { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.redeem-consent-label a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.redeem-msg { font-size: 0.85rem; margin-top: 8px; min-height: 20px; }
.redeem-msg.success { color: #27ae60; }
.redeem-msg.error   { color: #e74c3c; }

/* Actions */
.dash-actions { display: flex; flex-direction: column; gap: 10px; }
.dash-actions .btn-primary, .dash-actions .btn-ghost { width: 100%; text-align: center; }
.btn-signout { width: 100%; padding: 11px; border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text-muted); border: 1.5px solid var(--border); background: none; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.btn-signout:hover { color: #e74c3c; border-color: #e74c3c; }
.btn-cancel { width: 100%; padding: 11px; border-radius: var(--radius-sm); font-size: 0.9rem; color: #e67e22; border: 1.5px solid #e67e22; background: none; cursor: pointer; transition: background 0.15s, color 0.15s; }
.btn-cancel:hover { background: rgba(230,126,34,0.08); }
.btn-cancel:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-refund { width: 100%; padding: 11px; border-radius: var(--radius-sm); font-size: 0.9rem; color: #e74c3c; border: 1.5px solid #e74c3c; background: none; cursor: pointer; transition: background 0.15s, color 0.15s; }
.btn-refund:hover { background: rgba(231,76,60,0.08); }
.btn-refund:disabled { opacity: 0.5; cursor: not-allowed; }
.sub-action-msg { font-size: 0.85rem; margin-top: 8px; min-height: 20px; }
.sub-action-msg.success { color: #27ae60; }
.sub-action-msg.error   { color: #e74c3c; }

/* Errors */
.error-banner { background: rgba(231,76,60,0.08); border: 1px solid rgba(231,76,60,0.3); border-radius: var(--radius-sm); padding: 12px 16px; color: #e74c3c; font-size: 0.88rem; margin-bottom: 16px; }
