*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #FF4263;
  --dark:   #004D68;
  --dark2:  #002D3D;
  --light:  #EEF3F6;
  --muted:  #3A5566;
  --border: #D8E4EC;
  --white:  #FFFFFF;
  --sidebar-w: 250px;
}

body {
  font-family: 'Segoe UI', 'Noto Color Emoji', system-ui, sans-serif;
  background: var(--light);
  color: var(--dark2);
  min-height: 100vh;
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--white);
  text-decoration: none;
}
.logo span { color: var(--red); }
.logo .suffix { color: #A8C8D8; font-weight: 400; letter-spacing: 0; }

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  border-radius: 20px;
  background: var(--light);
}
.user-chip-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 0.2rem;
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--dark2);
}

.btn {
  padding: 0.4rem 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
  display: inline-block;
}

.btn-with-spinner { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-with-spinner:disabled { cursor: default; opacity: 0.85; }

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--red); color: var(--white); }
.btn-ghost   { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost.active, .btn-ghost:hover { background: var(--light); color: var(--dark2); opacity: 1; }

/* ── APP SHELL ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--dark2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo {
  display: block;
  text-decoration: none;
  line-height: 0;
}
.sidebar-logo img {
  max-width: 100%;
  height: auto;
  display: block;
}

.chip-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--dark2);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}
.chip-icon-btn:hover { background: rgba(0,0,0,.06); }

/* ── SELETOR DE IDIOMA ──
   Dropdown customizado (SVG, não emoji) em vez de <select> nativo - o
   Windows/Chrome não desenha bandeira em emoji dentro de <option>, mostra
   só o código do país (BR/ES). SVG fica idêntico em qualquer navegador. */
.lang-switch { position: relative; }
.lang-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: var(--dark2);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  border-radius: 20px;
  cursor: pointer;
}
.lang-switch-btn:hover { background: rgba(0,0,0,.06); }
.lang-switch-chevron { font-size: 0.6rem; color: var(--muted); }
.lang-flag { border-radius: 2px; flex-shrink: 0; display: block; }

.lang-switch-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 150px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  z-index: 30;
  padding: 0.35rem;
}
.lang-switch-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--dark2);
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.lang-switch-option:hover { background: var(--light); }
.lang-switch-option.active { background: var(--light); font-weight: 700; }

/* ── NOTIFICAÇÕES (sino, painel, toast) ── */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 20px;
  background: var(--red);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  z-index: 30;
}
.notif-panel-title {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark2);
  border-bottom: 1px solid var(--border);
}
.notif-panel-list { display: flex; flex-direction: column; }
.notif-item {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item-unread { background: #F0F7FB; }
.notif-item-message { color: var(--dark2); line-height: 1.4; }
.notif-item-time { color: var(--muted); font-size: 0.7rem; margin-top: 0.2rem; }
.notif-empty { padding: 1.5rem 1rem; text-align: center; font-size: 0.8rem; color: var(--muted); }

.toast-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 200;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--red);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(255,66,99,.35);
  font-size: 0.82rem;
  max-width: 340px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { flex-shrink: 0; }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
}

.sidebar-group { margin-bottom: 0.25rem; }

.sidebar-group summary {
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #A8C8D8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  border-radius: 4px;
}
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary:hover { background: rgba(255,255,255,.06); }
.sidebar-group[open] summary { color: var(--white); }

.sidebar-group-label { display: flex; align-items: center; gap: 0.4rem; }

.sidebar-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.15s;
}
.sidebar-group[open] .sidebar-group-chevron { transform: rotate(90deg); }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem 0.5rem 1.5rem;
  border-radius: 4px;
  color: #A8C8D8;
  text-decoration: none;
  font-size: 0.83rem;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.sidebar-link.active { background: var(--red); color: var(--white); }
.sidebar-link-icon { font-size: 0.9rem; }

/* ── MAIN AREA ── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 56px;
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
}
.search-icon { font-size: 0.8rem; opacity: 0.6; }
.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--dark2);
  font-family: inherit;
}
.search-form input::placeholder { color: var(--muted); }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  max-height: 360px;
  overflow-y: auto;
  z-index: 20;
}
.search-dropdown.show { display: block; }
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
  color: var(--dark2);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: var(--light); }
.search-dropdown-item .type-icon { color: var(--muted); flex-shrink: 0; }
.search-dropdown-item .type-icon-file { color: #217346; }
.search-dropdown-name { flex: 1; }
.search-dropdown-empty {
  padding: 0.8rem 0.9rem;
  font-size: 0.82rem;
  color: var(--muted);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 2rem;
  gap: 1.5rem;
  width: 100%;
}

.unauthenticated {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}
.page-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── CATEGORY DETAIL ── */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cards-sort-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin: 0.35rem 0 0.25rem;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}
.cards-sort-label { color: var(--muted); }
.cards-filter-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 0.1rem;
}
.cards-filter-label { color: var(--muted); }
.cards-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  max-width: 10rem;
}
.cards-filter-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cards-filter-toggle:hover { background: rgba(0,0,0,.06); color: var(--dark2); }
.cards-filter-toggle.active { background: var(--white); color: var(--dark2); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.th-filter-wrap { position: relative; display: inline-block; margin-left: 0.15rem; }
.th-filter-toggle {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
}
.th-filter-icon { display: block; }
.th-filter-toggle:hover { background: rgba(0,0,0,.06); color: var(--dark2); }
.th-filter-toggle.active { color: var(--dark2); font-weight: 700; }
.th-filter-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 150px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  z-index: 30;
  padding: 0.3rem;
  text-transform: none;
}
.th-filter-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  color: var(--dark2);
  font-size: 0.78rem;
  font-weight: 400;
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
}
.th-filter-option:hover { background: var(--light); }
.th-filter-option.active { background: var(--light); font-weight: 700; }
.th-filter-option svg { flex-shrink: 0; }

.pagination-showall {
  margin-left: auto;
  font-weight: 600;
}

.view-toggle {
  display: inline-flex;
  gap: 0.2rem;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem;
}
.view-toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.view-toggle-btn:hover { color: var(--dark2); }
.view-toggle-btn.active {
  background: var(--white);
  color: var(--dark2);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ── HOME SECTIONS ── */
.category-section { display: flex; flex-direction: column; gap: 0.75rem; }
.category-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
}

.home-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.home-section-favoritos { border-top: 3px solid var(--red); }
.home-section-acessados { border-top: 3px solid var(--dark); }

.home-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.home-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.home-section-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* ── HOME HERO ── */
.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.home-greeting {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark2);
}
.home-date {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
/* ── BANNER DE DESTAQUE (OKR / metas da empresa) ── */
.featured-banner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: linear-gradient(120deg, var(--dark2) 0%, var(--dark) 100%);
  border-radius: 12px;
  padding: 1.25rem 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0,45,61,.18);
  transition: transform 0.15s, box-shadow 0.15s;
}
.featured-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,45,61,.24);
}
.featured-banner-top {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.featured-banner-greeting {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
}
.featured-banner-date {
  font-size: 0.76rem;
  color: rgba(255,255,255,.6);
}
.featured-banner-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.featured-banner-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.featured-banner-body { flex: 1; min-width: 0; }
.featured-banner-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 0.2rem;
}
.featured-banner-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
}
.featured-banner-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,.7);
  margin-top: 0.25rem;
  max-width: 560px;
}
.featured-banner-cta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.featured-banner-cta .btn-primary { white-space: nowrap; }

/* ── MAIS ACESSADOS TOPBAR (compacto) ── */
.home-section-compact { padding: 0.9rem 1.1rem; gap: 0.6rem; }
.home-section-header-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.home-section-icon-compact {
  width: auto;
  height: auto;
  background: none;
  font-size: 1rem;
}
.home-section-header-compact .category-title { font-size: 0.85rem; }

.dashboard-topbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}
.topbar-item { position: relative; }
.topbar-item:hover .access-count-badge { transform: translateY(-1px); }
.topbar-item .dashboard-card {
  height: 100%;
  padding: 0.7rem 1rem;
  gap: 0.3rem;
}
.topbar-item .dashboard-card-name { font-size: 0.8rem; }
.topbar-item .dashboard-card-name .type-icon { width: 17px; height: 17px; }
.topbar-item .dashboard-card-name-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  min-width: 0;
}
.topbar-item .dashboard-card-categories { display: none; }
.topbar-item .favorite-star { display: none; }
.topbar-item .lock-badge { display: none; }
.topbar-item .dashboard-card-top-row { justify-content: flex-end; }
.access-count-badge {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--white);
  background: var(--dark2);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform 0.1s;
  z-index: 4;
}
.lock-mini { font-size: 0.65rem; line-height: 1; }
.dashboard-card.tooltip-open { z-index: 5; }

.tooltip-wrap { position: relative; display: inline-flex; align-items: center; }
.mini-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark2);
  color: var(--white);
  font-size: 0.7rem;
  line-height: 1.3;
  font-weight: 400;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  z-index: 6;
  text-transform: none;
  letter-spacing: normal;
}
.tooltip-wrap:hover .mini-tooltip { display: block; }

@media (max-width: 1100px) {
  .dashboard-topbar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .dashboard-topbar { grid-template-columns: repeat(2, 1fr); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.dashboard-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}

.dashboard-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 20px;
}

.dashboard-card-top-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.favorite-star {
  border: none;
  background: transparent;
  color: var(--border);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.favorite-star:hover { color: var(--red); }
.favorite-star.is-favorited { color: var(--red); }

.lock-badge { font-size: 0.9rem; line-height: 1; }

.table-badges-col { width: 1%; white-space: nowrap; }
.table-col-favorito {
  padding-left: 0.4rem;
  padding-right: 0.05rem;
  border-right: 1px solid var(--border);
}
.table-col-cadeado {
  padding-left: 0.05rem;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border);
}

.sort-icon-link {
  display: inline-flex;
  color: #2E6FA8;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.sort-icon-link:hover,
.sort-icon-link.active { opacity: 1; }

.sort-text-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.sort-text-link:hover,
.sort-text-link.active { color: #2E6FA8; }

.sort-arrow {
  display: inline-block;
  margin-left: 0.2rem;
  font-size: 0.7em;
  color: #2E6FA8;
}
.sort-arrow-lg { font-size: 1.3em; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
}
.pagination-link {
  color: var(--dark);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  transition: background 0.15s, border-color 0.15s;
}
.pagination-link:hover { background: var(--light); border-color: var(--dark); }
.pagination-status { font-size: 0.8rem; color: var(--muted); }
.table-badges { display: inline-flex; align-items: center; gap: 0.15rem; }
.table-badges .favorite-star { font-size: 1.1rem; }

.table-name-link {
  color: var(--dark2);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.table-name-link:hover { text-decoration: underline; color: var(--dark); }
.table-name-link .type-icon { color: var(--muted); flex-shrink: 0; }
.table-name-link:hover .type-icon { color: var(--dark); }
.table-name-link .type-icon-file { color: #217346; }

.table-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity 0.12s, transform 0.12s;
}
.table-name-link:hover .table-action-icon { opacity: 1; transform: translateX(0); }
.table-action-icon .action-icon-open { color: var(--red); }
.table-action-icon .action-icon-download { color: var(--dark); }

.icon-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0 0 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.icon-legend-label {
  font-weight: 700;
  color: var(--dark2);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  margin-right: 0.15rem;
}
.icon-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.icon-legend-glyph { font-size: 0.9rem; line-height: 1; }
.icon-legend-svg { display: inline-flex; }
.icon-legend-svg.type-icon-dashboard-legend { color: var(--muted); }
.icon-legend-svg.type-icon-file-legend { color: #217346; }

.info-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--light);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.info-icon:hover { background: var(--dark); color: var(--white); border-color: var(--dark); }

.info-tooltip {
  display: none;
  position: absolute;
  top: 2.6rem;
  right: 1.2rem;
  left: 1.2rem;
  background: var(--dark2);
  color: var(--white);
  font-size: 0.76rem;
  line-height: 1.4;
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  z-index: 5;
  text-decoration: none;
}
.info-tooltip.show { display: block; }

.dashboard-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--dark);
  transform: translateY(-1px);
}

.dashboard-card-name { font-size: 0.95rem; font-weight: 600; color: var(--dark2); display: flex; align-items: center; gap: 0.4rem; }
.dashboard-card-name .type-icon { width: 20px; height: 20px; flex-shrink: 0; }
.table-name-link .type-icon { width: 18px; height: 18px; }
.dashboard-card-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.breadcrumb-flags { font-size: 0.9rem; letter-spacing: 0.1em; }

.dashboard-card-categories { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.category-chip {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dark);
  background: #E8F4FD;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.dashboard-table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* Sem overflow:hidden de propósito - cortava o tooltip de descrição que
     aparece nas últimas linhas da tabela. Os cantos são arredondados na
     própria tabela (thead/tbody first/last-child) em vez de via clip. */
}

.dashboard-table { width: 100%; border-collapse: collapse; }
.dashboard-table thead tr:first-child th:first-child { border-top-left-radius: 8px; }
.dashboard-table thead tr:first-child th:last-child { border-top-right-radius: 8px; }
.dashboard-table tbody tr:last-child td:first-child { border-bottom-left-radius: 8px; }
.dashboard-table tbody tr:last-child td:last-child { border-bottom-right-radius: 8px; }
.dashboard-table th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--muted);
  background: var(--light);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.dashboard-table td {
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  vertical-align: middle;
}
.dashboard-table tbody tr:nth-child(even) td { background: #FAFCFD; }
.dashboard-table tbody tr:hover td { background: var(--light); }
.dashboard-table .table-desc { color: var(--muted); max-width: 420px; }
.dashboard-table td .category-chip { font-size: 0.65rem; }

.desc-tooltip-wrap { display: block; width: 100%; }
.table-desc-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desc-mini-tooltip {
  bottom: auto;
  top: calc(100% + 0.4rem);
  left: 0;
  transform: none;
  white-space: normal;
  width: max-content;
  max-width: 360px;
  text-align: left;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  text-align: center;
  color: var(--muted);
}

/* ── ÁREA DE PARCEIROS ── */
.partner-notice {
  background: #FFFCF2;
  border: 1px solid #F5E9C8;
  border-left: 4px solid #E0BE5C;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #6B5417;
}
.partner-notice-icon { font-size: 1.1rem; flex-shrink: 0; }
.partner-notice strong { color: #4d3d10; }

/* ── EMBED CARD ── */
.embed-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex: 1;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.embed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.embed-title { font-size: 0.9rem; font-weight: 600; color: var(--dark2); }

.embed-actions { display: flex; gap: 0.5rem; align-items: center; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  margin-right: 0.3rem;
}

.embed-status {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
}

.refresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: default;
  line-height: 1;
}
.refresh-badge.refresh-badge-warning { color: #a15c00; }

#report-container {
  flex: 1;
  min-height: 650px;
  height: 650px;
  width: 100%;
  position: relative;
}

#pbi-embed-div, #pbi-embed-div iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 650px !important;
  border: none !important;
}

/* ── ACCESS REQUEST FORM ── */
.access-request-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 380px;
}
.access-request-form .btn-with-spinner {
  align-self: center;
  padding: 0.55rem 1.5rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark2);
  text-align: left;
}

.form-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--dark2);
  resize: vertical;
}
.form-textarea:focus { outline: none; border-color: var(--dark); }

.form-error {
  font-size: 0.78rem;
  color: var(--red);
  text-align: left;
}

/* ── STATES ── */
.state-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  text-align: center;
}

.state-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.state-icon.load  { background: #FEF3E2; }
.state-icon.error { background: #FEE2E2; }

.state-title { font-size: 1rem; font-weight: 700; color: var(--dark2); }
.state-desc  { font-size: 0.82rem; color: var(--muted); max-width: 320px; line-height: 1.5; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.step-rollout {
  height: 1.3em;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 320px;
}
.step-rollout-text {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.progress-bar-track {
  width: 220px;
  height: 6px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--dark);
  border-radius: 999px;
  transition: width 0.4s ease-out;
}

/* ── TERMOS DE USO DE DADOS (disclaimer de download) ── */
.terms-banner {
  max-width: 420px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  text-align: left;
}
.terms-banner-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
  cursor: default;
}
.terms-banner-check input { margin-top: 0.2rem; flex-shrink: 0; }
.terms-banner-check a { color: var(--dark); font-weight: 600; text-decoration: underline; }
.terms-banner-status {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1a7a4c;
}

.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,45,61,.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.terms-modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.terms-modal-title { font-size: 1.1rem; font-weight: 700; color: var(--dark2); margin-bottom: 0.9rem; }
.terms-modal-body { font-size: 0.85rem; color: var(--muted); line-height: 1.6; text-align: left; }
.terms-modal-body ul { margin: 0.5rem 0 0 1.2rem; }
.terms-modal-body li { margin-bottom: 0.4rem; }
.terms-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--dark); }
.breadcrumb .current { color: var(--dark2); font-weight: 600; }

/* ── LOGIN ── */
.login-page {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--dark2);
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background-image: url("../imgs/login-bg.0dd1f4e0a01e.jpg");
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) contrast(1.05);
  z-index: 0;
}

.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,77,104,.92) 0%, rgba(0,45,61,.9) 55%, rgba(255,66,99,.55) 100%);
  mix-blend-mode: color;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,45,61,.45);
  z-index: 1;
}

.login-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
  max-width: 340px;
}

.login-logo { width: 100%; max-width: 220px; height: auto; margin-bottom: 2rem; }

.login-card {
  width: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}

.login-card > .btn { margin-top: auto; width: 100%; }
