/* ── Auth Portal (Login) ─────────────────────────── */
.badge-adm {
    font-size: 0.6rem;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #451a03;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.auth-portal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.auth-portal::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(56, 189, 248, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse at center, black, transparent 80%);
}

.auth-portal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    padding: 3.5rem;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
    animation: authCardPop 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo-img {
    width: 140px;
    height: 140px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    clip-path: circle(50%);
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.15));
}

.auth-header h2 { 
    font-size: 2rem; 
    font-weight: 800; 
    color: white; 
    margin-bottom: 0.5rem; 
    letter-spacing: -0.02em;
}

.auth-header p { 
    color: var(--text-secondary); 
    font-size: 0.95rem; 
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-left: 0.5rem;
}

.auth-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.auth-form input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.auth-submit { 
    width: 100%; 
    height: 53px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 20px -5px rgba(56, 189, 248, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
    box-shadow: 0 15px 30px -5px rgba(56, 189, 248, 0.5);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.google-btn {
    width: 100%;
    height: 53px;
    background: transparent !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.google-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.google-btn img {
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

.auth-footer { margin-top: 2.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

.btn-logout {
    width: 100%;
    background: rgba(244, 63, 94, 0.05);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.15);
    height: 47px;
    padding: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--rose);
    color: white;
}

.app-container {
    opacity: 0;
    filter: blur(20px);
    transition: all 0.8s ease;
    pointer-events: none;
}

.app-container.ready {
    opacity: 1;
    filter: blur(0);
    pointer-events: auto;
}

:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --emerald: #10b981;
    --rose: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --surface-glass: rgba(255, 255, 255, 0.05);
    --font-inter: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Status Badges & Cloud Sync ───────────────────────────────────── */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

#cloud-status.sync-idle {
    color: var(--emerald);
    border-color: rgba(16, 185, 129, 0.3);
}

#cloud-status.sync-saving {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

#cloud-status.sync-error {
    color: var(--rose);
    border-color: rgba(244, 63, 94, 0.3);
}

@keyframes spin-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 5px currentColor); }
    100% { transform: scale(1); opacity: 0.8; }
}

.sync-saving .cloud-icon {
    display: inline-block;
    animation: spin-pulse 1s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-inter);
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* Background animated glow */
.glass-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 20% 40%, rgba(99, 102, 241, 0.15), transparent 60%),
                radial-gradient(circle at 80% 60%, rgba(16, 185, 129, 0.12), transparent 50%);
    z-index: -1;
    filter: blur(80px);
}

.app-container {
    flex: 1;
    height: 100vh;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2rem;
    box-shadow: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: opacity 0.8s ease, padding 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.status-badge {
    background: var(--surface-glass);
    padding: 0.5rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.test-notif-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: 8px;
    transition: var(--transition);
}

.test-notif-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* ── Menu Lateral (Sidebar Premium) ─────────────────── */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 25;
    display: none;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nav-overlay.active {
    display: block;
}

.side-nav {
    position: relative;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(13, 18, 30, 0.98);
    backdrop-filter: blur(40px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 30;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.25rem 0 1.25rem; /* Padding inferior zerado */
    flex-shrink: 0;
    overflow-x: hidden;
}

/* Modo Lateral Fixo (Desktop - 6cm aprox) */
@media (min-width: 1025px) {
    .side-nav {
        width: 230px; /* Largura fixa (equivale aos 6cm solicitados) */
        padding: 2.5rem 1.25rem;
    }

    /* Esconder botões de toggle no desktop para visual fixo e contínuo */
    #menu-toggle, #menu-toggle-side {
        display: none !important;
    }

    .app-container {
        padding: 2.5rem 3rem;
    }

    /* Garantir que todos os textos fiquem visíveis permanentemente */
    .brand-text, 
    .nav-item span, 
    .nav-section-label, 
    .user-details, 
    .btn-logout-minimal, 
    .nav-notif-status, 
    .btn-archive-compact span {
        opacity: 1 !important;
        pointer-events: auto !important;
        width: auto !important;
        margin: initial !important;
        overflow: visible !important;
    }

    .nav-close-mobile {
        display: none !important;
    }
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 1rem 0.75rem 0.4rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    transition: all 0.3s ease;
}

.brand-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: contain;
    background: white;
    padding: 4px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.brand-agenda {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.brand-nise {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.8rem;
    color: #94a3b8; /* Cor suave para itens inativos */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    border: none; /* Removendo bordas permanentemente */
    background: transparent;
}

.nav-item i, .nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-item span {
    font-size: 0.95rem;
}

.nav-item:hover {
    color: white;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2); /* Fundo roxo suave idêntico ao exemplo */
    color: #818cf8; /* Texto roxo claro para destaque */
    font-weight: 600;
}

.nav-item.active svg {
    color: #818cf8 !important;
}

.nav-footer {
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: 0; /* Padding inferior zerado */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-archive-compact {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
    height: 47px;
    padding: 0 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-archive-compact:hover {
    background: var(--rose);
    color: white;
    box-shadow: 0 8px 15px rgba(244, 63, 94, 0.3);
}


.user-profile-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    height: 47px;
    padding: 0 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #451a03;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: opacity 0.3s ease;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.btn-logout-minimal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout-minimal:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
}

.btn-sync-online {
    width: 100%;
    height: 47px;
    margin-bottom: 0;
    padding: 0;
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--accent) 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 12px;
    display: none; /* Exibido via JS após login */
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.3);
}

.btn-sync-online:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.4);
}

.btn-sync-online:active {
    transform: translateY(0);
}

.nav-sync-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 47px;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-top: 2px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    cursor: help;
}

.nav-sync-timer:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.timer-value {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    
    background: linear-gradient(
        to right, 
        #fff 0%, 
        var(--accent) 30%, 
        #fff 60%,
        var(--accent) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    text-shadow: 0 0 20px var(--accent-glow);
    animation: navTimerShine 6s linear infinite, navTimerBreath 2s ease-in-out infinite alternate;
}

@keyframes navTimerShine {
    to { background-position: 200% center; }
}

@keyframes navTimerBreath {
    from { opacity: 0.8; filter: drop-shadow(0 0 5px var(--accent-glow)); }
    to { opacity: 1; filter: drop-shadow(0 0 15px var(--accent-glow)); transform: scale(1.03); }
}

.backup-tools {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-tool {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-tool:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ── Menu Toggle Button & Header ───────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    min-width: 0;
}


.header-center {
    flex: 1;
    max-width: 400px;
    display: flex;
    justify-content: center;
}

.main-search-input {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0 16px;
    width: 100%;
    max-width: 550px;
    transition: var(--transition);
}


.main-search-input:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.main-search-input svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.main-search-input input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.8rem 0.8rem;
    font-size: 0.95rem;
    outline: none;
}

.main-search-input input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

#current-date {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0.8;
}



.menu-toggle-btn {
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.05);
}

.menu-toggle-btn.sidebar-toggle {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
}

/* ── Painéis e Histórico ─────────────────────────── */
.panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 2rem;
}

.history-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.history-search-wrap {
    position: relative;
    width: 320px;
    display: flex;
    align-items: center;
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 12px;
    transition: var(--transition);
}

.history-search-wrap:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.history-search-wrap svg {
    color: var(--text-secondary);
}

.history-search-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 0.8rem 0.5rem;
    font-size: 0.9rem;
    outline: none;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.empty-history {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--surface-glass);
    border-radius: 24px;
    border: 1px dashed var(--glass-border);
}

/* Cards de Histórico */
.history-day-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
}

.day-card-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.day-card-header h3 {
    font-size: 1rem;
    color: var(--accent);
}

.day-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.day-stats span strong {
    color: var(--text-primary);
}

.day-card-body {
    padding: 1.5rem 2rem;
}

.history-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

@media (max-width: 600px) {
    .history-tasks-grid {
        grid-template-columns: 1fr;
    }
}

.history-task-item {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 1.25rem;
    font-size: 0.9rem;
    border-left: 3px solid var(--accent);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
}

.history-task-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.history-task-item.completed {
    border-left-color: var(--emerald);
    opacity: 0.9;
}

.history-task-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

.content-wrapper {
    display: flex;
    gap: 3rem;
    align-items: stretch;
    flex: 1;
}

.sidebar.section-left {
    width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.stats-row {
    margin-top: auto;
    width: 100%;
}

.stats-card {
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    min-width: 200px;
    min-height: 100px;
}

.sidebar.section-right {
    width: 280px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.stats-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.count-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.lists-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.count-large.emerald {
    color: var(--emerald);
}

.stats-card.pending { border-left: 4px solid var(--accent); }
.stats-card.completed { border-left: 4px solid var(--emerald); }

.task-list-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.task-list-section.pending h2 { color: var(--accent); }
.task-list-section.completed h2 { color: var(--emerald); }

.task-item.completed {
    opacity: 0.7;
    background: rgba(16, 185, 129, 0.05);
}

.task-checkbox.checked {
    background: var(--emerald);
    border-color: var(--emerald);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
}
#task-form {
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-wrapper:focus-within {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 10px 20px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.plus-icon {
    color: var(--accent);
    margin-right: 1rem;
    opacity: 0.8;
}

#task-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 0;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

#task-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.shortcut-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--surface-glass);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    opacity: 0.6;
    pointer-events: none;
    white-space: nowrap;
}

.input-wrapper:focus-within .shortcut-hint {
    opacity: 1;
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Task List Styles */
.list-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
}

.list-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.count-badge {
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
}

#task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.task-item {
    background: rgba(255, 255, 255, 0.04); /* Fundo um pouco mais visível para compensar a falta de borda */
    border: none; /* Removendo bordas das tarefas */
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

/* Intensificamos o destaque para tarefas pendentes de dias anteriores */
.task-item.urgent {
    border-left: 6px solid var(--rose) !important;
    background: rgba(244, 63, 94, 0.12) !important;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.2), inset 0 0 10px rgba(244, 63, 94, 0.1);
    animation: urgentPulse 2s infinite ease-in-out;
}

@keyframes urgentPulse {
    0% { border-left-color: var(--rose); }
    50% { border-left-color: #ff8a9a; }
    100% { border-left-color: var(--rose); }
}

.task-item.urgent .task-text {
    font-weight: 600;
    color: #ffdce1;
}

.task-item.urgent .task-checkbox {
    border-color: var(--rose) !important;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

/* Priority Themes */
.task-item.priority-theme-normal {
    border-left: 4px solid var(--accent);
}

.task-item.priority-theme-normal .task-checkbox {
    border-color: var(--accent);
}

.task-item.priority-theme-alta {
    border-left: 4px solid var(--rose);
}

.task-item.priority-theme-media {
    border-left: 4px solid #f59e0b;
}

.task-item.priority-theme-media .task-checkbox {
    border-color: #f59e0b;
}

.task-item.priority-theme-baixa {
    border-left: 4px solid var(--emerald);
}

.task-item.priority-theme-baixa .task-checkbox {
    border-color: var(--emerald);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}


.task-text {
    flex: 1;
    font-size: 0.95rem;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    opacity: 0.4;
    transition: var(--transition);
}

.task-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--rose);
    background: rgba(244, 63, 94, 0.1);
}

/* Toast for internal feedback */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: none; /* override the toast hidden */
}

.modal-card {
    background: rgba(22, 33, 55, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 95%;
    max-width: 920px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-inter);
    font-size: 0.95rem;
    transition: var(--transition);
    resize: none;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group select option {
    background: #1e2940;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--glass-border);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    height: 52px;
    padding: 0 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(99,102,241,0.3);
}

.btn-secondary {
    background: var(--surface-glass);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    height: 52px;
    padding: 0 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

/* Priority badges on task items */
.priority-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}

.priority-alta  { background: rgba(244,63,94,0.15);  color: #f43f5e; }
.priority-media { background: rgba(245,158,11,0.15); color: #f59e0b; }
.priority-baixa { background: rgba(16,185,129,0.15); color: #10b981; }

.task-deadline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.task-item-clickable {
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-register-btn {
    width: 100%; 
    border: none; 
    outline: none; 
    text-align: left; 
    background: rgba(99, 102, 241, 0.15); 
    color: var(--text-primary); 
    padding: 12px; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    gap: 10px; 
    border-radius: 8px; 
    font-weight: 500; 
    cursor: pointer; 
    border: 1px solid rgba(99, 102, 241, 0.3); 
    transition: 0.3s; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.admin-register-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent);
}

.admin-card {
    background: var(--surface-glass); 
    border: 1px solid var(--glass-border); 
    padding: 2rem; 
    border-radius: 12px; 
    margin-bottom: 2rem;
}

.responsive-form {
    display: flex; 
    gap: 1.5rem; 
    align-items: flex-end;
}

.flex-grow {
    flex: 2; 
}

.cpf-input {
    width: 100%; 
    border-radius: 8px; 
    border: 1px solid var(--accent); 
    background: rgba(0,0,0,0.3); 
    color: white; 
    padding: 15px 18px !important; 
    font-size: 1.1rem !important; 
    letter-spacing: 2px; 
    outline: none; 
    transition: 0.3s; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.admin-btn {
    padding: 0 30px; 
    font-size: 1rem; 
    border-radius: 12px; 
    white-space: nowrap; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    height: 52px;
}

.admin-note {
    margin-top: 1.5rem; 
    font-size: 0.85rem; 
    color: var(--text-secondary);
    opacity: 0.8;
}

.flex-2 { flex: 2; min-width: 300px; }
.flex-1 { flex: 1; min-width: 180px; }

.settings-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.settings-section {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.settings-section:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(30, 41, 59, 0.5);
}

.settings-header-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.settings-icon-glow {
    width: 48px;
    height: 48px;
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.2);
}

.settings-icon-glow.accent {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.settings-container h3 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 0.25rem;
    text-transform: none;
    letter-spacing: -0.01em;
    font-weight: 700;
}

.settings-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Row for maintenance button and hint */
.settings-action-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.settings-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
}

/* Grid for configuration fields */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Redundant override removed for consistency */

.settings-footer {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#settings-save-status {
    margin: 0;
    font-size: 0.9rem;
    color: var(--emerald);
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.settings-container .btn-primary {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ── Painel de Configurações & Admin ────────────────── */
#panel-settings .history-header {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 1.5rem;
    padding-top: 1rem;
}

.settings-container .btn-primary {
    align-self: flex-start;
    padding: 0.85rem 2.8rem;
    font-size: 0.95rem;
    border-radius: 12px;
    min-width: 220px;
}


.nav-admin-only {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.admin-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.users-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-allowed-item {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.user-allowed-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-revoke {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-revoke:hover {
    background: var(--rose);
    color: white;
}

@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }

    .sidebar.section-left, .sidebar.section-right {
        width: 100%;
        order: 2;
    }

    .sidebar.section-left {
        order: 3;
    }

    .main-content {
        order: 1;
        width: 100%;
    }

    .stats-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-top: 0;
    }

    .stats-card {
        min-width: 0;
        min-height: auto;
        padding: 1.25rem;
    }

    .side-nav {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
        width: 290px;
        background: rgba(13, 18, 30, 0.99); 
        box-shadow: 20px 0 50px rgba(0,0,0,0.6);
        padding: 2rem 1rem;
        transition: transform 0.3s ease;
    }

    .side-nav.active {
        transform: translateX(0);
    }
    
    .side-nav.collapsed {
        transform: translateX(-100%);
    }

    /* Em mobile, mantemos os botões de toggle */
    #menu-toggle {
        display: flex !important;
    }
    
    #menu-toggle-side {
        display: none !important; /* Esconde o hambúrguer de dentro em prol do (X) */
    }

    .nav-close-mobile {
        display: flex !important;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .brand-nise {
        font-size: 1.2rem;
    }

    .app-container {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .nav-overlay {
        display: none;
    }
    
    .nav-overlay.active {
        display: block;
        z-index: 999;
    }

    .header-left {
        gap: 1rem;
    }

    #current-date {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .main-search-input {
        width: 100% !important;
        margin: 0;
        order: 3;
    }

    #current-date {
        margin-left: 0 !important;
        padding-right: 0 !important;
        order: 2;
        font-size: 0.75rem;
        background: rgba(255,255,255,0.05);
        padding: 4px 10px;
        border-radius: 8px;
    }

    .lists-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .history-search-wrap {
        width: 100%;
    }

    .auth-card {
        padding: 2.5rem 1.5rem;
        width: 90%;
        max-width: 400px;
    }

    .dinf-grid-v2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .dinf-modal-field {
        grid-column: span 1 !important;
    }

    .task-main-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .task-text {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .priority-badge, .task-deadline {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stats-card {
        padding: 1rem;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .stats-card p {
        margin: 0;
        font-size: 0.85rem;
    }

    .stats-card .count-large {
        font-size: 1.25rem;
    }

    .task-item {
        padding: 1rem;
        gap: 0.85rem;
        flex-direction: row;
        align-items: flex-start;
    }

    .task-checkbox {
        width: 26px; /* Slightly larger for touch */
        height: 26px;
        margin-top: 2px;
    }

    .task-item-clickable {
        flex: 1;
    }

    .task-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .task-text {
        font-size: 1rem;
        line-height: 1.4;
        margin: 0;
    }

    .priority-badge, .task-deadline, .is-dinf-icon {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .auth-logo-img {
        width: 100px;
        height: 100px;
        margin-bottom: 1.5rem;
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }

    .modal-card {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 1.25rem 1rem;
    }
    
    .input-wrapper {
        padding: 0.5rem 1rem;
    }
    
    #task-input {
        font-size: 1.1rem;
    }

    .shortcut-hint {
        display: none;
    }

    .btn-primary, .btn-secondary, .btn-archive, .btn-logout, .btn-sync-online {
        padding: 1rem;
        font-size: 1rem;
    }

    .nav-item {
        padding: 1rem 1.25rem;
        min-height: 56px;
    }

    .side-nav {
        width: 85%;
        max-width: 320px;
    }

    .sidebar-brand {
        margin-bottom: 1.5rem;
    }

    .task-checkbox {
        width: 28px; 
        height: 28px;
    }

    /* Ajuste para botões de ação na tarefa no mobile */
    .task-item .delete-btn {
        padding: 10px;
        opacity: 1; /* Sempre visível no mobile */
        background: rgba(244, 63, 94, 0.1);
        border-radius: 10px;
    }

    /* Ajuste no formulário administrativo */
    .responsive-form {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-card {
        padding: 1.25rem;
    }

    .form-group.flex-2, .form-group.flex-1 {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 360px) {
    header h1 {
        font-size: 1.2rem;
    }

    .brand-nise {
        font-size: 1.1rem;
    }

    .side-nav {
        width: 90%;
    }
}

/* ── Tooltip de Detalhes ───────────────────────────── */
.task-tooltip {
    position: fixed;
    width: 340px;
    background: rgba(13, 20, 35, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.5rem;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.95);
    visibility: hidden;
}

.task-tooltip.active {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-header h4 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.tooltip-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tooltip-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tooltip-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.tooltip-text {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.tooltip-footer {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.tooltip-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tooltip-info strong {
    color: var(--text-primary);
}

/* ── Estilos de Gestão de Usuários e Sincronização ── */

.user-allowed-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.user-allowed-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.user-allowed-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.user-allowed-info small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.btn-revoke {
    background: transparent;
    border: none;
    color: var(--rose);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-revoke:hover {
    background: rgba(244, 63, 94, 0.12);
    text-decoration: underline;
}

/* Removido duplicata para evitar conflito de estilos */

/* ── Tarefas Especiais: IS DINF ── */

.task-item.is-dinf {
    border-left-width: 6px;
    border-left-style: solid;
    border-image: linear-gradient(to bottom, #38bdf8, #6366f1) 1;
}

.is-dinf-icon {
    font-size: 0.75rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 8px;
    font-weight: 800;
}

.task-main-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.dinf-card-info {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dinf-mini-field {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Tooltip DINF */
.tooltip-dinf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dinf-grid-item {
    font-size: 0.75rem;
    color: white;
}

.dinf-modal-field label {
    font-size: 0.75rem !important;
    text-transform: uppercase;
    color: var(--accent); /* Cor seguindo o padrão do cabeçalho DINF */
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 8px !important;
    display: block;
}

.dinf-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dinf-input-wrapper textarea {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: white !important;
    font-size: 0.85rem !important;
    padding: 10px 40px 10px 12px !important; /* Espaço para o botão na direita */
    border-radius: 8px !important;
    width: 100%;
    outline: none;
    cursor: text;
    resize: none;
    min-height: 42px;
    overflow-y: hidden;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.dinf-input-wrapper textarea:focus {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.btn-copy-inside {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    z-index: 5;
}

.btn-copy-inside:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

/* ── Utilitários Globais ── */
.hidden {
    display: none !important;
}

.panel {
    display: none; /* Padrão: oculto */
    flex-direction: column;
    padding: 0;
    width: 100%;
}

.panel.active {
    display: flex; /* Exibe o painel ativo */
}

/* ── Analytics Dashboard (Premium Professional) ────────────────── */
.analytics-summary-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
    transform: scale(1.02);
}

.summary-item.highlight {
    border-color: rgba(16, 185, 129, 0.25);
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.summary-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
}

.highlight .summary-value {
    color: var(--emerald);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    padding: 1rem 0 3rem;
    animation: analyticsSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes analyticsSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.analytics-card {
    grid-column: span 4;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.analytics-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.analytics-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.analytics-card:hover::before {
    opacity: 1;
}

.analytics-card.wide {
    grid-column: span 8;
}

.analytics-card.full {
    grid-column: span 12;
}

.card-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title-area h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-icon-box {
    width: 42px;
    height: 42px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    margin-top: auto;
}

.chart-container-large {
    position: relative;
    height: 320px;
    width: 100%;
}

@media (max-width: 1200px) {
    .analytics-card { grid-column: span 6; }
    .analytics-card.wide { grid-column: span 12; }
}

@media (max-width: 768px) {
    .analytics-card, .analytics-card.wide, .analytics-card.full {
        grid-column: span 12;
    }
}
