/* ===== VARIÁVEIS GLOBAIS — Identidade Nexus ===== */
:root {
    /* Primárias */
    --nexus-blue: #3B82F6;
    --nexus-blue-hover: #2563EB;
    --nexus-blue-light: #60A5FA;
    --nexus-blue-dark: #1D4ED8;

    /* Apoio (gráficos / indicadores) */
    --nexus-purple: #6366F1;
    --nexus-cyan: #0EA5E9;
    --nexus-sky: #38BDF8;

    /* Tokens de marca (defaults; sobrescritos por tema) */
    --color-primary: var(--nexus-blue);
    --color-primary-hover: var(--nexus-blue-hover);
    --color-primary-light: var(--nexus-blue-light);
    --color-primary-active: var(--nexus-blue-dark);
    --color-secondary: #111827;
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #06B6D4;

    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;

    --color-primary-rgb: 59, 130, 246;
    --color-success-rgb: 34, 197, 94;
    --color-warning-rgb: 245, 158, 11;
    --color-danger-rgb: 239, 68, 68;
    --color-info-rgb: 6, 182, 212;
}

/* ===== TEMA CLARO (contraparte da paleta Nexus) ===== */
[data-bs-theme="light"] {
    --bg-body: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-tertiary: #F8FAFC;
    --bg-modal: #FFFFFF;
    --bg-hover: #E2E8F0;
    --bg-active: #DBEAFE;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-disabled: #94A3B8;
    --border-color: #E2E8F0;
    --border-hover: #CBD5E1;
    --divider-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(11, 18, 32, 0.06);
    --shadow-md: 0 4px 16px rgba(11, 18, 32, 0.10);
    --input-bg: #F8FAFC;

    --color-primary: #3B82F6;
    --color-primary-hover: #2563EB;
    --color-primary-light: #60A5FA;
    --color-primary-active: #1D4ED8;

    --bs-body-bg: #F1F5F9;
    --bs-body-color: #0F172A;
    --bs-emphasis-color: #0F172A;
    --bs-secondary-color: #64748B;
    --bs-border-color: #E2E8F0;
    --bs-primary: #3B82F6;
    --bs-primary-rgb: 59, 130, 246;
    --bs-success: #22C55E;
    --bs-success-rgb: 34, 197, 94;
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #EF4444;
    --bs-info: #06B6D4;
    --bs-info-rgb: 6, 182, 212;
    --bs-secondary-bg: #FFFFFF;
    --bs-tertiary-bg: #F8FAFC;
    --bs-link-color: #2563EB;
    --bs-link-hover-color: #1D4ED8;
}

/* ===== TEMA ESCURO — Paleta oficial Nexus ===== */
[data-bs-theme="dark"] {
    --color-primary: #3B82F6;
    --color-primary-hover: #2563EB;
    --color-primary-light: #60A5FA;
    --color-primary-active: #1D4ED8;
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #06B6D4;

    --bg-body: #0B1220;
    --bg-sidebar: #09111F;
    --bg-card: #111827;
    --bg-tertiary: #1F2937;
    --bg-modal: #151C2E;
    --bg-hover: #1F2937;
    --bg-active: color-mix(in srgb, #3B82F6 18%, #1F2937 82%);
    --text-primary: #FFFFFF;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --text-disabled: #6B7280;
    --border-color: #263246;
    --border-hover: #3B4B66;
    --divider-color: #1E293B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --input-bg: #1F2937;

    /* Bootstrap 5.3 — sincroniza componentes nativos */
    --bs-body-bg: #0B1220;
    --bs-body-color: #FFFFFF;
    --bs-emphasis-color: #FFFFFF;
    --bs-secondary-color: #9CA3AF;
    --bs-tertiary-color: rgba(156, 163, 175, 0.78);
    --bs-border-color: #263246;
    --bs-primary: #3B82F6;
    --bs-primary-rgb: 59, 130, 246;
    --bs-success: #22C55E;
    --bs-success-rgb: 34, 197, 94;
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #EF4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-info: #06B6D4;
    --bs-info-rgb: 6, 182, 212;
    --bs-secondary-bg: #111827;
    --bs-tertiary-bg: #1F2937;
    --bs-link-color: #60A5FA;
    --bs-link-hover-color: #93C5FD;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    transition: background 0.25s ease, color 0.25s ease;
}

/* ===== LAYOUT ===== */
.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    min-height: var(--header-height);
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    text-decoration: none;
    flex-shrink: 0;
    background: var(--bg-sidebar);
}

.sidebar-brand-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-company-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo {
    height: 34px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.brand-logo--auth {
    height: 52px;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
}

.sidebar-nav {
    padding: 0.75rem;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.sidebar-nav a i { font-size: 1rem; flex-shrink: 0; }

.sidebar-nav a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
}

.sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-footer-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-footer-nav a i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-footer-nav a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-primary);
}

.sidebar-footer-nav a.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

[data-bs-theme="dark"] .sidebar-footer-nav a:hover,
[data-bs-theme="dark"] .sidebar-footer-nav a.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 0.875rem 0.25rem;
    opacity: 0.7;
}

.sidebar-admin-menu {
    margin-bottom: 0.5rem;
}

.sidebar-admin-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.sidebar-admin-toggle i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-admin-chevron {
    font-size: 0.75rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.sidebar-admin-menu.is-open .sidebar-admin-chevron {
    transform: rotate(180deg);
}

.sidebar-admin-toggle:hover,
.sidebar-admin-toggle.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
}

.sidebar-admin-submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
}

.sidebar-admin-menu.is-open .sidebar-admin-submenu {
    grid-template-rows: 1fr;
}

.sidebar-admin-submenu-inner {
    overflow: hidden;
    padding-top: 0.15rem;
}

.sidebar-admin-submenu a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.625rem 0.45rem 2rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-admin-submenu a i {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-admin-submenu a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-primary);
}

.sidebar-admin-submenu a.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

[data-bs-theme="dark"] .sidebar-admin-toggle:hover,
[data-bs-theme="dark"] .sidebar-admin-toggle.active,
[data-bs-theme="dark"] .sidebar-admin-submenu a:hover,
[data-bs-theme="dark"] .sidebar-admin-submenu a.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== TOPBAR ===== */
.topbar {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    min-height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}

.topbar-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.topbar-btn i { font-size: 1rem; }

/* ===== BUSCA GLOBAL ===== */
.search-global {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-global .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.search-global input {
    width: 100%;
    height: 38px;
    padding: 0 1rem 0 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.15s;
    outline: none;
}

.search-global input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.search-global input::placeholder { color: var(--text-muted); }

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 380px;
    overflow-y: auto;
    display: none;
    z-index: 500;
}

.search-dropdown.show { display: block; }

.search-result-item {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    transition: background 0.1s;
}

.search-result-item:hover { background: rgba(79,70,229,0.08); }

.search-dropdown-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

/* ===== NOTIFICAÇÕES ===== */
.notifications-wrap {
    position: relative;
}

.notifications-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--color-danger, #dc3545);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(320px, calc(100vw - 2rem));
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 600;
    overflow: hidden;
}

.notifications-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notifications-list {
    max-height: 320px;
    overflow-y: auto;
}

.notifications-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.notifications-item:last-child { border-bottom: none; }

.notifications-item:hover { background: rgba(79,70,229,0.06); }

.notifications-item.is-read { opacity: 0.65; }

.notifications-item-msg {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.notifications-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.notifications-empty i { font-size: 1.5rem; opacity: 0.5; }

/* ===== CONTEÚDO ===== */
.page-content { padding: 1.5rem; flex: 1; }

/* Paginação (Bootstrap 5) alinhada ao tema Nexus */
.pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.4rem;
    --bs-pagination-font-size: 0.875rem;
    --bs-pagination-color: var(--text-secondary);
    --bs-pagination-bg: var(--bg-card);
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: var(--border-color);
    --bs-pagination-border-radius: var(--radius-sm);
    --bs-pagination-hover-color: var(--text-primary);
    --bs-pagination-hover-bg: var(--bg-hover);
    --bs-pagination-hover-border-color: var(--border-hover);
    --bs-pagination-focus-color: var(--color-primary);
    --bs-pagination-focus-bg: var(--bg-hover);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--color-primary-rgb), 0.2);
    --bs-pagination-focus-border-color: var(--color-primary);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--color-primary);
    --bs-pagination-active-border-color: var(--color-primary);
    --bs-pagination-disabled-color: var(--text-disabled);
    --bs-pagination-disabled-bg: var(--bg-tertiary);
    --bs-pagination-disabled-border-color: var(--border-color);
    margin-bottom: 0;
}

.pagination .page-link {
    min-width: 2.25rem;
    text-align: center;
}

.security-reminder-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: -1.5rem -1.5rem 1.25rem;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.06));
    border-bottom: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--text-primary);
}

.security-reminder-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
    flex-shrink: 0;
    font-size: 1.1rem;
}

.security-reminder-body {
    flex: 1;
    min-width: 200px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.security-reminder-body strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.sidebar-security-badge {
    margin-left: auto;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--color-warning);
    color: #1a1a1a;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

[data-bs-theme="dark"] .security-reminder-banner {
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.18), rgba(255, 152, 0, 0.06));
    border-bottom-color: rgba(255, 152, 0, 0.35);
}

[data-bs-theme="dark"] .security-reminder-icon {
    background: rgba(255, 152, 0, 0.22);
}

/* ===== ENVIRONMENT PANELS ===== */
.env-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.env-panel {
    border-left: 4px solid var(--env-color, var(--color-primary));
    padding: 1.25rem 1.5rem;
    overflow: hidden;
}

.env-panel--unassigned { border-left-color: var(--text-muted); }

.env-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.env-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.env-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: color-mix(in srgb, var(--env-color, #64748b) 18%, transparent);
    color: var(--env-color, #64748b);
    border: 1px solid color-mix(in srgb, var(--env-color, #64748b) 35%, transparent);
}

.env-badge--muted {
    --env-color: #94a3b8;
}

.env-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.env-section {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.env-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.env-resource-card {
    background: var(--bg-hover, rgba(0,0,0,0.03));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}

.env-quick-form { margin-top: 0.25rem; }

.link-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.link-env-assign-form {
    flex-shrink: 0;
    width: 4.5rem;
}

.link-env-select {
    font-size: 0.75rem;
    font-weight: 600;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    border-color: var(--border-color);
}

.link-env-select--unset {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.env-badge--static {
    flex-shrink: 0;
    min-width: 2.5rem;
}

.env-panel-notes {
    background: var(--bg-hover, rgba(0,0,0,0.03));
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.env-overview-card {
    border-left: 4px solid var(--env-color, var(--color-primary));
    padding: 1rem 1.15rem;
}

.env-overview-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.env-overview-base-url {
    color: var(--text-muted);
    text-decoration: none;
}

.env-overview-base-url:hover {
    color: var(--color-primary);
}

.env-overview-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color);
}

.env-overview-link-item:last-child {
    border-bottom: none;
}

.env-overview-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    min-width: 0;
}

.env-overview-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.env-overview-link:hover {
    color: var(--color-primary);
}

/* ===== CARDS ===== */
.card-modern {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== PROJECT CARD (minimal) ===== */
.project-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.35);
}

.project-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.project-card-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 14px;
}

.project-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--project-accent, #3B82F6) 12%, var(--bg-card) 88%) 0%,
        color-mix(in srgb, var(--project-accent, #3B82F6) 6%, var(--bg-card) 94%) 100%
    );
}

.project-card-media--placeholder {
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--project-accent, #3B82F6) 88%, #000 12%) 0%,
        color-mix(in srgb, var(--project-accent, #3B82F6) 55%, #0B1220 45%) 100%
    );
}

.project-card-media-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: rgba(255, 255, 255, 0.12);
    user-select: none;
    pointer-events: none;
}

.project-card-logo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

.project-card-media-initial {
    font-size: clamp(2.5rem, 28%, 4.5rem);
    font-weight: 700;
    line-height: 1;
    color: color-mix(in srgb, var(--project-accent, #3B82F6) 72%, var(--text-primary) 28%);
    user-select: none;
    pointer-events: none;
}

.project-card-media-shade {
    display: none;
}

.project-card-title {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

.project-card-favorite {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 3;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.project-card:hover .project-card-favorite,
.project-card-favorite.is-active,
.project-card-favorite:focus-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.project-card-favorite:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.project-card-favorite.is-active {
    color: #FBBF24;
}

.project-card-favorite.is-active i {
    color: #FBBF24;
}

.project-card-checklist {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 3;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.project-card:hover .project-card-checklist,
.project-card-checklist.is-active,
.project-card-checklist:focus-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.project-card-checklist:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.project-card-checklist.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.project-card-checklist.is-active i {
    color: #A5B4FC;
}

.project-card-env-bar {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    min-height: 1.65rem;
}

.project-card-env-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--env-color) 35%, var(--text-muted));
    background: color-mix(in srgb, var(--env-color) 6%, transparent);
    border-right: 1px solid var(--border-color);
    transition: color 0.2s ease, background 0.2s ease;
}

.project-card-env-segment:last-child {
    border-right: none;
}

.project-card-env-segment.is-active {
    color: var(--env-color);
    background: color-mix(in srgb, var(--env-color) 16%, transparent);
    box-shadow: inset 0 -2px 0 var(--env-color);
}

.project-card:hover .project-card-env-segment.is-active {
    background: color-mix(in srgb, var(--env-color) 22%, transparent);
}

/* ===== DASHBOARD ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.1rem;
    letter-spacing: -0.02em;
}

.dashboard-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-search {
    position: relative;
    min-width: 260px;
}

.dashboard-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.dashboard-search input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-search input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.dashboard-section {
    margin-bottom: 2.5rem;
}

.dashboard-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dashboard-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dashboard-section-head .dashboard-section-title {
    margin-bottom: 0;
}

.dashboard-search--inline {
    min-width: 220px;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.dashboard-kpi-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.dashboard-kpi-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: var(--shadow-sm);
    color: inherit;
}

.dashboard-kpi-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: color-mix(in srgb, var(--color-primary) 12%, var(--bg-card) 88%);
    color: var(--color-primary);
}

.dashboard-kpi-icon--env {
    background: color-mix(in srgb, #0EA5E9 12%, var(--bg-card) 88%);
    color: #0EA5E9;
}

.dashboard-kpi-icon--server {
    background: color-mix(in srgb, #22C55E 12%, var(--bg-card) 88%);
    color: #22C55E;
}

.dashboard-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.dashboard-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.dashboard-kpi-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .dashboard-kpis {
        grid-template-columns: 1fr;
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-project-row {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-project-row:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: var(--shadow-sm);
}

.dashboard-project-row-thumb {
    position: relative;
    flex-shrink: 0;
    align-self: stretch;
    width: 96px;
    min-height: 96px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--project-accent, #3B82F6) 12%, var(--bg-card) 88%) 0%,
        color-mix(in srgb, var(--project-accent, #3B82F6) 6%, var(--bg-card) 94%) 100%
    );
}

.dashboard-project-row-thumb-bg {
    display: none;
}

.dashboard-project-row-thumb-logo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

.dashboard-project-row-thumb-initial {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: color-mix(in srgb, var(--project-accent, #3B82F6) 72%, var(--text-primary) 28%);
    user-select: none;
    pointer-events: none;
}

.dashboard-project-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-project-row-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-project-row-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.dashboard-project-row-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.25;
}

.dashboard-project-row-title:hover {
    color: var(--color-primary);
}

.dashboard-project-row-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.status-badge-sm {
    font-size: 0.68rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
}

.dashboard-project-row-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.dashboard-project-row-action {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dashboard-project-row-action:hover {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--color-primary) 35%, var(--border-color));
}

.dashboard-project-row-action.btn-favorite.is-active {
    color: #FBBF24;
    border-color: rgba(251, 191, 36, 0.35);
}

.dashboard-project-row-action.btn-checklist.is-active {
    color: #A5B4FC;
    border-color: rgba(165, 180, 252, 0.35);
}

.dashboard-link-bar {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-width: 0;
}

.dashboard-link-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    flex: 1;
    min-width: 0;
}

.dashboard-link-group {
    flex: 1 1 160px;
    min-width: 0;
    padding: 0 0.85rem;
    border-right: 1px solid var(--border-color);
}

.dashboard-link-group:first-child {
    padding-left: 0;
}

.dashboard-link-group:last-child {
    padding-right: 0;
    border-right: none;
}

.dashboard-link-group-head {
    margin-bottom: 0.45rem;
}

.dashboard-link-group-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.18rem 0.45rem;
    border-radius: 5px;
    color: var(--env-color);
    background: color-mix(in srgb, var(--env-color) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--env-color) 35%, transparent);
    line-height: 1.2;
}

.dashboard-link-group-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dashboard-link-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.4rem;
    border-radius: 7px;
    text-decoration: none;
    min-width: 0;
    transition: background 0.15s ease;
}

.dashboard-link-item:hover {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.dashboard-link-item:hover .dashboard-link-url {
    text-decoration: underline;
}

.dashboard-link-item > .bi {
    flex-shrink: 0;
    color: var(--color-primary);
    font-size: 0.95rem;
    width: 1.1rem;
    text-align: center;
}

.dashboard-link-name {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 38%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-link-url {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    color: #818cf8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-link-bar-copy {
    flex-shrink: 0;
    align-self: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dashboard-link-bar-copy:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--text-primary);
}

.dashboard-project-row-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .dashboard-project-row {
        flex-direction: column;
    }

    .dashboard-project-row-thumb {
        width: 100%;
        min-height: 120px;
    }

    .dashboard-project-row-header {
        flex-direction: row;
    }

    .dashboard-link-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-link-groups {
        flex-direction: column;
    }

    .dashboard-link-group {
        flex: 1 1 auto;
        padding: 0.65rem 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .dashboard-link-group:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .dashboard-link-group:first-child {
        padding-top: 0;
    }

    .dashboard-link-name {
        max-width: none;
    }

    .dashboard-link-url {
        white-space: normal;
        word-break: break-all;
    }

    .dashboard-link-bar-copy {
        align-self: flex-end;
    }
}

/* ===== BOTÃO PRIMÁRIO CUSTOMIZADO ===== */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: #fff !important;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary-custom:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-primary-custom:active { transform: translateY(0); }

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg,
        var(--border-color) 25%,
        rgba(128,128,128,0.1) 50%,
        var(--border-color) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-anim 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-anim {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 280px;
    max-width: 360px;
}

.toast-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    animation: toast-in 0.25s ease;
}

.toast-item.toast-success { border-left: 4px solid var(--color-success); }
.toast-item.toast-error   { border-left: 4px solid var(--color-danger); }
.toast-item.toast-warning { border-left: 4px solid var(--color-warning); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===== PROJETO — HEADER / BANNER ===== */
.project-header {
    position: relative;
    margin: -1.5rem -1.5rem 0;
}

.project-banner {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--radius);
}

.project-cover-preview {
    display: block;
    width: 100%;
    max-width: 420px;
    max-height: 160px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.project-logo-preview {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    padding: 0.35rem;
}

.project-header-info {
    background: var(--bg-card);
    padding: 0 1.5rem 1.25rem;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: -44px;
}

.project-logo-lg {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    border: 4px solid var(--bg-card);
    object-fit: cover;
    background: var(--bg-card);
    flex-shrink: 0;
}

.project-header-meta {
    flex: 1;
    padding-top: 1rem;
    min-width: 0;
}

.project-header-meta h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.project-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.75rem;
    flex-wrap: wrap;
}

/* ===== ABAS DO PROJETO ===== */
.project-tabs {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    margin: 0 -1.5rem 1.5rem;
    padding: 0 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 0;
    scrollbar-width: none;
}

.project-tabs::-webkit-scrollbar { display: none; }

.project-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.project-tabs a:hover { color: var(--text-primary); }
.project-tabs a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* ===== METRIC CARDS ===== */
.metric-card {
    padding: 1.25rem;
    text-align: center;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-card .metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== LINK CARD ===== */
.link-card {
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== METHOD BADGE ===== */
.method-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
}

/* ===== APIS TABLE (separação entre endpoints) ===== */
.apis-table > tbody td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.apis-table > tbody + tbody {
    border-top: 8px solid var(--bg-body);
}

.apis-table > tbody > tr.api-row-details td {
    border-top: 0;
    padding-top: 0;
}

/* ===== TEMA ESCURO — componentes ===== */
[data-bs-theme="dark"] .sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .sidebar-nav a.active {
    background: var(--bg-active);
    color: var(--text-primary);
    font-weight: 600;
}

[data-bs-theme="dark"] .topbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .search-global input:focus,
[data-bs-theme="dark"] .dashboard-search input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

[data-bs-theme="dark"] .card-modern:hover {
    border-color: #3A3A3A;
}

[data-bs-theme="dark"] .project-card:hover {
    border-color: rgba(59, 130, 246, 0.45);
}

[data-bs-theme="dark"] .btn-primary-custom:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

[data-bs-theme="dark"] .project-tabs a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

[data-bs-theme="dark"] .auth-page,
[data-bs-theme="dark"] .auth-body {
    background: #010510;
}

[data-bs-theme="dark"] .drop-zone:hover,
[data-bs-theme="dark"] .drop-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.06);
}

[data-bs-theme="dark"] .search-result-item:hover {
    background: var(--bg-hover);
}

[data-bs-theme="dark"] .start-day-link:hover {
    background: var(--bg-hover);
}

/* ===== TABELAS — DARK MODE ===== */
[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--bg-card);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .table th {
    color: var(--text-muted);
    border-color: var(--border-color);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-bs-theme="dark"] .table td { border-color: var(--border-color); }

/* ===== FORMULÁRIOS — DARK MODE ===== */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--color-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

[data-bs-theme="dark"] .form-control::placeholder { color: var(--text-muted); }

[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ===== MODAIS — tokens Nexus ===== */
.modal-content {
    background-color: var(--bg-modal, var(--bg-card));
    border-color: var(--border-color);
    color: var(--text-primary);
}

.modal-header,
.modal-footer {
    border-color: var(--divider-color, var(--border-color));
}

.modal-header .btn-close {
    filter: none;
}

[data-bs-theme="dark"] .modal-header .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: 0.7;
}

/* ===== BOTÕES — DARK MODE ===== */
[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: rgba(255,255,255,0.08);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: var(--color-danger);
    color: #fff;
}

[data-bs-theme="dark"] .btn-outline-warning {
    color: var(--color-warning);
    border-color: var(--color-warning);
}

[data-bs-theme="dark"] .btn-outline-warning:hover {
    background-color: var(--color-warning);
    color: #0B1220;
}

[data-bs-theme="dark"] .btn-link {
    color: var(--text-muted);
}

[data-bs-theme="dark"] .btn-link:hover {
    color: var(--color-primary);
}

/* ===== BADGES — DARK MODE ===== */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: rgba(255,255,255,0.1) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: var(--bg-active) !important;
    color: var(--text-muted) !important;
}

/* ===== LIST GROUP — DARK MODE ===== */
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .list-group-item:hover {
    background-color: var(--bg-hover);
}

/* ===== ALERTS — DARK MODE ===== */
[data-bs-theme="dark"] .alert-danger  { background: rgba(239, 68, 68, 0.14);  border-color: rgba(239, 68, 68, 0.35);  color: #FCA5A5; }
[data-bs-theme="dark"] .alert-success { background: rgba(34, 197, 94, 0.14);  border-color: rgba(34, 197, 94, 0.35);  color: #86EFAC; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.35); color: #FCD34D; }
[data-bs-theme="dark"] .alert-info    { background: rgba(6, 182, 212, 0.14);  border-color: rgba(6, 182, 212, 0.35);  color: #67E8F9; }

/* ===== DROPDOWN — DARK MODE ===== */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== HR — DARK MODE ===== */
[data-bs-theme="dark"] hr { border-color: var(--border-color); opacity: 1; }

/* ===== AUTH PAGE — Nexus split layout ===== */
.auth-body {
    margin: 0;
    min-height: 100vh;
    background: #010510;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #010510;
    padding: 0;
}

.auth-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 1.5rem;
    padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem);
    position: relative;
}

.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 2rem;
    background: #010510;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: authBrandIn 0.7s ease both;
}

.auth-brand-logo {
    display: block;
    width: min(504px, 100%);
    max-width: 576px;
    height: auto;
    margin: 0 auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: none;
}

.auth-brand-name {
    margin: 0;
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    letter-spacing: 0.28em;
    color: #FFFFFF;
    text-indent: 0.28em;
}

.auth-brand-tagline {
    margin: 0.85rem 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #D1D5DB;
}

.auth-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: authCardIn 0.75s ease 0.08s both;
}

.auth-card,
.auth-card--glass {
    width: 100%;
    max-width: 420px;
    background: rgba(21, 28, 46, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #FFFFFF;
    border-radius: 22px;
    padding: 2.25rem 2rem 2rem;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.18),
        0 24px 60px rgba(0, 0, 0, 0.45);
    border: 1px solid #263246;
}

.auth-card-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60A5FA;
    font-size: 1.45rem;
    border: 1px solid rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.08);
}

.auth-card-head {
    text-align: center;
    margin-bottom: 1.35rem;
}

.auth-card-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

.auth-card-subtitle {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #D1D5DB;
}

.auth-alert {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: #D1D5DB;
    margin: 0;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.auth-card .auth-input,
.auth-card .form-control.auth-input {
    background: #1F2937;
    border: 1px solid #263246;
    color: #FFFFFF;
    border-radius: 10px;
    min-height: 46px;
    padding: 0.65rem 2.75rem 0.65rem 2.6rem;
    box-shadow: none;
}

.auth-card .auth-input::placeholder {
    color: #6B7280;
}

.auth-card .auth-input:focus {
    background: #1F2937;
    border-color: #3B82F6;
    color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: #9CA3AF;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle:hover {
    color: #60A5FA;
    background: rgba(59, 130, 246, 0.1);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -0.15rem;
}

.auth-remember .form-check-label {
    color: #D1D5DB;
    font-size: 0.875rem;
}

.auth-remember .form-check-input {
    background-color: #1F2937;
    border-color: #3B4B66;
}

.auth-remember .form-check-input:checked {
    background-color: #3B82F6;
    border-color: #3B82F6;
}

.auth-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: #9CA3AF;
}

.auth-footer-link {
    text-align: center;
    margin-top: 1.15rem;
}

.auth-footer-link a {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.875rem;
}

.auth-footer-link a:hover {
    color: #60A5FA;
}

.auth-card .btn-auth-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.35rem;
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 45%, #2563EB 100%);
    border: 1px solid transparent;
    color: #fff !important;
    padding: 0.78rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.auth-card .btn-auth-login:hover,
.auth-card .btn-auth-login:focus {
    background: linear-gradient(135deg, #93C5FD 0%, #3B82F6 40%, #1D4ED8 100%);
    border-color: transparent;
    color: #fff !important;
    filter: brightness(1.03);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.38);
    transform: translateY(-1px);
}

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

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 1.5rem 1.1rem 2rem;
        gap: 0.5rem;
    }

    .auth-brand {
        min-height: auto;
        padding: 1.25rem 0.5rem 0.25rem;
    }

    .auth-brand-logo {
        width: min(336px, 100%);
    }

    .auth-brand-name {
        font-size: 1.85rem;
        letter-spacing: 0.22em;
        text-indent: 0.22em;
    }

    .auth-brand-tagline {
        font-size: 0.68rem;
        letter-spacing: 0.2em;
    }

    .auth-card,
    .auth-card--glass {
        padding: 1.75rem 1.35rem 1.5rem;
        border-radius: 18px;
    }
}

/* ===== COMPARTILHAMENTO / VISIBILIDADE ===== */
.access-mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.access-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin: 0;
}

.access-mode-option:hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.04);
}

.access-mode-option.active {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
}

.access-mode-input {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.access-mode-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
}

.access-mode-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.access-mode-text strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.access-mode-text small {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.participant-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    margin: 0;
    transition: background 0.12s;
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-item:hover {
    background: rgba(59, 130, 246, 0.06);
}

.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.participant-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.participant-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.participant-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .access-mode-option:hover,
[data-bs-theme="dark"] .access-mode-option.active {
    background: var(--bg-hover);
}

[data-bs-theme="dark"] .participant-item:hover {
    background: var(--bg-hover);
}

/* ===== DOCUMENTAÇÃO ===== */
.doc-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .doc-type-options { grid-template-columns: 1fr; }
}

.doc-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    margin: 0;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

.doc-type-option i { font-size: 1.25rem; color: var(--color-primary); }

.doc-type-option:hover,
.doc-type-option.active {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.06);
    color: var(--text-primary);
}

.doc-type-input { display: none; }

.doc-image-wrapper,
.doc-text-wrapper {
    width: min(210mm, 100%);
    margin-inline: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.08);
}

.doc-pdf-wrapper {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--input-bg);
}

[data-bs-theme="dark"] .doc-image-wrapper,
[data-bs-theme="dark"] .doc-text-wrapper,
[data-theme="dark"] .doc-image-wrapper,
[data-theme="dark"] .doc-text-wrapper {
    background: color-mix(in srgb, var(--bg-card) 92%, #fff);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.24);
}

.doc-pdf-viewer {
    width: 100%;
    height: min(78vh, 920px);
    min-height: 520px;
    border: 0;
    display: block;
    background: #fff;
}

.doc-image-wrapper {
    width: min(210mm, 100%, calc((100vh - 12rem) * 210 / 297));
    max-height: min(297mm, calc(100vh - 12rem));
    aspect-ratio: 210 / 297;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
}

.doc-image-viewer {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: calc(var(--radius-sm) - 2px);
}

.doc-text-wrapper {
    min-height: 297mm;
    padding: 18mm 16mm;
    box-sizing: border-box;
}

.markdown-body {
    line-height: 1.65;
    color: var(--text-primary);
    font-size: 0.95rem;
    word-wrap: break-word;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-body h1 { font-size: 1.75rem; }
.markdown-body h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.35rem; }
.markdown-body h3 { font-size: 1.15rem; }

.markdown-body p {
    margin-bottom: 0.9rem;
}

.markdown-body blockquote {
    margin: 1rem 0;
    padding: 0.65rem 1rem;
    border-left: 3px solid var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
}

.markdown-body pre {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-body pre.mermaid {
    background: transparent;
    border: none;
    padding: 0.5rem 0;
    text-align: center;
}

.markdown-body pre.mermaid.mermaid-error {
    border: 1px dashed var(--border-color);
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.markdown-body code {
    background: var(--input-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-body li {
    margin-bottom: 0.35rem;
}

.markdown-body li > input[type="checkbox"] {
    margin-right: 0.45rem;
    vertical-align: middle;
    pointer-events: none;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.75rem;
    text-align: left;
}

.markdown-body th {
    background: var(--input-bg);
    font-weight: 600;
}

.markdown-body tr:nth-child(even) td {
    background: color-mix(in srgb, var(--input-bg) 55%, transparent);
}

.markdown-body img.markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin: 0.75rem 0;
    display: block;
}

.markdown-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.markdown-body hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.markdown-body del {
    opacity: 0.75;
}

[data-bs-theme="dark"] .doc-type-option:hover,
[data-bs-theme="dark"] .doc-type-option.active {
    background: var(--bg-hover);
}

/* ===== DOCUMENTAÇÃO — SUB-ABAS E BIBLIOTECA ===== */
.doc-inner-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.doc-inner-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.doc-inner-tabs a:hover {
    color: var(--text-primary);
}

.doc-inner-tabs a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.doc-inner-tabs-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--input-bg);
    font-size: 0.7rem;
    font-weight: 600;
}

.doc-inner-tabs a.active .doc-inner-tabs-count {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
}

.doc-library-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 992px) {
    .doc-library-layout {
        grid-template-columns: 1fr;
    }
}

.doc-library-list {
    padding: 0;
    overflow: hidden;
}

.doc-library-list-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.doc-library-items {
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow-y: auto;
}

.doc-library-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.doc-library-item:last-child {
    border-bottom: none;
}

.doc-library-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.doc-library-item.active {
    background: rgba(59, 130, 246, 0.1);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.doc-library-item-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
}

.doc-library-item-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-library-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-library-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-library-viewer {
    min-width: 0;
}

.doc-viewer-panel .doc-image-wrapper,
.doc-viewer-panel .doc-text-wrapper,
.doc-viewer-panel .doc-text-wrapper + .small.text-muted {
    margin-inline: auto;
}

[data-bs-theme="dark"] .doc-library-item:hover,
[data-bs-theme="dark"] .doc-library-item.active {
    background: var(--bg-hover);
}

[data-bs-theme="dark"] .doc-inner-tabs a.active {
    color: var(--color-primary);
}

.service-fields-builder {
    background: color-mix(in srgb, var(--input-bg) 55%, transparent);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.85rem;
}

.service-field-row {
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    background: var(--bg-card);
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.75rem;
}

.service-field-row:last-child {
    margin-bottom: 0;
}

.service-field-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.service-field-row-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.service-field-row-title .bi {
    opacity: 0.6;
}

.service-field-remove {
    line-height: 1;
    padding: 0.15rem 0.45rem;
}

.service-field-row textarea {
    min-height: 38px;
}

.service-field-item {
    border-left: 3px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
    padding-left: 0.75rem;
}

.service-field-command {
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.04);
    padding: 0.65rem 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
}

[data-bs-theme="dark"] .service-field-command {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.35);
}

/* ===== DROP ZONE ===== */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-muted);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(79,70,229,0.05);
}

.drop-zone.is-invalid {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.06);
}

/* ===== AVATAR ===== */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar-image {
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
}

/* ===== EQUIPE ===== */
.team-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.team-cards-empty {
    grid-column: 1 / -1;
}

.team-tcg-card-link {
    display: block;
    height: 100%;
}

.team-tcg-card {
    height: 100%;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.team-tcg-card-link:hover .team-tcg-card {
    transform: translateY(-4px) scale(1.01);
}

.team-tcg-card-link--static {
    cursor: default;
    pointer-events: none;
}

.team-tcg-card-link--static:hover .team-tcg-card {
    transform: none;
}

.team-tcg-card-frame {
    --tcg-frame: color-mix(in srgb, var(--color-primary) 55%, #b8860b 45%);
    --tcg-frame-soft: color-mix(in srgb, var(--tcg-frame) 22%, var(--bg-card));
    --tcg-panel: color-mix(in srgb, var(--bg-card) 88%, var(--input-bg));
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 3px solid var(--tcg-frame);
    border-radius: 14px;
    background: linear-gradient(165deg, var(--tcg-frame-soft) 0%, var(--bg-card) 38%, var(--bg-card) 100%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--tcg-frame) 35%, transparent),
        var(--shadow-sm);
    overflow: hidden;
}

.team-tcg-card-art {
    position: relative;
    aspect-ratio: 1 / 1;
    margin: 0.55rem 0.55rem 0;
    border: 2px solid color-mix(in srgb, var(--tcg-frame) 45%, var(--border-color));
    border-radius: 10px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 55%),
        linear-gradient(145deg, color-mix(in srgb, var(--color-primary) 12%, var(--bg-body)), var(--input-bg));
}

.team-tcg-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-tcg-card-art-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--color-primary) 70%, var(--text-primary));
    letter-spacing: -0.04em;
}

.team-tcg-card-namebar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.5rem 0.55rem 0.35rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--tcg-frame) 35%, var(--border-color));
    border-radius: 8px;
    background: color-mix(in srgb, var(--tcg-frame) 8%, var(--bg-card));
}

.team-tcg-card-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-tcg-card-attribute {
    flex-shrink: 0;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-primary) 14%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--color-primary) 30%, var(--border-color));
    color: var(--color-primary);
    font-size: 0.72rem;
}

.team-tcg-card-stars {
    display: flex;
    justify-content: center;
    gap: 0.2rem;
    margin: 0 0.55rem 0.45rem;
    min-height: 1rem;
}

.team-tcg-card-stars .bi {
    font-size: 0.72rem;
    color: color-mix(in srgb, var(--text-muted) 55%, transparent);
}

.team-tcg-card-stars .bi.is-active {
    color: #d4a017;
    text-shadow: 0 0 6px color-mix(in srgb, #d4a017 35%, transparent);
}

.team-tcg-card-stats {
    margin: 0 0.55rem 0.55rem;
    margin-top: auto;
    padding: 0.55rem 0.6rem 0.45rem;
    border: 1px solid color-mix(in srgb, var(--tcg-frame) 30%, var(--border-color));
    border-radius: 10px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--tcg-panel) 92%, transparent), var(--tcg-panel)),
        repeating-linear-gradient(
            -12deg,
            color-mix(in srgb, var(--border-color) 35%, transparent) 0 1px,
            transparent 1px 7px
        );
}

.team-tcg-card-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.team-tcg-card-stat {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.35rem;
}

.team-tcg-card-stat-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.team-tcg-card-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.team-tcg-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    border-top: 1px dashed color-mix(in srgb, var(--border-color) 80%, transparent);
    padding-top: 0.35rem;
}

.team-tcg-card-username {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-tcg-card-rank {
    flex-shrink: 0;
    font-weight: 700;
    color: color-mix(in srgb, var(--color-primary) 75%, var(--text-primary));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-tcg-card-cargo {
    margin-top: 0.25rem;
    font-size: 0.66rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .team-tcg-card-frame,
[data-theme="dark"] .team-tcg-card-frame {
    --tcg-frame: color-mix(in srgb, var(--color-primary) 65%, #8b7355 35%);
}

[data-bs-theme="dark"] .team-tcg-card-stars .bi.is-active,
[data-theme="dark"] .team-tcg-card-stars .bi.is-active {
    color: #f0c14b;
}

.team-member-card {
    display: flex;
    flex-direction: column;
}

.team-project-chip {
    text-decoration: none;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.7rem;
}

.team-project-chip:hover {
    color: var(--color-primary) !important;
    border-color: color-mix(in srgb, var(--color-primary) 35%, var(--border-color));
}

.team-flowchart {
    min-height: 190px;
    margin: 0;
}

.team-chart-wrap {
    position: relative;
    min-height: 240px;
    height: 240px;
}

/* ===== CARD DE PERMISSÕES DO PERFIL (USUÁRIOS) ===== */
.role-permissions-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.role-permissions-card .card-title {
    color: var(--text-primary);
}

.role-permissions-card #role-permissions {
    color: var(--text-primary);
}

.role-permissions-card #role-permissions .text-muted {
    color: var(--text-muted) !important;
}

/* ===== ANIMAÇÕES ===== */
.fade-in { animation: fadeIn 0.3s ease; }

/* ===== PRELOADER ===== */
.portal-preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    min-width: 180px;
}

.portal-preloader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
    border-top-color: var(--color-primary);
    animation: portalSpin 0.75s linear infinite;
}

.portal-preloader-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

html.portal-loading .app-wrapper {
    visibility: hidden;
}

.app-wrapper {
    transition: opacity 0.2s ease;
}

html:not(.portal-loading) .app-wrapper {
    animation: fadeIn 0.25s ease;
}

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

.portal-preloader-btn-spinner {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    margin-right: 0.35rem;
    vertical-align: -0.15em;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: portalSpin 0.65s linear infinite;
}

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

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }

    .sidebar.show { transform: translateX(0); }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }

    .sidebar-overlay.show { display: block; }

    .main-content { margin-left: 0; }

    .topbar { padding: 0 1rem; }

    .page-content { padding: 1rem; }

    .security-reminder-banner { margin: -1rem -1rem 1rem; padding: 0.75rem 1rem; }

    .project-header-info { flex-direction: column; align-items: flex-start; }
}

/* ===== CODE ===== */
code {
    background: rgba(79,70,229,0.1);
    color: var(--color-primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

[data-bs-theme="dark"] code {
    background: rgba(59, 130, 246, 0.12);
    color: #7AB8FF;
}

/* ===== CHECKLIST DIÁRIA ===== */
.checklist-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
}

.checklist-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.checklist-subtitle {
    color: var(--text-muted);
    max-width: 560px;
}

.checklist-progress-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--color-primary) calc(var(--progress, 0) * 1%), rgba(128,128,128,0.15) 0);
    position: relative;
}

.checklist-progress-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--bg-card);
}

.checklist-progress-value {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 1rem;
}

.checklist-item {
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.checklist-item.is-done {
    border-color: rgba(34, 197, 94, 0.35);
}

.checklist-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.checklist-item-body {
    padding: 1rem 1.25rem 1.25rem;
}

.checklist-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.checklist-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checklist-check-ui {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.checklist-check input:checked + .checklist-check-ui {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checklist-check input:checked + .checklist-check-ui::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.checklist-item-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
}

.checklist-item.is-done .checklist-item-title {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(128,128,128,0.5);
}

.checklist-note-input {
    font-size: 0.9rem;
    resize: vertical;
    min-height: 64px;
}

/* ===== MINHAS FERRAMENTAS ===== */
.tools-filter-wrap {
    min-width: 200px;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tools-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tools-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-sm);
}

.tools-item-main {
    min-width: 0;
    flex: 1;
}

.tools-item-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 0;
}

.tools-item-link > .bi {
    flex-shrink: 0;
    color: var(--color-primary);
    font-size: 0.95rem;
}

.tools-item-name {
    flex-shrink: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tools-item-url {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tools-item-link:hover .tools-item-url {
    color: var(--color-primary);
    text-decoration: underline;
}

.tools-item-desc {
    margin-top: 0.35rem;
    padding-left: 1.45rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tools-item-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-tool-start-day.is-active {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.08);
}

.btn-tool-start-day.is-active:hover {
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.6);
    background: rgba(217, 119, 6, 0.14);
}

.tools-item--start-day {
    border-color: rgba(217, 119, 6, 0.28);
}

.tools-item-start-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
    margin-left: 1.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #d97706;
}

@media (max-width: 768px) {
    .tools-item {
        flex-direction: column;
    }

    .tools-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .tools-item-name {
        max-width: 55%;
    }
}

/* ===== KANBAN ===== */
.dashboard-section--kanban {
    margin-bottom: 1.25rem;
}

.kanban-board {
    padding: 1rem 1.15rem 1.1rem;
}

.kanban-board-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.kanban-board-intro {
    min-width: 0;
    flex: 1 1 240px;
}

.kanban-board-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-left: auto;
    flex-shrink: 0;
}

.kanban-board-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.kanban-board-title .bi {
    color: var(--color-primary);
    font-size: 1.2rem;
}

.kanban-new-task-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.88rem;
}

.kanban-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
    height: clamp(520px, calc(100vh - 250px), 920px);
    min-height: 520px;
}

.kanban-layout--no-scratchpad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kanban-column--scratchpad {
    --scratch-accent: #a78bfa;
    --scratch-accent-soft: #c4b5fd;
    --scratch-surface: color-mix(in srgb, var(--scratch-accent) 9%, var(--bg-body));
    --scratch-surface-deep: color-mix(in srgb, var(--scratch-accent) 14%, var(--bg-card));
    --scratch-border: color-mix(in srgb, var(--scratch-accent) 24%, var(--border-color));
    background: linear-gradient(165deg, var(--scratch-surface-deep) 0%, var(--scratch-surface) 48%, var(--bg-body) 100%);
    border-color: var(--scratch-border);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--scratch-accent-soft) 18%, transparent);
    min-height: 0;
    padding: 0.85rem 0.9rem 0.75rem;
}

[data-bs-theme="dark"] .kanban-column--scratchpad,
[data-theme="dark"] .kanban-column--scratchpad {
    --scratch-accent: #c4b5fd;
    --scratch-accent-soft: #ddd6fe;
    --scratch-surface: color-mix(in srgb, var(--scratch-accent) 7%, var(--bg-body));
    --scratch-surface-deep: color-mix(in srgb, var(--scratch-accent) 11%, var(--bg-card));
}

.kanban-column--scratchpad .kanban-column-title {
    color: color-mix(in srgb, var(--scratch-accent) 70%, var(--text-primary));
}

.kanban-column--scratchpad .kanban-column-title .bi {
    color: var(--scratch-accent);
}

.kanban-column--scratchpad .kanban-column-header {
    margin-bottom: 0.55rem;
    padding-bottom: 0.55rem;
    border-bottom-color: color-mix(in srgb, var(--scratch-accent) 18%, var(--border-color));
}

.kanban-scratchpad-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.kanban-scratchpad-save-task {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--scratch-accent) 28%, var(--border-color));
    border-radius: 8px;
    background: color-mix(in srgb, var(--scratch-accent) 10%, var(--bg-card));
    color: var(--scratch-accent);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kanban-scratchpad-save-task:hover:not(:disabled) {
    background: color-mix(in srgb, var(--scratch-accent) 18%, var(--bg-card));
    border-color: color-mix(in srgb, var(--scratch-accent) 45%, var(--border-color));
}

.kanban-scratchpad-save-task:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.kanban-scratchpad-save-task.is-saving {
    animation: kanban-scratchpad-pulse 0.8s ease infinite;
}

@keyframes kanban-scratchpad-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.kanban-scratchpad-hint {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: color-mix(in srgb, var(--scratch-accent) 55%, var(--text-muted));
    flex-shrink: 0;
}

.kanban-scratchpad-hint .bi {
    font-size: 0.68rem;
    vertical-align: -0.05em;
}

.kanban-scratchpad-input {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    resize: none;
    overflow-y: auto;
    border: 1px solid color-mix(in srgb, var(--scratch-accent) 18%, var(--border-color));
    border-radius: 12px;
    background: color-mix(in srgb, var(--scratch-accent) 5%, var(--bg-card));
    color: var(--text-primary);
    padding: 0.75rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.55;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kanban-scratchpad-input::placeholder {
    color: color-mix(in srgb, var(--text-muted) 85%, var(--scratch-accent-soft));
}

.kanban-scratchpad-input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--scratch-accent) 45%, var(--border-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--scratch-accent) 16%, transparent);
}

.kanban-scratchpad-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.kanban-scratchpad-status {
    font-size: 0.72rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--scratch-accent) 50%, var(--text-muted));
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--scratch-accent) 10%, transparent);
}

.kanban-scratchpad-status.is-saving { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.kanban-scratchpad-status.is-saved { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.kanban-scratchpad-status.is-error { color: #ef4444; background: rgba(239, 68, 68, 0.12); }

.kanban-column {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.85rem 0.85rem 0.9rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kanban-column--todo { --column-accent: #64748b; }
.kanban-column--doing { --column-accent: #f59e0b; }
.kanban-column--done { --column-accent: #22c55e; }

.kanban-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--column-accent);
}

.kanban-column.is-drag-over .kanban-column-body {
    background: color-mix(in srgb, var(--column-accent) 8%, transparent);
    border-radius: 12px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.kanban-column-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 0;
}

.kanban-column--todo .kanban-column-title .bi { color: #94a3b8; }
.kanban-column--doing .kanban-column-title .bi { color: #f59e0b; }
.kanban-column--done .kanban-column-title .bi { color: #22c55e; }

.kanban-column-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.kanban-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.kanban-column-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kanban-column-add:hover {
    color: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 35%, var(--border-color));
    background: color-mix(in srgb, var(--color-primary) 8%, var(--bg-card));
}

.kanban-column-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0.1rem 0.15rem 0.15rem 0;
    transition: background 0.15s ease;
}

.kanban-column-body:empty {
    min-height: 80px;
}

.kanban-column-body:empty::after {
    content: 'Arraste anotações para cá';
    display: block;
    margin: auto;
    padding: 1.25rem 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.kanban-card {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    min-height: auto;
    background: var(--bg-card);
    border: 1px solid color-mix(in srgb, var(--border-color) 85%, transparent);
    border-radius: 10px;
    overflow: hidden;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.kanban-card:hover {
    border-color: color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
}

.kanban-card.is-filtered { display: none; }

.kanban-card--chosen {
    transform: rotate(1.5deg) scale(1.02);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    cursor: grabbing;
}

.kanban-card--ghost {
    opacity: 0.35;
    border-style: dashed;
}

.kanban-card--dragging {
    opacity: 0.9;
    cursor: grabbing;
}

.kanban-card--shared-in {
    border-color: color-mix(in srgb, var(--color-primary) 22%, var(--border-color));
}

.kanban-card--new { animation: kanbanCardEnter 0.45s ease; }
.kanban-card--highlight { animation: kanbanCardHighlight 2.2s ease; }

@keyframes kanbanCardEnter {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes kanbanCardHighlight {
    0%, 100% { box-shadow: none; border-color: var(--border-color); }
    20%, 60% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); border-color: rgba(59, 130, 246, 0.55); }
}

.kanban-card-priority {
    display: none;
}

.kanban-card-body {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.7rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.kanban-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.kanban-card-actions {
    display: flex;
    gap: 0.15rem;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.kanban-card:hover .kanban-card-actions,
.kanban-card:hover > .kanban-card-body > .kanban-card-top .kanban-card-action {
    opacity: 1;
}

.kanban-card-action {
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.kanban-card-action:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.kanban-card-delete:hover { color: #EF4444; }

.kanban-card-share:hover { color: var(--color-primary); }

.kanban-share-picker,
.kanban-share-users {
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    background: var(--input-bg);
    padding: 0.65rem 0.75rem;
}

.kanban-share-users {
    max-height: 180px;
    overflow-y: auto;
}

.kanban-share-users .form-check {
    margin-bottom: 0.35rem;
}

.kanban-share-users .form-check:last-child {
    margin-bottom: 0;
}

.kanban-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: break-word;
    letter-spacing: -0.01em;
}

.kanban-card-desc {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.15rem;
    margin-top: 0.2rem;
    min-width: 0;
}

.kanban-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    max-width: 100%;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-meta-item .bi {
    font-size: 0.68rem;
    opacity: 0.8;
}

.kanban-card-meta-sep {
    color: var(--text-muted);
    opacity: 0.45;
    font-size: 0.68rem;
    line-height: 1;
    padding: 0 0.1rem;
    user-select: none;
}

.kanban-card-meta-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--priority-color);
    flex-shrink: 0;
}

.kanban-card-meta-item--completed {
    color: color-mix(in srgb, #16A34A 70%, var(--text-muted));
}

.kanban-card-meta-item--priority {
    color: color-mix(in srgb, var(--priority-color) 75%, var(--text-muted));
    font-weight: 600;
}

.kanban-card-meta-item--project,
.kanban-card-meta-item--personal,
.kanban-card-meta-item--shared {
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .kanban-layout,
    .kanban-layout--no-scratchpad {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        height: auto;
        min-height: auto;
    }

    .kanban-column--scratchpad {
        grid-column: 1 / -1;
        height: 240px;
    }

    .kanban-scratchpad-input {
        min-height: 0;
    }

    .kanban-column {
        height: 380px;
    }

    .kanban-column-body {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        padding: 1.1rem 1rem 1.2rem;
    }

    .kanban-board-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kanban-board-actions {
        margin-left: 0;
        justify-content: flex-end;
    }

    .kanban-layout,
    .kanban-layout--no-scratchpad {
        grid-template-columns: 1fr;
    }

    .kanban-column--scratchpad {
        height: 220px;
    }

    .kanban-column {
        height: 360px;
    }

    .kanban-card-actions {
        opacity: 1;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== AGENDA / FULLCALENDAR ===== */
#meetings-calendar {
    --fc-border-color: var(--border-color);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--bg-tertiary);
    --fc-list-event-hover-bg-color: var(--bg-hover);
    --fc-today-bg-color: rgba(var(--color-primary-rgb), 0.08);
    --fc-button-bg-color: var(--color-primary);
    --fc-button-border-color: var(--color-primary);
    --fc-button-hover-bg-color: var(--color-primary-hover);
    --fc-button-hover-border-color: var(--color-primary-hover);
    --fc-button-active-bg-color: var(--color-primary-active);
    --fc-button-active-border-color: var(--color-primary-active);
    --fc-event-bg-color: var(--color-primary);
    --fc-event-border-color: var(--color-primary);
    color: var(--text-primary);
}

#meetings-calendar .fc {
    font-family: inherit;
}

#meetings-calendar .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 600;
}

#meetings-calendar .fc-col-header-cell-cushion,
#meetings-calendar .fc-daygrid-day-number {
    color: var(--text-secondary);
    text-decoration: none;
}

#meetings-calendar .meeting-cancelled,
#meetings-calendar .fc-event.meeting-cancelled {
    opacity: 0.55;
    text-decoration: line-through;
    filter: grayscale(0.4);
}

.dashboard-meetings {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dashboard-meeting-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.dashboard-meeting-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.dashboard-meeting-item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dashboard-meeting-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meeting-participants-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    padding: 0.35rem;
}

.meeting-participant-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    margin: 0;
    border-radius: 6px;
    cursor: pointer;
}

.meeting-participant-option:hover {
    background: var(--bg-hover);
}

.meeting-participant-option .form-check-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.meeting-participant-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.meeting-participant-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.meeting-participant-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
