:root {
  --sidebar-bg: #081c36;
  --sidebar-bg-2: #0c2648;
  --sidebar-hover: #14335c;
  --sidebar-active: linear-gradient(90deg, #1b6ef3 0%, #1558c7 100%);
  --sidebar-text: #e2eaf6;
  --sidebar-muted: #7f97b8;

  --bg-page: #f1f5fa;
  --bg-card: #ffffff;
  --border-soft: #e2e8f2;

  --text-main: #152238;
  --text-secondary: #5c6f8c;
  --text-muted: #8696ae;

  --blue-primary: #1b6ef3;
  --blue-dark: #124ec2;
  --blue-soft: #e8f1ff;

  --orange-accent: #f28c38;
  --green-success: #16a34a;
  --green-soft: #dcfce7;
  --amber-warn: #d97706;
  --amber-soft: #fef3c7;
  --red-danger: #dc2626;
  --red-soft: #fee2e2;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 18px rgba(15, 37, 68, 0.05);
}

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

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 14px;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* Sidebar */
.sidebar {
  width: 248px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  flex-shrink: 0;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2575fc 0%, #f59e42 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 21px;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-top: 2px;
}

.menu-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 16px 10px 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(27, 110, 243, 0.35);
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-chevron {
  font-size: 15px;
  color: var(--sidebar-muted);
}

.nav-link.active .nav-chevron {
  color: #ffffff;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 14px 4px 4px;
}

.tenant-box {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 12px;
}

.tenant-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tenant-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.tenant-caption {
  font-size: 10.5px;
  color: var(--sidebar-muted);
}

.tenant-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 1px;
}

.status-pill {
  display: inline-block;
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
}

.tenant-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Área principal */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.topbar-company-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.topbar-company-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.topbar-company-doc {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafd;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 7px 12px;
  width: 250px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--text-main);
  width: 100%;
}

.kbd-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

.notif-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f8fafd;
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -2px;
  background: var(--red-danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafd;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  font-size: 12.5px;
  font-weight: 600;
}

.user-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.content-area {
  flex: 1;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Banner superior no estilo do mockup */
.module-hero {
  background: linear-gradient(105deg, #123b7a 0%, #1a67e8 48%, #e5883b 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(18, 59, 122, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.module-hero-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.module-hero h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.module-hero p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 4px;
}

.hero-stat-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: right;
}

.hero-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

/* Grids e cards */
.grid-2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  align-items: start;
}

.card,
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card h2,
.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

/* Formulário */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input,
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d5dfed;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-control:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(27, 110, 243, 0.14);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: var(--blue-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-em-uso-agora {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: #ffffff;
  border: 1px solid #1e40af;
  border-radius: var(--radius-sm);
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(23, 37, 84, 0.28);
  line-height: 1.3;
  white-space: nowrap;
}

/* Tabelas */
table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-soft);
  background: #f8fafd;
}

td {
  padding: 11px 10px;
  border-bottom: 1px solid #eef2f7;
  color: var(--text-main);
  vertical-align: middle;
}

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

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

.id-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue-primary);
  background: var(--blue-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Flash messages */
.flash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}

/* Rodapé */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-soft);
  padding: 11px 24px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-success);
  margin-right: 4px;
}

@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 190px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .topbar {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .search-box {
    display: none;
  }
}


/* Fonte maior e legível nos botões principais sem afetar ícones pequenos */
button:not(.notif-btn),
.btn,
a.btn {
  font-size: 18px !important;
  font-weight: 700;
  line-height: 1.25;
}
.repor-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.repor-input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid #d5dfed;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.repor-input:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(27, 110, 243, 0.14);
}

.btn-repor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--blue-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-repor:hover {
  background: var(--blue-dark);
}

/* Rolagem interna para listas com 10+ cadastros */
.table-wrap.scroll-limite-10,
.table-responsive.scroll-limite-10 {
  max-height: 460px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.table-wrap.scroll-limite-10 thead th,
.table-responsive.scroll-limite-10 thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafd;
  box-shadow: inset 0 -1px 0 var(--border-soft);
}
