/* ============================================================
   FZStore — Global Stylesheet
   Aesthetic: Dark luxury / editorial fintech
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=JetBrains+Mono:wght@400;500&display=swap');
/* Font Awesome 6 carregado via CDN no header.php */

:root {
  --bg:       #080b10;
  --surface:  #0d1119;
  --surface2: #111722;
  --surface3: #161d28;
  --border:   #1c2333;
  --border2:  #243044;

  --accent:   #00d68f;
  --accent-d: #00a86b;
  --blue:     #2563eb;
  --blue-l:   #3b82f6;
  --amber:    #f59e0b;
  --red:      #ef4444;
  --purple:   #8b5cf6;

  --text:     #e2e8f0;
  --text-2:   #94a3b8;
  --text-3:   #475569;

  --radius:   14px;
  --radius-s: 8px;
  --shadow:   0 4px 24px #00000060;
  --shadow-l: 0 8px 48px #00000080;

  --sidebar-w:           240px;
  --sidebar-w-collapsed:  64px;
  --header-h:             64px;
  --sidebar-transition:   .28s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 15px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── EFEITO DE FUNDO ANIMADO ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% 15%,  #00d68f09 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 90% 85%,  #2563eb08 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 20%,  #8b5cf606 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 20% 80%,  #00d68f05 0%, transparent 60%);
  animation: bgPulse 14s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #00d68f18 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 18%, #2563eb18 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 75%, #8b5cf614 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 60%, #00d68f10 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 85%, #2563eb12 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 40%, #00d68f0c 0%, transparent 100%),
    radial-gradient(1px   1px   at 30% 55%, #8b5cf60a 0%, transparent 100%),
    radial-gradient(1px   1px   at 92% 40%, #00d68f08 0%, transparent 100%);
  background-size: 320px 280px, 280px 340px, 360px 300px, 300px 320px, 340px 280px, 260px 360px, 400px 300px, 280px 400px;
  opacity: .55;
  animation: bgPulse 20s ease-in-out infinite alternate-reverse;
}

@keyframes bgPulse {
  0%   { opacity: .55; transform: scale(1)    translateX(0px)   translateY(0px);  }
  33%  { opacity: .75; transform: scale(1.02)  translateX(-10px) translateY(8px);  }
  66%  { opacity: .65; transform: scale(.99)   translateX(6px)   translateY(-6px); }
  100% { opacity: .80; transform: scale(1.015) translateX(-5px)  translateY(4px);  }
}

/* garante que conteúdo fique acima do fundo */
.app-wrapper, .login-page { position: relative; z-index: 1; }
/* sidebar e topbar precisam de background sólido sobre o efeito */
.sidebar  { backdrop-filter: blur(0px); }
.topbar   { backdrop-filter: blur(12px); background: #0d111994 !important; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ══════════════════════════════════════════
   LAYOUT — Sidebar fixa + conteúdo adaptativo
══════════════════════════════════════════ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR — SEMPRE FIXA ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  transition: width var(--sidebar-transition), transform var(--sidebar-transition);
  flex-shrink: 0;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
}

/* ── LADO DIREITO: topbar + conteúdo ── */
.app-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  transition: margin-left var(--sidebar-transition);
  min-height: 100vh;
}

body.sidebar-collapsed .app-right {
  margin-left: var(--sidebar-w-collapsed);
}

/* ── LOGO ── */
.sidebar-logo {
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--blue-l));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: #000; font-weight: 800;
  flex-shrink: 0;
  transition: border-radius var(--sidebar-transition);
}

body.sidebar-collapsed .brand-icon { border-radius: 50%; }

.brand-text { overflow: hidden; white-space: nowrap; }

.brand-name {
  font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em;
}
.brand-name span { color: var(--accent); }

.brand-sub {
  font-size: .65rem; color: var(--text-3);
  letter-spacing: .06em; text-transform: uppercase; margin-top: 2px;
}

body.sidebar-collapsed .brand-text {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

/* ── NAV ── */
.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
  overflow: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-section-label {
  padding: 10px 8px 5px;
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
}

.nav-section-label span {
  font-size: .62rem; font-weight: 700; color: var(--text-3);
  letter-spacing: .1em; text-transform: uppercase;
  transition: opacity var(--sidebar-transition);
  display: block;
}

body.sidebar-collapsed .nav-section-label span { opacity: 0; }
body.sidebar-collapsed .nav-section-label { padding: 4px 0; }

body.sidebar-collapsed .nav-section-label::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-s);
  font-size: .87rem;
  font-weight: 600;
  color: var(--text-2);
  transition: background .15s, color .15s, padding var(--sidebar-transition), justify-content var(--sidebar-transition);
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover { background: var(--surface3); color: var(--text); }

.nav-item.nav-pro-locked {
  opacity: .5;
  cursor: pointer;
  position: relative;
}
.nav-item.nav-pro-locked:hover {
  opacity: .8;
  background: #f0a42910;
  color: var(--amber);
}
.pro-badge {
  margin-left: auto;
  font-size: .6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0a429, #e07b00);
  color: #000;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.nav-item.active {
  background: linear-gradient(90deg, #00d68f1a, #00d68f08);
  color: var(--accent);
  border: 1px solid #00d68f22;
}

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent);
  border-radius: 0 3px 3px 0;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}

/* Tooltip no hover quando colapsado */
body.sidebar-collapsed .nav-item::after {
  content: attr(title);
  position: absolute;
  left: calc(var(--sidebar-w-collapsed) + 8px);
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-s);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s .05s;
  z-index: 100;
  box-shadow: var(--shadow);
}
body.sidebar-collapsed .nav-item:hover::after { opacity: 1; }

.nav-ico {
  width: 20px;
  text-align: center;
  font-size: .9rem;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.nav-label {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--sidebar-transition);
}

body.sidebar-collapsed .nav-label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.nav-badge {
  background: var(--red);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

body.sidebar-collapsed .nav-badge {
  position: absolute;
  top: 4px; right: 4px;
  padding: 1px 4px;
  font-size: .55rem;
  min-width: 14px;
}

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Seção Meu Perfil fixada no final — esconde label quando collapsed */
body.sidebar-collapsed .sidebar [style*="border-top"] .nav-section-label {
  display: none;
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-s);
  background: var(--surface3);
  /* sem overflow:hidden — evita cortar o btn-logout */
  transition: padding var(--sidebar-transition), justify-content var(--sidebar-transition);
  min-width: 0; /* permite flex shrink correto */
}

body.sidebar-collapsed .admin-card {
  justify-content: center;
  padding: 8px 0;
}

.admin-avatar {
  width: 34px; height: 34px;
  min-width: 34px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.admin-info {
  flex: 1;
  min-width: 0; /* permite text-overflow funcionar */
  overflow: hidden;
  transition: opacity var(--sidebar-transition), max-width var(--sidebar-transition);
}

.admin-name {
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-role {
  font-size: .67rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.admin-validade { color: var(--accent); }
.admin-validade.exp { color: var(--red); }

body.sidebar-collapsed .admin-info,
body.sidebar-collapsed .btn-logout {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.btn-logout {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: .9rem;
  padding: 6px 5px;
  border-radius: 5px;
  transition: color .15s, opacity var(--sidebar-transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-left: auto; /* garante que fique sempre no canto direito */
}
.btn-logout:hover { color: var(--red); }

/* ── OVERLAY MOBILE ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: #00000060;
  z-index: 49;
}
.sidebar-overlay.active { display: block; }

/* ── TOPBAR ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px 0 16px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--surface) 90%, transparent) !important;
}

.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 34px; height: 34px;
  border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .9rem;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}

.sidebar-toggle:hover {
  background: var(--surface3);
  border-color: var(--border2);
  color: var(--accent);
}

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

.topbar-title {
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.topbar-page-icon { color: var(--accent); font-size: .88rem; }

.topbar-sub { font-size: .76rem; color: var(--text-3); margin-top: 1px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-alert {
  display: flex; align-items: center; gap: 5px;
  background: #ef444418; border: 1px solid #ef444430;
  color: var(--red); border-radius: var(--radius-s);
  padding: 5px 10px; font-size: .78rem; font-weight: 700;
  transition: background .15s;
  text-decoration: none;
}
.topbar-alert:hover { background: #ef444428; }

.topbar-date {
  display: flex; align-items: center; gap: 5px;
  font-size: .76rem; color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* ── MAIN CONTENT ── */
.main-content {
  padding: 28px;
  padding-bottom: 140px;
  flex: 1;
}

/* Empurra o botão do Tawk.to para não cobrir conteúdo */
#tawkchat-container,
.tawk-min-container,
.tawk-button-container,
iframe[id*="tawk"] {
  bottom: 16px !important;
  right: 16px !important;
  left: auto !important;
}

/* ══════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════ */

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Cards que contêm tabela com scroll — overflow deve ser visible */
.card.cd-hist-card,
.card.card-table,
.card-overflow-visible,
.card.card-tabs,
.card.card-filter {
  overflow: visible;
}

/* Card de filtro: mantém visual mas deixa tabs transbordar */
.card.card-filter {
  position: relative;
}

/* Tab-pills dentro de card: garante scroll mesmo com overflow:hidden no pai */
.card .tab-pills {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.card .tab-pills::-webkit-scrollbar { display: none; }

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

.card-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.card-title-lg {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: border .2s, transform .2s;
}

.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffffff04, transparent);
  pointer-events: none;
}

.stat-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}

.stat-value.accent { color: var(--accent); }
.stat-value.blue   { color: var(--blue-l); }
.stat-value.amber  { color: var(--amber); }
.stat-value.red    { color: var(--red); }
.stat-value.purple { color: var(--purple); }

.stat-meta {
  font-size: .78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  position: absolute;
  top: 16px; right: 18px;
  font-size: 1.8rem;
  opacity: .15;
}

.stat-trend-up   { color: var(--accent); }
.stat-trend-down { color: var(--red); }

/* ── GRIDS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.grid-5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 18px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: #ffffff03; }

.td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success { background: #00d68f18; color: var(--accent);  border: 1px solid #00d68f25; }
.badge-warning { background: #f59e0b18; color: var(--amber);   border: 1px solid #f59e0b25; }
.badge-danger  { background: #ef444418; color: var(--red);     border: 1px solid #ef444425; }
.badge-info    { background: #2563eb18; color: var(--blue-l);  border: 1px solid #2563eb25; }
.badge-muted   { background: #ffffff08; color: var(--text-3);  border: 1px solid var(--border); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: #00ffad; transform: translateY(-1px); box-shadow: 0 4px 16px #00d68f30; }

.btn-secondary {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border2); background: var(--surface2); }

.btn-blue {
  background: var(--blue);
  color: #fff;
}
.btn-blue:hover { background: var(--blue-l); }

.btn-danger {
  background: #ef444420;
  color: var(--red);
  border: 1px solid #ef444430;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-warning {
  background: #f59e0b20;
  color: var(--amber);
  border: 1px solid #f59e0b30;
}
.btn-warning:hover { background: var(--amber); color: #000; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: border .15s, box-shadow .15s;
  appearance: none;
}

.form-control:focus {
  border-color: var(--blue-l);
  box-shadow: 0 0 0 3px #2563eb18;
}

.form-control::placeholder { color: var(--text-3); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── ALERTS / FLASH ── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  margin-bottom: 20px;
  font-size: .88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-success { background: #00d68f14; border: 1px solid #00d68f30; color: var(--accent); }
.flash-error   { background: #ef444414; border: 1px solid #ef444430; color: var(--red); }
.flash-info    { background: #2563eb14; border: 1px solid #2563eb30; color: var(--blue-l); }
.flash-warning { background: #f59e0b14; border: 1px solid #f59e0b30; color: var(--amber); }

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

.page-header-left h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.page-header-left p {
  font-size: .85rem;
  color: var(--text-2);
  margin-top: 3px;
}

.page-header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── TOKEN / MONO ── */
.token-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: var(--accent);
  background: #00d68f0c;
  border: 1px solid #00d68f20;
  border-radius: var(--radius-s);
  padding: 6px 10px;
  display: inline-block;
  word-break: break-all;
  cursor: pointer;
  transition: border .15s;
}

.token-display:hover { border-color: var(--accent); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state .empty-ico { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state p { color: var(--text-3); font-size: .9rem; }

/* ── SECTION DIVIDER ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h3 {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── CHART AREA ── */
.chart-area {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 0 0;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-wrap {
  width: 100%;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
}

.chart-bar {
  border-radius: 4px 4px 0 0;
  transition: height .4s cubic-bezier(.4,0,.2,1), opacity .2s;
  cursor: pointer;
  min-height: 4px;
}

.chart-bar:hover { opacity: .8; }
.chart-bar.bar-received { background: var(--accent); width: 44%; }
.chart-bar.bar-pending  { background: var(--amber);  width: 44%; }

.chart-label {
  font-size: .65rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 12px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-legend .dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── ACTIVITY FEED ── */
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-dot.green  { background: var(--accent); }
.activity-dot.amber  { background: var(--amber); }
.activity-dot.red    { background: var(--red); }
.activity-dot.blue   { background: var(--blue-l); }

.activity-info { flex: 1; min-width: 0; }
.activity-name { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub  { font-size: .75rem; color: var(--text-3); margin-top: 1px; }
.activity-val  { font-family: 'JetBrains Mono', monospace; font-size: .82rem; white-space: nowrap; }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 5px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue-l));
  border-radius: 99px;
  transition: width .5s;
}

/* ── PILL TABS ── */
.tab-pills {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 4px;
  flex-wrap: nowrap;
}

.tab-pill {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-pill.active, .tab-pill:hover {
  background: var(--surface3);
  color: var(--text);
}

.tab-pill.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ── CONFIRM BADGE / STATUS ── */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  font-weight: 600;
}

.status-indicator::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
}

.si-active::before  { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.si-inactive::before { background: var(--text-3); }

/* ── MB HELPERS ── */
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: .82rem; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-accent { color: var(--accent); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-blue   { color: var(--blue-l); }

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 60% at 30% 80%, #00d68f08, transparent),
    radial-gradient(ellipse 60% 50% at 80% 10%, #2563eb08, transparent);
}

.login-box {
  width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-l);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--blue-l));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 14px;
  color: #000; font-weight: 800;
}

.login-logo h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.login-logo h1 span { color: var(--accent); }
.login-logo p { font-size: .85rem; color: var(--text-3); margin-top: 4px; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* ══════════════════════════════════════════
   RESPONSIVE — Tablet (≤1024px)
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-5 { grid-template-columns: 1fr 1fr 1fr; }
  .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   Sidebar vira drawer: oculta por padrão,
   abre quando NÃO estiver collapsed
══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 240px;
    --header-h: 56px;
  }

  /* app-right ocupa tudo */
  .app-right {
    margin-left: 0 !important;
  }

  /* Sidebar: escondida por padrão (collapsed por padrão no mobile) */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    box-shadow: none;
    transition: transform var(--sidebar-transition), box-shadow var(--sidebar-transition);
  }

  /* Sidebar aberta (classe NOT collapsed) */
  body:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0);
    box-shadow: 6px 0 40px #000000c0;
  }

  /* Topbar: full width, sem blur no mobile */
  .topbar {
    padding: 0 14px;
    background: var(--surface) !important;
    backdrop-filter: none !important;
  }

  .main-content { padding: 14px; padding-bottom: 140px; }

  /* Grids */
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-2           { grid-template-columns: 1fr;     gap: 10px; }
  .grid-5           { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-row.cols-4,
  .form-row.cols-3  { grid-template-columns: 1fr 1fr; }
  .form-row.cols-2  { grid-template-columns: 1fr; }

  /* Page header empilha */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header-actions { width: 100%; flex-wrap: wrap; }
  .page-header-actions .btn { flex: 1; min-width: 110px; justify-content: center; }

  /* Subtítulo topbar some no mobile */
  .topbar-sub { display: none; }

  /* Tabela: scroll horizontal suave */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { min-width: 500px; }

  /* Stat cards */
  .stat-value { font-size: 1.5rem; }

  /* Cards */
  .card-header { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .card-body   { padding: 14px; }

  /* Login */
  .login-box { width: calc(100% - 32px); padding: 28px 20px; }

  /* Topbar: esconde data/hora para ganhar espaço */
  .topbar-date { display: none; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Small mobile (≤480px)
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-5 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid-2 { grid-template-columns: 1fr; gap: 8px; }
  .form-row.cols-4,
  .form-row.cols-3,
  .form-row.cols-2 { grid-template-columns: 1fr; }
  .main-content { padding: 10px; padding-bottom: 140px; }
  .page-header-actions .btn { font-size: .78rem; padding: 7px 10px; }
  .stat-value { font-size: 1.35rem; }
  .stat-card  { padding: 14px 16px; }
}

/* ══════════════════════════════════════════
   GATEWAY OPTION CARDS (configuracoes.php)
══════════════════════════════════════════ */
.gw-option {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 20px 16px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--border); background: var(--surface2);
  transition: all .2s; position: relative; user-select: none;
}
.gw-option input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.gw-option:hover { border-color: var(--border2); background: var(--surface3); }
.gw-option.selected { border-color: var(--accent); background: #00d68f0a; }
.gw-option.selected::after {
  content: '\f058';
  font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 10px; right: 10px;
  color: var(--accent); font-size: .85rem;
}
.gw-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; flex-shrink: 0;
}
.gw-name { font-size: .9rem; font-weight: 800; margin-bottom: 4px; }
.gw-desc { font-size: .72rem; color: var(--text-3); line-height: 1.4; }
.gw-status { font-size: .72rem; font-weight: 700; margin-top: 10px; padding: 3px 10px; border-radius: 999px; }
.gw-status.ok  { background: #00d68f12; color: var(--accent); border: 1px solid #00d68f25; }
.gw-status.err { background: #ef444412; color: var(--red);    border: 1px solid #ef444425; }

.font-mono { font-family: 'JetBrains Mono', monospace; font-size: .82rem !important; }
