/* ================================================================
   MoneyFlow — Dashboard Administrativo
   Variáveis de tema → Layout → Sidebar → Topbar → Conteúdo → Tabela → Responsivo
   ================================================================ */

/* ───────────────── TEMA CLARO ───────────────── */
[data-theme="light"] {
  --dash-bg:          #f0f2f5;
  --dash-surface:     #ffffff;
  --dash-sidebar:     #ffffff;
  --dash-sidebar-hov: #f4f6fa;
  --dash-sidebar-act: #eef1fb;
  --dash-topbar:      #ffffff;
  --dash-text:        #1a1a2e;
  --dash-text-soft:   #4a4a6a;
  --dash-text-muted:  #8a8aaa;
  --dash-accent:      #3b5bdb;
  --dash-accent-hov:  #2b4bc8;
  --dash-accent-bg:   rgba(59, 91, 219, .08);
  --dash-border:      #e0e2ea;
  --dash-shadow:      0 1px 4px rgba(26, 26, 46, .06);
  --dash-shadow-lg:   0 4px 20px rgba(26, 26, 46, .08);
  --dash-danger:      #e03131;
  --dash-danger-bg:   rgba(224, 49, 49, .08);
  --dash-success:     #2f9e44;
  --dash-success-bg:  rgba(47, 158, 68, .1);
  --dash-warning:     #e8590c;
  --dash-warning-bg:  rgba(232, 89, 12, .08);
  --dash-row-hover:   #f8f9fb;
  --dash-toggle-bg:   #e0e2ea;
  --dash-toggle-knob: #ffffff;
  --dash-badge-active-bg:   rgba(47, 158, 68, .12);
  --dash-badge-active-text: #2f9e44;
  --dash-badge-inactive-bg:   rgba(138, 138, 170, .12);
  --dash-badge-inactive-text: #8a8aaa;
  --dash-stat-icon1:  rgba(59, 91, 219, .1);
  --dash-stat-icon2:  rgba(47, 158, 68, .1);
  --dash-stat-icon3:  rgba(232, 89, 12, .1);
  --dash-stat-icon4:  rgba(107, 114, 128, .15);
}

/* ───────────────── TEMA ESCURO ───────────────── */
[data-theme="dark"] {
  --dash-bg:          #0c0c16;
  --dash-surface:     #16162a;
  --dash-sidebar:     #111122;
  --dash-sidebar-hov: #1a1a32;
  --dash-sidebar-act: #1e1e3a;
  --dash-topbar:      #16162a;
  --dash-text:        #e4e4f0;
  --dash-text-soft:   #a0a0c0;
  --dash-text-muted:  #5a5a7a;
  --dash-accent:      #5c7cfa;
  --dash-accent-hov:  #748ffc;
  --dash-accent-bg:   rgba(92, 124, 250, .12);
  --dash-border:      #22223a;
  --dash-shadow:      0 1px 4px rgba(0, 0, 0, .3);
  --dash-shadow-lg:   0 4px 20px rgba(0, 0, 0, .4);
  --dash-danger:      #ff6b6b;
  --dash-danger-bg:   rgba(255, 107, 107, .1);
  --dash-success:     #51cf66;
  --dash-success-bg:  rgba(81, 207, 102, .1);
  --dash-warning:     #ff922b;
  --dash-warning-bg:  rgba(255, 146, 43, .1);
  --dash-row-hover:   #1a1a32;
  --dash-toggle-bg:   #22223a;
  --dash-toggle-knob: #5c7cfa;
  --dash-badge-active-bg:   rgba(81, 207, 102, .15);
  --dash-badge-active-text: #51cf66;
  --dash-badge-inactive-bg:   rgba(90, 90, 122, .2);
  --dash-badge-inactive-text: #5a5a7a;
  --dash-stat-icon1:  rgba(92, 124, 250, .15);
  --dash-stat-icon2:  rgba(81, 207, 102, .15);
  --dash-stat-icon3:  rgba(255, 146, 43, .15);
  --dash-stat-icon4:  rgba(156, 163, 175, .2);
}

/* ───────────────── RESET & BASE ───────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--dash-bg);
  color: var(--dash-text);
  line-height: 1.5;
  transition: background .3s ease, color .3s ease;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

/* ───────────────── LAYOUT PRINCIPAL ───────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

/* ───────────────── SIDEBAR ───────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--dash-sidebar);
  border-right: 1px solid var(--dash-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  z-index: 100;
  transition: background .3s ease, border-color .3s ease, transform .3s ease, width .25s ease;
  overflow-y: auto;
}

/* Sidebar retraído: só ícones, largura reduzida */
.sidebar.sidebar--retracted {
  width: 72px;
}

.sidebar.sidebar--retracted .sidebar__brand-text,
.sidebar.sidebar--retracted .sidebar__logo,
.sidebar.sidebar--retracted .sidebar__favoritos-head .sidebar__section-label,
.sidebar.sidebar--retracted .sidebar__search-input,
.sidebar.sidebar--retracted .sidebar__link-text,
.sidebar.sidebar--retracted .sidebar__link-handle,
.sidebar.sidebar--retracted .sidebar__user-info {
  display: none !important;
}

.sidebar.sidebar--retracted .sidebar__brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.sidebar--retracted .sidebar__favoritos {
  padding: 12px 8px 16px;
}

.sidebar.sidebar--retracted .sidebar__favoritos-head {
  justify-content: center;
  margin-bottom: 8px;
}

.sidebar.sidebar--retracted .sidebar__favoritos-actions {
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sidebar.sidebar--retracted .sidebar__search-wrap {
  display: none;
}

.sidebar.sidebar--retracted .sidebar__nav {
  padding: 12px 8px 16px;
  align-items: center;
}

.sidebar.sidebar--retracted .sidebar__link {
  justify-content: center;
  padding: 12px;
  min-height: 48px;
}

.sidebar.sidebar--retracted .sidebar__section-label {
  padding: 12px 0 4px;
  text-align: center;
  font-size: 0;
  line-height: 0;
}

.sidebar.sidebar--retracted .sidebar__section-label::after {
  content: '•';
  font-size: .75rem;
  color: var(--dash-text-muted);
  display: block;
}

.sidebar.sidebar--retracted .sidebar__footer {
  padding: 12px 8px;
  justify-content: center;
}

.sidebar.sidebar--retracted .sidebar__user {
  justify-content: center;
}

.sidebar.sidebar--retracted .sidebar__avatar {
  margin: 0;
}

/* Layout quando sidebar está retraído */
.dash-layout--sidebar-retracted {
  grid-template-columns: 72px 1fr;
}

.dash-layout--sidebar-retracted .topbar {
  left: 72px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--dash-border);
  flex-shrink: 0;
}

.sidebar__hamburger {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--dash-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.sidebar__hamburger:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

.sidebar__hamburger .material-symbols-outlined {
  font-size: 1.4rem;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__logo-img {
  max-width: 40px;
  width: auto;
  height: auto;
  max-height: 40px;
  display: block;
  border-radius: 10px;
}

.sidebar__brand-text {
  font-size: 1.15rem;
  color: var(--dash-text);
}

.sidebar__brand-money {
  font-weight: 400;
}

.sidebar__brand-flow {
  font-weight: 700;
  font-style: italic;
}

/* Bloco Favoritos + busca (estilo referência) */
.sidebar__favoritos {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-bottom: 1px solid var(--dash-border);
}

.sidebar__favoritos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar__favoritos-head .sidebar__section-label {
  padding: 0;
  margin: 0;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--dash-text-muted);
}

.sidebar__favoritos-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar__icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.sidebar__icon-btn:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

.sidebar__icon-btn .material-symbols-outlined {
  font-size: 1.2rem;
}

.sidebar__search-wrap {
  position: relative;
}

.sidebar__search-wrap .sidebar__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--dash-text-muted);
  pointer-events: none;
}

.sidebar__search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  background: var(--dash-bg);
  color: var(--dash-text);
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.sidebar__search-input::placeholder {
  color: var(--dash-text-muted);
}

.sidebar__search-input:focus {
  border-color: var(--dash-accent);
  box-shadow: 0 0 0 2px var(--dash-accent-bg);
}

.sidebar__nav {
  flex: 1;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar__section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--dash-text-muted);
  padding: 16px 0 8px;
}

.sidebar__section-label:first-of-type {
  padding-top: 8px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 28px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--dash-text-soft);
  transition: all .2s ease;
  cursor: pointer;
  text-align: left;
}

.sidebar__link:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

.sidebar__link--active {
  background: var(--dash-sidebar-act);
  color: var(--dash-accent);
  font-weight: 600;
}

.sidebar__link-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  opacity: .9;
}

.sidebar__link--active .sidebar__link-icon {
  opacity: 1;
  color: var(--dash-accent);
}

.sidebar__link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__link-label {
  font-weight: 500;
  line-height: 1.3;
}

.sidebar__link-desc {
  font-size: .75rem;
  font-weight: 400;
  color: var(--dash-text-muted);
  line-height: 1.3;
}

.sidebar__link--active .sidebar__link-desc {
  color: var(--dash-accent);
  opacity: .9;
}

.sidebar__link-handle {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--dash-text-muted);
  opacity: .35;
  cursor: grab;
  transition: opacity .2s ease;
}

.sidebar__link:hover .sidebar__link-handle,
.sidebar__link--active .sidebar__link-handle {
  opacity: .5;
}

.sidebar__link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .7;
}

.sidebar__link--active svg {
  opacity: 1;
  color: var(--dash-accent);
}

.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--dash-border);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.sidebar__user-info {
  overflow: hidden;
}

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

.sidebar__user-role {
  font-size: .72rem;
  color: var(--dash-text-muted);
}

/* ───────────────── TOPBAR ───────────────── */
.topbar {
  grid-area: topbar;
  background: var(--dash-topbar);
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: fixed;
  top: 0;
  left: 320px;
  right: 0;
  height: 64px;
  z-index: 90;
  transition: background .3s ease, border-color .3s ease, left .3s ease;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar__left > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dash-text);
  padding: 8px;
  border-radius: 20px;
}

.topbar__hamburger:hover {
  background: var(--dash-sidebar-hov);
}

.topbar__hamburger .material-symbols-outlined {
  font-size: 1.4rem;
}

.topbar__hamburger svg {
  width: 22px;
  height: 22px;
}

.topbar__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dash-text);
  line-height: 1.3;
}

.topbar__breadcrumb {
  font-size: .8rem;
  color: var(--dash-text-muted);
  line-height: 1.3;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Widget Desbloquear Versão Completa (topbar) */
.unlock-widget {
  padding: 6px 10px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 10px;
}

.unlock-widget__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  background: #7C3AED;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  transition: background .2s ease;
  white-space: nowrap;
}

.unlock-widget__btn:hover {
  background: #6D28D9;
  color: #fff;
}

.topbar__theme-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__theme-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--dash-text-soft);
}

.topbar__search {
  position: relative;
}

.topbar__search-input {
  background: var(--dash-bg);
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: .85rem;
  color: var(--dash-text);
  width: 240px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}

.topbar__search-input::placeholder {
  color: var(--dash-text-muted);
}

.topbar__search-input:focus {
  border-color: var(--dash-accent);
  box-shadow: 0 0 0 3px var(--dash-accent-bg);
}

.topbar__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--dash-text-muted);
  pointer-events: none;
}

.topbar__icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dash-text-soft);
  transition: all .2s;
  position: relative;
}

.topbar__icon-btn:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

.topbar__icon-btn svg {
  width: 18px;
  height: 18px;
}

.topbar__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  background: var(--dash-danger);
  border-radius: 50%;
  font-size: .6rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toggle de tema */
.theme-toggle {
  width: 48px;
  height: 26px;
  background: var(--dash-toggle-bg);
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background .3s ease;
  display: flex;
  align-items: center;
  padding: 2px;
  flex-shrink: 0;
}

.theme-toggle__knob {
  width: 22px;
  height: 22px;
  background: var(--dash-toggle-knob);
  border-radius: 50%;
  transition: transform .3s ease, background .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

[data-theme="dark"] .theme-toggle__knob {
  transform: translateX(22px);
}

/* ───────────────── ÁREA PRINCIPAL ───────────────── */
.main {
  grid-area: main;
  padding: 32px;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: margin-left .3s ease;
}

.main > * {
  width: 100%;
  max-width: 1280px;
}

/* ───────────────── CARDS ESTATÍSTICAS ───────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all .25s ease;
  box-shadow: var(--dash-shadow);
}

.stat-card:hover {
  box-shadow: var(--dash-shadow-lg);
  transform: translateY(-2px);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__icon--1 { background: var(--dash-stat-icon1); }
.stat-card__icon--2 { background: var(--dash-stat-icon2); }
.stat-card__icon--3 { background: var(--dash-stat-icon3); }
.stat-card__icon--4 { background: var(--dash-stat-icon4); }

.stat-card__icon svg {
  width: 22px;
  height: 22px;
}

.stat-card__icon--1 svg { color: var(--dash-accent); }
.stat-card__icon--2 svg { color: var(--dash-success); }
.stat-card__icon--3 svg { color: var(--dash-warning); }
.stat-card__icon--4 svg { color: #6b7280; }
[data-theme="dark"] .stat-card__icon--4 svg { color: #9ca3af; }

.stat-card__info {
  min-width: 0;
}

.stat-card__label {
  font-size: .78rem;
  color: var(--dash-text-muted);
  margin-bottom: 2px;
}

.stat-card__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dash-text);
  line-height: 1.2;
}

.stat-card__delta {
  font-size: .72rem;
  font-weight: 600;
  margin-top: 2px;
}

.stat-card__delta--up { color: var(--dash-success); }
.stat-card__delta--down { color: var(--dash-danger); }

/* ───────────────── PANEL / CARD CONTAINER ───────────────── */
.panel {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  box-shadow: var(--dash-shadow);
  transition: background .3s ease, border-color .3s ease;
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--dash-border);
  flex-wrap: wrap;
  gap: 12px;
}

.panel__title {
  font-size: 1rem;
  font-weight: 700;
}

.panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botões do dashboard */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: .82rem;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all .2s ease;
}

.dash-btn svg {
  width: 16px;
  height: 16px;
}

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

.dash-btn--outline {
  background: transparent;
  color: var(--dash-text-soft);
  border: 1px solid var(--dash-border);
}
.dash-btn--outline:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

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

.dash-btn--sm {
  padding: 5px 10px;
  font-size: .78rem;
  border-radius: 6px;
}

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

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.dash-table thead {
  background: var(--dash-bg);
}

.dash-table th {
  text-align: left;
  padding: 12px 20px;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--dash-text-muted);
  border-bottom: 1px solid var(--dash-border);
  white-space: nowrap;
}

.dash-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--dash-border);
  color: var(--dash-text-soft);
  vertical-align: middle;
}

.dash-table tbody tr {
  transition: background .15s ease;
}

.dash-table tbody tr:hover {
  background: var(--dash-row-hover);
}

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

.table__code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .82rem;
  color: var(--dash-accent);
  font-weight: 600;
}

.table__name {
  font-weight: 600;
  color: var(--dash-text);
}

.table__id {
  font-family: monospace;
  font-size: .8rem;
  color: var(--dash-text-muted);
}

/* Badge ativo/inativo */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--active {
  background: var(--dash-badge-active-bg);
  color: var(--dash-badge-active-text);
}

.badge--inactive {
  background: var(--dash-badge-inactive-bg);
  color: var(--dash-badge-inactive-text);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Ações da tabela */
.table__actions {
  display: flex;
  gap: 6px;
}

.table__action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--dash-border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  color: var(--dash-text-muted);
}

.table__action-btn:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

.table__action-btn--danger:hover {
  background: var(--dash-danger-bg);
  color: var(--dash-danger);
  border-color: transparent;
}

.table__action-btn svg {
  width: 15px;
  height: 15px;
}

/* Paginação */
.panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--dash-border);
  font-size: .82rem;
  color: var(--dash-text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination {
  display: flex;
  gap: 4px;
}

.pagination__btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--dash-border);
  border-radius: 6px;
  background: transparent;
  color: var(--dash-text-soft);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  transition: all .2s;
}

.pagination__btn:hover {
  background: var(--dash-sidebar-hov);
}

.pagination__btn--active {
  background: var(--dash-accent);
  color: #fff;
  border-color: var(--dash-accent);
}

.pagination__btn--active:hover {
  background: var(--dash-accent-hov);
}

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

/* ───────────────── OVERLAY SIDEBAR MOBILE ───────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 95;
  transition: opacity .3s ease;
}

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

/* ───────────────── Modal Configurar Menu (engrenagem) ───────────────── */
.menu-config-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.menu-config-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.menu-config-window {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--dash-surface);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

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

.menu-config-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dash-text);
  margin: 0;
}

.menu-config-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.menu-config-close:hover {
  background: var(--dash-row-hover);
  color: var(--dash-text);
}

.menu-config-close .material-symbols-outlined {
  font-size: 1.25rem;
}

.menu-config-filter-wrap {
  position: relative;
  padding: 16px 24px;
  border-bottom: 1px solid var(--dash-border);
}

.menu-config-filter-icon {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--dash-text-muted);
  pointer-events: none;
}

.menu-config-filter {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  background: var(--dash-bg);
  color: var(--dash-text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.menu-config-filter::placeholder {
  color: var(--dash-text-muted);
}

.menu-config-filter:focus {
  border-color: var(--dash-accent);
}

.menu-config-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--dash-bg);
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}

.menu-config-row--visible {
  border-color: var(--dash-success);
  background: var(--dash-success-bg);
}

.menu-config-row__icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--dash-text-soft);
}

.menu-config-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-config-row__label {
  font-weight: 500;
  font-size: .9rem;
  color: var(--dash-text);
}

.menu-config-row__desc {
  font-size: .75rem;
  color: var(--dash-text-muted);
}

.menu-config-pin {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.menu-config-pin:hover {
  background: var(--dash-row-hover);
  color: var(--dash-text);
}

.menu-config-pin--on {
  color: var(--dash-accent);
}

.menu-config-pin--on .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.menu-config-pin .material-symbols-outlined {
  font-size: 1.25rem;
}

.menu-config-hint {
  padding: 12px 24px 20px;
  margin: 0;
  font-size: .8rem;
  color: var(--dash-text-muted);
  border-top: 1px solid var(--dash-border);
}

/* ───────────────── Menu Drawer (esquerda) + Apresentação (direita) ───────────────── */
.user-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.user-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.user-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--dash-surface);
  border-right: 1px solid var(--dash-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 251;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .25s ease;
}

.user-drawer-overlay.is-open .user-drawer {
  transform: translateX(0);
}

.user-drawer__header {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--dash-border);
}

.user-drawer__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--dash-accent-bg);
  object-fit: cover;
  border: 2px solid var(--dash-border);
}

.user-drawer__avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--dash-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
}

.user-drawer__workspaces-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.user-drawer__workspaces-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dash-text-muted);
}

.user-drawer__workspace-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--dash-bg);
  border: 1px solid var(--dash-border);
}

.user-drawer__workspace-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dash-text);
}

.user-drawer__add-workspace {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--dash-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .05s;
}

.user-drawer__add-workspace:hover {
  background: var(--dash-accent-hov);
}

.user-drawer__add-workspace .material-symbols-outlined {
  font-size: 1.25rem;
}

.user-drawer__nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  margin: 12px 20px 0;
  border-radius: 16px;
  color: var(--dash-text-soft);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}

.user-drawer__nav-link:hover {
  background: var(--dash-row-hover);
  color: var(--dash-text);
}

.user-drawer__nav-link .material-symbols-outlined {
  font-size: 1.25rem;
}

/* Painel Apresentação (abre à esquerda, ao lado do Menu Drawer) */
.apresentacao-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.apresentacao-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.apresentacao-panel {
  position: fixed;
  top: 0;
  left: 320px;
  bottom: 0;
  width: 400px;
  max-width: calc(95vw - 320px);
  background: var(--dash-surface);
  border-right: 1px solid var(--dash-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 261;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .25s ease;
  padding: 24px;
}

.apresentacao-overlay.is-open .apresentacao-panel {
  transform: translateX(0);
}

.apresentacao-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.apresentacao-panel__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dash-text);
  margin: 0;
}

.apresentacao-panel__close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.apresentacao-panel__close:hover {
  background: var(--dash-row-hover);
  color: var(--dash-text);
}

.apresentacao-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.apresentacao-panel__text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dash-text);
  margin: 0;
}

.apresentacao-panel__cta {
  margin-top: auto;
  padding-top: 24px;
}

.apresentacao-panel__cta .md-filled-button,
.apresentacao-panel__cta .dash-btn--primary {
  width: 100%;
  justify-content: center;
  border-radius: 20px;
  padding: 14px 24px;
  font-size: 1rem;
}

/* ───────────────── Painel comercial (itens do menu sem página) ───────────────── */
.comercial-overlay {
  position: fixed;
  inset: 0;
  z-index: 270;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.comercial-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.comercial-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 96vw;
  background: var(--dash-surface);
  border-left: 1px solid var(--dash-border);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
  z-index: 271;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.comercial-overlay.is-open .comercial-panel {
  transform: translateX(0);
}

.comercial-panel__inner {
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100%;
}

.comercial-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: var(--dash-bg);
  color: var(--dash-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.comercial-panel__close:hover {
  background: var(--dash-row-hover);
  color: var(--dash-text);
}

.comercial-panel__close .material-symbols-outlined {
  font-size: 1.25rem;
}

.comercial-panel__hero {
  padding-top: 8px;
}

.comercial-panel__badge {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--dash-accent-bg) 0%, rgba(92, 124, 250, 0.15) 100%);
  color: var(--dash-accent);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comercial-panel__title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dash-text);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.comercial-panel__lead {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dash-text-soft);
  margin: 0;
}

.comercial-panel__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comercial-panel__features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9375rem;
  color: var(--dash-text);
  line-height: 1.4;
}

.comercial-panel__features .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--dash-accent);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.comercial-panel__cta-wrap {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--dash-border);
}

.comercial-panel__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--dash-accent) 0%, var(--dash-accent-hov) 100%);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(59, 91, 219, 0.35);
  transition: transform .15s ease, box-shadow .2s ease;
}

.comercial-panel__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 91, 219, 0.4);
}

.comercial-panel__cta .material-symbols-outlined {
  font-size: 1.25rem;
  transition: transform .2s ease;
}

.comercial-panel__cta:hover .material-symbols-outlined {
  transform: translateX(4px);
}

.comercial-panel__cta-hint {
  margin: 12px 0 0;
  font-size: .8125rem;
  color: var(--dash-text-muted);
  text-align: center;
}

[data-theme="dark"] .comercial-panel__cta {
  box-shadow: 0 4px 20px rgba(92, 124, 250, 0.25);
}

[data-theme="dark"] .comercial-panel__cta:hover {
  box-shadow: 0 8px 28px rgba(92, 124, 250, 0.35);
}

/* ───────────────── MODAL ───────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--dash-shadow-lg);
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal__title {
  font-size: 1rem;
  font-weight: 700;
}

.modal__close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--dash-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.modal__close:hover {
  background: var(--dash-sidebar-hov);
  color: var(--dash-text);
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__body {
  padding: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--dash-text);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--dash-bg);
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .88rem;
  color: var(--dash-text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--dash-accent);
  box-shadow: 0 0 0 3px var(--dash-accent-bg);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--dash-accent);
  cursor: pointer;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--dash-border);
}

/* Modal de aviso (popup do sistema) */
.modal--alert .modal__body {
  padding: 24px 24px 8px;
}

.modal-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  font-size: 1.1rem;
}

.modal-alert__message {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--dash-text);
}

.modal--alert .modal__footer {
  justify-content: center;
  padding: 20px 24px 24px;
}

.modal--alert .modal__footer .dash-btn {
  min-width: 120px;
}

/* ───────────────── TOAST / NOTIFICAÇÃO ───────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--dash-text);
  box-shadow: var(--dash-shadow-lg);
  animation: toastIn .3s ease;
  min-width: 260px;
}

.toast--success { border-left: 3px solid var(--dash-success); }
.toast--danger  { border-left: 3px solid var(--dash-danger); }
.toast--info    { border-left: 3px solid var(--dash-accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ───────────────── EMPTY STATE ───────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--dash-text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: .4;
}

.empty-state p {
  font-size: .92rem;
}

/* ───────────────── STAFF (API) ───────────────── */
.panel--staff {
  margin-top: 24px;
}

.panel__subtitle {
  font-size: .8rem;
  font-weight: 400;
  color: var(--dash-text-muted);
  margin-top: 4px;
}

.staff-wrap {
  padding: 0 24px 24px;
}

.staff-loading {
  padding: 24px;
  text-align: center;
  color: var(--dash-text-muted);
  font-size: .9rem;
}

.staff-content .table-wrap {
  margin-top: 0;
}

.staff-content pre {
  margin: 0;
  font-size: .8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.staff-error {
  padding: 16px 24px;
  background: var(--dash-danger-bg);
  color: var(--dash-danger);
  border-radius: 8px;
  font-size: .9rem;
}

/* ───────────────── EQUIPE — ações à direita na tabela ───────────────── */
.dash-table__actions-header {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.dash-table__actions-cell {
  text-align: right;
  white-space: nowrap;
}

.staff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-left: 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.staff-btn:hover {
  background: var(--dash-row-hover);
  color: var(--dash-text);
}

.staff-btn-delete:hover {
  color: var(--dash-danger, #dc3545);
}

.staff-btn svg {
  display: block;
}

/* ───────────────── RESPONSIVO ───────────────── */
@media (max-width: 1024px) {
  .topbar__search-input { width: 180px; }
}

@media (max-width: 768px) {
  .dash-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .topbar {
    left: 0;
  }

  .topbar__hamburger {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding: 24px 16px;
  }

  .topbar__search {
    display: none;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .panel__header {
    padding: 16px 18px;
  }

  .dash-table th,
  .dash-table td {
    padding: 10px 14px;
  }

  .panel__footer {
    padding: 12px 18px;
    font-size: .78rem;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px 12px;
  }

  .panel__actions {
    width: 100%;
  }

  .dash-btn span.btn-label { display: none; }
}
