﻿/* ═══════════════════════════════════════════════
   NaNavalha — Electron App Styles v2
   Design System: Corporate Modern / Dark Mode
   ═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Brand */
  --primary: #6C3CE1;
  --primary-dark: #5428C8;
  --primary-light: rgba(108, 60, 225, 0.1);
  --primary-ring: rgba(108, 60, 225, 0.2);

  /* Semantic */
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-dark: #b45309;
  --warning-light: #fffbeb;

  /* Surface */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-2: #cbd5e1;

  /* Typography */
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Radius */
  --radius-sm: 5px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);

  /* Transition */
  --t: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  font-size: 14px;
}

.hidden { display: none !important; }

/* ════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), opacity var(--t);
  white-space: nowrap;
  user-select: none;
  outline: none;
  text-decoration: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:active { opacity: 0.9; }

.btn-danger {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.16); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-2);
}
.btn-outline:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

.btn-icon {
  padding: 7px;
  border-radius: var(--radius-sm);
}

/* Action Buttons — ghost/outline por padrão */
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid rgba(22, 163, 74, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t);
}
.btn-success:hover { background: rgba(22, 163, 74, 0.16); }

.btn-warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning-dark);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid rgba(217, 119, 6, 0.32);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t);
}
.btn-warn:hover { background: rgba(217, 119, 6, 0.15); }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 211, 102, 0.08);
  color: #1ca84b;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid rgba(37, 211, 102, 0.32);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t);
}
.btn-whatsapp:hover { background: rgba(37, 211, 102, 0.15); }

.btn-link-subtle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t);
}
.btn-link-subtle:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ════════════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════════════ */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  font-family: inherit;
}

.field input:hover,
.field select:hover {
  border-color: var(--border-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field input[type="range"] {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.field input[type="date"] { cursor: text; }

.field input[readonly] {
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: default;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.error-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 14px;
  border: 1px solid rgba(220, 38, 38, 0.15);
  line-height: 1.4;
}

/* ════════════════════════════════════════════════
   SCREENS
   ════════════════════════════════════════════════ */
.screen {
  width: 100%;
  height: 100vh;
}

#blocked-screen,
#login-screen,
#register-screen,
#register-verify-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 55%, #0c1830 100%);
  position: relative;
  overflow: hidden;
}

#blocked-screen::before,
#login-screen::before,
#register-screen::before,
#register-verify-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108, 60, 225, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(108, 60, 225, 0.10) 0%, transparent 50%);
  pointer-events: none;
}

/* Grid pattern overlay */
#blocked-screen::after,
#login-screen::after,
#register-screen::after,
#register-verify-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ── Login Card ── */
.login-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 400px;
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-brand-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(108, 60, 225, 0.4);
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 32px;
  margin-top: 4px;
}

.login-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-link {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 16px;
  margin-bottom: 0;
}

.login-link a,
.link-btn {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.login-link a:hover,
.link-btn:hover { text-decoration: underline; }

/* ── Inputs de código de 6 dígitos ── */
.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.code-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}

.code-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.15);
}

.code-digit::-webkit-outer-spin-button,
.code-digit::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Blocked Card ── */
.blocked-card { text-align: center; }

.blocked-msg {
  color: var(--danger);
  font-size: 0.95rem;
  margin: 20px 0 12px;
  line-height: 1.6;
  background: var(--danger-light);
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

/* Mensagem de contato na tela de suspensão */
.suspended-contact-msg {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.6;
}
.suspended-contact-msg a {
  color: var(--primary);
  text-decoration: none;
}

/* Motivo da suspensão (definido pelo admin) */
.suspended-reason-msg {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: rgba(220, 38, 38, 0.06);
  border-left: 3px solid rgba(220, 38, 38, 0.4);
  padding: 8px 12px;
  border-radius: 4px;
  margin: 0 0 12px;
  line-height: 1.6;
}

/* ── Expired Overlay (assinatura vencida, active=false) ── */
#expired-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
#expired-overlay.hidden {
  display: none;
}
.expired-overlay-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.expired-overlay-icon {
  width: 64px;
  height: 64px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #f59e0b;
}
.expired-overlay-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.expired-overlay-msg {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}
.expired-overlay-contact {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 10px;
}
.expired-overlay-contact a {
  color: var(--primary);
  text-decoration: none;
}

/* ── Subscription Warning Banner (vencimento próximo) ── */
#subscription-warning-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  animation: banner-slide-down 0.25s ease;
}
#subscription-warning-banner.hidden {
  display: none;
}
#subscription-warning-banner.warning {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}
#subscription-warning-banner.danger {
  background: #fee2e2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}
.sub-banner-msg {
  flex: 1;
}
.sub-banner-renew {
  background: none;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.sub-banner-renew:hover { opacity: 0.7; }
.sub-banner-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.55;
  padding: 0 2px;
  line-height: 1;
  transition: opacity 0.15s;
}
.sub-banner-dismiss:hover { opacity: 1; }

@keyframes banner-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════
   APP LAYOUT
   ════════════════════════════════════════════════ */
#app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  position: relative;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.header-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
}

.header-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.tenant-badge {
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(108, 60, 225, 0.15);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Body ── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 214px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-group-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  text-align: left;
}

.nav-btn svg {
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity var(--t);
}

.nav-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-btn:hover svg { opacity: 0.9; }

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-btn.active svg { opacity: 1; }

/* ── Content ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.015em;
}

/* ════════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 { margin-bottom: 0; }

/* ════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

.card h3 {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.card-narrow { max-width: 480px; }
.card-sm  { max-width: 420px; }

/* ════════════════════════════════════════════════
   STAT CARDS
   ════════════════════════════════════════════════ */
.cash-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

/* Colored accent bar top */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-2);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.cash-summary-row .stat-card:nth-child(1)::before { background: var(--primary); }
.cash-summary-row .stat-card:nth-child(2)::before { background: var(--success); }
.cash-summary-row .stat-card:nth-child(3)::before { background: var(--danger); }
.cash-summary-row .stat-card:nth-child(4)::before { background: var(--warning); }

.stat-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  word-break: break-word;
}

.income { color: var(--success) !important; }
.expense { color: var(--danger) !important; }

/* ════════════════════════════════════════════════
   TOGGLE SWITCH
   ════════════════════════════════════════════════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-2);
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ════════════════════════════════════════════════
   FILA LAYOUT
   ════════════════════════════════════════════════ */
.fila-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

/* ════════════════════════════════════════════════
   QUEUE LIST
   ════════════════════════════════════════════════ */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--t), box-shadow var(--t);
}

.queue-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.queue-position {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.queue-position.in-service { background: var(--success); }

.queue-info {
  flex: 1;
  min-width: 0;
}

.queue-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-time {
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.queue-phone { color: var(--text-muted); }

.queue-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.queue-badge.waiting {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.queue-badge.in-service {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

/* ── Timers de tempo na fila / atendimento ── */
.queue-timer {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  line-height: 1.5;
}
.queue-timer.timer-green  { background: var(--success-light); color: var(--success); border: 1px solid rgba(22, 163, 74, 0.2); }
.queue-timer.timer-yellow { background: var(--warning-light);  color: var(--warning);  border: 1px solid rgba(217, 119, 6, 0.2); }
.queue-timer.timer-red    { background: #fee2e2; color: #b91c1c; border: 1px solid rgba(185, 28, 28, 0.2); }

.queue-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Dropdown de ações do atendimento ── */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.att-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  z-index: 200;
  min-width: 190px;
  padding: 4px 0;
}

.att-dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  font-size: 0.875rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--surface-2);
}

.dropdown-item-danger {
  color: var(--danger, #d93025);
}


.queue-ahead {
  min-width: 72px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.72rem;
  text-align: center;
  flex-shrink: 0;
  border: 1px solid rgba(108, 60, 225, 0.15);
  letter-spacing: 0.01em;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 0.9rem;
}

/* ════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1e293b;
  color: #f1f5f9;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 2000;
  animation: toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
  line-height: 1.4;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ════════════════════════════════════════════════
   QUEUE JOIN NOTIFICATION
   ════════════════════════════════════════════════ */
.queue-join-notif {
  position: fixed;
  top: 68px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 1500;
  animation: joinIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.queue-join-badge {
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

@keyframes joinIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 20px;
  animation: overlayIn 0.18s ease;
}

/* Confirm modal deve sempre aparecer acima de qualquer outro modal */
#confirm-modal {
  z-index: 1100;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  width: 440px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-form { width: 460px; }
.modal-narrow { width: 420px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.modal > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ════════════════════════════════════════════════
   DATA TABLE
   ════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.875rem;
  box-shadow: var(--shadow-xs);
}

.data-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  text-align: left;
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--bg);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .empty-state { padding: 36px 16px; text-align: center; }

/* ════════════════════════════════════════════════
   TRANSACTION LIST
   ════════════════════════════════════════════════ */
.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: background var(--t);
  gap: 12px;
  min-height: 64px;
}
.tx-item.income  { border-left-color: var(--success); }
.tx-item.expense { border-left-color: var(--danger); }

.tx-item:hover { background: var(--surface-2); }

.tx-item .tx-desc {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tx-item .tx-cat {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 1px 8px;
}

.tx-item .tx-amount {
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ─── Action menu (dropdown "...") ─────────────────── */
.action-menu-wrap {
  position: relative;
  display: inline-block;
}
.action-menu-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
  vertical-align: middle;
  letter-spacing: 0;
}
.action-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 140px;
  overflow: hidden;
}
.action-menu.hidden { display: none; }
.action-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
  transition: background var(--t);
}
.action-menu-item:hover { background: var(--surface-2); }
.action-menu-item.danger { color: var(--danger); }

/* ─── Client search autocomplete ───────────────────── */
.client-search-wrap {
  position: relative;
}
.client-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  max-height: 180px;
  overflow-y: auto;
}
.client-dropdown.hidden { display: none; }
.client-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
  transition: background var(--t);
  border-bottom: 1px solid var(--border);
}
.client-dropdown-item:last-child { border-bottom: none; }
.client-dropdown-item:hover { background: var(--surface-2); }
.client-dropdown-item .cdi-name { font-weight: 600; }
.client-dropdown-item .cdi-phone { font-size: 0.75rem; color: var(--text-secondary); margin-top: 1px; }
.selected-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light, rgba(99,102,241,0.1));
  border: 1px solid var(--primary);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 8px;
  color: var(--text);
}
.selected-client-chip button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  padding: 0 2px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.selected-client-chip button:hover { color: var(--danger); }
.selected-client-chip.hidden { display: none; }

/* ════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════ */
.badge-active {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-inactive {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.subscription-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid;
}

/* ════════════════════════════════════════════════
   CASH RESULT
   ════════════════════════════════════════════════ */
.cash-result-list {
  list-style: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cash-result-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  font-size: 0.9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--bg);
}

.cash-result-list li:last-child { border-bottom: none; }
.cash-result-list li strong { font-weight: 700; }

/* ════════════════════════════════════════════════
   REPORT LAYOUT
   ════════════════════════════════════════════════ */

/* ── Cabeçalho da página Relatórios ── */
.rpt-page-header { margin-bottom: 20px; }
.rpt-page-header h2 { margin: 0 0 4px; }
.rpt-page-sub { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* ── Card de filtro ── */
.rpt-filter-card { margin-bottom: 20px; }

.rpt-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.rpt-quick-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.rpt-quick-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.rpt-quick-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.rpt-date-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.rpt-date-row .field {
  margin-bottom: 0;
  flex: 1;
  min-width: 130px;
}

.rpt-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  padding-bottom: 10px;
  user-select: none;
  flex-shrink: 0;
}

.rpt-date-error {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 500;
}

/* ── Cards de métricas (4 itens) ── */
.rpt-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .rpt-metrics-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .rpt-metrics-row { grid-template-columns: 1fr; }
}

.rpt-metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-xs);
}

.rpt-mc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rpt-metric-card--blue  .rpt-mc-icon { background: var(--primary-light);      color: var(--primary); }
.rpt-metric-card--green .rpt-mc-icon { background: var(--success-light);      color: var(--success); }
.rpt-metric-card--red   .rpt-mc-icon { background: var(--danger-light);       color: var(--danger);  }
.rpt-metric-card--amber .rpt-mc-icon { background: var(--warning-light);      color: var(--warning); }

.rpt-mc-body { flex: 1; min-width: 0; }

.rpt-mc-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rpt-mc-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpt-mc-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* ── Seções de conteúdo ── */
.rpt-section { margin-bottom: 20px; }

.rpt-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.rpt-section-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.rpt-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 9999px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  line-height: 1.6;
}
.rpt-badge:empty { display: none; }

.rpt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rpt-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
  margin: 0;
}

.rpt-error {
  text-align: center;
  color: var(--danger);
  font-size: 0.85rem;
  padding: 12px 0;
  margin: 0;
}

/* ── Histórico por cliente ── */
.rpt-client-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rpt-client-select {
  flex: 1;
  min-width: 180px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.rpt-client-select:focus { border-color: var(--primary); }

.rpt-client-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

/* ── Sub-abas internas do Relatório ── */
.rpt-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.rpt-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  flex-shrink: 0;
}
.rpt-tab:hover {
  background: var(--surface);
  color: var(--text);
}
.rpt-tab.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ── Autocomplete ── */
.rpt-ac-wrap { position: relative; margin-bottom: 12px; }

.rpt-ac-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: border-color var(--t), box-shadow var(--t);
}
.rpt-ac-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.rpt-ac-icon { flex-shrink: 0; color: var(--text-muted); }

.rpt-ac-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
}
.rpt-ac-input::placeholder { color: var(--text-muted); }

.rpt-ac-clear {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--t), background var(--t);
  flex-shrink: 0;
}
.rpt-ac-clear:hover { color: var(--text); background: var(--border); }

.rpt-ac-dropdown {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-height: 320px;
  overflow-y: auto;
}

.rpt-ac-group-label {
  padding: 7px 14px 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.rpt-ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--t);
  border-bottom: 1px solid var(--border);
}
.rpt-ac-item:last-child { border-bottom: none; }
.rpt-ac-item:hover { background: var(--primary-light); }

.rpt-ac-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rpt-ac-name mark {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
  border-radius: 2px;
  padding: 0 1px;
}

.rpt-ac-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rpt-ac-empty {
  padding: 16px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
.rpt-ac-loading { font-style: italic; }

.rpt-ac-pages {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 0;
}

.rpt-ac-page-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--t);
}
.rpt-ac-page-btn:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.rpt-ac-page-btn:disabled { opacity: 0.4; cursor: default; }

.rpt-ac-page-info {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Lista inline de clientes (Por Cliente) ── */
.rpt-cli-list {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}
.rpt-cli-list.hidden { display: none; }
.rpt-cli-list-more {
  font-style: italic;
  border-top: 1px solid var(--border);
}

/* ── Área de resultado do cliente ── */
.rpt-cli-result-area { margin-top: 16px; }

.rpt-cli-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.rpt-cli-selected-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ════════════════════════════════════════════════
   REPORTS REDESIGN — 4-Tab Layout
   ════════════════════════════════════════════════ */

/* Main tabs */
.rpt-main-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}

.rpt-main-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}

.rpt-main-tab:hover { background: var(--bg); color: var(--text); }
.rpt-main-tab.active { background: var(--primary); color: #fff; }

.rpt-main-panel { display: block; }
.rpt-main-panel.hidden { display: none; }

/* Chart switcher */
.rpt-chart-switcher {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.rpt-chart-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--t), color var(--t), border-color var(--t);
}

.rpt-chart-btn:hover { background: var(--bg); color: var(--text); }
.rpt-chart-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Bottom grid: Top Clientes + Top Serviços */
.rpt-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

@media (max-width: 680px) {
  .rpt-bottom-grid { grid-template-columns: 1fr; }
}

/* Trend indicators on metric cards */
.rpt-trend {
  font-size: 0.73rem;
  margin-top: 2px;
  min-height: 16px;
}

.rpt-trend.up   { color: #16a34a; }
.rpt-trend.down { color: #dc2626; }
.rpt-trend.neutral { color: var(--text-muted); }

/* Top Clients */
.rpt-top-client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t);
  border-radius: 6px;
  padding-inline: 4px;
}

.rpt-top-client:last-child { border-bottom: none; }
.rpt-top-client:hover { background: var(--primary-light); }

.rpt-cli-medal {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.rpt-cli-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.rpt-cli-info { flex: 1; min-width: 0; }

.rpt-cli-info-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpt-cli-info-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rpt-cli-total {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Top Services */
.rpt-top-svc {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.rpt-top-svc:last-child { border-bottom: none; }

.rpt-top-svc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.rpt-top-svc-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpt-top-svc-meta {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.rpt-top-svc-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.rpt-top-svc-rev {
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
}

.rpt-svc-bar-wrap {
  background: var(--bg);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}

.rpt-svc-bar {
  background: var(--primary);
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Financeiro summary row */
.rpt-fin-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.rpt-fin-card {
  padding: 14px 16px;
}

@media (max-width: 700px) {
  .rpt-fin-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .rpt-fin-summary { grid-template-columns: 1fr; }
}

/* Drawer overlay */
.rpt-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.rpt-drawer-overlay.hidden { display: none; }

/* Drawer panel */
.rpt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: var(--surface);
  z-index: 201;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.14);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rpt-drawer.open { transform: translateX(0); }
.rpt-drawer.hidden { display: none; }

.rpt-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.rpt-drawer-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.rpt-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: background var(--t), color var(--t);
}

.rpt-drawer-close:hover { background: var(--bg); color: var(--text); }

.rpt-drawer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.rpt-drawer-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
}

/* ════════════════════════════════════════════════
   SETTINGS TABS
   ════════════════════════════════════════════════ */
.settings-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-md);
  width: fit-content;
}

.settings-tab {
  background: none;
  border: none;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--t);
  white-space: nowrap;
}

.settings-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}

.settings-tab.active {
  color: var(--primary);
  background: var(--surface);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.settings-panel { animation: fadeUp 0.15s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════
   CATEGORIES LIST
   ════════════════════════════════════════════════ */
.categories-list { display: flex; flex-direction: column; gap: 2px; }

.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  gap: 12px;
}

.category-name { font-size: 0.9rem; font-weight: 500; color: var(--text); flex: 1; }

.badge-default {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--primary-muted, rgba(99,102,241,0.15));
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
}

.category-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ════════════════════════════════════════════════
   PIN DISPLAY
   ════════════════════════════════════════════════ */
.pin-display {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  display: inline-block;
  min-width: 220px;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════════ */
body.dark-mode {
  --bg: #0d0d1a;
  --surface: #13132a;
  --surface-2: #1a1a35;
  --border: #26264a;
  --border-2: #333366;
  --text: #f0f0ff;
  --text-secondary: #9090b8;
  --text-muted: #5a5a80;
  --primary: #7C3AED;
  --primary-dark: #6B3CE1;
  --primary-light: rgba(108, 60, 225, 0.18);
  --primary-ring: rgba(108, 60, 225, 0.3);
  --success: #16a34a;
  --danger: #dc2626;
  --warning-dark: #b45309;
  --success-light: rgba(22, 163, 74, 0.14);
  --danger-light: rgba(220, 38, 38, 0.14);
  --warning-light: rgba(217, 119, 6, 0.14);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.75);
}

body.dark-mode #login-screen,
body.dark-mode #blocked-screen {
  background: linear-gradient(145deg, #07071a 0%, #0d0d1a 55%, #090920 100%);
}

body.dark-mode .login-card {
  background: var(--surface);
  border: 1px solid var(--border);
}

body.dark-mode .app-header {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .sidebar {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .nav-btn:hover { background: var(--surface-2); }

body.dark-mode .nav-btn.active {
  background: var(--primary-light);
  color: #a78bfa;
}

body.dark-mode .nav-btn.active svg { opacity: 1; }

body.dark-mode .card {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .stat-card {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .modal {
  background: var(--surface);
  border: 1px solid var(--border);
}

body.dark-mode .modal-overlay { background: rgba(0, 0, 0, 0.7); }

body.dark-mode .queue-item {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .queue-item:hover { border-color: var(--primary); }

body.dark-mode .tx-item {
  background: var(--surface);
  border-color: var(--border);
}
body.dark-mode .tx-item.income  { border-left-color: var(--success); }
body.dark-mode .tx-item.expense { border-left-color: var(--danger); }
body.dark-mode .action-menu { background: var(--surface); border-color: var(--border); }
body.dark-mode .client-dropdown { background: var(--surface); border-color: var(--border); }
body.dark-mode .client-dropdown-item { border-color: var(--border); }

body.dark-mode .data-table {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .data-table th {
  background: var(--surface-2);
  border-color: var(--border);
}

body.dark-mode .data-table td { border-color: var(--surface-2); }
body.dark-mode .data-table tbody tr:hover { background: var(--surface-2); }

body.dark-mode .field input,
body.dark-mode .field select,
body.dark-mode .field textarea {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

body.dark-mode .field input:focus,
body.dark-mode .field select:focus {
  border-color: var(--primary);
}

body.dark-mode .btn-outline {
  border-color: var(--border-2);
  color: var(--text-secondary);
}

body.dark-mode .btn-outline:hover {
  background: var(--surface-2);
  color: var(--text);
}

body.dark-mode .settings-tabs { background: var(--surface-2); }

body.dark-mode .settings-tab.active {
  background: var(--surface);
  color: #a78bfa;
}

body.dark-mode .header-user {
  background: var(--surface-2);
  border-color: var(--border);
}

body.dark-mode .queue-join-notif { background: #15803d; }

body.dark-mode .toast {
  background: var(--surface-2);
  color: var(--text);
}

body.dark-mode .cash-result-list {
  border-color: var(--border);
}

body.dark-mode .cash-result-list li {
  background: var(--surface);
  border-color: var(--surface-2);
}

body.dark-mode .queue-ahead {
  background: var(--primary-light);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.25);
}

body.dark-mode .queue-timer.timer-green  { background: rgba(22, 163, 74, 0.15);  color: #4ade80; border-color: rgba(22, 163, 74, 0.2); }
body.dark-mode .queue-timer.timer-yellow { background: rgba(217, 119, 6, 0.15);  color: #fbbf24; border-color: rgba(217, 119, 6, 0.2); }
body.dark-mode .queue-timer.timer-red    { background: rgba(185, 28, 28, 0.15);  color: #f87171; border-color: rgba(185, 28, 28, 0.2); }

body.dark-mode .tenant-badge {
  background: var(--primary-light);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.25);
}

body.dark-mode .pin-display {
  background: var(--surface-2);
  border-color: var(--border-2);
}

body.dark-mode .error-msg {
  background: var(--danger-light);
  border-color: rgba(220, 38, 38, 0.2);
}

body.dark-mode .blocked-msg {
  background: var(--danger-light);
  border-color: rgba(220, 38, 38, 0.2);
}

body.dark-mode #expired-overlay {
  background: rgba(7, 11, 26, 0.92);
}

body.dark-mode #subscription-warning-banner.warning {
  background: #451a03;
  color: #fde68a;
  border-bottom-color: #78350f;
}

body.dark-mode #subscription-warning-banner.danger {
  background: #450a0a;
  color: #fecaca;
  border-bottom-color: #7f1d1d;
}

body.dark-mode .field input[readonly] {
  background: var(--surface);
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════
   AVULSO MODAL — checkbox salvar cliente
   ════════════════════════════════════════════════ */
.avulso-save-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  user-select: none;
}

.avulso-save-cb {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════ */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body * { visibility: hidden; }

  #print-area,
  #print-area * { visibility: visible; }

  #bottom-tab-bar { display: none !important; }

  #print-area {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
  }

  /* Folha A4 com borda grossa externa */
  .print-sheet {
    width: 210mm;
    height: 297mm;
    overflow: hidden;
    margin: 0 auto;
    padding: 6mm;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    color: #111;
    border: 3mm solid #111;
    box-sizing: border-box;
  }

  /* Borda fina interna — efeito quadro duplo */
  .print-inner {
    flex: 1;
    border: 0.5mm solid #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12mm 14mm;
    gap: 0;
  }

  /* Nome da barbearia grande em destaque */
  .print-tenant-name {
    font-size: 28pt;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111;
    text-align: center;
    line-height: 1.1;
    margin-bottom: 3mm;
  }

  /* Crédito NaNavalha discreto */
  .print-brand {
    font-size: 8pt;
    font-weight: 400;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
    margin-bottom: 6mm;
  }

  .print-divider {
    width: 50mm;
    height: 0.4mm;
    background: #bbb;
    margin: 0 0 6mm 0;
  }

  /* Frase criativa em itálico */
  .print-tagline {
    font-size: 12pt;
    font-style: italic;
    color: #444;
    text-align: center;
    max-width: 120mm;
    line-height: 1.55;
    margin-bottom: 9mm;
  }

  /* Caixa do QR Code */
  .print-qr-box {
    padding: 6mm;
    border: 0.5mm solid #ddd;
    border-radius: 3mm;
    background: #fff;
    margin-bottom: 7mm;
  }

  .print-qr-box img {
    width: 100mm;
    height: 100mm;
    display: block;
  }

  /* URL visível abaixo do QR */
  .print-url {
    font-size: 8.5pt;
    font-family: 'Courier New', Courier, monospace;
    color: #666;
    text-align: center;
    word-break: break-all;
    max-width: 130mm;
    margin-bottom: 8mm;
  }

  /* Nota do PIN em caixinha sutil */
  .print-pin-note {
    font-size: 10pt;
    color: #555;
    text-align: center;
    max-width: 120mm;
    line-height: 1.5;
    border: 0.3mm solid #ccc;
    border-radius: 2mm;
    padding: 3mm 6mm;
  }
}

/* ════════════════════════════════════════════════
   PAGE TOOLBAR — search + filter bar acima das tabelas
   ════════════════════════════════════════════════ */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  font-size: 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.filter-select {
  padding: 9px 30px 9px 12px;
  font-size: 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color var(--t), box-shadow var(--t);
  font-family: inherit;
  white-space: nowrap;
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.toolbar-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

/* ════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
  padding: 2px 0;
}

.pagination-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-pages {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0 4px;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════
   QUEUE SECTION HEADER (título + badge de contagem)
   ════════════════════════════════════════════════ */
.queue-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.queue-section-header h3 { margin-bottom: 0; }

.queue-count-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(108, 60, 225, 0.15);
  letter-spacing: 0.01em;
}

.queue-count-badge.in-service {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.2);
}

/* ════════════════════════════════════════════════
   CAIXA — header da seção de transações
   ════════════════════════════════════════════════ */
.cash-section-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.cash-section-actions h3 { margin-bottom: 0; }

/* TX list — sem scroll, usa paginação */

/* ════════════════════════════════════════════════
   DARK MODE — novos elementos
   ════════════════════════════════════════════════ */
body.dark-mode .search-input {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

body.dark-mode .search-input:focus {
  border-color: var(--primary);
}

body.dark-mode .filter-select {
  background-color: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

body.dark-mode .queue-count-badge {
  background: var(--primary-light);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.25);
}

body.dark-mode .queue-count-badge.in-service {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.2);
}

/* ════════════════════════════════════════════════
   STAT TREND — indicador delta nas stat-cards
   ════════════════════════════════════════════════ */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.01em;
}

.trend-up   { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--text-muted); }

/* ════════════════════════════════════════════════
   QUEUE WAIT TIME — tempo decorrido no atendimento
   ════════════════════════════════════════════════ */
.queue-wait {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--warning-light);
  color: var(--warning-dark);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  flex-shrink: 0;
}

body.dark-mode .queue-wait {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.25);
}

/* queue item em atendimento: borda esquerda verde */
.queue-item.is-active {
  border-left: 3px solid var(--success);
}

/* ════════════════════════════════════════════════
   FILTER PILLS — linha de pílulas para filtro rápido
   ════════════════════════════════════════════════ */
.filter-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.pill-count {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
}

.pill:not(.active) .pill-count {
  background: var(--primary-light);
  color: var(--primary);
}

/* ════════════════════════════════════════════════
   DASHBOARD MINI-CHART ROW
   ════════════════════════════════════════════════ */
.dash-mini-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.dash-mini-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 14px;
  box-shadow: var(--shadow-xs);
}

.dash-mini-chart-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.dash-mini-chart canvas {
  width: 100% !important;
  max-height: 100px;
}

/* ════════════════════════════════════════════════
   DASHBOARD HEADER ACTIONS + TOGGLE OPEN/CLOSE
   ════════════════════════════════════════════════ */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-toggle-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), transform 80ms;
  box-shadow: 0 2px 8px rgba(108, 60, 225, 0.28);
}

.btn-toggle-open:hover { background: var(--primary-dark); }
.btn-toggle-open:disabled { opacity: 0.5; cursor: default; transform: none; }

.toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: background var(--t);
}

.toggle-dot.open { background: var(--success); }
.toggle-dot.closed { background: var(--danger, #e53935); }

/* ════════════════════════════════════════════════
   DASHBOARD CALL-NEXT BUTTON
   ════════════════════════════════════════════════ */
.btn-call-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), transform 80ms;
  box-shadow: 0 2px 8px rgba(108, 60, 225, 0.28);
  letter-spacing: -0.01em;
} /*aqui*/

.btn-call-next:hover  { background: var(--primary-dark); }
.btn-call-next:active { transform: scale(0.97); }
.btn-call-next:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ════════════════════════════════════════════════
   DASHBOARD QUICK STATS ROW (grid na página inicial)
   ════════════════════════════════════════════════ */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* stat-card color accents para dash */
.dash-stats-row .stat-card:nth-child(1)::before { background: var(--primary); }
.dash-stats-row .stat-card:nth-child(2)::before { background: var(--success); }
.dash-stats-row .stat-card:nth-child(3)::before { background: var(--warning); }
.dash-stats-row .stat-card:nth-child(4)::before { background: var(--danger); }

/* ════════════════════════════════════════════════
   LOGO — "Na" roxo, "Navalha" herdado
   ════════════════════════════════════════════════ */
a.logo, a.header-logo {
  text-decoration: none;
  color: inherit;
}

.logo em,
.header-logo em {
  color: var(--primary);
  font-style: italic;
  font-weight: 400;
}

/* ════════════════════════════════════════════════
   DARK MODE — ACTION BUTTONS (suavizados)
   Evita excesso de cores saturadas em fundo escuro
   ════════════════════════════════════════════════ */
body.dark-mode .btn-success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(74, 222, 128, 0.25);
  color: #4ade80;
}
body.dark-mode .btn-success:hover { background: rgba(22, 163, 74, 0.22); }

body.dark-mode .btn-danger,
body.dark-mode .btn.btn-danger {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: #f87171;
}
body.dark-mode .btn-danger:hover,
body.dark-mode .btn.btn-danger:hover { background: rgba(220, 38, 38, 0.22); }

body.dark-mode .btn-whatsapp {
  background: rgba(37, 211, 102, 0.10);
  border-color: rgba(74, 222, 128, 0.22);
  color: #4ade80;
}
body.dark-mode .btn-whatsapp:hover { background: rgba(37, 211, 102, 0.20); }

body.dark-mode .btn-warn {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fbbf24;
}
body.dark-mode .btn-warn:hover { background: rgba(217, 119, 6, 0.22); }

/* ════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — @media (max-width: 640px)
   Estratégia: sidebar oculta, barra de abas no rodapé, cards em tabelas
   ════════════════════════════════════════════════════════════════════ */

/* ── Overlay escuro ao abrir sidebar no mobile ── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 109;
}

/* Botão fechar sidebar — oculto no desktop, visível no mobile via media query */
.sidebar-close-btn {
  display: none;
}

/* ── Barra de navegação inferior (mobile) ── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 4px;
  align-items: stretch;
}

.mobile-tab-bar .mtb-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
  min-width: 0;
  overflow: hidden;
}

.mobile-tab-bar .mtb-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.mobile-tab-bar .mtb-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mobile-tab-bar .mtb-btn.active {
  color: var(--primary);
}

.mobile-tab-bar .mtb-btn:active {
  background: var(--primary-muted, rgba(99,102,241,0.1));
}

@media (max-width: 640px) {
  /* ── Sidebar ── */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 110;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 240px;
    padding-top: 60px; /* abaixo do header */
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Botão X dentro do sidebar */
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 4px;
  }

  .mobile-overlay.active {
    display: block;
  }

  /* ── Tab bar ── */
  .mobile-tab-bar {
    display: flex;
  }

  /* ── Header ── */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 111; /* acima do sidebar (110) para manter hamburger clicável */
  }

  .header-sep,
  #tenant-name {
    display: none;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .header-left {
    gap: 0;
  }

  .header-right {
    gap: 6px;
  }

  .header-user span {
    display: none; /* esconde nome do usuário */
  }

  /* ── Content area ── */
  .content {
    padding: 16px 12px;
    padding-bottom: 72px; /* espaço para tab bar */
  }

  /* ── Page headers ── */
  .page-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-header h2 {
    font-size: 1.1rem;
  }

  .btn-call-next {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  /* ── Stat cards ── */
  .dash-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-mini-chart-row {
    grid-template-columns: 1fr;
  }

  .cache-summary-row,
  .cash-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── Filter pills — scroll horizontal ── */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 6px;
  }

  .filter-pills::-webkit-scrollbar { display: none; }

  /* ── Tables → Cards ── */
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.875rem;
    border: none;
    gap: 8px;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Célula de ações: empilhar sem label */
  .data-table tbody td:last-child {
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }

  .data-table tbody td:last-child::before {
    display: none;
  }

  /* ── Modais → bottom sheet ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal.modal-form {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
    padding: 20px 16px 24px;
  }

  /* ── Relatórios ── */
  .rpt-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .rpt-bottom-grid {
    grid-template-columns: 1fr;
  }

  .rpt-fin-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .rpt-main-tabs {
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .rpt-main-tabs::-webkit-scrollbar { display: none; }

  .rpt-main-tab {
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .rpt-quick-btns {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rpt-quick-btns::-webkit-scrollbar { display: none; }

  .rpt-date-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ── Drawer de relatórios ── */
  .rpt-drawer {
    width: 100% !important;
    border-radius: 20px 20px 0 0;
  }

  /* ── Settings tabs — scroll horizontal ── */
  .settings-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .settings-tabs::-webkit-scrollbar { display: none; }

  /* ── Caixa — transação item ── */
  .tx-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* ── Página de toolbar ── */
  .page-toolbar {
    flex-wrap: wrap;
  }

  .search-wrap {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  /* ── Queue items — compact vertical layout ── */
  .queue-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .queue-ahead {
    min-width: unset;
    font-size: 0.65rem;
    padding: 2px 8px;
  }

  .queue-info {
    flex-basis: calc(100% - 90px);
    min-width: 0;
  }

  .queue-name {
    font-size: 0.82rem;
  }

  .queue-time {
    font-size: 0.7rem;
  }

  .queue-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }

  .queue-position {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

/* Dark mode additions for mobile bar */
body.dark-mode .mobile-tab-bar {
  background: var(--surface);
  border-top-color: var(--border);
}

/* Hamburger button — oculto no desktop, visível no mobile via media query */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
}

/* ════════════════════════════════════════════════
   TRANSAÇÕES — Página de gerenciamento financeiro
   ════════════════════════════════════════════════ */

/* ── Cabeçalho de navegação por período ── */
.tx-page-header {
  margin-bottom: 16px;
}
.tx-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.tx-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.tx-nav-arrow:hover { background: var(--bg); color: var(--text); }
.tx-nav-arrow:disabled { opacity: 0.35; cursor: not-allowed; }

.tx-period-center {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 160px;
  justify-content: center;
}
.tx-month-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.tx-year-btn {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--t);
}
.tx-year-btn:hover { background: var(--primary-light); }

/* Pílulas de mês */
.tx-month-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.tx-month-pill {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t);
}
.tx-month-pill:hover { border-color: var(--primary); color: var(--primary); }
.tx-month-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tx-month-pill:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Cards de resumo ── */
.tx-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.tx-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 14px 14px 16px;
  box-shadow: var(--shadow-xs);
}
.tx-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.tx-card-icon--income  { background: #f0fdf4; color: #16a34a; }
.tx-card-icon--expense { background: #fef2f2; color: #dc2626; }
.tx-card-icon--balance { background: var(--primary-light); color: var(--primary); }
.tx-card-body { flex: 1; min-width: 0; }
.tx-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.tx-card-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.tx-card-value.income  { color: #16a34a; }
.tx-card-value.expense { color: #dc2626; }
.tx-card-filter {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--t), background var(--t);
}
.tx-card-filter:hover { color: var(--primary); background: var(--primary-light); }

/* ── Barra de ações em lote ── */
.tx-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1d4ed8;
}
.tx-batch-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.tx-batch-delete-btn:hover { background: #fef2f2; border-color: #dc2626; }
body.dark-mode .tx-actions-bar {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
body.dark-mode .tx-batch-delete-btn {
  background: transparent;
  border-color: rgba(220, 38, 38, 0.4);
  color: #f87171;
}
body.dark-mode .tx-batch-delete-btn:hover { background: rgba(220, 38, 38, 0.1); }

/* ── Card da tabela ── */
.tx-table-card { padding: 0; overflow: hidden; }

/* ── Toolbar (filtro + busca) ── */
.tx-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.tx-type-filter-wrap { position: relative; }
.tx-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.tx-filter-btn:hover, .tx-filter-btn.active { border-color: var(--primary); color: var(--primary); }
.tx-filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}
.tx-filter-option {
  padding: 9px 14px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text);
  transition: background var(--t);
}
.tx-filter-option:hover { background: var(--bg); }
.tx-filter-option.selected { color: var(--primary); font-weight: 600; }
.tx-search-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}
.tx-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  flex-shrink: 0;
}
.tx-search-toggle:hover, .tx-search-toggle.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tx-search-input {
  flex: 1;
  max-width: 320px;
  height: 32px;
  padding: 0 10px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--t), opacity 0.2s;
}
.tx-search-input:focus { border-color: var(--primary); }
.tx-search-input.hidden { display: none; }
@keyframes tx-slide-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tx-search-input:not(.hidden) { animation: tx-slide-in 0.2s ease; }

/* ── Tabela ── */
.tx-table-wrap { overflow-x: auto; }
.tx-table { min-width: 580px; }
.tx-th-check  { width: 36px; text-align: center; padding: 0; }
.tx-th-date   { width: 120px; white-space: nowrap; }
.tx-th-type   { width: 90px; }
.tx-th-amount { width: 120px; text-align: right; }
.tx-th-actions { width: 48px; text-align: center; }
.tx-sort-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0 2px;
  margin-left: 2px;
  vertical-align: middle;
  transition: color var(--t);
}
.tx-sort-btn:hover { color: var(--primary); }
.tx-sort-btn.asc::after  { content: '↑'; }
.tx-sort-btn.desc::after { content: '↓'; }

/* Célula de descrição + categoria */
.tx-cell-desc { font-weight: 500; color: var(--text); line-height: 1.3; }
.tx-cell-cat  { font-size: 0.72rem; color: var(--text-secondary); margin-top: 1px; }

/* Badges de tipo */
.tx-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.tx-badge-income  { background: #f0fdf4; color: #16a34a; }
.tx-badge-expense { background: #fef2f2; color: #dc2626; }

/* Valores */
.tx-amount-income  { color: #16a34a; font-weight: 600; text-align: right; display: block; }
.tx-amount-expense { color: #dc2626; font-weight: 600; text-align: right; display: block; }

/* Célula de checkbox */
.tx-check-cell { text-align: center; }

/* Menu de ações inline */
.tx-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: background var(--t), color var(--t);
}
.tx-action-btn:hover { background: var(--bg); color: var(--text); }
.tx-actions-cell { display: flex; align-items: center; gap: 2px; justify-content: center; }
.tx-edit-btn   { color: var(--primary); }
.tx-edit-btn:hover { background: var(--primary-light); }
.tx-delete-btn { color: var(--danger); }
.tx-delete-btn:hover { background: var(--danger-light); }

/* ── Paginação ── */
.tx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.tx-page-size-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.tx-page-size-label { white-space: nowrap; }
.tx-page-size-select {
  height: 30px;
  padding: 0 6px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.tx-pag-controls-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}
.tx-pag-range { color: var(--text-secondary); white-space: nowrap; }
.tx-pag-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tx-pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.tx-pag-btn:hover:not(:disabled) { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.tx-pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tx-pag-pages { font-size: 0.8rem; padding: 0 6px; color: var(--text); white-space: nowrap; }

/* ── Dark mode adaptations ── */
body.dark-mode .tx-card-icon--income  { background: rgba(22, 163, 74, 0.12); }
body.dark-mode .tx-card-icon--expense { background: rgba(220, 38, 38, 0.12); }
body.dark-mode .tx-badge-income  { background: rgba(22, 163, 74, 0.15); color: #4ade80; }
body.dark-mode .tx-badge-expense { background: rgba(220, 38, 38, 0.15); color: #f87171; }
body.dark-mode .tx-amount-income  { color: #4ade80; }
body.dark-mode .tx-amount-expense { color: #f87171; }
body.dark-mode .tx-card-value.income  { color: #4ade80; }
body.dark-mode .tx-card-value.expense { color: #f87171; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .tx-summary-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tx-pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tx-pag-controls-wrap { width: 100%; justify-content: space-between; }
  .tx-toolbar { flex-wrap: wrap; }
  .tx-search-input { max-width: none; min-width: 0; }
}
