:root {
  --tree-dark: #0f3d2e;
  --tree: #1f7a4d;
  --bg: #f6f8f7;
}

body {
  background: var(--bg);
  color: #111827;
}

.login-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31,122,77,.12), transparent 40%),
    radial-gradient(circle at bottom right, rgba(15,61,46,.14), transparent 40%),
    #f4f7f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.05);
}

.login-card h1 {
  font-weight: 700;
  margin-top: 14px;
}

.brand-mark,
.brand-logo-shell {
  background: linear-gradient(135deg, var(--tree-dark), var(--tree));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(31,122,77,.16);
}

.brand-mark {
  width: 68px;
  height: 68px;
  border-radius: 22px;
}

.brand-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.app-navbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #edf2f7;
  box-shadow: 0 4px 18px rgba(15,23,42,.03);
}

.brand-logo-shell {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.navbar-tree-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.navbar-brand {
  color: #111827 !important;
}

.navbar-brand small {
  font-size: 12px;
}

#btnLogout {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  transition: .18s ease;
}

#btnLogout:hover {
  transform: translateY(-1px);
  background: #f3f4f6;
}

.hero-card {
  background: linear-gradient(135deg, var(--tree-dark), var(--tree));
  color: #fff;
  border-radius: 26px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 14px 36px rgba(31,122,77,.18);
}

.hero-card h2 {
  margin: 0;
  font-weight: 700;
}

.hero-card p {
  margin: 4px 0 0;
  opacity: .88;
}

.soft-card {
  border: none;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.03);
}

.btn-tree {
  background: linear-gradient(135deg, var(--tree-dark), var(--tree));
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  transition: .18s ease;
}

.btn-tree:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31,122,77,.18);
}

.form-control,
.form-select {
  border-radius: 5px;
  border-color: #e5e7eb;
  min-height: 44px;
}

.form-control-sm,
.form-select-sm {
  min-height: 34px;
  border-radius: 5px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tree);
  box-shadow: 0 0 0 4px rgba(31,122,77,.12);
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  background: #f8faf9;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 14px;
}

.badge-soft {
  background: rgba(31,122,77,.10);
  color: var(--tree);
  border: 1px solid rgba(31,122,77,.12);
  font-weight: 500;
}

.btn-icon-action {
  border: none;
  background: transparent;
  padding: 4px 6px;
  line-height: 1;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  transition: all .15s ease;
  cursor: pointer;
}

.btn-icon-action:hover {
  background: rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.empresas-table-wrapper,
.filiais-table-wrapper,
.usuarios-table-wrapper {
  width: 100%;
  overflow-x: hidden;
}

.empresas-table,
.filiais-table,
.usuarios-table {
  width: 100%;
  table-layout: fixed;
}

.empresas-table th,
.empresas-table td,
.filiais-table th,
.filiais-table td,
.usuarios-table th,
.usuarios-table td {
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 14px;
}

.empresas-table .badge,
.filiais-table .badge,
.usuarios-table .badge {
  margin-bottom: 4px;
}

.empresas-table th:nth-child(1),
.empresas-table td:nth-child(1),
.filiais-table th:nth-child(1),
.filiais-table td:nth-child(1) { width: 40px; }

.empresas-table th:nth-child(2),
.empresas-table td:nth-child(2),
.filiais-table th:nth-child(2),
.filiais-table td:nth-child(2) { width: 14%; }

.empresas-table th:nth-child(3),
.empresas-table td:nth-child(3),
.filiais-table th:nth-child(3),
.filiais-table td:nth-child(3) { width: 24%; }

.empresas-table th:nth-child(4),
.empresas-table td:nth-child(4),
.filiais-table th:nth-child(4),
.filiais-table td:nth-child(4) { width: 16%; }

.empresas-table th:nth-child(5),
.empresas-table td:nth-child(5),
.filiais-table th:nth-child(5),
.filiais-table td:nth-child(5) {
  width: 10%;
  text-align: center;
}

.empresas-table th:nth-child(6),
.empresas-table td:nth-child(6),
.filiais-table th:nth-child(6),
.filiais-table td:nth-child(6) { width: 24%; }

.empresas-table th:nth-child(7),
.empresas-table td:nth-child(7),
.filiais-table th:nth-child(7),
.filiais-table td:nth-child(7) {
  width: 12%;
  text-align: center;
}

.usuarios-table th:nth-child(1),
.usuarios-table td:nth-child(1) { width: 40px; }
.usuarios-table th:nth-child(2),
.usuarios-table td:nth-child(2) { width: 22%; }
.usuarios-table th:nth-child(3),
.usuarios-table td:nth-child(3) { width: 24%; }
.usuarios-table th:nth-child(4),
.usuarios-table td:nth-child(4) { width: 18%; }
.usuarios-table th:nth-child(5),
.usuarios-table td:nth-child(5) {
  width: 10%;
  text-align: center;
}
.usuarios-table th:nth-child(6),
.usuarios-table td:nth-child(6) {
  width: 12%;
  text-align: center;
}
.usuarios-table th:nth-child(7),
.usuarios-table td:nth-child(7) { width: 14%; }

@media (max-width: 768px) {
  .hero-card { flex-direction: column; align-items: flex-start; }
  .module-grid { grid-template-columns: 1fr; }
}
