:root {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f5;
  --bg-input: #f0f2f5;
  --border: #e2e5ea;
  --border-focus: #16a34a;
  --gold: #16a34a;
  --gold-light: #22c55e;
  --gold-dark: #15803d;
  --gold-glow: rgba(22, 163, 74, 0.10);
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #94a3b8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════
   LOGIN PAGE — SPLIT LAYOUT
═══════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  background: #f5f7fa;
}

.login-split {
  display: flex;
  min-height: 100vh;
}

/* --- Left branded panel --- */
.login-brand {
  flex: 0 0 480px;
  background: linear-gradient(160deg, #0f7a3b 0%, #16a34a 40%, #15803d 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
}

.brand-bg-pattern::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.brand-bg-pattern::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.025);
}

.brand-content {
  position: relative;
  z-index: 1;
  padding: 60px 48px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}

.brand-logo-text {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: rgba(255,255,255,0.95);
}

.brand-logo-text strong {
  font-weight: 700;
}

.brand-hero {
  margin-bottom: 48px;
}

.brand-hero h2 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.brand-hero p {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  max-width: 360px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.brand-feature strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.brand-feature span {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

.brand-footer-text {
  margin-top: auto;
  padding-top: 48px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* --- Right login form --- */
.login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #ffffff;
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
}

.mobile-logo {
  display: none;
  margin-bottom: 24px;
}

.login-form-header {
  margin-bottom: 36px;
}

.login-form-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-form-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-login {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(22,163,74,0.3);
}

.btn-login:hover::before {
  opacity: 1;
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(22,163,74,0.2);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-login .btn-arrow {
  transition: transform 0.25s;
}

.btn-login:hover .btn-arrow {
  transform: translateX(3px);
}

.login-secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.login-secure-badge svg {
  color: var(--gold);
  flex-shrink: 0;
}

/* --- Inputs refined --- */
.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 46px;
  background: #f8f9fb;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:focus {
  border-color: var(--gold);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(22,163,74,0.08);
}

.input-wrapper:focus-within .input-icon {
  color: var(--gold);
}

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.hidden { display: none !important; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Login responsive --- */
@media (max-width: 960px) {
  .login-brand { display: none; }
  .login-form-side { padding: 32px 24px; }
  .mobile-logo { display: block; }
  .login-form-header h1 { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
}

.sidebar-logo .gold { color: var(--gold); }

.sidebar-tagline {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--gold);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card:hover {
  border-color: var(--border-focus);
  box-shadow: 0 2px 12px rgba(22,163,74,0.08);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.gold { background: var(--gold-glow); color: var(--gold); }
.stat-icon.green { background: rgba(34,197,94,0.1); color: var(--success); }
.stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.gold { color: var(--gold); }

.stat-change {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Tables */
.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: var(--bg-card);
}

.data-card-title {
  font-size: 16px;
  font-weight: 600;
}

.data-card-actions {
  display: flex;
  gap: 8px;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
}

.accounts-table-shell {
  position: relative;
}

.accounts-lock-notice {
  margin: 16px 16px 0;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 10px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.table-wrapper.is-locked {
  filter: blur(2px);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.accounts-table-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(1px);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 24px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 14px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(34,197,94,0.1);
  color: var(--success);
}

.status-badge.inactive {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}

.status-badge.pending {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #ffffff;
  border: none;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 2px 12px rgba(22,163,74,0.25);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(20px);
  transition: transform 0.2s;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.modal-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-progress.active {
  opacity: 1;
}

.modal-progress .bar {
  height: 100%;
  width: 40%;
  background: var(--gold);
  border-radius: 3px;
  animation: progressSlide 1s ease-in-out infinite;
}

@keyframes progressSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  animation: toastIn 0.3s ease;
  font-size: 14px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Account document */
.doc-text {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  height: 20px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Action dropdown */
.actions-cell {
  position: relative;
}

.action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.kebab-wrapper {
  position: relative;
  display: inline-block;
  z-index: 10;
}

.kebab-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
  line-height: 1;
}

.kebab-btn:hover { border-color: var(--gold); color: var(--gold); }

.kebab-menu {
  display: none;
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 200px;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  overflow: hidden;
}

.kebab-menu.open { display: block; }

.kebab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.kebab-menu-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.kebab-menu-item.danger { color: var(--danger); }
.kebab-menu-item.danger:hover { background: rgba(239,68,68,0.1); }

.kebab-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Detail section */
.detail-section {
  margin-top: 16px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-info-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.detail-info-item .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-info-item .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}

.pix-key-row {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pix-key-row .key-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pix-key-row .key-type {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pix-key-row .key-value {
  font-size: 13px;
  color: var(--text-primary);
  font-family: monospace;
}

.pix-key-row .key-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    z-index: 1001;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Main layout */
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 72px;
    min-height: 100vh;
  }

  /* Page header */
  .page-header {
    margin-bottom: 20px;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .page-title { font-size: 18px; }
  .page-subtitle { font-size: 13px; }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px;
    border-radius: 10px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-change {
    font-size: 11px;
    margin-top: 6px;
  }

  /* Data cards & tables */
  .data-card {
    border-radius: 10px;
    margin-bottom: 16px;
  }

  .data-card-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .data-card-title {
    font-size: 14px;
  }

  .table-wrapper {
    font-size: 13px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  thead th {
    padding: 10px 12px;
    font-size: 10px;
    white-space: nowrap;
  }

  tbody td {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Buttons */
  .btn {
    font-size: 12px;
    padding: 7px 12px;
  }

  .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* Modals */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .modal-title {
    font-size: 18px;
  }

  .modal-subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }

  /* Toasts */
  .toast-container {
    top: 64px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: auto;
    width: 100%;
    font-size: 13px;
    padding: 12px 14px;
  }

  /* Detail grids inside modals */
  .detail-info-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-info-item {
    padding: 8px 12px;
  }

  .detail-info-item .value {
    font-size: 13px;
  }

  /* PIX key rows */
  .pix-key-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .pix-key-row .key-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Kebab menu */
  .kebab-menu {
    min-width: 160px;
  }

  /* Confirm dialog */
  .confirm-box {
    padding: 24px 20px;
    width: 92%;
  }

  /* Withdrawal CTA */
  .withdrawal-cta {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 14px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .withdrawal-cta-info {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 10px;
  }

  .withdrawal-cta-icon {
    width: 42px;
    height: 42px;
  }

  .btn-withdrawal-cta {
    width: 100%;
    justify-content: center;
  }

  /* Empty state */
  .empty-state {
    padding: 40px 16px;
  }

  .empty-state svg {
    width: 40px;
    height: 40px;
  }

  /* Settings page specific */
  .settings-form .form-group {
    margin-bottom: 16px;
  }

  /* Hide non-essential columns on small screens */
  .hide-mobile {
    display: none !important;
  }

  /* Make body not scroll when sidebar is open */
  body.sidebar-open {
    overflow: hidden;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 18px;
  }

  .main-content {
    padding: 12px;
    padding-top: 68px;
  }

  .modal {
    padding: 20px 16px;
  }
}

/* Mobile top bar */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  z-index: 999;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.mobile-topbar-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-topbar-logo .gold { color: var(--gold); }

.hamburger-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.hamburger-btn:hover {
  background: var(--bg-card-hover);
}

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Sidebar close button */
.sidebar-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}

.sidebar-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .sidebar-close { display: flex; }
  .sidebar-header { position: relative; }
}

/* Withdrawal CTA banner */
.withdrawal-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(22,163,74,0.04) 0%, rgba(22,163,74,0.08) 100%);
  border: 1px solid rgba(22,163,74,0.15);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.withdrawal-cta-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.withdrawal-cta-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.withdrawal-cta-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.withdrawal-cta-info span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.btn-withdrawal-cta {
  white-space: nowrap;
  padding: 12px 24px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
  gap: 8px;
}

/* Money formatting */
.money { font-variant-numeric: tabular-nums; }
.money.positive { color: var(--success); }
.money.negative { color: var(--danger); }

/* Sweeper pulse */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon.warning {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}

.confirm-icon.danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
