/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
    --color-primary: #4F46E5;
    --color-primary-hover: #4338CA;
    --color-secondary: #0F172A;
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== TEMA CLARO ===== */
[data-bs-theme="light"] {
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --text-primary: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.08);
    --shadow-md: 0 4px 16px rgba(15,23,42,0.12);
    --input-bg: #F8FAFC;
}

/* ===== TEMA ESCURO (perfil Kanban — charcoal + acentos) ===== */
[data-bs-theme="dark"] {
    --color-primary: #007BFF;
    --color-primary-hover: #0062CC;
    --color-success: #4CAF50;
    --color-warning: #FF9800;
    --color-danger: #EF5350;

    --bg-body: #121212;
    --bg-sidebar: #181818;
    --bg-card: #1E1E1E;
    --bg-hover: #2A2A2A;
    --bg-active: #333333;
    --text-primary: #FFFFFF;
    --text-muted: #A0A0A0;
    --border-color: #2C2C2C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.55);
    --input-bg: #252525;

    /* Bootstrap 5.3 — sincroniza componentes nativos */
    --bs-body-bg: #121212;
    --bs-body-color: #FFFFFF;
    --bs-emphasis-color: #FFFFFF;
    --bs-secondary-color: #A0A0A0;
    --bs-tertiary-color: rgba(160, 160, 160, 0.78);
    --bs-border-color: #2C2C2C;
    --bs-primary: #007BFF;
    --bs-primary-rgb: 0, 123, 255;
    --bs-success: #4CAF50;
    --bs-success-rgb: 76, 175, 80;
    --bs-warning: #FF9800;
    --bs-warning-rgb: 255, 152, 0;
    --bs-danger: #EF5350;
    --bs-secondary-bg: #1E1E1E;
    --bs-tertiary-bg: #252525;
    --bs-link-color: #4DA3FF;
    --bs-link-hover-color: #7AB8FF;
}

/* ===== 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 {
    height: var(--header-height);
    min-height: var(--header-height);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    background: var(--bg-sidebar);
}

.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(79, 70, 229, 0.1);
    color: var(--color-primary);
}

.sidebar-nav a.active {
    background: rgba(79, 70, 229, 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(79, 70, 229, 0.08);
    color: var(--color-primary);
}

.sidebar-footer-nav a.active {
    background: rgba(79, 70, 229, 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;
}

/* ===== 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(79, 70, 229, 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; }

.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);
}

/* ===== 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(79, 70, 229, 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: 4 / 3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.project-card-media--placeholder {
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--project-accent, #4F46E5) 88%, #000 12%) 0%,
        color-mix(in srgb, var(--project-accent, #4F46E5) 55%, #0F172A 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-media-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
    pointer-events: none;
}

.project-card-media-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.82) 0%,
        rgba(15, 23, 42, 0.35) 38%,
        transparent 72%
    );
    pointer-events: none;
}

.project-card-title {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 1rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.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: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.85);
    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: rgba(15, 23, 42, 0.75);
    color: #fff;
}

.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: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.85);
    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: rgba(15, 23, 42, 0.75);
    color: #fff;
}

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

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

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

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

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

.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    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(79, 70, 229, 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;
}

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

/* ===== 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;
}

.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;
}

/* ===== 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(0, 123, 255, 0.22);
}

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

[data-bs-theme="dark"] .project-card:hover {
    border-color: rgba(0, 123, 255, 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 {
    background: #001a44;
}

[data-bs-theme="dark"] .drop-zone:hover,
[data-bs-theme="dark"] .drop-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(0, 123, 255, 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(0, 123, 255, 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);
}

/* ===== 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: #121212;
}

[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, 83, 80, 0.14);  border-color: rgba(239, 83, 80, 0.35);  color: #FF8A80; }
[data-bs-theme="dark"] .alert-success { background: rgba(76, 175, 80, 0.14);  border-color: rgba(76, 175, 80, 0.35);  color: #81C784; }
[data-bs-theme="dark"] .alert-warning { background: rgba(255, 152, 0, 0.14); border-color: rgba(255, 152, 0, 0.35); color: #FFB74D; }

/* ===== 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 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #001a44;
    padding: 1.5rem;
}

.auth-card {
    background: #FFFFFF;
    color: #0F172A;
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-card h4 {
    color: #0F172A;
}

.auth-card .text-muted {
    color: #64748B !important;
}

.auth-card .form-label {
    color: #334155;
    font-weight: 500;
}

.auth-card .form-control {
    background: #F8FAFC;
    border-color: #E2E8F0;
    color: #0F172A;
}

.auth-card .form-control:focus {
    background: #FFFFFF;
    border-color: #007BFF;
    color: #0F172A;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.auth-card .form-check-label {
    color: #475569;
}

.auth-card .btn-auth-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #001a44;
    border: 1px solid #001a44;
    color: #fff !important;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}

.auth-card .btn-auth-login:hover,
.auth-card .btn-auth-login:focus {
    background: #002a66;
    border-color: #002a66;
    color: #fff !important;
}

/* ===== 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(79, 70, 229, 0.04);
}

.access-mode-option.active {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 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(79, 70, 229, 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(3, 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(79, 70, 229, 0.06);
    color: var(--text-primary);
}

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

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

.doc-pdf-viewer {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    border: 0;
    display: block;
}

.markdown-body {
    line-height: 1.65;
    color: var(--text-primary);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

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

.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;
}

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

[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(79, 70, 229, 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(79, 70, 229, 0.05);
}

.doc-library-item.active {
    background: rgba(79, 70, 229, 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;
}

[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);
}

/* ===== 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);
}

/* ===== 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;
}

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

@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(0, 123, 255, 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;
}

/* ===== 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); }
