/* ============================================================
   Gerencial JF Gráfica — Design System
   Paleta extraída da logo JF Print:
   Ciano   #26ACE2
   Magenta #EB068C
   Amarelo #FCE013
   Grafite #0B0D0E / #16181B
   ============================================================ */

:root {
  --cyan: #26ACE2;
  --magenta: #EB068C;
  --yellow: #FCE013;

  --cyan-dim: #1c85b3;
  --magenta-dim: #b2056b;
  --yellow-dim: #d9bd10;

  --ink: #23282b;

  /* Sidebar: cinza suave em degradê, com leves matizes das cores da logo */
  --sb-bg-1: #eef1f3;
  --sb-bg-2: #e6e9ec;
  --sb-bg-3: #eae3e8;
  --sb-bg-4: #ede8de;
  --sb-border: rgba(20, 24, 28, 0.08);
  --sb-hover: rgba(20, 24, 28, 0.045);
  --sb-active-surface: rgba(255, 255, 255, 0.72);
  --sb-tile-bg: rgba(255, 255, 255, 0.62);
  --sb-scrollbar: rgba(20, 24, 28, 0.16);

  --text-hi: #1b1f22;
  --text-mid: #565e64;
  --text-low: #8b939a;

  --bg-app: #f4f6f7;
  --bg-panel: #ffffff;
  --bg-panel-border: #e5e9eb;
  --text-body: #23282b;
  --text-muted: #6b7378;

  --sidebar-w: 292px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-soft: 0 8px 24px rgba(11, 13, 14, 0.06);
  --shadow-panel: 0 1px 2px rgba(11, 13, 14, 0.04), 0 12px 32px rgba(11, 13, 14, 0.06);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-app);
  color: var(--text-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Layout shell ---------------- */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  background: linear-gradient(165deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 32%, var(--sb-bg-3) 64%, var(--sb-bg-4) 100%);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  transition: width 0.28s var(--ease);
  position: relative;
  z-index: 20;
}

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

/* Brand / logo zone */

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
}

.sidebar__brand img.brand-logo-full {
  height: 46px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(20, 24, 28, 0.12));
  transition: opacity 0.15s var(--ease);
}

.sidebar__brand img.brand-logo-icon {
  height: 34px;
  width: auto;
  flex-shrink: 0;
  display: none;
  filter: drop-shadow(0 2px 5px rgba(20, 24, 28, 0.12));
}

.sidebar.collapsed .sidebar__brand {
  padding: 18px 8px 16px;
  min-height: 96px;
}

.sidebar.collapsed .sidebar__brand img.brand-logo-full {
  display: none;
}

.sidebar.collapsed .sidebar__brand img.brand-logo-icon {
  display: block;
}

.sidebar__brand-sub {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--cyan-dim), var(--magenta-dim) 60%, var(--yellow-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.15s var(--ease);
}

.sidebar.collapsed .sidebar__brand-sub {
  opacity: 0;
  height: 0;
  pointer-events: none;
}

/* Collapse toggle button */

.sidebar__toggle {
  position: absolute;
  top: 22px;
  right: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  border: 2px solid var(--bg-app);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transition: transform 0.28s var(--ease);
  box-shadow: 0 2px 8px rgba(20, 24, 28, 0.22);
}

.sidebar__toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.28s var(--ease);
}

.sidebar.collapsed .sidebar__toggle svg {
  transform: rotate(180deg);
}

.sidebar__toggle:hover {
  filter: brightness(1.06);
}

/* Nav scroll area */

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 24px;
}

.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: var(--sb-scrollbar);
  border-radius: 10px;
}
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }

.nav-section {
  margin-bottom: 6px;
}

.nav-section__label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-low);
  padding: 16px 10px 8px;
  white-space: nowrap;
  transition: opacity 0.15s var(--ease);
}

.sidebar.collapsed .nav-section__label {
  opacity: 0;
  height: 0;
  padding: 8px 0 0;
  overflow: hidden;
}

/* Group (accordion) */

.nav-group {
  margin-bottom: 3px;
}

.nav-group__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  background: transparent;
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
  position: relative;
}

.nav-group__head:hover {
  background: var(--sb-hover);
  color: var(--text-hi);
}

.nav-group.open > .nav-group__head {
  color: var(--text-hi);
  background: var(--sb-active-surface);
  box-shadow: 0 1px 2px rgba(20, 24, 28, 0.05);
}

.nav-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sb-tile-bg);
  box-shadow: 0 1px 2px rgba(20, 24, 28, 0.05);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.nav-group__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group__chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-low);
  transition: transform 0.22s var(--ease);
}

.nav-group.open > .nav-group__head .nav-group__chevron {
  transform: rotate(90deg);
  color: var(--text-hi);
}

.sidebar.collapsed .nav-group__label,
.sidebar.collapsed .nav-group__chevron {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

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

/* Submenu */

.nav-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.26s var(--ease);
}

.nav-group.open > .nav-sub {
  max-height: 520px;
}

.sidebar.collapsed .nav-sub {
  display: none;
}

.nav-sub__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 46px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-low);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-sub__item::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-low);
  transform: translateY(-50%);
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.nav-sub__item:hover {
  background: var(--sb-hover);
  color: var(--text-hi);
}

.nav-sub__item.active {
  color: var(--text-hi);
  font-weight: 600;
  background: var(--sb-active-surface);
  box-shadow: 0 1px 2px rgba(20, 24, 28, 0.05);
}

.nav-sub__item.active::before {
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 0 3px rgba(235, 6, 140, 0.18);
}

/* Flat item (Administrador links, no submenu) */

.nav-flat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  background: transparent;
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-flat:hover {
  background: var(--sb-hover);
  color: var(--text-hi);
}

.nav-flat.active {
  color: var(--text-hi);
  background: var(--sb-active-surface);
  box-shadow: 0 1px 2px rgba(20, 24, 28, 0.05);
}

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

.sidebar.collapsed .nav-flat span.label-text {
  opacity: 0;
  width: 0;
}

/* Item "Início" em destaque no topo do menu */

.nav-section--home {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sb-border);
}

.nav-home {
  font-size: 14px;
}

.nav-home .nav-icon {
  background: var(--sb-active-surface);
}

/* ---------------- Welcome / Início ---------------- */

.welcome-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.welcome-hero {
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 44px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(38, 172, 226, 0.08), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(235, 6, 140, 0.08), transparent 40%),
    radial-gradient(circle at 95% 5%, rgba(252, 224, 19, 0.10), transparent 35%);
  pointer-events: none;
}

.welcome-hero__icon {
  width: 64px;
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 10px rgba(20, 24, 28, 0.14));
  position: relative;
}

.welcome-hero h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-body);
  margin: 0 0 12px;
  position: relative;
}

.welcome-hero p {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.65;
  margin: 0;
  position: relative;
}

.welcome-hero .crumb-mini {
  position: relative;
  margin-bottom: 6px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.welcome-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.welcome-card:hover {
  transform: translateY(-2px);
  border-color: rgba(38, 172, 226, 0.35);
  box-shadow: 0 10px 24px -8px rgba(20, 24, 28, 0.16);
}

.welcome-card__icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.welcome-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-body);
}

.welcome-card__sub {
  font-size: 12px;
  color: var(--text-muted);
}

.welcome-card__arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* Sidebar footer */

.sidebar__footer {
  padding: 14px 18px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar__footer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), var(--magenta) 55%, var(--yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #101214;
  font-weight: 800;
  font-size: 13px;
}

.sidebar__footer-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  transition: opacity 0.15s var(--ease);
}

.sidebar.collapsed .sidebar__footer-text {
  opacity: 0;
  width: 0;
}

.sidebar__footer-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-hi);
}

.sidebar__footer-role {
  font-size: 10.5px;
  color: var(--text-low);
}

.sidebar__footer-text {
  flex: 1;
  min-width: 0;
}

.sidebar__footer-name,
.sidebar__footer-role {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__logout {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  border: none;
  background: var(--sb-tile-bg);
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sidebar__logout:hover {
  background: rgba(235, 6, 140, 0.12);
  color: var(--magenta-dim);
}

.sidebar__logout svg {
  width: 15px;
  height: 15px;
}

.sidebar.collapsed .sidebar__logout {
  display: none;
}

/* ---------------- Boot loading ---------------- */

.boot-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: calc(100vh - var(--topbar-h) - 70px - 40px);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
}

.boot-loading__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--bg-panel-border);
  border-top-color: var(--magenta);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Main column ---------------- */

.main-col {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--bg-panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 16px;
}

.topbar__crumb {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar__crumb-path {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__crumb-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar__pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(38, 172, 226, 0.10), rgba(235, 6, 140, 0.10));
  border: 1px solid rgba(38, 172, 226, 0.18);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-body);
  white-space: nowrap;
}

.topbar__pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.topbar__user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), var(--magenta) 55%, var(--yellow));
  color: #101214;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar__user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-body);
}

.topbar__user-role {
  font-size: 10.5px;
  color: var(--text-muted);
}

.topbar__icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--bg-panel-border);
  background: #fafbfb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.topbar__icon-btn:hover {
  background: var(--bg-app);
  color: var(--text-body);
}

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

/* ---------------- Content area ---------------- */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 30px 32px 40px;
}

.page {
  display: none;
  animation: fadeUp 0.35s var(--ease);
}

.page.active {
  display: block;
}

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

.construction-panel {
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  min-height: calc(100vh - var(--topbar-h) - 70px - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  position: relative;
  overflow: hidden;
}

.construction-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(38, 172, 226, 0.07), transparent 40%),
    radial-gradient(circle at 88% 90%, rgba(235, 6, 140, 0.07), transparent 40%),
    radial-gradient(circle at 90% 8%, rgba(252, 224, 19, 0.08), transparent 35%);
  pointer-events: none;
}

.construction-badge {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--magenta) 55%, var(--yellow) 100%);
  box-shadow: 0 14px 30px -8px rgba(235, 6, 140, 0.35);
}

.construction-badge svg {
  width: 40px;
  height: 40px;
  color: #fff;
}

.construction-panel h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-body);
  margin: 0 0 8px;
  position: relative;
}

.construction-panel .crumb-mini {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--cyan-dim), var(--magenta-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
  position: relative;
}

.construction-panel p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.6;
  margin: 0 0 26px;
  position: relative;
}

.construction-progress {
  width: 220px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-app);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--bg-panel-border);
}

.construction-progress > span {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--yellow));
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.construction-tag {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--magenta-dim);
  background: rgba(235, 6, 140, 0.08);
  border: 1px solid rgba(235, 6, 140, 0.18);
  padding: 6px 14px;
  border-radius: 999px;
  position: relative;
}

/* ---------------- Admin: painel base ---------------- */

.admin-panel {
  background: var(--bg-panel);
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 32px 36px 36px;
}

.admin-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.admin-panel__head h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-body);
  margin: 2px 0 6px;
}

.admin-panel__head p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  max-width: 480px;
}

.admin-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
}

.admin-btn--primary {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  color: #fff;
}

.admin-btn--primary:hover { filter: brightness(1.06); }

.admin-btn--ghost {
  background: var(--bg-app);
  border-color: var(--bg-panel-border);
  color: var(--text-body);
}

.admin-btn--ghost:hover { background: #eceff1; }

.admin-btn--danger {
  background: rgba(235, 6, 140, 0.08);
  border-color: rgba(235, 6, 140, 0.22);
  color: var(--magenta-dim);
}

.admin-btn--danger:hover { background: rgba(235, 6, 140, 0.14); }

.admin-btn:disabled { opacity: 0.6; cursor: default; }

/* Tabela de usuários */

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  background: var(--bg-app);
  padding: 12px 16px;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--bg-panel-border);
  color: var(--text-body);
  vertical-align: middle;
}

.admin-table__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-table__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 16px !important;
}

.admin-table__empty--error {
  color: var(--magenta-dim);
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.admin-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta) 55%, var(--yellow));
  color: #101214;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.badge--admin { background: rgba(235, 6, 140, 0.10); color: var(--magenta-dim); }
.badge--user { background: rgba(38, 172, 226, 0.10); color: var(--cyan-dim); }
.badge--on { background: rgba(34, 160, 90, 0.10); color: #1c8a52; }
.badge--off { background: rgba(120, 128, 134, 0.12); color: var(--text-muted); }

/* Modal / formulário */

.admin-form-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.42);
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}

.admin-form-overlay.open { display: flex; }

.admin-form {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(11, 13, 14, 0.35);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-form h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text-body);
}

.admin-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-form__field input,
.admin-form__field select {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-panel-border);
  background: var(--bg-app);
  color: var(--text-body);
}

.admin-form__field input:disabled {
  opacity: 0.6;
}

.admin-form__field input:focus,
.admin-form__field select:focus {
  outline: none;
  border-color: var(--cyan);
}

.admin-form__message {
  font-size: 12.5px;
  font-weight: 600;
  min-height: 16px;
}

.admin-form__message--ok { color: #1c8a52; }
.admin-form__message--error { color: var(--magenta-dim); }

.admin-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Telas de Acesso */

.access-filter {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--bg-panel-border);
}

.access-filter__select {
  min-width: 280px;
  flex: 1;
}

.access-filter__bulk {
  display: flex;
  gap: 8px;
}

.access-admin-notice {
  background: rgba(38, 172, 226, 0.08);
  border: 1px solid rgba(38, 172, 226, 0.2);
  color: var(--cyan-dim);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 600;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.access-group {
  border: 1px solid var(--bg-panel-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-app);
}

.access-group__title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-body);
  margin-bottom: 10px;
}

.access-group__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.access-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-body);
  cursor: pointer;
}

.access-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--magenta);
}

.access-save-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ---------------- Login ---------------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(165deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 32%, var(--sb-bg-3) 64%, var(--sb-bg-4) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(11, 13, 14, 0.22);
  padding: 40px 36px 34px;
  text-align: center;
}

.login-card img {
  height: 56px;
  width: auto;
  margin: 0 auto 10px;
  filter: drop-shadow(0 3px 8px rgba(20, 24, 28, 0.14));
}

.login-card .crumb-mini {
  margin-bottom: 22px;
}

.login-card h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-body);
  margin: 0 0 22px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.login-form label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form input {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-panel-border);
  background: var(--bg-app);
  color: var(--text-body);
}

.login-form input:focus {
  outline: none;
  border-color: var(--cyan);
}

.login-submit {
  margin-top: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transition: filter 0.15s var(--ease);
}

.login-submit:hover { filter: brightness(1.06); }
.login-submit:disabled { opacity: 0.65; cursor: default; }

.login-forgot {
  text-align: center;
  margin-top: 16px;
  font-size: 12.5px;
}

.login-forgot a {
  color: var(--cyan-dim);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.login-forgot a:hover { text-decoration: underline; }

.login-message {
  font-size: 12.5px;
  font-weight: 600;
  min-height: 16px;
  text-align: center;
  margin-top: 4px;
}

.login-message--error { color: var(--magenta-dim); }
.login-message--ok { color: #1c8a52; }

/* ---------------- Overlay (mobile) ---------------- */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 14, 0.5);
  z-index: 15;
}

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

/* ---------------- Responsive ---------------- */

@media (max-width: 920px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: var(--sidebar-w);
  }
  .main-col { width: 100%; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 30px; }
  .admin-panel { padding: 22px 18px 26px; }
  .admin-panel__head { flex-direction: column; }
  .access-filter { flex-direction: column; align-items: stretch; }
  .login-card { padding: 32px 22px 28px; }
}

@media (max-width: 560px) {
  .topbar__right { gap: 8px; }
  .topbar__user-text { display: none; }
}
