:root {
  --primary-color: #00677f;
  --primary-dark: #00536a;
  --secondary-color: #d4a843;
  --text-dark: #1a2b30;
  --soft-bg: #f5f8f9;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #244b97;
  --text-muted: #5e7580;
  --bg-secondary: #f7fafa;
}

[ng-cloak],
[data-ng-cloak],
.ng-cloak {
  display: none !important;
}

body {
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: var(--soft-bg);
  color: var(--text-dark);
  line-height: 1.5;
}

.backoffice-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #00677f 0%, #003d4d 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-wrap {
  color: #fff;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}

.sidebar-logo-wide {
  width: 176px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.sidebar-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.sidebar-title {
  margin: 8px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.sidebar-menu {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.menu-item {
  color: #ecf0f1;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-left-color: var(--secondary-color);
  color: #fff;
}

.menu-item.active {
  background: rgba(0, 103, 127, 0.18);
  border-left-color: var(--secondary-color);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-chip {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.main-content {
  margin-left: 250px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar-simple {
  padding: 10px 25px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-context {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  padding-right: 15px;
  border-right: 1px solid #e5e7eb;
  color: var(--primary-color);
}

.page-context-title {
  color: #2c3e50;
  font-weight: 600;
}

.page-context-subtitle {
  color: #6d7888;
  font-size: 12px;
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 22px;
  padding: 0 12px;
  height: 38px;
  min-width: 280px;
  flex: 1;
}

.search-inline i {
  color: #999;
}

.search-inline input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
}

.page-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  border: 1px solid transparent;
  background: var(--secondary-color);
  color: #2b210f;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  min-height: 38px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-action:hover {
  background: #b18d3e;
  color: #2b210f;
}

.btn-action.danger {
  background: #f4dddc;
  color: #7f2222;
  border-color: #e7c5c3;
}

.btn-action.danger:hover {
  background: #f0d2d1;
  color: #6e1c1c;
}

.btn-action.dark {
  background: var(--primary-color);
  color: #fff;
}

.btn-action.dark:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-action:disabled {
  opacity: 0.64;
  cursor: not-allowed;
}

.content-body {
  padding: 22px 30px;
}

.card-soft {
  background: #fff;
  border: 1px solid #e8dfcf;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(25, 31, 45, 0.06);
}

.card-soft .card-header {
  padding: 12px 16px;
  font-weight: 700;
  color: #274055;
  background: linear-gradient(120deg, #fbfdff 0%, #f4f8fc 100%);
  border-bottom: 1px solid #e5edf4;
}

.card-soft .card-body {
  padding: 16px;
}

.table-wrap {
  overflow: hidden;
}

.stat-card {
  background: #fff;
  border: 1px solid #e8dfcf;
  border-radius: 10px;
  padding: 12px 14px;
}

.stat-label {
  font-size: 12px;
  color: #556275;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: #1c2a3c;
}

.stat-value.small {
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 700;
}

.module-kpis .stat-card {
  height: 100%;
}

.docs-topbar-actions .btn {
  border-radius: 12px;
  padding-inline: 12px;
  font-weight: 600;
}

.module-topbar-actions .btn {
  border-radius: 12px;
  padding-inline: 12px;
  font-weight: 600;
}

.docs-kpis .stat-card {
  border-color: #e5edf5;
  box-shadow: 0 2px 8px rgba(16, 40, 63, 0.05);
  border-radius: 14px;
}

.docs-kpis .stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5f7388;
}

.docs-kpis .stat-value {
  color: #10344d;
}

.uat-progress {
  height: 8px;
  border-radius: 999px;
  background: #e8eef6;
  border: 1px solid #d9e3ef;
  overflow: hidden;
  min-width: 90px;
}

.uat-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0b7392, #18a1c6);
}

.uat-thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uat-thumb-list a {
  display: block;
  width: 56px;
  height: 56px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.uat-thumb-list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge.status-submetida { background: #e8edf3; color: #3d4f64; }
.badge.status-em_analise { background: #e6efff; color: #244b97; }
.badge.status-deferida { background: #e7f4ea; color: #1d6a39; }
.badge.status-indeferida { background: #f9e7e7; color: #8a2222; }

.dev-banner {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: #003d4d;
  color: #fff;
  text-align: center;
  padding: 6px 10px;
  font-weight: 700;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(130deg, rgba(0, 103, 127, 0.10) 0%, rgba(0, 103, 127, 0) 45%),
    linear-gradient(315deg, rgba(212, 168, 67, 0.12) 0%, rgba(212, 168, 67, 0) 40%),
    #f6f4ef;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e8dfcf;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 50, 65, 0.14);
  padding: 22px;
  animation: cardIn 0.24s ease-out;
}

.login-card h1 {
  font-size: 1.35rem;
  margin: 10px 0 2px;
}

.login-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
}

.export-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 1px solid #e8dfcf;
  border-radius: 12px;
  text-decoration: none;
  padding: 16px;
  color: #2b2b2b;
  box-shadow: 0 2px 8px rgba(35, 20, 12, 0.06);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.export-card i {
  color: var(--primary-color);
  font-size: 1.15rem;
}

.export-card strong {
  color: #2b2b2b;
}

.export-card span {
  color: #6f6f6f;
  font-size: 0.9rem;
}

.export-card:hover {
  border-color: #d8c28a;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(38, 27, 15, 0.1);
}

.table th,
.table td {
  vertical-align: middle;
}

.table thead th {
  font-size: 0.78rem;
  color: #546072;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table tbody td {
  color: #2c3340;
}

.participants-table thead th {
  white-space: nowrap;
}

.participants-table tbody td {
  font-size: 0.9rem;
}

.panel-section {
  border-top: 1px solid #f0ebdf;
  margin-top: 10px;
  padding-top: 10px;
}

.detail-grid {
  margin-bottom: 4px;
}

.detail-card {
  height: 100%;
  border: 1px solid #ece3d2;
  border-radius: 10px;
  background: #fcfcfd;
  padding: 12px;
}

.detail-card h6 {
  margin-bottom: 10px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4e5b70;
}

.detail-card p {
  margin-bottom: 5px;
  font-size: 0.92rem;
}

.participation-text {
  white-space: pre-wrap;
  line-height: 1.6;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.attachments-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 8px;
}

.attachments-list li {
  border: 1px solid #eee7d9;
  border-radius: 8px;
  background: #fffdfa;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.list-table thead th {
  font-size: 0.75rem;
  color: #5f6e82;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.list-table tbody tr:hover {
  background: #fafbfd;
}

.table-toolbar {
  background: linear-gradient(180deg, #0d5d7e 0%, #0b5371 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px;
}

.table-toolbar-grid {
  display: grid;
  grid-template-columns: 140px 140px 1fr 110px;
  gap: 10px;
  align-items: end;
}

.table-toolbar-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.table-toolbar .form-select,
.table-toolbar .form-control {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 10px;
}

.table-toolbar-action .btn {
  white-space: nowrap;
  border-radius: 10px;
}

.module-table thead th {
  background: #0b5471;
  color: #eef6fb;
  border-color: #0e6485;
}

.module-table tbody td {
  border-color: #e9eef3;
}

.docs-grid-card {
  border-radius: 18px;
  overflow: hidden;
  border-color: #dfebf4;
  box-shadow: 0 8px 22px rgba(11, 42, 68, 0.06);
}

.module-grid-card {
  border-radius: 18px;
  overflow: hidden;
  border-color: #dfebf4;
  box-shadow: 0 8px 22px rgba(11, 42, 68, 0.06);
}

.docs-grid-header {
  background: linear-gradient(120deg, #fefefe 0%, #f3f8fc 100%) !important;
}

.docs-id-cell {
  color: #3f566b;
  font-weight: 600;
  width: 74px;
}

.docs-title-cell {
  font-weight: 600;
  color: #17364e;
}

.docs-file-cell {
  color: #456178;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-category-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid #d6e4ef;
  color: #2a4d66;
  background: #eef6fc;
  text-transform: capitalize;
}

.docs-category-chip.cat-regulamento {
  background: #edf5ff;
  border-color: #cfe0fb;
  color: #2d5a9a;
}

.docs-category-chip.cat-relatorio {
  background: #fff7ea;
  border-color: #f3dfb4;
  color: #8a6321;
}

.docs-category-chip.cat-cartografia {
  background: #eaf9ef;
  border-color: #cae7d4;
  color: #2c6a41;
}

.docs-category-chip.cat-participacao {
  background: #f4f1ff;
  border-color: #dcd4fb;
  color: #5d47a3;
}

.docs-row-actions .btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}

.table-footer-meta {
  padding: 9px 12px;
  border-top: 1px solid #e6edf4;
  color: #5f6f81;
  font-size: 0.83rem;
  background: #f8fbfe;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.14) 0, rgba(255,255,255,0) 32%), rgba(10, 17, 30, 0.6);
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.dialog-card {
  width: min(780px, 95vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #d7e0ea;
  box-shadow: 0 24px 56px rgba(8, 12, 22, 0.42);
}

.dialog-card .card-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-bottom: 1px solid #e0e7f0;
  padding: 14px 16px;
}

.dialog-card .card-body {
  padding: 18px 16px;
}

.dialog-card .form-control,
.dialog-card .form-select {
  border-color: #d7e0ea;
}

.dialog-card .form-control:focus,
.dialog-card .form-select:focus {
  border-color: #7ba7d9;
  box-shadow: 0 0 0 0.2rem rgba(71, 130, 197, 0.16);
}

.participation-page {
  display: grid;
  gap: 12px;
}

.participation-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(120deg, #ffffff 0%, #f7fbff 100%);
}

.hero-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #61738a;
  margin-bottom: 4px;
}

.hero-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-subtitle {
  margin-top: 4px;
  color: #61738a;
  font-size: 0.9rem;
}

.participation-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.participation-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi {
  padding: 12px;
  border-right: 1px solid #e6edf4;
}

.kpi:last-child {
  border-right: none;
}

.kpi-label {
  display: block;
  color: #6b7f95;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  display: block;
  margin-top: 4px;
  color: #1d2c3d;
}

.participation-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.participation-info-grid > div {
  border: 1px solid #e7edf3;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfdff;
}

.participation-info-grid > div.full {
  grid-column: 1 / -1;
}

.participation-info-grid span {
  display: block;
  font-size: 0.75rem;
  color: #6b7f95;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.participation-info-grid strong {
  display: block;
  margin-top: 3px;
  color: #223446;
  font-size: 0.92rem;
  word-break: break-word;
}

.attachments-list-spacious {
  margin: 0;
}

.attachments-list-spacious li {
  border-left: none;
  border-right: none;
  border-radius: 0;
  background: #fff;
  padding: 12px 14px;
}

.raw-json {
  margin: 0;
  padding: 10px;
  background: #0f1722;
  color: #d6e3f5;
  border-radius: 8px;
  max-height: 320px;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}

.map-preview-wrap {
  border: 1px solid #e0e8ef;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fbff;
}

.map-preview-frame {
  width: 100%;
  height: 360px;
  min-height: 360px;
  border: 0;
  display: block;
  position: relative;
}

.list-map-shell {
  position: relative;
}

.list-map-shell:fullscreen {
  background: #ffffff;
  padding: 12px;
}

.list-map-shell:fullscreen .map-preview-frame {
  height: calc(100vh - 24px);
  min-height: calc(100vh - 24px);
}

.list-map-dialog {
  position: absolute;
  right: 14px;
  top: 14px;
  width: min(320px, calc(100% - 28px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8e2ea;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(12, 28, 45, 0.22);
  padding: 10px 11px;
  z-index: 3;
}

.list-map-dialog-title {
  font-weight: 700;
  color: #223c51;
  margin-bottom: 5px;
}

.list-map-dialog-row {
  font-size: 0.84rem;
  color: #38546a;
}

.map-layer-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.82rem;
  color: #284357;
}

.map-layer-switcher label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f6fbff;
  border: 1px solid #dbe8f3;
  border-radius: 999px;
  padding: 4px 10px;
}

.map-layer-switcher label input[disabled] {
  opacity: 0.9;
}

/* OpenLayers fallback styles (if external ol.css fails to load) */
.map-preview-frame .ol-viewport,
.map-preview-frame .ol-unselectable,
.map-preview-frame .ol-layer,
.map-preview-frame .ol-layer canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

.map-preview-frame .ol-viewport {
  overflow: hidden;
  touch-action: none;
}

.participation-timeline-card .card-header {
  background: linear-gradient(120deg, #f8fbff 0%, #edf5fd 100%);
}

.timeline-rail {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0b4f68;
  margin-top: 4px;
  box-shadow: 0 0 0 3px rgba(11, 79, 104, 0.18);
}

.timeline-content {
  border: 1px solid #e3ebf3;
  border-radius: 9px;
  padding: 8px 10px;
  background: #fbfdff;
}

.timeline-title {
  font-weight: 700;
  color: #254054;
}

.timeline-when {
  font-size: 0.8rem;
  color: #5d7488;
}

.timeline-note {
  font-size: 0.85rem;
  color: #33495d;
}

.status-dialog-card {
  width: min(860px, 95vw);
}

.uat-premium-dialog {
  width: min(640px, 95vw);
  border-radius: 16px;
  border-color: #d8e4ef;
  box-shadow: 0 30px 60px rgba(11, 28, 48, 0.38);
}

.uat-premium-dialog .card-header {
  background: linear-gradient(135deg, #0a5f7f 0%, #094c67 100%);
  color: #fff;
}

.uat-premium-dialog .card-header .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.uat-premium-dialog .card-header .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.uat-delete-dialog .card-header {
  background: linear-gradient(135deg, #8d1b1b 0%, #6b1313 100%);
}

.status-dialog-card .card-header {
  background: linear-gradient(130deg, #005f78 0%, #0b4f68 100%);
  color: #fff;
  padding: 14px 16px;
}

.status-dialog-card .card-header .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.status-dialog-card .card-header .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.status-step-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e3ed;
  border-radius: 10px;
  background: #f7fbff;
  color: #264257;
}

.inline-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-right-color: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}

.inline-spinner.dark {
  border-color: rgba(61, 48, 24, 0.3);
  border-right-color: rgba(61, 48, 24, 0.06);
}

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

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

/* ─── Collapsible Menu Groups ─── */

.menu-group {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.menu-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.menu-group-toggle i:first-child {
  width: 18px;
  text-align: center;
  font-size: 0.78rem;
}

.menu-group-toggle:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
}

.menu-group.open > .menu-group-toggle {
  color: rgba(255,255,255,0.8);
}

.mg-arrow {
  margin-left: auto;
  font-size: 0.55rem;
  transition: transform 0.25s ease;
}

.menu-group.open > .menu-group-toggle .mg-arrow {
  transform: rotate(180deg);
}

.menu-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.menu-group.open > .menu-group-items {
  max-height: 400px;
}

.menu-group-items .menu-item {
  padding-left: 48px;
  font-size: 0.82rem;
}

.menu-item i:first-child {
  width: 18px;
  text-align: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.menu-item-external {
  margin-top: 4px;
  opacity: 0.65;
  font-size: 0.8rem;
}

.menu-item-external:hover { opacity: 1; }

.menu-ext-icon {
  font-size: 0.6rem;
  margin-left: auto;
  opacity: 0.5;
}

.btn-logout {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.75rem;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.user-chip {
  justify-content: space-between;
}

/* ─── Topbar Global Search ─── */

.topbar-global-search {
  flex: 1 1 400px;
  max-width: 600px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d3deea;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(17, 58, 88, 0.08);
  padding: 0 14px;
}

.topbar-global-search i {
  color: #6b7d91;
  font-size: 0.84rem;
}

.topbar-global-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  color: #1f3144;
}

.topbar-global-search input:focus {
  outline: none;
}

.topbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-left: auto;
}

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

/* ─── Hamburger ─── */

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #d3deea;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 1rem;
  color: #2c3e50;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1000px) {
  .sidebar {
    width: 70px;
  }
  .menu-item span,
  .user-chip span,
  .menu-group-toggle span,
  .mg-arrow,
  .menu-ext-icon,
  .sidebar-title {
    display: none;
  }
  .menu-group-toggle {
    justify-content: center;
    padding: 10px;
  }
  .menu-group-items .menu-item {
    padding-left: 0;
    justify-content: center;
  }
  .sidebar-logo-wide {
    width: 38px;
    height: 38px;
  }
  .main-content {
    margin-left: 70px;
  }
  .page-context {
    display: none;
  }
  .participation-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    border-right: none;
    border-bottom: 1px solid #e6edf4;
  }
  .participation-info-grid {
    grid-template-columns: 1fr;
  }
  .topbar-global-search {
    max-width: none;
    flex: 1;
    min-width: 0;
  }
  .topbar-actions-slot .btn-action {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 250px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }
  .menu-item span,
  .user-chip span,
  .menu-group-toggle span,
  .mg-arrow,
  .menu-ext-icon,
  .sidebar-title {
    display: inline;
  }
  .menu-group-toggle {
    justify-content: flex-start;
    padding: 11px 18px;
  }
  .menu-group-items .menu-item {
    padding-left: 48px;
    justify-content: flex-start;
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger-btn {
    display: flex;
  }
  .topbar-simple {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }
  .topbar-global-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
  .page-context {
    display: none;
  }
  .content-body {
    padding: 14px 12px;
  }
  .table-toolbar-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .table-toolbar-action .btn {
    width: 100%;
  }
  .docs-file-cell {
    max-width: 220px;
  }
  .dialog-card {
    width: 100vw;
    max-height: 100vh;
    border-radius: 10px;
  }
  .participation-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .participation-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .participation-kpis {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 10px;
  }
  .dialog-card {
    border-radius: 0;
  }
  .export-card {
    padding: 12px;
  }
}
