/* ============================================
   Gmails do Marcone — Components
   ============================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  text-decoration: none;
  height: 36px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.03); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: var(--text-xs); height: 28px; }
.btn-lg { padding: 12px 24px; font-size: var(--text-base); height: 44px; }
.btn-full { width: 100%; }

.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Inputs ─ */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
input.error, select.error { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: var(--text-xs); margin-top: var(--space-1); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Cards ─ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-fast) var(--ease-default);
}
.card:hover { border-color: var(--border-default); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.card-title svg { width: 18px; height: 18px; color: var(--text-secondary); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
}
.badge-green { background: var(--accent-muted); color: var(--accent-text); }
.badge-yellow { background: var(--warning-muted); color: var(--warning); }
.badge-red { background: var(--danger-muted); color: var(--danger); }
.badge-blue { background: var(--info-muted); color: var(--info); }
.badge-admin { background: var(--danger-muted); color: var(--danger); }
.badge-user { background: var(--accent-muted); color: var(--accent-text); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 12px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
td {
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--duration-fast) var(--ease-default); }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.td-mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.td-muted { color: var(--text-tertiary); }
.td-accent { color: var(--accent-text); font-weight: 600; }
.td-truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  min-width: 280px;
  max-width: 420px;
  animation: toastIn var(--duration-normal) var(--ease-enter);
  border-left: 3px solid var(--text-tertiary);
}
.toast-success { border-left-color: var(--accent); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }
.toast-exit { animation: toastOut var(--duration-fast) var(--ease-exit) forwards; }

/* ── Modal / Overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--duration-normal) var(--ease-enter);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  width: 90%;
  max-width: 440px;
  animation: modalIn var(--duration-normal) var(--ease-enter);
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* ── Drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4000;
  animation: fadeIn var(--duration-normal) var(--ease-enter);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  z-index: 4001;
  overflow-y: auto;
  animation: drawerIn var(--duration-normal) var(--ease-enter);
  padding: var(--space-6);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-title { font-size: var(--text-lg); font-weight: 600; }
.drawer-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.drawer-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.drawer-section { margin-bottom: var(--space-6); }
.drawer-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}
.drawer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}
.drawer-label { font-size: var(--text-sm); color: var(--text-secondary); }
.drawer-value { font-size: var(--text-sm); color: var(--text-primary); font-weight: 500; }

/* ── Quantity Stepper ── */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.stepper-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
.stepper-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
.stepper-value {
  width: 48px;
  text-align: center;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: none;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  height: 36px;
  font-family: var(--font-sans);
}

/* ── Skeleton ── */
.skeleton {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  animation: pulse 1.5s ease-in-out infinite;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; width: 60%; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-tertiary); margin-bottom: var(--space-4); }
.empty-state-title { font-size: var(--text-base); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); }
.empty-state-desc { font-size: var(--text-sm); color: var(--text-tertiary); max-width: 280px; margin-bottom: var(--space-4); }

/* ── Code Display ── */
.code-display {
  background: var(--bg-base);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  word-break: break-all;
  color: var(--text-primary);
  position: relative;
}
.code-display-accent {
  border-color: rgba(34, 197, 94, 0.3);
  border-style: solid;
}

/* ── Delivery Box ── */
.delivery-box {
  background: var(--bg-base);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  color: var(--accent-text);
}

/* ── OTP Display ── */
.otp-display {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}
.otp-code {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent-text);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  outline: none;
}

/* ── Info/Warning Boxes ── */
.info-box {
  background: var(--accent-muted);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--accent-text);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.info-box svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

.warning-box {
  background: var(--warning-muted);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--warning);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.warning-box svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

.danger-box {
  background: var(--danger-muted);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--danger);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.danger-box svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

/* ── PIX Modal ── */
.pix-modal {
  background: var(--bg-base);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  margin-top: var(--space-4);
}
.pix-qr { max-width: 200px; border-radius: var(--radius-md); margin-bottom: var(--space-3); }
.pix-status { font-size: var(--text-sm); margin-top: var(--space-2); }
.pix-status-waiting { color: var(--warning); }
.pix-status-paid { color: var(--accent-text); }

/* ── Auth Tabs ── */
.auth-tabs {
  display: flex;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  background: var(--bg-elevated);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  transition: all var(--duration-fast) var(--ease-default);
}
.auth-tab.active {
  background: var(--accent);
  color: #000;
}
.auth-tab:not(.active):hover { color: var(--text-primary); }

/* ── Admin Tabs ── */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.admin-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  transition: all var(--duration-fast) var(--ease-default);
}
.admin-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.admin-tab:hover:not(.active) { color: var(--text-primary); }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}
.stat-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}
.stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent-text);
  margin-bottom: 2px;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Trust Signals ── */
.trust-signals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.trust-item svg { width: 16px; height: 16px; color: var(--accent); }

/* ── Quick Links ── */
.quick-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-default);
  cursor: pointer;
}
.quick-link:hover { border-color: var(--border-default); background: var(--bg-overlay); }
.quick-link-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.quick-link-icon svg { width: 20px; height: 20px; color: var(--text-secondary); }
.quick-link-text { flex: 1; }
.quick-link-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.quick-link-desc { font-size: var(--text-xs); color: var(--text-tertiary); }
.quick-link-arrow { color: var(--text-tertiary); flex-shrink: 0; }

/* ── Animations ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.7; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }