/* Tokens alinhados à landing VOLARO (+ escala UX 2025–2026) */
:root {
    --green-500: #10B981;
    --green-600: #059669;
    --blue-500: #3B82F6;
    --blue-600: #2563EB;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #FFFFFF;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
body.app-body {
    margin: 0;
    font-family: var(--font-family);
    color: var(--gray-700);
    background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 48%, #eef2f7 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --sidebar-width: 268px;
}

a { color: var(--blue-600); text-decoration: none; transition: color 0.15s var(--ease-out); }
a:hover { text-decoration: underline; color: var(--blue-500); }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 0;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
    z-index: 200;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding-top: max(1.25rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}
.sidebar-brand {
    flex-shrink: 0;
}
.sidebar-brand a {
    display: block;
    padding: 0 1.25rem 1rem;
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--green-500), var(--blue-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    padding-bottom: 0.5rem;
}
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
/* Itens do menu: ícone + rótulo (layout tipo Instagram Web) */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0.8rem;
    margin-bottom: 0.1rem;
    border-radius: 12px;
    color: var(--gray-300);
    font-size: 0.9375rem;
    line-height: 1.35;
    font-weight: 500;
    text-decoration: none;
    transition:
        background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
}
.sidebar-nav-link:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.75);
    outline-offset: 2px;
}
.sidebar-nav-link:active {
    transform: scale(0.98);
}
.sidebar-nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
}
.sidebar-nav-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: inherit;
}
.sidebar-nav-link__icon svg {
    display: block;
    width: 24px;
    height: 24px;
}
.sidebar-nav-link__label {
    flex: 1;
    min-width: 0;
}
.sidebar-nav-link--muted {
    color: var(--gray-400);
}
.sidebar-nav-link--muted:hover {
    color: var(--gray-200);
}
.sidebar-nav .nav-group-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-500);
    padding: 1rem 0.8rem 0.35rem;
    font-weight: 600;
}
.sidebar-nav .nav-group-label:first-child { padding-top: 0; }

.form-section-title { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.ods-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.5rem; }
.ods-grid .chk { font-size: 0.8125rem; color: var(--gray-700); }
.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9375rem; }
.data-table th, .data-table td { border: 1px solid var(--gray-200); padding: 0.5rem 0.75rem; text-align: left; }
.data-table th { background: var(--gray-100); font-weight: 600; }

.main-wrap {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0.65rem 1.15rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(0.65rem, env(safe-area-inset-top));
    /* Branco opaco: evita tom acinzentado quando o fundo da página é cinza */
    background-color: #ffffff;
    background-image: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: none;
    font-size: 0.875rem;
}
.topbar-org {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-org--grow {
    flex: 1;
}
.topbar-user {
    flex-shrink: 1;
    min-width: 0;
    max-width: 46vw;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.15rem;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.topbar-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    color: inherit;
}
.topbar-user-unit {
    font-size: 0.8em;
    font-weight: 400;
    line-height: 1.25;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botão menu (visível só em ecrã estreito — ver media query abaixo) */
.nav-menu-toggle {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -0.35rem 0 -0.35rem -0.35rem;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.nav-menu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.nav-menu-toggle-bars {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    position: relative;
    transition: background 0.2s ease;
}
.nav-menu-toggle-bars::before,
.nav-menu-toggle-bars::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s ease, top 0.2s ease;
}
.nav-menu-toggle-bars::before { top: -7px; }
.nav-menu-toggle-bars::after { top: 7px; }

body.nav-open .nav-menu-toggle-bars {
    background: transparent;
}
body.nav-open .nav-menu-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
}
body.nav-open .nav-menu-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}
body.nav-open .nav-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
}
.main-content {
    padding: 1.5rem;
    max-width: 1100px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
/* Listagens / painel: mainContentFluid no render() — largura útil total */
.main-content--fluid {
    max-width: none;
    width: 100%;
    padding-left: clamp(1rem, 2.5vw, 2.5rem);
    padding-right: clamp(1rem, 2.5vw, 2.5rem);
    padding-top: clamp(1.25rem, 2vw, 1.75rem);
    padding-bottom: clamp(1.25rem, 2vw, 2rem);
}

.muted { color: var(--gray-500); }

h1 { font-size: 1.5rem; margin: 0 0 1rem; color: var(--gray-900); letter-spacing: -0.02em; line-height: 1.25; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), transform 0.15s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.btn-primary {
    background: linear-gradient(135deg, var(--green-500), var(--green-600));
    color: var(--white);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.32);
}
.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.4);
    filter: brightness(1.03);
}
.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-900);
}
.btn-secondary:hover { background: #e5e7eb; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.35rem;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease-out), transform 0.18s var(--ease-out);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
}
.stat-card .label { font-size: 0.75rem; color: var(--gray-500); text-transform: none; letter-spacing: 0.02em; font-weight: 600; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; line-height: 1.15; }

/* KPI do painel — ícone + cartão com mais profundidade */
.stat-card--dash {
    --stat-accent: var(--gray-500);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.05rem 1.1rem;
    border: 1px solid var(--gray-200);
    border-left-width: 4px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--white) 0%, var(--gray-50) 100%);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card--dash:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
}
.stat-card-visual {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.14);
    color: var(--stat-accent);
}
.stat-card-svg {
    width: 23px;
    height: 23px;
}
.stat-card-copy {
    flex: 1;
    min-width: 0;
}
.stat-card--dash .stat-card-copy .label {
    margin-bottom: 0.25rem;
    text-transform: none;
    letter-spacing: 0.015em;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.stat-card--dash .stat-card-hint {
    margin-top: 0.35rem;
}
.stat-card--dash:not(.stat-card--impact) .value {
    font-size: 1.65rem;
}
.stat-card--impact {
    padding: 0.88rem 1rem;
}
.stat-card--impact .stat-card-visual {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}
.stat-card--impact .stat-card-svg {
    width: 20px;
    height: 20px;
}
.stat-card--impact .value {
    font-size: 1.3rem;
}
.stat-card--impact .stat-card-copy .label {
    font-size: 0.75rem;
    letter-spacing: 0.015em;
    line-height: 1.35;
    text-transform: none;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: manual;
}
.stat-card--accent-slate {
    --stat-accent: #64748b;
    border-left-color: #64748b;
}
.stat-card--accent-slate .value {
    color: #334155;
}
.stat-card--accent-indigo {
    --stat-accent: #4f46e5;
    border-left-color: #4f46e5;
}
.stat-card--accent-indigo .value {
    color: #4338ca;
}
.stat-card--accent-cyan {
    --stat-accent: #0891b2;
    border-left-color: #0891b2;
}
.stat-card--accent-cyan .value {
    color: #0e7490;
}
.stat-card--accent-blue .stat-card-visual,
.stat-card--accent-teal .stat-card-visual,
.stat-card--accent-amber .stat-card-visual,
.stat-card--accent-green .stat-card-visual,
.stat-card--accent-slate .stat-card-visual,
.stat-card--accent-indigo .stat-card-visual,
.stat-card--accent-cyan .stat-card-visual {
    background: rgba(148, 163, 184, 0.12);
}
.stat-card--accent-blue .stat-card-visual {
    background: rgba(59, 130, 246, 0.14);
}
.stat-card--accent-teal .stat-card-visual {
    background: rgba(13, 148, 136, 0.14);
}
.stat-card--accent-amber .stat-card-visual {
    background: rgba(217, 119, 6, 0.14);
}
.stat-card--accent-green .stat-card-visual {
    background: rgba(5, 150, 105, 0.14);
}
.stat-card--accent-indigo .stat-card-visual {
    background: rgba(79, 70, 229, 0.13);
}
.stat-card--accent-cyan .stat-card-visual {
    background: rgba(8, 145, 178, 0.13);
}
.stat-card--accent-slate .stat-card-visual {
    background: rgba(100, 116, 139, 0.13);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
table.data-table th, table.data-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
table.data-table th { font-size: 0.8rem; color: var(--gray-500); background: var(--gray-50); }

table.data-table tbody tr {
    transition: background 0.14s var(--ease-out);
}
table.data-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.95);
}
table.data-table tbody tr:last-child td {
    border-bottom: none;
}

.form-row { margin-bottom: 1rem; }
.form-row label:not(.form-check) {
    display: block;
}
.form-row label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}
.form-row input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.select2-search__field),
.form-row select,
.form-row textarea {
    width: 100%;
    max-width: 480px;
    min-height: 2.625rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.form-row textarea { min-height: 5rem; }
.form-row input[type="checkbox"],
.form-row input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    min-height: 0;
    max-width: none;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border-radius: 4px;
    vertical-align: top;
    accent-color: var(--blue-600);
    cursor: pointer;
    transition: box-shadow 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}
.form-row input[type="radio"] {
    border-radius: 50%;
}
.form-row input[type="checkbox"]:active,
.form-row input[type="radio"]:active {
    transform: scale(0.94);
}
.form-row input:not([type="checkbox"]):not([type="radio"]):not(.select2-search__field):focus-visible,
.form-row select:focus-visible,
.form-row textarea:focus-visible {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: var(--focus-ring);
}
.form-row input[type="checkbox"]:focus-visible,
.form-row input[type="radio"]:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
    box-shadow: none;
}

/* Checkbox / rádio com rótulo à direita — alinhamento à esquerda */
.form-check {
    display: flex !important;
    align-items: flex-start;
    gap: 0.55rem;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0 !important;
    max-width: 100%;
    text-align: left;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-top: 0.2rem;
}
.form-check span {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
    font-size: 0.9375rem;
}
.form-check-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-top: 0.4rem;
    width: 100%;
    max-width: 480px;
}
.form-panel-card .form-check-list {
    max-width: 100%;
}
.form-label-heading {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--gray-900);
}

/* Formulários sem layout fluido: bloco centrado + cartão com borda (evita “vazio” à direita) */
.form-page-shell {
    max-width: min(42rem, 100%);
    margin-left: auto;
    margin-right: auto;
}
.form-page-shell .lions-page-head {
    margin-bottom: 1.35rem;
}
.form-panel-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.65rem 1.35rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.22s var(--ease-out);
}
.form-panel-card .form-row input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.select2-search__field),
.form-panel-card .form-row select,
.form-panel-card .form-row textarea {
    max-width: 100%;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--gray-100);
}
.form-panel-note {
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border: 1px dashed var(--gray-200);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.45;
}

/* Acordeão em cartões de formulário (ex.: gestão do portal público) */
.form-panel-disclosure {
    margin: 0;
}
.form-panel-disclosure__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
    padding: 0;
    margin: 0;
}
.form-panel-disclosure__summary::-webkit-details-marker {
    display: none;
}
.form-panel-disclosure__summary::marker {
    content: '';
    font-size: 0;
}
.form-panel-disclosure__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.35;
    text-align: left;
}
.form-panel-disclosure__hint {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--blue-600);
    line-height: 1.35;
}
.form-panel-disclosure__hint-close {
    display: none;
}
.form-panel-disclosure[open] .form-panel-disclosure__hint-open {
    display: none;
}
.form-panel-disclosure[open] .form-panel-disclosure__hint-close {
    display: inline;
}
.form-panel-disclosure__content {
    padding-top: 1rem;
}
.form-panel-disclosure:not([open]) > .form-panel-disclosure__summary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

.form-panel-card textarea.portal-html-area {
    width: 100%;
    max-width: 100%;
    min-height: 12rem;
    resize: vertical;
}

/* Secções em página larga (ex.: unidades): cartão a 100% sem encolher a listagem */
.units-section {
    margin-bottom: 1.5rem;
}
.units-section > h2 {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
}
.units-section .section-lead {
    margin-top: 0;
}
.form-panel-card.units-section .form-row input:not(.select2-search__field),
.form-panel-card.units-section .form-row select,
.form-panel-card.units-section .form-row textarea {
    max-width: 100%;
}
.units-table-wrap {
    overflow-x: auto;
    margin-top: 0.35rem;
    -webkit-overflow-scrolling: touch;
}
.units-table-wrap .data-table {
    margin-top: 0;
}

/* Abas: unidade principal / extras (página unidades por usuário) — estilo “segmented” visível */
.units-tabs-shell {
    padding-top: 0.25rem;
}
.units-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.4rem;
    margin: 0 0 1.15rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}
.units-tabs-tab {
    appearance: none;
    flex: 1 1 10rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--gray-600);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    text-align: center;
    transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.units-tabs-tab:hover {
    color: var(--gray-900);
    background: rgba(255, 255, 255, 0.75);
}
.units-tabs-tab.is-active {
    color: var(--blue-600);
    background: #fff;
    border-color: var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.units-tabs-tab:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), var(--shadow-sm);
}
.units-tabs-tab.is-active:focus-visible {
    box-shadow: var(--focus-ring), var(--shadow-sm);
}
.units-tabs-shell .units-tab-panel > h2 {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
}
.units-tab-panel > h2:first-child {
    margin-top: 0;
}

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; line-height: 1.55; max-width: 56rem; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }

/* Mensagens flash flutuantes (visíveis ao rolar a página) */
.flash-toast-stack {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(40rem, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    z-index: 10060;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    box-sizing: border-box;
}

.flash-toast-stack--below-topbar {
    top: calc(env(safe-area-inset-top, 0px) + 3.25rem);
}

.flash-toast-stack--auth-page {
    top: calc(env(safe-area-inset-top, 0px) + 1rem);
}

.flash-toast-stack--below-public-topbar {
    top: calc(env(safe-area-inset-top, 0px) + 4rem);
}

.flash-toast-stack .flash-toast {
    pointer-events: auto;
    position: relative;
    margin: 0;
    max-width: none;
    padding: 0.85rem 2.5rem 0.85rem 1rem;
    line-height: 1.55;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
    animation: flash-toast-in 0.35s ease-out;
}

@keyframes flash-toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav-link,
    .btn,
    .card,
    .stat-card,
    .form-row input,
    .form-row select,
    .form-row textarea,
    table.data-table tbody tr,
    .flash-toast {
        transition: none !important;
    }
    .flash-toast {
        animation: none !important;
    }
    .sidebar-nav-link:hover,
    .theme-lions .sidebar-nav-link:hover,
    .sidebar-nav-link:active,
    .theme-lions .sidebar-nav-link:active {
        transform: none !important;
    }
    .btn:active {
        transform: none !important;
    }
}

.flash-toast__close {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    border: none;
    background: transparent;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    color: inherit;
}

.flash-toast__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.flash-toast__text {
    display: block;
}

.public-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}
.public-main { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

@media (max-width: 768px) {
    .sidebar {
        width: min(88vw, 288px);
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 210;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
        padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
        overflow: hidden;
        transform: translateX(-105%);
        transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        will-change: transform;
    }
    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    }
    .main-wrap {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .main-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 180;
        flex-wrap: nowrap;
    }
    .nav-menu-toggle {
        display: inline-flex;
    }
}

@media (min-width: 769px) {
    body.nav-open {
        overflow: visible !important;
    }
    body.nav-open .nav-backdrop {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* Painel / dashboard (registos de voluntariado) */
.dash-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}
.dash-page .card {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
/* Cartões a largura total: .dash-card-flat anulava margin-bottom — repor respiro entre blocos */
.dash-page > .dash-section.card.dash-card-flat {
    margin-bottom: 1.75rem;
}
.dash-section {
    margin-bottom: 1.75rem;
}
.dash-section-title {
    margin: 0 0 0.35rem;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--gray-900);
}
.dash-section-lead {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.45;
}
.grid-stats.dash-kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: clamp(0.75rem, 2vw, 1.1rem);
}
.grid-stats.dash-extra-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(205px, 100%), 1fr));
    gap: clamp(0.65rem, 1.5vw, 0.95rem);
}
@media (max-width: 480px) {
    .grid-stats.dash-kpi-grid,
    .grid-stats.dash-extra-grid {
        grid-template-columns: 1fr;
    }
}
.dash-page .grid-stats {
    min-width: 0;
}
.stat-card--accent-blue { border-left: 4px solid var(--blue-500); }
.stat-card--accent-teal { border-left: 4px solid #0d9488; }
.stat-card--accent-amber { border-left: 4px solid #d97706; }
.stat-card--accent-green { border-left: 4px solid var(--green-600); }
.stat-card-hint {
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 500;
    line-height: 1.35;
}
.stat-card--dash .stat-card-hint {
    color: var(--gray-500);
}
.dash-pipeline-track {
    display: flex;
    height: 14px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-200);
    margin-bottom: 0.75rem;
}
.dash-pipeline-seg { min-width: 2px; transition: width 0.2s ease; }
.dash-pipeline-seg--planned { background: linear-gradient(90deg, #64748b, #94a3b8); }
.dash-pipeline-seg--ongoing { background: linear-gradient(90deg, var(--blue-500), #38bdf8); }
.dash-pipeline-seg--done { background: linear-gradient(90deg, var(--green-600), #34d399); }
.dash-pipeline-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}
.dash-pipeline-legend strong { color: var(--gray-900); font-weight: 600; }
.dash-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.dash-dot--planned { background: #64748b; }
.dash-dot--ongoing { background: var(--blue-500); }
.dash-dot--done { background: var(--green-600); }
.dash-two-col {
    display: flex;
    flex-flow: row nowrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    padding-top: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
/* Duas colunas com largura máxima explícita (evita sobreposição no painel) */
@media (min-width: 901px) {
    .dash-two-col > * {
        flex: 0 0 calc(50% - 0.75rem);
        width: calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
        min-width: 0;
        box-sizing: border-box;
    }
}
@media (max-width: 900px) {
    .dash-two-col {
        flex-flow: column nowrap;
    }
    .dash-two-col > * {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }
}
.dash-card-flat.card {
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.95);
    width: 100%;
    box-sizing: border-box;
}
.dash-table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.dash-two-col .data-table,
.dash-split-feed-month .data-table {
    max-width: 100%;
}
.dash-mini-table {
    font-size: 0.875rem;
}
.dash-mini-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dash-bar-cell {
    min-width: 88px;
    vertical-align: middle;
}
.dash-inline-bar {
    display: block;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}
.dash-inline-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue-500), #60a5fa);
}
.dash-inline-bar-fill--violet {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

/* Ranking de unidades (gamificação no painel) */
.dash-unit-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.dash-unit-rank-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.65rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: var(--gray-50);
    border: 1px solid rgba(226, 232, 240, 0.9);
    min-width: 0;
}
.dash-unit-rank-row--top1 {
    border-color: rgba(217, 119, 6, 0.45);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(254, 243, 199, 0.35));
}
.dash-unit-rank-row--top2 {
    border-color: rgba(148, 163, 184, 0.55);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.65));
}
.dash-unit-rank-row--top3 {
    border-color: rgba(180, 83, 9, 0.35);
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.9), rgba(254, 215, 170, 0.2));
}
.dash-unit-rank-pos {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9375rem;
    color: var(--gray-700);
    background: #fff;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    align-self: center;
}
.dash-unit-rank-row--top1 .dash-unit-rank-pos {
    border-color: #d97706;
    color: #b45309;
}
.dash-unit-rank-row--top2 .dash-unit-rank-pos {
    border-color: #94a3b8;
    color: #475569;
}
.dash-unit-rank-row--top3 .dash-unit-rank-pos {
    border-color: #ea580c;
    color: #c2410c;
}
.dash-unit-rank-body {
    flex: 1 1 auto;
    min-width: 0;
}
.dash-unit-rank-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.35rem;
}
.dash-unit-rank-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
    line-height: 1.35;
    min-width: 0;
    word-break: break-word;
}
.dash-unit-rank-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.9375rem;
    color: var(--blue-600);
    white-space: nowrap;
}
.dash-unit-rank-count-label {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--gray-500);
}
.dash-unit-rank-bar-wrap {
    height: 10px;
    border-radius: 5px;
    background: var(--gray-200);
    overflow: hidden;
    margin-bottom: 0.3rem;
}
.dash-unit-rank-bar {
    display: block;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #0d9488, #2dd4bf);
    min-width: 4px;
    transition: width 0.25s ease;
}
.dash-unit-rank-row--top1 .dash-unit-rank-bar {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}
.dash-unit-rank-row--top2 .dash-unit-rank-bar {
    background: linear-gradient(90deg, #64748b, #94a3b8);
}
.dash-unit-rank-row--top3 .dash-unit-rank-bar {
    background: linear-gradient(90deg, #ea580c, #fb923c);
}
.dash-unit-rank-meta {
    font-size: 0.75rem;
    line-height: 1.35;
}

/* Metas por tipo de ação — competição no painel */
.dash-goal-contest-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 0.35rem;
}
.dash-goal-contest-block {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    padding: 0.85rem 1rem 1rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.6), #fff);
    min-width: 0;
}
.dash-goal-contest-head {
    margin-bottom: 0.65rem;
}
.dash-goal-contest-type {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
}
.dash-goal-contest-meta {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}
.dash-goal-contest-sep {
    opacity: 0.55;
    padding: 0 0.2rem;
}
.dash-goal-contest-list {
    margin-top: 0.25rem;
}
.dash-goal-contest-bar--done {
    background: linear-gradient(90deg, #059669, #34d399) !important;
}
.dash-goal-contest-badge {
    font-weight: 600;
    color: #047857;
}
.dash-goal-contest-empty {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

/* Metas — formulário */
.goals-toolbar-form {
    margin-bottom: 1rem;
}
.goals-save-form .goals-save-actions {
    margin-bottom: 0.75rem;
}
.goals-save-actions--bottom {
    margin-top: 1rem;
    margin-bottom: 0;
}
.goals-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.5rem;
    min-width: 0;
}
.goals-metric-table .goals-metric-select {
    min-width: min(100%, 280px);
    max-width: 100%;
}
.goals-metric-table .goals-target-input {
    min-width: 7rem;
    max-width: 12rem;
}
.goals-save-hint {
    font-size: 0.8125rem;
    margin: 0 0 0.5rem;
}

.dash-card-footer-link {
    margin: 1rem 0 0;
    font-size: 0.875rem;
}
.dash-ods-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dash-ods-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.2fr) 2.5rem;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.8125rem;
}
.dash-ods-item:last-child { border-bottom: none; }
.dash-ods-num {
    font-weight: 700;
    color: var(--blue-600);
    text-align: center;
}
.dash-ods-label { color: var(--gray-700); line-height: 1.3; }
.dash-ods-bar-wrap {
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}
.dash-ods-bar {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #059669, #34d399);
}
.dash-ods-count {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
    .dash-ods-item {
        grid-template-columns: 24px 1fr;
        grid-template-rows: auto auto;
    }
    .dash-ods-bar-wrap { grid-column: 2 / -1; }
    .dash-ods-count { grid-column: 2; text-align: left; }
}
.dash-split-feed-month {
    display: flex;
    flex-flow: row nowrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
@media (min-width: 901px) {
    .dash-split-feed-month > * {
        flex: 0 0 calc(50% - 0.75rem);
        width: calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
        min-width: 0;
        box-sizing: border-box;
    }
}
@media (max-width: 900px) {
    .dash-split-feed-month {
        flex-flow: column nowrap;
    }
    .dash-split-feed-month > * {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }
}
.dash-feed-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}
.dash-feed-metrics > * {
    min-width: 0;
}
@media (max-width: 560px) {
    .dash-feed-metrics { grid-template-columns: 1fr; }
}
.dash-feed-metric {
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.dash-feed-metric-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}
.dash-feed-metric-label {
    display: block;
    margin-top: 0.25rem;
    line-height: 1.35;
    font-size: 0.8125rem;
    color: var(--gray-600);
}
/* Lions: .theme-lions .small-hint usa margin-top negativo (formulários); aqui empilha sem sobrepor o rótulo */
.theme-lions .dash-feed-metric .small-hint,
.dash-feed-metric .small-hint {
    display: block;
    margin-top: 0.35rem;
    line-height: 1.35;
}
.dash-split-feed-month .small-hint code {
    word-break: break-all;
    font-size: 0.7rem;
}
.dash-month-chart {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0.35rem;
    min-height: 140px;
    padding: 0.5rem 0 0;
    flex-wrap: wrap;
}
.dash-month-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3rem;
}
.dash-month-bar-wrap {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.dash-month-bar {
    display: block;
    width: 100%;
    max-width: 2.25rem;
    min-height: 4px;
    background: linear-gradient(180deg, var(--blue-500), #93c5fd);
    border-radius: 4px 4px 0 0;
}
.dash-month-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    margin-top: 0.35rem;
}
.dash-month-n {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-700);
}
.dash-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dash-recent-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.dash-recent-list li:last-child { border-bottom: none; }
.dash-recent-link {
    font-weight: 600;
    color: var(--blue-600);
}
.dash-recent-meta {
    font-size: 0.8125rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.dash-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}
.dash-badge--planned { background: #f1f5f9; color: #475569; border-color: rgba(71, 85, 105, 0.14); }
.dash-badge--ongoing { background: #dbeafe; color: #1d4ed8; border-color: rgba(29, 78, 216, 0.18); }
.dash-badge--completed { background: #d1fae5; color: #047857; border-color: rgba(4, 120, 87, 0.2); }
.dash-badge--none { background: var(--gray-100); color: var(--gray-600); border-color: rgba(107, 114, 128, 0.14); }
.dash-badge--warn { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.2); }
.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}
.small-hint { font-size: 0.75rem; display: block; margin-top: 0.35rem; }

.kr-agenda-toolbar { gap: 0.75rem; align-items: center; }
.kr-agenda-toolbar__modes { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.kr-agenda-toolbar__filters { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.kr-agenda-toolbar__search {
    flex: 1 1 220px;
    min-width: min(100%, 12rem);
    max-width: 28rem;
    margin-inline-start: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.kr-agenda-toolbar__search label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #3d4f5f;
}
.kr-agenda-toolbar__search-input {
    width: 100%;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #c5ced6;
    font-family: inherit;
    font-size: 0.95rem;
}
.kr-agenda-row--search-hidden {
    display: none !important;
}
.kr-cal__pill--search-hidden {
    display: none !important;
}
.kr-agenda-search-empty {
    margin-top: 0.75rem;
}
.kr-agenda-meta { font-size: 0.8125rem; margin-top: 0.25rem; }
table.data-table tbody tr.kr-agenda-row--atrasado { background: rgba(254, 243, 199, 0.35); }
table.data-table tbody tr.kr-agenda-row--atrasado:hover { background: rgba(254, 243, 199, 0.55); }

/* Pesquisa KRs — vista calendário (grade mensal) */
.kr-cal {
    margin-top: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.kr-cal__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.kr-cal__nav { display: flex; gap: 0.35rem; }
.kr-cal__nav-btn { min-width: 2.25rem; padding-left: 0.5rem; padding-right: 0.5rem; font-weight: 700; }
.kr-cal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    flex: 1 1 auto;
    text-align: center;
    order: 0;
}
.kr-cal__header .kr-cal__nav { order: -1; }
.kr-cal__header .kr-cal__today { order: 1; }
.kr-cal__weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.kr-cal__weekday {
    padding: 0.45rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-600);
    text-align: center;
    border-right: 1px solid var(--gray-200);
}
.kr-cal__weekday:last-child { border-right: none; }
.kr-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    background: var(--gray-200);
}
.kr-cal__day {
    min-height: 6.5rem;
    min-width: 0;
    padding: 0.35rem 0.4rem 0.45rem;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}
.kr-cal__day:nth-child(7n) { border-right: none; }
.kr-cal__day--outside {
    background: #fafbfc;
    color: var(--gray-400);
}
.kr-cal__day--today {
    box-shadow: inset 0 0 0 2px rgba(31, 142, 200, 0.45);
    background: rgba(239, 246, 255, 0.65);
}
.kr-cal__daynum {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.2;
}
.kr-cal__day--outside .kr-cal__daynum { color: var(--gray-400); font-weight: 500; }
.kr-cal__events {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 auto;
    min-height: 0;
}
.kr-cal__pill {
    display: block;
    font-size: 0.6875rem;
    line-height: 1.25;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--gray-800);
    border: 1px solid transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.kr-cal__pill:hover { text-decoration: none; filter: brightness(0.97); }
.kr-cal__pill--planned { background: #f1f5f9; border-color: rgba(71, 85, 105, 0.12); }
.kr-cal__pill--ongoing { background: #dbeafe; border-color: rgba(29, 78, 216, 0.15); color: #1e3a8a; }
.kr-cal__pill--done { background: #d1fae5; border-color: rgba(4, 120, 87, 0.15); color: #065f46; }
.kr-cal__pill--cancel { background: #f1f5f9; color: var(--gray-500); border-color: rgba(100, 116, 139, 0.12); }
.kr-cal__pill--late.kr-cal__pill--planned,
.kr-cal__pill--late.kr-cal__pill--ongoing {
    box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.35);
}
.kr-cal__more {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--gray-500);
    padding: 0 0.15rem;
}
.kr-cal__empty-hint { margin-top: 1rem; }

.reg-pesquisa-agenda__hint {
    margin: 0 1rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
}
.reg-pesquisa-agenda-sem-data {
    margin-top: 1.25rem;
}
.reg-pesquisa-agenda-sem-data__list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}
.reg-pesquisa-agenda-sem-data__list li {
    margin-bottom: 0.35rem;
}
.reg-vista-toggle,
.reg-agenda-por {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.reg-vista-toggle .btn,
.reg-agenda-por .btn {
    padding: 0.32rem 0.65rem;
    font-size: 0.8125rem;
}

@media (max-width: 720px) {
    .kr-cal__day { min-height: 5.25rem; padding: 0.25rem 0.25rem 0.35rem; }
    .kr-cal__pill { font-size: 0.625rem; padding: 0.1rem 0.28rem; }
    .kr-cal__title { font-size: 1rem; width: 100%; order: 1; }
    .kr-cal__header .kr-cal__nav { order: 0; width: 100%; justify-content: flex-start; }
    .kr-cal__header .kr-cal__today { order: 2; margin-left: auto; }
}

/* Gráficos em rosca (Chart.js) + mapas de calor no painel */
.dash-chart-grid {
    display: flex;
    flex-flow: row wrap;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
@media (min-width: 1101px) {
    .dash-chart-grid > .dash-chart-box {
        flex: 0 0 calc((100% - 2.5rem) / 3);
        width: calc((100% - 2.5rem) / 3);
        max-width: calc((100% - 2.5rem) / 3);
        min-width: 0;
        box-sizing: border-box;
    }
}
@media (max-width: 1100px) {
    .dash-chart-grid > .dash-chart-box {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}
.dash-chart-box {
    margin: 0;
    padding: 0;
    min-height: 0;
    min-width: 0;
}
.dash-chart-caption {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}
.dash-chart-canvas-wrap {
    position: relative;
    height: 260px;
    max-width: 100%;
}
.dash-chart-empty {
    margin: 0;
    padding: 2rem 0.5rem;
    text-align: center;
}
.dash-heat-block {
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
.dash-heat-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}
.dash-heat-scale {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    margin-bottom: 0.65rem;
}
.dash-heat-scale--compact {
    margin-bottom: 0.45rem;
}
.dash-heat-gradient {
    flex: 1;
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e5e7eb, #1f8ec8, #0f3555);
    max-width: 180px;
}
.dash-heat-gradient--ods {
    background: linear-gradient(90deg, #ecfdf5, #059669, #064e3b);
    max-width: 200px;
}
.dash-heat-month-row {
    display: flex;
    flex-flow: row wrap;
    gap: 0.45rem;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.dash-heat-cell-wrap {
    flex: 1 1 auto;
    min-width: min(4.5rem, calc(25% - 0.45rem));
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .dash-heat-cell-wrap {
        min-width: calc(25% - 0.45rem);
    }
}
.dash-heat-cell {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background: linear-gradient(
        145deg,
        rgba(31, 142, 200, calc(0.07 + (var(--heat) / 100) * 0.78)),
        rgba(15, 53, 85, calc(0.1 + (var(--heat) / 100) * 0.74))
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dash-heat-cell--zero {
    background: var(--gray-100);
    border-color: var(--gray-200);
    box-shadow: none;
}
.dash-heat-m-label {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    margin-top: 0.35rem;
    font-weight: 600;
}
.dash-heat-m-n {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-800);
}
.dash-heat-ods-block {
    margin-bottom: 1.25rem;
}
.dash-heat-ods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 0.45rem;
    margin-top: 0.5rem;
}
.dash-heat-ods-cell {
    position: relative;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    min-height: 52px;
    padding: 0.35rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: linear-gradient(
        145deg,
        rgba(5, 150, 105, calc(0.08 + (var(--heat) / 100) * 0.72)),
        rgba(4, 120, 87, calc(0.12 + (var(--heat) / 100) * 0.78))
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.dash-heat-ods-cell--zero {
    background: var(--gray-100);
    box-shadow: none;
}
.dash-heat-ods-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.dash-heat-ods-cell--zero .dash-heat-ods-num {
    color: var(--gray-500);
    text-shadow: none;
}
.dash-heat-ods-n {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}
.dash-heat-ods-cell--zero .dash-heat-ods-n {
    color: var(--gray-600);
}

/* Feed — coluna central (largura fixa tipo Instagram Web; não estica em telas largas) */
.feed-column {
    width: 100%;
    max-width: min(470px, 100%);
    margin-inline: auto;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .feed-column {
        max-width: min(630px, 100%);
    }
}

/* Feed — linha de stories (autores) estilo Instagram */
.feed-stories {
    margin: 0 0 1rem;
    padding: 0.75rem 0.25rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.feed-stories__list {
    list-style: none;
    display: flex;
    gap: 0.9rem;
    margin: 0;
    padding: 0 0.75rem;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.feed-stories__list::-webkit-scrollbar {
    height: 6px;
}
.feed-stories__list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 999px;
}
.feed-stories__item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}
.feed-story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 72px;
    text-decoration: none;
    color: var(--gray-700);
    transition: transform 0.15s ease;
}
.feed-story:hover,
.feed-story:focus-visible {
    transform: translateY(-1px);
    color: var(--gray-900);
    text-decoration: none;
    outline: none;
}
.feed-story__ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    padding: 3px;
    background: conic-gradient(
        from 210deg,
        var(--blue-500) 0deg,
        var(--blue-600) 120deg,
        #1e40af 220deg,
        var(--blue-500) 360deg
    );
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.18);
}
.feed-story__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--white);
    color: var(--blue-600);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border: 2px solid var(--white);
    line-height: 1;
}
.feed-story__name {
    display: block;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Feed — cartões e curtidas */
.feed-posts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.feed-column .feed-post-card {
    margin-bottom: 0;
}
.feed-post-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}
.feed-post-card__main {
    padding: 1.25rem;
    flex: 1;
    min-width: 0;
}
.feed-post-card__header {
    margin-bottom: 0.75rem;
}
.feed-post-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
}
.feed-post-card__meta {
    margin: 0;
    font-size: 0.875rem;
}
.feed-post-card__main .feed-body {
    margin-top: 0.25rem;
}
.feed-post-card__media {
    margin-top: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}
.feed-post-card__media img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    vertical-align: middle;
    object-fit: contain;
}
/* Mídia no HTML do registro (feed-body) — não ultrapassar a coluna */
.feed-post-card .feed-body--html img,
.feed-post-card .feed-body--html video {
    max-width: 100%;
    height: auto;
}
.feed-post-card .feed-body--html iframe {
    max-width: 100%;
}
.feed-post-card__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem 1rem;
    margin-top: auto;
    border-top: 1px solid var(--gray-200);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.65) 0%, var(--white) 100%);
}
.feed-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.feed-like-btn:hover:not(:disabled) {
    border-color: var(--gray-400);
    color: var(--gray-800);
    background: var(--gray-50);
}
.feed-like-btn:active:not(:disabled) {
    transform: scale(0.98);
}
.feed-like-btn:focus-visible {
    outline: 2px solid var(--green-500);
    outline-offset: 2px;
}
.feed-like-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}
.feed-like-btn__count {
    font-variant-numeric: tabular-nums;
    min-width: 1.25rem;
}
.feed-like-btn__svg {
    display: block;
}
.feed-like-btn__heart-fill {
    transition: opacity 0.18s ease;
}
.feed-like-btn:not(.feed-like-btn--active) .feed-like-btn__heart-fill {
    opacity: 0;
}
.feed-like-btn--active {
    border-color: rgba(225, 29, 72, 0.45);
    background: rgba(254, 226, 226, 0.65);
    color: rgb(190, 18, 60);
}
.feed-like-btn--active .feed-like-btn__heart-fill {
    opacity: 1;
}
.feed-like-btn--active .feed-like-btn__heart-stroke {
    opacity: 0;
}
.feed-share-btn {
    font-size: 0.875rem;
}
.feed-share-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}
.feed-share-modal[hidden] {
    display: none !important;
}
.feed-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
}
.feed-share-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    max-height: min(90vh, 32rem);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.feed-share-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.feed-share-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
}
.feed-share-modal__close {
    font-size: 1.35rem;
    line-height: 1;
    padding: 0.15rem 0.45rem;
}
.feed-share-modal__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.feed-share-modal__row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.35;
}
.feed-share-modal__row input {
    margin-top: 0.2rem;
}
.feed-share-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.1rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
}
#feed-share-modal-lead {
    margin: 0;
    padding: 0.65rem 1.1rem 0;
}

/* OKR — bloco opcional colapsável (KR) */
.reg-kr-disclosure {
    margin: 1.25rem 0 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: linear-gradient(145deg, rgba(239, 246, 255, 0.5), rgba(255, 255, 255, 0.98));
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.reg-kr-disclosure__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem;
}
.reg-kr-disclosure__intro {
    min-width: 0;
    flex: 1;
}
.reg-kr-disclosure__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}
.reg-kr-disclosure__lead {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--gray-600);
}
.reg-kr-disclosure__toggle {
    flex-shrink: 0;
    white-space: nowrap;
}
.reg-kr-disclosure__body {
    padding: 0 1.125rem 1.125rem;
    border-top: 1px solid rgba(59, 130, 246, 0.12);
}
.reg-kr-disclosure--collapsed .reg-kr-disclosure__header {
    border-bottom: none;
}
@media (max-width: 560px) {
    .reg-kr-disclosure__header {
        flex-wrap: wrap;
    }
    .reg-kr-disclosure__toggle {
        width: 100%;
        white-space: normal;
    }
}

/* OKR — resultados-chave no formulário de registro */
.reg-okr-scope-callout {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.65), rgba(255, 255, 255, 0.95));
}
.reg-okr-scope-callout__title {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--blue-600);
}
.reg-okr-scope-callout__text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--gray-700);
}
.reg-okr-inline-jump {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.reg-okr-objective-panel {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), var(--white));
    box-shadow: var(--shadow-sm);
}
.reg-okr-objective-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.reg-okr-objective-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-800);
}
.reg-okr-objective-pct {
    font-weight: 800;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    color: var(--blue-600);
}
.reg-okr-bar {
    height: 12px;
    border-radius: 999px;
    background: var(--gray-200);
    overflow: hidden;
}
.reg-okr-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green-500), var(--blue-500));
    transition: width 0.25s var(--ease-out);
}
.reg-kr-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.reg-kr-card {
    margin: 0;
    padding: 1rem 1.125rem 1.125rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}
.reg-kr-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--gray-100);
}
.reg-kr-card__kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}
.reg-vol-form .field-hint-muted {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--gray-500);
}
.reg-kr-add-wrap {
    margin-top: 0.35rem;
}
.reg-kr-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.reg-kr-progress-wrap input[type="range"] {
    flex: 1;
    min-width: 6rem;
}
.reg-kr-progress-val {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 2.75rem;
    color: var(--gray-700);
}
.reg-kr-progress-readonly {
    display: inline-block;
    padding: 0.35rem 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
    .reg-kr-card .form-row-grid-3 {
        grid-template-columns: 1fr;
    }
}
