:root {
  --acr-navy: #12122b;
  --acr-indigo: #6d75e0;
  --acr-indigo-dark: #5a62c9;
  --acr-green: #22c58b;
  --acr-text: #2f3542;
  --acr-muted: #8a94a6;
  --acr-border: #e7e9ee;
  --acr-bg: #f5f6f9;
  --acr-card-bg: #ffffff;
  --acr-radius: 6px;
  --acr-font: "Segoe UI", Leelawadee, Ebrima, Verdana, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--acr-font);
  color: var(--acr-text);
  background: var(--acr-bg);
}

a {
  color: var(--acr-indigo-dark);
  text-decoration: none !important;
}

/* Dropdowns (perfil, Security, Registrations) sempre por cima de qualquer
   botao flutuante da pagina (ex: aba de recolher menu do relatorio). */
.dropdown-menu {
  z-index: 2000 !important;
}

/* ---- Header / shell nav (tema "acr" - reaproveitado em todas as telas) ---- */
.acr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--acr-border);
  padding: 0 24px;
  height: 64px;
}

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

.acr-brand img {
  height: 32px;
  display: block;
}

.acr-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.acr-nav li a {
  color: #4b5563;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.acr-nav li a:hover {
  color: var(--acr-indigo-dark);
}

.acr-header-icons {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #6b7280;
}

.acr-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Perfil (dropdown com Alterar senha / Sair) ---- */
.acr-profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 4px;
  border-radius: 20px;
  cursor: pointer;
}

.acr-profile-btn:hover {
  background: var(--acr-bg);
}

.acr-profile-btn .fa-chevron-down {
  font-size: 10px;
  color: #9aa2b1;
}

/* ---- Nav responsivo (mobile) ---- */
.acr-nav-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--acr-text);
  padding: 6px 10px;
  cursor: pointer;
}

.acr-nav-collapse {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  margin-left: 24px;
}

@media (max-width: 860px) {
  .acr-header {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    padding: 10px 16px;
  }

  .acr-nav-toggle {
    display: block;
  }

  .acr-nav-collapse {
    margin-left: 0;
  }

  .acr-nav-collapse.collapse:not(.show) {
    display: none !important;
  }

  .acr-nav-collapse.collapse.show {
    display: flex !important;
  }

  .acr-nav-collapse {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--acr-border);
    margin-top: 10px;
  }

  .acr-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
  }

  .acr-nav .dropdown-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    border: none;
    padding-left: 20px;
  }

  .acr-header-icons {
    width: 100%;
    justify-content: space-between;
  }

  /* Cadastro lista+detalhe empilha verticalmente no mobile */
  body:has(.crud-shell) {
    overflow: auto !important;
  }

  .crud-shell {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 64px);
  }

  .crud-list {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--acr-border);
  }

  .crud-list-items {
    max-height: 320px;
  }
}

/* ---- Content area ---- */
.acr-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.acr-content h1 {
  font-size: 26px;
  margin-bottom: 20px;
}

.acr-report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--acr-border);
  border-radius: var(--acr-radius);
  overflow: hidden;
}

.acr-report-list li a {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--acr-border);
  color: var(--acr-indigo-dark);
}

.acr-report-list li:last-child a {
  border-bottom: none;
}

.acr-report-list li a:hover {
  background: var(--acr-bg);
}

/* ---- Cards de relatorios (dashboard) ---- */
.acr-report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.acr-report-card {
  display: block;
  background: #fff;
  border: 1px solid var(--acr-border);
  border-left: 4px solid var(--acr-indigo);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.acr-report-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.acr-report-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--acr-text);
}

.acr-report-card-empresa {
  font-size: 12px;
  color: var(--acr-muted);
  margin-top: 4px;
}

/* ---- Login ---- */
.acr-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 8vw;
  background-image: url("/assets/login-cover.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.acr-login-card {
  width: 340px;
  background: var(--acr-card-bg);
  border-radius: var(--acr-radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  padding: 28px 26px;
}

.acr-login-card h2 {
  margin: 0 0 20px;
  font-size: 22px;
}

.acr-field {
  margin-bottom: 14px;
}

.acr-field label {
  display: block;
  font-size: 13px;
  color: var(--acr-muted);
  margin-bottom: 4px;
}

.acr-field input,
.acr-field select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--acr-border);
  border-radius: 4px;
  background: #f2f3f6;
  font-size: 14px;
}

.acr-btn {
  display: inline-block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 4px;
  background: #4ec9b0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.acr-btn:hover {
  filter: brightness(0.95);
}

.acr-login-links {
  margin-top: 12px;
  font-size: 13px;
}

/* ---- Generic grid (admin CRUD pages: users, groups, apps, empresas...) ---- */
.acr-grid-titlebar {
  background: var(--acr-indigo);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.acr-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.acr-grid-toolbar .acr-new-btn {
  background: var(--acr-green);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
}

.acr-grid-toolbar .acr-search {
  border: 1px solid var(--acr-border);
  border-radius: 20px;
  padding: 8px 16px;
  width: 320px;
}

.acr-grid-toolbar .acr-export-btn {
  background: #eef0f4;
  border: 1px solid var(--acr-border);
  border-radius: 4px;
  padding: 9px 14px;
  cursor: pointer;
}

table.acr-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

table.acr-table th {
  text-align: left;
  font-size: 13px;
  color: var(--acr-muted);
  border-bottom: 1px solid var(--acr-border);
  padding: 12px 24px;
}

table.acr-table td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--acr-border);
  font-size: 14px;
}

.acr-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
}

.acr-pagination button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--acr-muted);
}

.acr-pagination button.active {
  background: var(--acr-indigo);
  color: #fff;
}

/* ---- Client dashboard (generico, tema ACR reaproveitado p/ todos os clientes) ---- */
.acr-dashboard-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--acr-border);
}

.acr-dashboard-filters .acr-field {
  margin: 0;
  min-width: 120px;
}

.acr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding: 24px;
}

.acr-card {
  background: #fff;
  border: 1px solid var(--acr-border);
  border-radius: var(--acr-radius);
  padding: 16px;
}

.acr-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--acr-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.acr-stat {
  font-size: 28px;
  font-weight: 700;
}

/* ---- Modal (New/Edit cadastros) ---- */
.acr-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 43, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.acr-modal {
  width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--acr-radius);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.acr-modal h3 {
  margin: 0 0 16px;
}

.acr-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.acr-modal-actions .acr-btn-secondary {
  flex: 1;
  background: #eef0f4;
  color: var(--acr-text);
  border: none;
  border-radius: 4px;
  padding: 10px 14px;
  cursor: pointer;
}

.acr-modal-actions .acr-btn {
  flex: 1;
}

/* ---- Cadastro em lista + painel de detalhe (estilo "list + drawer") ---- */
.crud-shell {
  display: flex;
  height: calc(100vh - 64px);
  background: #fff;
}

.crud-list {
  width: 440px;
  min-width: 340px;
  border-right: 1px solid var(--acr-border);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.crud-list-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--acr-border);
}

.crud-list-header h1 {
  font-size: 22px;
  margin: 0 0 2px;
}

.crud-list-header p {
  color: var(--acr-muted);
  font-size: 13px;
  margin: 0 0 14px;
}

.crud-list-search {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--acr-border);
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 10px;
}

.crud-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crud-pill {
  border: 1px solid var(--acr-border);
  background: #f5f6f9;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--acr-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.crud-pill .badge {
  background: #e2e4ea;
  color: var(--acr-text);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

.crud-pill.active {
  background: var(--acr-indigo);
  border-color: var(--acr-indigo);
  color: #fff;
}

.crud-pill.active .badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.crud-list-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.crud-item {
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
}

.crud-item:hover {
  background: var(--acr-bg);
}

.crud-item.active {
  background: #eef0fd;
  border-color: var(--acr-indigo);
}

.crud-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.crud-item-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.crud-item-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crud-item-sub {
  font-size: 12px;
  color: var(--acr-muted);
}

.crud-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fbfbfd;
}

.crud-detail-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acr-muted);
  font-size: 14px;
  flex-direction: column;
  gap: 10px;
}

.crud-detail-header {
  padding: 18px 28px;
  border-bottom: 1px solid var(--acr-border);
  background: #fff;
}

.crud-detail-header .eyebrow {
  font-size: 12px;
  color: var(--acr-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.crud-detail-header h2 {
  font-size: 19px;
  margin: 2px 0 8px;
}

.crud-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--acr-border);
}

.crud-tab-btn {
  border: none;
  background: none;
  padding: 12px 6px;
  font-size: 14px;
  color: var(--acr-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-right: 18px;
}

.crud-tab-btn.active {
  color: var(--acr-indigo-dark);
  border-bottom-color: var(--acr-indigo);
  font-weight: 600;
}

.crud-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.crud-form-compact {
  max-width: 640px;
}

.crud-form-compact .form-label {
  margin-bottom: 4px;
  font-size: 13px;
}

.crud-form-compact .form-text {
  font-size: 12px;
}

.crud-detail-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--acr-border);
  background: #fff;
  display: flex;
  gap: 10px;
}

.crud-tab-pane {
  display: none;
}

.crud-tab-pane.active {
  display: block;
}
