/* ============================================================
   STYLE.CSS — FEA Finance Jr. Dashboard
   Arquivo único de estilos (auth + dashboard, conforme decidido).
   Nesta etapa: reset global + tela de autenticação.
   ============================================================ */

/* ---------- Reset base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    /* Evita o "bounce" horizontal e o zoom acidental por double-tap no iOS,
       sem desativar o pinch-to-zoom (acessibilidade). */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

button {
    font-family: inherit;
    touch-action: manipulation;
}

/* Elementos interativos: sem callout de "segurar pra ver opções" do iOS,
   sem seleção de texto acidental durante toques/arrastos, e sem o atraso
   de ~300ms no tap (double-tap-to-zoom) em qualquer navegador mobile. */
button,
.nav-item,
.mobile-nav-item,
.mobile-avatar,
.sidebar-profile,
.view-switch-btn,
.type-toggle-btn,
.filter-btn,
.calendar-nav-btn,
.calendar-mode-btn,
.calendar-today-btn,
.attendance-tile-toggle,
.entity-edit-btn,
.entity-delete-btn,
.modal-close,
.cal-chip,
.task-checkbox-icon,
.attendance-badge-btn,
.quickadd-btn,
.member-card,
.calendar-cell-hasitems {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Inputs de texto continuam selecionáveis normalmente */
input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
}

/* ============================================================
   AUTH — tela de login / primeiro acesso / recuperação de senha
   ============================================================ */

.auth-body {
    background: #03182E;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
}

.auth-bg-video-wrap {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.auth-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.auth-bg-video.active {
    opacity: 1;
}

.auth-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 24, 46, 0.72);
}

.auth-body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: linear-gradient(45deg, rgba(61, 87, 120, 0.1), rgba(3, 24, 46, 0.1));
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

.auth-body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -15%;
    width: 60%;
    height: 120%;
    background: linear-gradient(45deg, rgba(3, 24, 46, 0.05), rgba(61, 87, 120, 0.08));
    border-radius: 50%;
    animation: float 25s ease-in-out infinite reverse;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.auth-main-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
    position: relative;
    z-index: 1;
}

.auth-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 360px;
}

.auth-form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 25px 25px 30px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 10px;
}

.logo-image {
    width: 150px;
    height: 150px;
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.auth-container {
    text-align: center;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-container .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.auth-container .form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.auth-container .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.auth-container .form-input:focus {
    border-color: #3D5778;
}

.auth-container .form-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #03182E, #3D5778);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.auth-container .form-btn:hover {
    transform: translateY(-2px);
}

.auth-container .form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.auth-link {
    color: #3E71B6;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.3s;
}

.auth-link:hover {
    color: #03182E;
    text-decoration: underline;
}

.auth-back-link {
    display: inline-block;
    margin-top: 18px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
}

.auth-back-link:hover {
    color: #333;
    text-decoration: underline;
}

.auth-step-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.auth-step-subtitle {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* ---------- Card de senha / código OTP (reutilizado por
   Primeiro Acesso e Esqueci a Senha) ---------- */

.password-reset-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(61, 87, 120, 0.2);
    position: relative;
}

.password-reset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #3D5778, #03182E);
}

.password-reset-card-header {
    text-align: center;
    padding: 22px 22px 14px 22px;
}

.password-reset-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
    animation: gentle-bounce 3s ease-in-out infinite;
}

@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.password-reset-card-title {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #03182E, #3D5778);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.password-reset-card-subtitle {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.password-reset-card-body {
    padding: 14px 22px 24px 22px;
}

.password-reset-card .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.password-reset-card .form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.password-reset-card .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f8f9fa;
}

.password-reset-card .form-input:focus {
    border-color: #3D5778;
    background: white;
    box-shadow: 0 0 0 4px rgba(61, 87, 120, 0.15);
}

/* Campo específico do código de 6 dígitos */
.otp-input {
    letter-spacing: 10px;
    text-align: center;
    font-size: 22px !important;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.password-requirements {
    margin: 15px 0;
    padding: 12px;
    background: #f0f8ff;
    border: 1px solid #e3f2fd;
    border-radius: 10px;
    border-left: 4px solid #3D5778;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
}

.requirement-icon {
    color: #3D5778;
    font-weight: bold;
}

.password-reset-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 22px rgba(61, 87, 120, 0.3);
    margin-top: 5px;
}

.password-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(61, 87, 120, 0.4);
}

.password-reset-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.password-reset-btn .btn-loading {
    display: none;
}

.password-reset-btn:disabled .btn-text {
    display: none;
}

.password-reset-btn:disabled .btn-loading {
    display: inline;
}

.resend-code-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: #3E71B6;
    font-size: 13px;
    cursor: pointer;
}

.resend-code-link:hover {
    text-decoration: underline;
}

.resend-code-link.disabled {
    color: #aaa;
    cursor: not-allowed;
    text-decoration: none;
}

/* ---------- Área de mensagens (erro / sucesso) ---------- */

#messageArea {
    max-width: 360px;
    margin: 14px auto 0 auto;
}

.auth-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
}

.auth-message.error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.auth-message.success {
    background: linear-gradient(135deg, #f0fdf4, #bbf7d0);
    color: #15803d;
    border: 1px solid #86efac;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 768px) {
    .auth-content {
        max-width: 350px;
    }

    .auth-form-container {
        padding: 20px;
        border-radius: 25px;
    }

    .logo-image {
        width: 120px;
        height: 120px;
    }

    .password-reset-card .form-input {
        font-size: 16px; /* evita zoom automático no iOS */
    }
}

@media (max-width: 480px) {
    .auth-main-container {
        padding: 15px;
    }

    .auth-form-container {
        padding: 16px;
        border-radius: 20px;
    }

    .logo-image {
        width: 100px;
        height: 100px;
    }

    .password-reset-card-header {
        padding: 18px 16px 10px 16px;
    }

    .password-reset-card-body {
        padding: 12px 16px 18px 16px;
    }
}

/* ============================================================
   DASHBOARD — casca do SPA (sidebar, abas, header mobile)
   ============================================================ */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f8f9fb;
}

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    background: white;
    border-right: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 24px;
}

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

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: #f5f6f8;
    color: #03182E;
}

.nav-item.active {
    background: #eef1f5;
    color: #03182E;
    font-weight: 600;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.nav-label {
    font-size: 14px;
}

/* Bloco de perfil clicável no rodapé da sidebar */
.sidebar-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-profile:hover {
    background: #f0f6fc;
    transform: translateY(-1px);
}

.sidebar-avatar,
.mobile-avatar,
.avatar-preview {
    border-radius: 50%;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.sidebar-avatar img,
.mobile-avatar img,
.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-profile-info {
    min-width: 0;
}

.sidebar-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-role {
    font-size: 11px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Header mobile ---------- */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid #eef0f3;
    width: 100%;
}

.mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
}

.mobile-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.mobile-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
    cursor: pointer;
}

.mobile-nav-scroll {
    display: none; /* vira flex só no breakpoint mobile, ver media query */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: white;
    border-top: 1px solid #eef0f3;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9aa3b2;
    cursor: pointer;
    padding: 10px 4px calc(8px + env(safe-area-inset-bottom)) 4px;
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    transition: transform 0.15s ease;
}

.mobile-nav-item.active {
    color: #03182E;
}

.mobile-nav-item.active svg {
    transform: translateY(-1px);
}

.mobile-nav-item:active svg {
    transform: scale(0.9);
}

/* ---------- Conteúdo principal ---------- */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 32px 40px;
}

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

.tab-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef1f4;
}

.tab-header-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #f5f6f8;
    border: 1px solid #e6e9ee;
    color: #3D5778;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-header-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.tab-header-text {
    min-width: 0;
}

.tab-header h2 {
    font-size: 19px;
    font-weight: 700;
    color: #03182E;
    letter-spacing: -0.02em;
    margin-bottom: 3px;
}

.tab-header p {
    font-size: 13px;
    color: #8a94a3;
}

.empty-state {
    background: white;
    border: 1px dashed #dfe3e8;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ---------- Área de mensagens do dashboard (toast) ---------- */
#dashboardMessageArea {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 100%;
    max-width: 360px;
}

/* ============================================================
   MODAL DE CONFIGURAÇÕES
   ============================================================ */

/* ============================================================
   PAINÉIS LATERAIS (drawers) — configurações, detalhe do dia,
   criação de evento/tarefa
   ============================================================
   Em vez do modal centralizado com fundo escurecido, o conteúdo
   desliza a partir da borda direita da tela (ou de baixo, no
   celular), com sombra própria pra dar profundidade — sem nunca
   escurecer o que está por trás. O usuário nunca perde o
   contexto do que estava fazendo. */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    background: white;
    width: 440px;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 28px 0 0 28px;
    box-shadow: -32px 0 64px rgba(15, 23, 42, 0.10), -4px 0 16px rgba(15, 23, 42, 0.06);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.32, .72, 0, 1);
}

.modal-overlay.active .modal {
    transform: translateX(0);
}

.modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 24px;
}

@media (max-width: 640px) {
    .modal-overlay {
        align-items: flex-end;
        justify-content: center;
    }

    .modal {
        width: 100%;
        height: auto;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-overlay.active .modal {
        transform: translateY(0);
    }

    .modal-close {
        width: 38px;
        height: 38px;
    }
}

.settings-modal-body {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.settings-section-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #8a94a3;
    margin-bottom: 10px;
}

.settings-card {
    background: #fbfcfe;
    border: 1px solid #eef1f4;
    border-radius: 16px;
    padding: 20px;
}

.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.avatar-preview {
    width: 72px;
    height: 72px;
    font-size: 24px;
    box-shadow: 0 0 0 4px white, 0 0 0 5px #eef1f4;
}

.avatar-upload-actions {
    flex: 1;
}

.secondary-btn {
    padding: 9px 18px;
    background: white;
    color: #03182E;
    border: 2px solid #3D5778;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: #f0f6fc;
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.settings-hint {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
}

/* Reaproveita .form-group / .form-label / .form-input / .form-btn
   já definidos na seção de auth para o corpo do modal */
.modal-body .form-group {
    margin-bottom: 14px;
    text-align: left;
}

.modal-body .form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.modal-body .form-input {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid #e9ecef;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    background: #fbfcfe;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.modal-body .form-input:focus {
    border-color: #3D5778;
    background: white;
    box-shadow: 0 0 0 4px rgba(61, 87, 120, 0.14);
}

/* Estilo neutro compartilhado por "Atualizar senha" e "Sair da conta" —
   nenhuma das duas é a ação principal da tela, então nenhuma das duas
   deveria ter destaque de CTA. */
.settings-neutral-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: #03182E;
    border: 1.5px solid #e6e9ee;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-neutral-btn:hover {
    background: #f5f6f8;
    border-color: #d7dbe2;
}

.settings-neutral-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   RESPONSIVO — DASHBOARD
   ============================================================ */

@media (max-width: 900px) {
    .dashboard-body {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .mobile-header {
        display: block;
    }

    .mobile-nav-scroll {
        display: flex;
    }

    .main-content {
        padding: 20px;
        padding-left: calc(20px + env(safe-area-inset-left));
        padding-right: calc(20px + env(safe-area-inset-right));
        /* Espaço reservado pra tab bar fixa no rodapé (~56px + home indicator) */
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .tab-header {
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .tab-header-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .tab-header-icon svg {
        width: 16px;
        height: 16px;
    }

    .tab-header h2 {
        font-size: 18px;
    }
}

/* ============================================================
   TOOLBAR DE ABA (filtros + botões de criação)
   ============================================================ */

.tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    background: #f0f2f5;
    padding: 4px;
    border-radius: 14px;
}

.filter-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: white;
    color: #03182E;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.create-btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    padding: 10px 20px 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #3D5778, #03182E);
    box-shadow: 0 8px 20px rgba(3, 24, 46, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.create-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(3, 24, 46, 0.3);
}

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

.create-btn-primary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 14px;
    line-height: 1;
}

/* ============================================================
   LISTA DE ENTIDADES (eventos + tarefas)
   ============================================================ */

.entity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Card de EVENTO: arredondado, identidade azul ---------- */
.event-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 20px;
    padding: 16px 18px;
    border: 1px solid #eef0f3;
    border-left: 5px solid #3D5778;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.event-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.entity-card-body {
    flex: 1;
    min-width: 0;
}

.entity-card-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.entity-card-title {
    flex: 1;
    min-width: 0;
}

.entity-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.entity-edit-btn,
.entity-delete-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.45;
    padding: 2px 4px;
    border-radius: 8px;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.entity-edit-btn:hover {
    opacity: 1;
    background: #eef6fd;
}

.entity-delete-btn:hover {
    opacity: 1;
    background: #fef2f2;
}

.entity-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.entity-badge-event {
    background: rgba(61, 87, 120, 0.15);
    color: #03182E;
}

.entity-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.entity-card-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}

.entity-card-description {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 10px;
}

.entity-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.area-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f0f2f5;
    color: #555;
    font-weight: 600;
}

.area-tag-geral {
    background: linear-gradient(135deg, rgba(61, 87, 120, 0.15), rgba(3, 24, 46, 0.15));
    color: #03182E;
}

/* ---------- Card de REUNIÃO: arredondado como evento, identidade roxa ---------- */
.meeting-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 20px;
    padding: 16px 18px;
    border: 1px solid #eef0f3;
    border-left: 5px solid #8E5FE8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.meeting-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8E5FE8, #5B3CAF);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.entity-badge-meeting {
    background: rgba(142, 95, 232, 0.15);
    color: #5b3caf;
}

/* ---------- Card de TAREFA: mais "quadrado", checkbox + status ---------- */
.task-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    border: 1px solid #eef0f3;
    border-left: 5px solid #ccc; /* sobrescrito por status-* abaixo */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.task-checkbox-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 2px solid #ccc;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    margin-top: 2px;
}

.entity-badge-task {
    background: rgba(46, 155, 107, 0.15);
    color: #1F6E4C;
}

.task-status-select {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* iOS faz zoom automático em <select>/<input> com font-size < 16px ao focar.
   Como aqui o tamanho pequeno é visual (pill compacta), a correção sobe a
   fonte só durante o foco, sem alterar a aparência normal do componente. */
@media (max-width: 900px) {
    .task-status-select:focus,
    .attendance-select:focus {
        font-size: 16px;
    }
}

/* Cores por status — reaproveitadas na borda do card, no checkbox e no select */
.status-nao_iniciada { background: #eceff1; color: #546e7a; }
.status-em_andamento { background: rgba(61, 87, 120, 0.18); color: #1f5f96; }
.status-concluida    { background: rgba(46, 204, 113, 0.2); color: #1e8449; }

.task-card.border-nao_iniciada { border-left-color: #b0bec5; }
.task-card.border-em_andamento { border-left-color: #3D5778; }
.task-card.border-concluida    { border-left-color: #2ecc71; }

.task-checkbox-icon.check-nao_iniciada { background: #b0bec5; }
.task-checkbox-icon.check-em_andamento { background: #3D5778; }
.task-checkbox-icon.check-concluida    { background: #2ecc71; }

/* ============================================================
   KANBAN DE TAREFAS — visão "Tarefas" da Lista
   ============================================================
   3 colunas fixas (Não iniciada / Em andamento / Concluída),
   com arrastar-e-soltar entre elas. */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.kanban-column {
    background: #f7f8fa;
    border: 1.5px solid #eef0f3;
    border-radius: 20px;
    padding: 14px;
    min-height: 160px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 14px 4px;
}

.kanban-column-header h4 {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    flex: 1;
}

.kanban-column-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-dot-nao_iniciada { background: #b0bec5; }
.kanban-dot-em_andamento { background: #3D5778; }
.kanban-dot-concluida    { background: #2ecc71; }

.kanban-column-count {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    background: white;
    border-radius: 20px;
    padding: 2px 8px;
    min-width: 20px;
    text-align: center;
}

.kanban-column-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
}

.kanban-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    border: 1.5px dashed #dde2e8;
    border-radius: 14px;
    font-size: 12px;
    color: #aaa;
    text-align: center;
    padding: 10px;
}

/* Coluna recebendo um card arrastado */
.kanban-column-dragover {
    background: rgba(61, 87, 120, 0.08);
    border-color: #3D5778;
}

/* Card em modo arrastável dentro do quadro */
.task-card-draggable {
    cursor: grab;
}

.task-card-draggable:active {
    cursor: grabbing;
}

.kanban-card-dragging {
    opacity: 0.4;
}

@media (max-width: 900px) {
    .kanban-board {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ============================================================
   PAINEL DE CRIAÇÃO — Evento e Tarefa unificados, com seletor
   de tipo que troca os campos específicos suavemente
   ============================================================ */

.create-drawer {
    width: 460px;
}

/* ---------- Popup de participantes: flutua ao lado esquerdo do painel de criação ----------
   Vive como irmão do .create-drawer dentro do overlay (que não tem overflow
   escondido), ancorado pela borda direita da tela mesma distância do drawer,
   pra não ser cortado pelo overflow:hidden do .modal. Reaproveita o mesmo
   visual do modal de presença (cabeçalho roxo, busca, grade de avatares). */
.create-participants-popup {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: calc(460px + 14px);
    width: 400px;
    max-width: calc(100vw - 460px - 28px);
    height: 100%;
    background: white;
    border-radius: 24px;
    box-shadow: -20px 0 48px rgba(15, 23, 42, 0.16), 0 8px 24px rgba(15, 23, 42, 0.10);
    overflow: hidden;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(12px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.create-participants-popup.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

.create-participants-popup .modal-header-attendance {
    border-radius: 24px 24px 0 0;
}

@media (max-width: 640px) {
    .create-participants-popup {
        inset: auto 0 0 0;
        right: auto;
        width: auto;
        max-width: none;
        height: auto;
        max-height: 80vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .create-participants-popup.active {
        transform: translateY(0);
    }
}

.create-drawer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 22px 24px 18px 24px;
    transition: background 0.25s ease;
}

.create-drawer-header-event {
    background: linear-gradient(135deg, #3D5778, #03182E);
}

.create-drawer-header-task {
    background: linear-gradient(135deg, #2E9B6B, #03182E);
}

.create-drawer-header-meeting {
    background: linear-gradient(135deg, #8E5FE8, #03182E);
}

.create-drawer-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Seletor de tipo: pílula deslizante, igual ao Calendário/Lista,
   só que sobre um fundo colorido — reforça "isso aqui é uma escolha" */
.type-toggle {
    position: relative;
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.18);
    padding: 4px;
    border-radius: 14px;
    isolation: isolate;
}

.type-toggle-indicator {
    position: absolute;
    top: 4px;
    left: 0;
    height: calc(100% - 8px);
    width: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    transition: transform 0.3s cubic-bezier(.4, 0, .2, 1), width 0.3s cubic-bezier(.4, 0, .2, 1);
    z-index: 0;
}

.type-toggle-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: color 0.2s ease;
}

.type-toggle-btn.active {
    color: #03182E;
}

.create-drawer-header-task .type-toggle-btn.active {
    color: #1F6E4C;
}

.create-drawer-header-meeting .type-toggle-btn.active {
    color: #5b3caf;
}

.create-drawer-body {
    padding-top: 22px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Troca suave entre os campos de Evento e Tarefa */
.create-fields-group {
    animation: fieldsFadeIn 0.22s ease;
}

@keyframes fieldsFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-textarea {
    resize: vertical;
    min-height: 70px;
    border-radius: 16px !important;
    font-family: inherit;
}

.area-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.area-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    background: #f5f6f8;
    padding: 7px 12px;
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.area-checkbox:hover {
    background: #eef1f5;
}

.area-checkbox:has(input:checked) {
    background: rgba(61, 87, 120, 0.15);
    border-color: #3D5778;
    color: #03182E;
    font-weight: 600;
}

.area-checkbox-general:has(input:checked) {
    background: linear-gradient(135deg, rgba(61, 87, 120, 0.2), rgba(3, 24, 46, 0.2));
    border-color: #03182E;
}

.area-checkbox input {
    accent-color: #3D5778;
}

/* Rodapé fixo do painel — a ação principal nunca fica "perdida" no scroll */
.create-drawer-footer {
    flex: 0 0 auto;
    padding: 16px 24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid #f0f1f4;
    background: white;
}

.create-drawer-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.create-drawer-submit:hover {
    transform: translateY(-2px);
}

.create-drawer-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.create-drawer-submit-event {
    background: linear-gradient(135deg, #3D5778, #03182E);
    box-shadow: 0 8px 20px rgba(3, 24, 46, 0.25);
}

.create-drawer-submit-task {
    background: linear-gradient(135deg, #2E9B6B, #03182E);
    box-shadow: 0 8px 20px rgba(3, 24, 46, 0.25);
}

.create-drawer-submit-meeting {
    background: linear-gradient(135deg, #8E5FE8, #03182E);
    box-shadow: 0 8px 20px rgba(3, 24, 46, 0.25);
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .tab-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   PLANNER — calendário mensal + lista, presente nas 5 abas
   ============================================================ */

/* ---------- Alternância Calendário / Lista ---------- */
.view-switch {
    position: relative;
    display: flex;
    gap: 2px;
    background: #eef1f5;
    padding: 4px;
    border-radius: 14px;
    isolation: isolate;
}

.view-switch-indicator {
    position: absolute;
    top: 4px;
    left: 0;
    height: calc(100% - 8px);
    width: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
    transition: transform 0.3s cubic-bezier(.4, 0, .2, 1), width 0.3s cubic-bezier(.4, 0, .2, 1);
    z-index: 0;
}

.view-switch-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: color 0.2s ease;
}

.view-switch-btn.active {
    color: #03182E;
}

.view-switch-icon {
    font-size: 13px;
}

/* ---------- Containers de visão (calendário / lista) ---------- */
.planner-view {
    display: none;
}

.planner-view.active {
    display: block;
}

/* ============================================================
   TIMELINE VERTICAL — visões "Reuniões" e "Eventos"
   ============================================================
   Substitui a lista simples por uma linha do tempo vertical:
   fácil de rolar, com uma linha contínua ligando os itens e um
   marcador "Hoje" separando visualmente passado de futuro. Itens
   passados ficam esmaecidos para não competir com o que vem a
   seguir. */
.timeline-scroll {
    position: relative;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 4px;
}

.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
}

.timeline-rail {
    position: relative;
    width: 16px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.timeline-rail::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #e4e7ec;
    transform: translateX(-50%);
}

.timeline-row:first-child .timeline-rail::before {
    top: 18px;
}

.timeline-row:last-child .timeline-rail::before {
    bottom: calc(100% - 18px);
}

.timeline-dot {
    position: relative;
    z-index: 1;
    top: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e4e7ec;
    flex-shrink: 0;
}

.timeline-dot-event {
    background: linear-gradient(135deg, #3D5778, #03182E);
}

.timeline-dot-meeting {
    background: linear-gradient(135deg, #8E5FE8, #5B3CAF);
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

/* Itens do passado ficam visualmente "atrás" do que está por vir */
.timeline-row-past {
    opacity: 0.55;
}

.timeline-row-past .timeline-dot {
    background: #cfd4da;
    box-shadow: 0 0 0 2px #e4e7ec;
}

.timeline-row-future .event-card,
.timeline-row-future .meeting-card {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

/* Marcador "Hoje": separa visualmente passado de futuro na linha */
.timeline-today-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 6px 0;
    margin: 4px 0;
}

.timeline-today-line {
    flex: 1;
    height: 2px;
    background: repeating-linear-gradient(90deg, #3D5778 0 6px, transparent 6px 12px);
}

.timeline-today-label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: white;
    background: linear-gradient(135deg, #3D5778, #03182E);
    padding: 4px 14px;
    border-radius: 20px;
}

.timeline-nodate {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed #e4e7ec;
}

.timeline-nodate h5 {
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

@media (max-width: 480px) {
    .timeline-scroll {
        max-height: 70vh;
    }

    .timeline-row {
        gap: 10px;
    }
}

/* ---------- Layout: calendário + barra lateral ---------- */
.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.calendar-card {
    background: white;
    border: 1px solid #eef0f3;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-nav-group {
    display: flex;
    gap: 4px;
}

.calendar-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid #e5e8ec;
    background: white;
    color: #03182E;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #f0f6fc;
}

.calendar-month-label {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    flex: 1;
    text-transform: capitalize;
}

.calendar-mode-switch {
    display: flex;
    border: 1px solid #e5e8ec;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.calendar-mode-btn {
    border: none;
    background: white;
    color: #03182E;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.calendar-mode-btn:hover {
    background: #f0f6fc;
}

.calendar-mode-btn.active {
    background: #3D5778;
    color: white;
}

.calendar-today-btn {
    border: 1px solid #3D5778;
    background: white;
    color: #03182E;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.calendar-today-btn:hover {
    background: #f0f6fc;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #999;
    text-transform: uppercase;
    padding: 4px 0 8px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.calendar-grid-week {
    grid-template-rows: 1fr;
}

.calendar-grid-week .calendar-cell {
    height: 100%;
}

.calendar-cell {
    height: 100px;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid #eef0f3;
    background: #fbfcfe;
    padding: 6px 6px 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.calendar-cell-dragover {
    border-color: #3D5778;
    background: rgba(61, 87, 120, 0.1);
    box-shadow: 0 0 0 2px rgba(61, 87, 120, 0.25) inset;
}

.calendar-cell-outside {
    background: transparent;
    border-color: transparent;
}

.calendar-cell-outside .calendar-cell-daynum {
    color: #ccc;
}

.calendar-cell-hasitems {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.calendar-cell-hasitems:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #dfe6ee;
}

.calendar-cell-today {
    border-color: #3D5778;
    background: rgba(61, 87, 120, 0.06);
}

.calendar-cell-today .calendar-cell-daynum {
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
}

.calendar-cell-daynum {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Só existe pra dar contexto ("SEG", "TER"...) na lista empilhada do
   mobile (visão Semana). No desktop e na visão Mês essa informação já
   vem do cabeçalho .calendar-weekdays, então fica escondido por padrão. */
.calendar-cell-weekday-label {
    display: none;
}

.calendar-cell-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    min-width: 0;
}

/* Chips do calendário — evento e tarefa são visualmente distintos
   por FORMATO + ÍCONE, não só por cor (mesma lógica dos cards) */
.cal-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    overflow: hidden;
    min-width: 0;
}

.cal-chip-draggable {
    cursor: grab;
}

.cal-chip-draggable:active {
    cursor: grabbing;
}

.cal-chip-dragging {
    opacity: 0.4;
}

.cal-chip-icon {
    flex-shrink: 0;
    font-size: 9px;
    width: 13px;
    height: 13px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.cal-chip-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Evento: pílula arredondada + ícone de calendário, azul */
.cal-chip-event {
    border-radius: 20px;
    background: rgba(61, 87, 120, 0.14);
    color: #1f5f96;
}

.cal-chip-event .cal-chip-icon {
    background: linear-gradient(135deg, #3D5778, #03182E);
    border-radius: 4px;
}

/* Tarefa: chip mais reto/quadrado + ícone de check, âmbar */
.cal-chip-task {
    border-radius: 5px;
    background: rgba(46, 155, 107, 0.16);
    color: #1F6E4C;
}

.cal-chip-task .cal-chip-icon {
    background: linear-gradient(135deg, #2E9B6B, #1F6E4C);
    border-radius: 3px;
}

/* Reunião: pílula arredondada + ícone de aperto de mãos, roxo */
.cal-chip-meeting {
    border-radius: 20px;
    background: rgba(142, 95, 232, 0.14);
    color: #5b3caf;
}

.cal-chip-meeting .cal-chip-icon {
    background: linear-gradient(135deg, #8E5FE8, #5B3CAF);
    border-radius: 4px;
}

.cal-chip-more {
    font-size: 10px;
    font-weight: 700;
    color: #999;
    padding: 2px 6px;
}

/* ============================================================
   Calendário no mobile — dois modos bem diferentes do desktop:
   1) Mês: células pequenas e de altura fixa, só com uma bolinha
      indicando "tem algo nesse dia" (sem listar os itens, senão
      o mês inteiro fica gigante verticalmente).
   2) Semana: em vez de 7 colunas espremidas, os dias ficam
      empilhados um embaixo do outro — cada um com espaço de
      sobra pra mostrar os eventos/tarefas por extenso.
   ============================================================ */
@media (max-width: 900px) {
    /* ---------- Mês: células fixas e pequenas + bolinha indicadora ---------- */
    .calendar-grid:not(.calendar-grid-week) {
        gap: 4px;
    }

    .calendar-grid:not(.calendar-grid-week) .calendar-cell {
        height: 40px;
        min-height: 0;
        padding: 4px;
        align-items: center;
        justify-content: flex-start;
        position: relative;
    }

    .calendar-grid:not(.calendar-grid-week) .calendar-cell-items {
        display: none;
    }

    .calendar-grid:not(.calendar-grid-week) .calendar-cell-hasitems::after {
        content: '';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #3D5778;
    }

    .calendar-grid:not(.calendar-grid-week) .calendar-cell-today.calendar-cell-hasitems::after {
        background: white;
    }

    /* ---------- Semana: lista empilhada, um dia por linha ---------- */
    .calendar-card:has(.calendar-grid-week) .calendar-weekdays {
        display: none;
    }

    .calendar-grid.calendar-grid-week {
        display: flex;
        flex-direction: column;
        gap: 8px;
        height: auto !important;
    }

    .calendar-grid-week .calendar-cell {
        display: grid;
        grid-template-columns: 40px 1fr;
        grid-template-areas:
            "wd    items"
            "num   items";
        column-gap: 12px;
        row-gap: 2px;
        height: auto;
        min-height: 52px;
        align-items: start;
        padding: 10px;
    }

    .calendar-grid-week .calendar-cell-weekday-label {
        display: block;
        grid-area: wd;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #999;
    }

    .calendar-grid-week .calendar-cell-today .calendar-cell-weekday-label {
        color: #3D5778;
    }

    .calendar-grid-week .calendar-cell-daynum {
        grid-area: num;
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .calendar-grid-week .calendar-cell-items {
        grid-area: items;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .calendar-grid-week .cal-chip {
        font-size: 13px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .calendar-grid-week .cal-chip-label {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .calendar-grid-week .cal-chip-icon {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .calendar-grid-week .calendar-cell-items:empty::after {
        content: 'Nada marcado';
        font-size: 12.5px;
        color: #c3c8d1;
    }
}

/* ---------- Barra lateral: próximos eventos / tarefas ---------- */
.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-block {
    background: white;
    border: 1px solid #eef0f3;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.sidebar-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sidebar-block-header h4 {
    font-size: 13px;
    color: #333;
}

.sidebar-see-all {
    border: none;
    background: none;
    color: #3D5778;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-see-all:hover {
    text-decoration: underline;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-empty {
    font-size: 12px;
    color: #999;
    padding: 6px 0;
}

/* Aparece só quando a lista tem mais itens do que o limite exibido
   (2 por bloco) — indica que há mais sem precisar carregar tudo. */
.sidebar-more {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    margin-top: -2px;
    font-size: 11.5px;
    font-weight: 600;
    color: #8a94a3;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-more:hover {
    background: #f7f9fb;
    color: #3D5778;
}

.sidebar-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-item:hover {
    background: #f7f9fb;
}

.sidebar-item-date {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.sidebar-item-event .sidebar-item-date {
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
}

.sidebar-item-date-task {
    background: rgba(46, 155, 107, 0.16);
    color: #1F6E4C;
    border-radius: 8px; /* mais quadrada que a de evento, reforça a diferença */
}

.sidebar-item-meeting .sidebar-item-date-meeting {
    background: rgba(142, 95, 232, 0.16);
    color: #5b3caf;
}

.sidebar-item-day {
    font-size: 14px;
    font-weight: 700;
}

.sidebar-item-month {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-item-body {
    flex: 1;
    min-width: 0;
}

.sidebar-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item-meta {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.sidebar-item-icon {
    font-size: 9px;
}

/* ---------- Painel de detalhe do dia ---------- */
.modal-header-day {
    background: linear-gradient(135deg, #03182E, #3D5778);
}

.day-detail-quickadd {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f0f1f4;
}

.quickadd-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    border-radius: 14px;
    border: 1.5px dashed #d9dee6;
    background: #fbfcfe;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.quickadd-btn-icon {
    font-size: 12px;
}

.quickadd-btn-event {
    color: #03182E;
}

.quickadd-btn-event:hover {
    background: rgba(61, 87, 120, 0.1);
    border-color: #3D5778;
    border-style: solid;
}

.quickadd-btn-task {
    color: #1F6E4C;
}

.quickadd-btn-task:hover {
    background: rgba(46, 155, 107, 0.12);
    border-color: #2E9B6B;
    border-style: solid;
}

.quickadd-btn-meeting {
    color: #5b3caf;
}

.quickadd-btn-meeting:hover {
    background: rgba(142, 95, 232, 0.12);
    border-color: #8E5FE8;
    border-style: solid;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .calendar-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .view-switch {
        order: -1;
        width: 100%;
    }

    .view-switch-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 6px;
        font-size: 12px;
        gap: 4px;
    }

    /* Barra do calendário/tarefas/reuniões/eventos: o switch de visão
       e o botão "Novo" ficam lado a lado numa linha só, em vez do botão
       ocupar uma linha inteira sozinho. */
    .tab-toolbar.tab-toolbar-planner {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }

    .tab-toolbar-planner .view-switch {
        order: 0;
        width: auto;
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .tab-toolbar-planner .view-switch::-webkit-scrollbar {
        display: none;
    }

    .tab-toolbar-planner .toolbar-actions {
        flex-shrink: 0;
    }

    .create-btn-primary-label {
        display: none;
    }

    .create-btn-primary {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        gap: 0;
    }

    .create-btn-primary-icon {
        width: 18px;
        height: 18px;
        background: transparent;
        font-size: 20px;
    }

    .calendar-cell {
        min-height: 64px;
        padding: 4px;
    }

    .cal-chip-label {
        max-width: 52px;
    }

    .calendar-month-label {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .calendar-nav {
        flex-wrap: wrap;
    }

    .calendar-month-label {
        order: 1;
        flex-basis: 100%;
    }

    .calendar-weekdays span:nth-child(n) {
        font-size: 9px;
    }

    .view-switch-btn {
        padding: 8px 2px;
        font-size: 0;
        gap: 0;
    }

    .view-switch-icon {
        font-size: 16px;
    }

    .calendar-cell {
        min-height: 52px;
        border-radius: 8px;
    }

    .calendar-cell-daynum {
        font-size: 10px;
        width: 16px;
        height: 16px;
    }

    .cal-chip {
        padding: 2px 4px;
    }

    .cal-chip-label {
        max-width: 40px;
    }
}

/* ============================================================
   ETAPA 9 — Aba Membros
   ============================================================ */

.members-search-wrap {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

.members-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e9ecef;
    border-radius: 14px;
    font-size: 13px;
    outline: none;
    background: #fbfcfe;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.members-search-input:focus {
    border-color: #3D5778;
    background: white;
    box-shadow: 0 0 0 4px rgba(61, 87, 120, 0.14);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.member-card {
    position: relative;
    background: white;
    border: 1px solid #eef0f3;
    border-radius: 20px;
    padding: 20px 14px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.member-card-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #f1f3f5;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.member-card-edit-btn:hover {
    background: #3D5778;
    color: white;
}

.member-card.member-inactive {
    background: #f7f8fa;
}

.member-card.member-inactive .member-card-avatar {
    opacity: 0.55;
    filter: grayscale(0.8);
}

.member-card.member-inactive .member-card-name,
.member-card.member-inactive .member-card-role,
.member-card.member-inactive .member-card-tags {
    opacity: 0.6;
}

.member-inactive-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.tab-header-actions {
    margin-left: auto;
}

.invite-member-btn {
    border: none;
    background: #3D5778;
    color: white;
    font-size: 12.5px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.invite-member-btn:hover {
    background: #03182E;
}

/* ---------- Modal de edição de membro / gestão de allowlist ---------- */
.allowlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.allowlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fbfcfe;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    padding: 12px 14px;
}

.allowlist-item-info {
    min-width: 0;
}

.allowlist-item-email {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.allowlist-item-meta {
    font-size: 11.5px;
    color: #888;
    margin-top: 2px;
}

.allowlist-item-status {
    font-size: 10.5px;
    font-weight: 700;
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 4px;
    display: inline-block;
}

.allowlist-item-status.pending {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}

.allowlist-remove-btn {
    flex: 0 0 auto;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.allowlist-remove-btn:hover {
    background: #dc2626;
    color: white;
}

.allowlist-divider {
    height: 1px;
    background: #eef0f3;
    margin: 20px 0;
}

.member-card-avatar {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    overflow: hidden;
}

.member-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card-role {
    font-size: 11px;
    color: #777;
    margin-bottom: 10px;
    line-height: 1.3;
}

.member-generation-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #3D5778;
    background: rgba(61, 87, 120, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.member-card-tags {
    display: flex;
    justify-content: center;
}

/* ============================================================
   ETAPA 10 — Reforço de responsividade mobile
   ============================================================ */

@media (max-width: 900px) {
    /* Toolbars (filtros + ações) empilham em telas pequenas */
    .tab-toolbar {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
    }

    .tab-toolbar > * {
        min-width: 0;
        max-width: 100%;
    }

    .filter-buttons {
        overflow-x: auto;
        min-width: 0;
        -ms-overflow-style: none;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .filter-buttons::-webkit-scrollbar {
        display: none;
    }

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

    .members-search-wrap {
        max-width: none;
    }

    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }

    .member-card {
        padding: 16px 10px;
    }

    /* Modais ocupam mais a tela, evitando aperto no celular */
    .modal {
        width: 94%;
        max-height: 90vh;
    }

    .modal-body {
        padding: 18px;
    }

    .entity-card-top-row {
        flex-wrap: wrap;
    }

    .entity-badge {
        order: 3;
    }

    .entity-card-actions {
        order: 2;
        margin-left: 0;
    }

    .entity-card-title {
        order: 1;
        width: 100%;
    }

    /* Alvos de toque maiores no mobile (iOS/Android recomendam ~40-44px) */
    .entity-edit-btn,
    .entity-delete-btn {
        padding: 8px;
    }

    .calendar-nav-btn {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .members-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .member-card-avatar {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }

    .area-checkbox-group {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   ETAPA 11 — Participantes convidados e Presença
   ============================================================ */

/* ---------- Seletor de participantes (dentro do painel de criação) ---------- */
.participants-picker-group {
    border-top: 1px dashed #e9ecef;
    padding-top: 16px;
    margin-top: 4px;
}

.participants-picker-hint {
    font-size: 12px;
    color: #888;
    margin: -2px 0 12px 0;
    line-height: 1.4;
}

.participants-quickadd {
    margin-bottom: 14px;
}

.participants-quickadd-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.participants-quickadd-select {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px !important;
    font-size: 13px !important;
}

.participants-quickadd-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 16px !important;
    font-size: 12.5px !important;
}

.participants-search-wrap {
    position: relative;
    margin-bottom: 14px;
}

.participants-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
}

.participants-search-results.active {
    display: block;
}

.participants-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.participants-search-item:hover {
    background: #f5f8fc;
}

.participants-search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.participants-search-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participants-search-item-role {
    font-size: 11px;
    color: #888;
}

.participants-search-item-add {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #03182E;
}

.participants-search-empty {
    padding: 14px;
    font-size: 12.5px;
    color: #999;
    text-align: center;
}

.participants-empty-hint {
    font-size: 12.5px;
    color: #999;
    text-align: center;
    padding: 10px 0;
}

.participants-count-hint {
    font-size: 11.5px;
    font-weight: 700;
    color: #03182E;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.participants-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f7fa;
    border: 1px solid #eef0f3;
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
}

.participant-chip-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #333;
}

.participant-chip-remove {
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #666;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    line-height: 1;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.participant-chip-remove:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* ---------- Mini avatar reaproveitado em busca / chips / presença ---------- */
.participant-mini-avatar {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.participant-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Badge de presença no card de evento/reunião ---------- */
.entity-card-footer {
    margin-top: 10px;
}

.attendance-badge-btn {
    border: 1px solid #eef0f3;
    background: #f8fafc;
    color: #03182E;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.attendance-badge-btn:hover {
    background: #eef6fd;
    transform: translateY(-1px);
}

/* ---------- Modal de Presença: painel centralizado (não o drawer lateral) ---------- */
.attendance-overlay {
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.42);
}

.attendance-modal-panel {
    width: min(760px, 94vw);
    height: min(92vh, 760px);
    border-radius: 28px;
    transform: scale(0.94);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(.32, .72, 0, 1), opacity 0.2s ease;
}

.attendance-overlay.active .attendance-modal-panel {
    transform: scale(1);
    opacity: 1;
}

.modal-header-attendance {
    align-items: flex-start;
    border-radius: 28px 28px 0 0;
    transition: background 0.25s ease;
}

.modal-header-attendance-event {
    background: linear-gradient(135deg, #3D5778, #03182E);
}

.modal-header-attendance-meeting {
    background: linear-gradient(135deg, #8E5FE8, #03182E);
}

.attendance-modal-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attendance-modal-subtitle {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Barra de busca + filtros por status ---------- */
.attendance-toolbar {
    flex: 0 0 auto;
    padding: 16px 24px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attendance-search-input {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid #e9ecef;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    background: #fbfcfe;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.attendance-search-input:focus {
    border-color: #3D5778;
    background: white;
    box-shadow: 0 0 0 4px rgba(61, 87, 120, 0.14);
}

.attendance-filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.attendance-filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: #f1f3f5;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.attendance-filter-chip:hover {
    background: #e6e9ed;
}

.attendance-filter-chip.active {
    background: #03182E;
    color: white;
}

.attendance-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-presente { background: #16a34a; }
.dot-atrasado { background: #d97706; }
.dot-ausente { background: #dc2626; }
.dot-justificado { background: #0891b2; }
.dot-pendente { background: #9ca3af; }

.attendance-filter-chip.active .attendance-chip-dot {
    background: white;
}

.attendance-chip-count {
    font-size: 10.5px;
    font-weight: 700;
    opacity: 0.85;
}

.attendance-edit-hint {
    font-size: 12.5px;
    color: #999;
    text-align: center;
    margin-top: 6px;
}

/* ---------- Corpo: grade de avatares (escala bem além de 30 pessoas) ---------- */
.attendance-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 14px 24px 20px 24px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 14px 8px;
}

.attendance-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 6px 2px 8px 2px;
    border-radius: 16px;
    text-align: center;
}

.attendance-tile-avatar {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    font-weight: 700;
    font-size: 18px;
    overflow: visible;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #e3e6eb;
    transition: box-shadow 0.2s ease;
}

.attendance-tile-avatar > img,
.attendance-tile-avatar > span:not(.attendance-tile-badge) {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attendance-tile-avatar > img {
    display: block;
}

/* Anel colorido ao redor do avatar — o principal indicador visual de status,
   reconhecível de longe numa grade grande, sem precisar ler texto. */
.attendance-ring-pendente { box-shadow: 0 0 0 3px white, 0 0 0 5px #d1d5db; }
.attendance-ring-presente { box-shadow: 0 0 0 3px white, 0 0 0 5px #16a34a; }
.attendance-ring-atrasado { box-shadow: 0 0 0 3px white, 0 0 0 5px #d97706; }
.attendance-ring-ausente { box-shadow: 0 0 0 3px white, 0 0 0 5px #dc2626; }
.attendance-ring-justificado { box-shadow: 0 0 0 3px white, 0 0 0 5px #0891b2; }

.attendance-tile-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    border: 2px solid white;
}

.attendance-badge-presente { background: #16a34a; }
.attendance-badge-atrasado { background: #d97706; }
.attendance-badge-ausente { background: #dc2626; }
.attendance-badge-justificado { background: #0891b2; }

.attendance-tile-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #333;
    max-width: 82px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Dropdown de status por participante — badge discreto,
   claro e com borda fina, no padrão de dashboards profissionais. ---------- */
.attendance-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    max-width: 100px;
    border: 1px solid #e2e4e9;
    background-color: #f8f9fb;
    border-radius: 6px;
    padding: 4px 20px 4px 9px;
    font-size: 10.5px;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    color: #666;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 8px 5px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%23999999'/></svg>");
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.attendance-select:hover:not(:disabled) {
    border-color: #c7cbd1;
}

.attendance-select:focus {
    outline: none;
    border-color: #03182E;
    box-shadow: 0 0 0 3px rgba(3, 24, 46, 0.1);
}

.attendance-select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-image: none;
    padding-right: 9px;
}

.attendance-select option {
    color: #222;
    background: white;
    font-weight: 500;
}

.attendance-select-pendente {
    background-color: #f8f9fb;
    border-color: #e2e4e9;
    color: #6b7280;
}

.attendance-select-presente {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.attendance-select-atrasado {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.attendance-select-ausente {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.attendance-select-justificado {
    background-color: #ecfeff;
    border-color: #a5f3fc;
    color: #0e7490;
}

/* ---------- Barra de ação em massa (fixa no rodapé do painel) ---------- */
.attendance-bulk-bar {
    flex: 0 0 auto;
    padding: 0 24px 20px 24px;
}

.attendance-bulk-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.attendance-bulk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.32);
}

@media (max-width: 640px) {
    .attendance-modal-panel {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header-attendance {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .attendance-grid {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 12px 4px;
    }

    .attendance-tile-avatar {
        width: 48px;
        height: 48px;
        font-size: 15px;
    }

    .attendance-tile-name {
        max-width: 66px;
        font-size: 10.5px;
    }

    .attendance-select {
        max-width: 74px;
        font-size: 9.5px;
        padding: 4px 16px 4px 8px;
    }
}
/* ============================================================
   ETAPA 12 — Convidar/remover participantes direto no modal de
   Presença: seção "não convidados" com botão (+), botão (−) nos
   já convidados, arraste entre as duas áreas, e painel de adição
   em massa por área/cargo (união ou interseção).
   ============================================================ */

.attendance-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.attendance-section-header-first {
    margin-top: 0;
}

.attendance-section-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #03182E;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.attendance-section-count {
    font-size: 11.5px;
    font-weight: 700;
    color: #999;
    background: #f1f3f5;
    padding: 2px 9px;
    border-radius: 10px;
}

.attendance-section-divider {
    height: 1px;
    background: #eef0f3;
    margin: 22px 0 18px 0;
}

.attendance-empty-invited {
    padding: 20px 0 10px 0;
    text-align: center;
}

/* ---------- Botões (+) e (−) no canto superior direito do avatar ---------- */
.attendance-tile-toggle {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    color: white;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
    transition: transform 0.15s ease, background 0.15s ease;
}

.attendance-tile-toggle:hover {
    transform: scale(1.12);
}

.attendance-tile-add {
    background: #16a34a;
}

.attendance-tile-add:hover {
    background: #15803d;
}

.attendance-tile-remove {
    background: #dc2626;
    font-size: 16px;
}

.attendance-tile-remove:hover {
    background: #b91c1c;
}

/* ---------- Tile de membro não convidado (avatar "neutro", sem anel) ---------- */
.attendance-tile[draggable="true"] {
    cursor: grab;
}

.attendance-tile[draggable="true"]:active {
    cursor: grabbing;
}

.attendance-tile-available {
    opacity: 0.92;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.attendance-tile-available:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.attendance-tile-avatar-plain {
    box-shadow: 0 0 0 3px white, 0 0 0 5px #eef0f3;
    filter: grayscale(0.15);
}

/* ---------- Zonas de arraste (destacam quando algo é arrastado por cima) ---------- */
.attendance-dropzone {
    border-radius: 16px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.attendance-dropzone-active {
    background: #eef6fd;
    box-shadow: inset 0 0 0 2px #3D5778;
}

/* ---------- Filtros de adição em massa: uma única linha
   (dropdown de área + dropdown de cargo + botão "+") ---------- */
.bulkadd-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.bulkadd-select {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #e2e4e9;
    background: white;
    color: #333;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    outline: none;
}

.bulkadd-select:focus,
.bulkadd-select:hover {
    border-color: #3D5778;
}

.bulkadd-row-apply {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    border: none;
    background: linear-gradient(135deg, #3D5778, #03182E);
    color: white;
    font-size: 12.5px;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 6px 16px rgba(3, 24, 46, 0.25);
}

.bulkadd-row-apply-icon {
    font-size: 14px;
    line-height: 1;
}

.bulkadd-row-apply:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(3, 24, 46, 0.32);
}

.bulkadd-row-apply:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 480px) {

    .attendance-tile-toggle {
        width: 19px;
        height: 19px;
        font-size: 12px;
    }

    .bulkadd-row {
        flex-wrap: wrap;
    }

    .bulkadd-select {
        flex: 1 1 100%;
    }

    .bulkadd-row-apply {
        flex: 1 1 100%;
        justify-content: center;
    }
}