/* ==========================================================================
   Helpia - Tema Glassmorphism (paleta Night Owl)
   ========================================================================== */
:root{
    --gm-bg-0: #011627;
    --gm-bg-1: #0b2942;
    --gm-bg-2: #10395c;
    --gm-bg-mid: #041c30;
    --gm-bg-glow-1: #0e3a5c;
    --gm-bg-glow-2: #123657;
    --gm-text: #d6deeb;
    --gm-text-muted: #9fb3c8;
    --gm-cyan: #7fdbca;
    --gm-blue: #82aaff;
    --gm-purple: #c792ea;
    --gm-green: #addb67;
    --gm-orange: #f78c6c;
    --gm-red: #ff5874;
    --gm-yellow: #ecc48d;
    --gm-pink: #ff7ab6;
    --gm-border: rgba(214,222,235,0.14);
    --gm-glass: rgba(255,255,255,0.06);
    --gm-glass-strong: rgba(255,255,255,0.10);
    --gm-shadow: 0 8px 32px rgba(1,10,20,0.45);
}

/* Fundo geral do sistema */
body{
    background: radial-gradient(circle at 15% 0%, var(--gm-bg-glow-1) 0%, transparent 45%),
                radial-gradient(circle at 100% 20%, var(--gm-bg-glow-2) 0%, transparent 40%),
                linear-gradient(160deg, var(--gm-bg-0) 0%, var(--gm-bg-mid) 55%, var(--gm-bg-1) 100%);
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    color: var(--gm-text);
}

.gm-text-muted{ color: var(--gm-text-muted) !important; }

/* Títulos legíveis sobre o fundo navy (o tema base do Argon assume fundo claro) */
.wrapper h1, .wrapper h2, .wrapper h3, .wrapper h4, .wrapper h5, .wrapper h6{
    color: #fff;
}
.wrapper .text-muted{
    color: var(--gm-text-muted) !important;
}

/* Cartão de vidro genérico */
.glass-card{
    background: var(--gm-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--gm-border);
    border-radius: 18px;
    box-shadow: var(--gm-shadow);
    color: var(--gm-text);
}
.glass-card .card-header,
.glass-card .card-footer{
    background: transparent;
    border-color: var(--gm-border);
    padding: 1rem 1.25rem;
}
.glass-card .card-body{
    padding: 1.25rem;
}
.glass-card .card-title,
.glass-card h4, .glass-card h5, .glass-card h3{
    color: #fff;
}

/* Inputs */
.glass-card .form-control,
.glass-card .form-select,
.gm-input{
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--gm-border);
    color: var(--gm-text);
    border-radius: 10px;
}
.glass-card .form-control::placeholder{ color: var(--gm-text-muted); }
.glass-card .form-control:focus,
.glass-card .form-select:focus{
    background: rgba(255,255,255,0.10);
    border-color: var(--gm-blue);
    color: #fff;
    box-shadow: 0 0 0 .2rem rgba(130,170,255,0.18);
}
.glass-card .slim-label,
.glass-card label{
    color: var(--gm-text-muted);
}
.glass-card .form-check-label{ color: var(--gm-text); }
.glass-card .text-secondary{ color: var(--gm-text-muted) !important; }
.glass-card .form-text{ color: var(--gm-text-muted); }
.glass-card .list-group-item{
    background: transparent;
    color: var(--gm-text);
    border-color: var(--gm-border);
}
.glass-card .input-group-text{
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--gm-border);
    color: var(--gm-text-muted);
}
.glass-card .progress{
    background: rgba(255,255,255,0.08);
}

/* Botões */
.btn-gm-primary{
    background: linear-gradient(135deg, var(--gm-blue), var(--gm-cyan));
    border: none;
    color: #011627;
    font-weight: 600;
    border-radius: 12px;
}
.btn-gm-primary:hover{ filter: brightness(1.08); color: #011627; }
.btn-gm-outline{
    background: transparent;
    border: 1px solid var(--gm-border);
    color: var(--gm-text);
    border-radius: 12px;
}
.btn-gm-outline:hover{ background: rgba(255,255,255,0.08); color: #fff; }

/* Badges de prioridade (0 = mais alta) */
.badge-prioridade-0{ background: var(--gm-red); color:#2b0410; }
.badge-prioridade-1{ background: var(--gm-orange); color:#2b1502; }
.badge-prioridade-2{ background: var(--gm-yellow); color:#2b2102; }
.badge-prioridade-3{ background: var(--gm-green); color:#0d2b02; }

/* Badges de status */
.badge-status-pendente{ background: rgba(236,196,141,.18); color: var(--gm-yellow); border:1px solid rgba(236,196,141,.4); }
.badge-status-andamento{ background: rgba(130,170,255,.18); color: var(--gm-blue); border:1px solid rgba(130,170,255,.4); }
.badge-status-pausado{ background: rgba(199,146,234,.18); color: var(--gm-purple); border:1px solid rgba(199,146,234,.4); }
.badge-status-aguardando_feedback{ background: rgba(127,219,202,.18); color: var(--gm-cyan); border:1px solid rgba(127,219,202,.4); }
.badge-status-aguardando_autorizacao{ background: rgba(247,140,108,.18); color: var(--gm-orange); border:1px solid rgba(247,140,108,.4); }
.badge-status-sem_autorizacao{ background: rgba(255,122,182,.18); color: var(--gm-pink); border:1px solid rgba(255,122,182,.4); }
.badge-status-concluida{ background: rgba(173,219,103,.18); color: var(--gm-green); border:1px solid rgba(173,219,103,.4); }
.badge-status-atrasada{ background: rgba(255,88,116,.18); color: var(--gm-red); border:1px solid rgba(255,88,116,.4); }
.badge-status-cancelada{ background: rgba(159,179,200,.18); color: var(--gm-text-muted); border:1px solid rgba(159,179,200,.4); }
.badge-status-pendente,.badge-status-andamento,.badge-status-pausado,.badge-status-aguardando_feedback,.badge-status-aguardando_autorizacao,.badge-status-sem_autorizacao,.badge-status-concluida,.badge-status-atrasada,.badge-status-cancelada{
    font-weight: 600;
    border-radius: 999px;
    padding: .35em .8em;
}

/* Avaliação por estrelas (nota 0-5) */
.star-rating{
    display: inline-flex;
    gap: 4px;
    direction: ltr;
}
.star-rating i{
    color: rgba(214,222,235,0.25);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color .15s ease, transform .1s ease;
}
.star-rating i.active{ color: var(--gm-yellow); }
.star-rating.editable i:hover{ transform: scale(1.15); }
.star-rating.readonly i{ cursor: default; }

/* Chip de arquivo anexado */
.gm-file-chip{
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    padding: .5rem .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gm-text);
}
.gm-file-chip a{ color: var(--gm-cyan); text-decoration: none; word-break: break-all; }
.gm-file-chip a:hover{ text-decoration: underline; }
.gm-file-chip .btn-remove-file{ color: var(--gm-red); cursor: pointer; }
.gm-file-chip .gm-file-link{ min-width: 0; flex: 1; }
.gm-file-thumb{
    width: 36px;
    height: 36px;
    min-width: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--gm-border);
}

/* Galeria de imagens no detalhamento da tarefa */
.gm-image-gallery{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.gm-gallery-item{
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--gm-border);
    aspect-ratio: 1 / 1;
}
.gm-gallery-item img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .15s ease;
}
.gm-gallery-item:hover img{
    transform: scale(1.05);
}

/* Dropzone de upload */
.gm-dropzone{
    border: 1.5px dashed var(--gm-border);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    color: var(--gm-text-muted);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.gm-dropzone:hover, .gm-dropzone.dragover{
    border-color: var(--gm-blue);
    background: rgba(130,170,255,0.06);
    color: var(--gm-text);
}

/* Cabeçalho/menu com efeito vidro sobre o fundo navy */
.sidenav, #header_container .bg-gradient-info, .menu_mobile_sidebar{
    background: linear-gradient(180deg, color-mix(in srgb, var(--gm-bg-1) 92%, transparent) 0%, color-mix(in srgb, var(--gm-bg-0) 96%, transparent) 100%) !important;
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--gm-border);
}
.sidenav .nav-link.active.glass,
.sidenav .nav-link:hover{
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}

/* Cards padrão (bootstrap) usados fora do glass-card ficam levemente translúcidos também */
.wrapper .card:not(.glass-card){
    background: rgba(255,255,255,0.95);
}

/* Dropdown menus legíveis sobre fundo escuro */
.dropdown-menu{
    background: var(--gm-bg-1);
    border: 1px solid var(--gm-border);
}
.dropdown-menu .dropdown-item{ color: var(--gm-text); }
.dropdown-menu .dropdown-item:hover{ background: rgba(255,255,255,0.08); color:#fff; }

/* Select2 - tema escuro */
.select2-container{ width: 100% !important; }
.select2-container--default .select2-selection--single{
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    height: calc(1.5em + 1.1rem + 2px);
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
    color: var(--gm-text);
    line-height: normal;
    padding-left: .75rem;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder{
    color: var(--gm-text-muted);
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
    height: 100%;
    right: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b{
    border-color: var(--gm-text-muted) transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{
    border-color: transparent transparent var(--gm-text-muted) transparent;
}
.select2-dropdown{
    background: var(--gm-bg-1);
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--gm-shadow);
}
.select2-search--dropdown{
    background: var(--gm-bg-1);
    padding: 8px;
}
.select2-search--dropdown .select2-search__field{
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--gm-border);
    color: var(--gm-text);
    border-radius: 8px;
}
.select2-results__option{
    color: var(--gm-text);
}
.select2-container--default .select2-results__option--highlighted[aria-selected]{
    background: rgba(130,170,255,0.2);
    color: #fff;
}
.select2-container--default .select2-results__option[aria-selected=true]{
    background: rgba(130,170,255,0.3);
    color: #fff;
}
.select2-results__message{
    color: var(--gm-text-muted);
}
.select2-container--default .select2-selection--single .select2-selection__clear{
    color: var(--gm-text-muted);
}

/* Offcanvas (painéis laterais) com o mesmo vidro do resto do tema */
.offcanvas.glass{
    background: color-mix(in srgb, var(--gm-bg-1) 92%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-left: 1px solid var(--gm-border);
    color: var(--gm-text);
}
.offcanvas.glass .offcanvas-header,
.offcanvas.glass .offcanvas-footer{
    border-color: var(--gm-border);
}
.offcanvas.glass .btn-close{
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Scrollbar discreta */
.gm-scroll::-webkit-scrollbar{ width: 6px; }
.gm-scroll::-webkit-scrollbar-thumb{ background: var(--gm-border); border-radius: 10px; }

/* Logo animada (splash da tela inicial) */
.hero-logo-wrap{ }
.hero-logo-anim{
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto;
}
.hero-logo-img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 26px rgba(130,170,255,.3));
    position: relative;
    z-index: 1;
}
.hero-logo-eyelid{
    position: absolute;
    left: 26%;
    right: 26%;
    top: 41.5%;
    height: 16%;
    background: #4b515b;
    border-radius: 45%;
    filter: blur(2px);
    transform: scaleY(0);
    transform-origin: center;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}
@media (prefers-reduced-motion: no-preference){
    .hero-logo-anim{
        animation: gm-logo-appear .9s cubic-bezier(.34,1.56,.64,1) both;
    }
    .hero-logo-eyelid{
        animation: gm-logo-blink 4.5s ease-in-out 1.3s infinite;
    }
}
@keyframes gm-logo-appear{
    0%{ opacity: 0; transform: scale(.25) rotate(-10deg); filter: blur(10px); }
    65%{ opacity: 1; transform: scale(1.08) rotate(2deg); filter: blur(0); }
    100%{ opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); }
}
@keyframes gm-logo-blink{
    0%, 88%, 100%{ transform: scaleY(0); opacity: 0; }
    90%{ transform: scaleY(1); opacity: 1; }
    93%{ transform: scaleY(1); opacity: 1; }
    95%{ transform: scaleY(0); opacity: 0; }
}

/* Card estilo "Netflix" (empresas no dashboard) */
.netflix-card{
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--gm-shadow);
    border: 1px solid var(--gm-border);
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}
.netflix-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 14px 40px rgba(1,10,20,.55);
}
.netflix-bg{
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.netflix-initials{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.6rem;
    font-weight: 800;
    color: rgba(255,255,255,.32);
    transform: rotate(-18deg) scale(1.25);
    letter-spacing: 2px;
    user-select: none;
    white-space: nowrap;
}
.netflix-overlay{
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(1,22,39,.05) 0%, rgba(1,22,39,.55) 45%, rgba(1,22,39,.95) 100%);
}
.netflix-content{
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px;
    z-index: 2;
}
.netflix-content h6{
    color: #fff;
    font-weight: 700;
    margin-bottom: .5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.netflix-stat-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .68rem;
    color: var(--gm-text-muted);
    margin-bottom: 3px;
}
.netflix-stat-row .star-rating i{ font-size: .68rem; }
.netflix-pending{
    display: inline-block;
    margin-top: 4px;
    font-size: .68rem;
    font-weight: 600;
    padding: .2em .6em;
    border-radius: 999px;
    background: rgba(130,170,255,.18);
    color: var(--gm-blue);
    border: 1px solid rgba(130,170,255,.4);
}


/* ==========================================================================
   Dashboard (tela inicial)
   ========================================================================== */
.dash-section-title{
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gm-text-muted);
    margin: 0 0 .9rem;
}
.dash-section-title::after{
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--gm-border), transparent);
}

/* KPIs */
.kpi-card{
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease;
}
.kpi-card:hover{
    transform: translateY(-3px);
    border-color: rgba(214,222,235,.28);
}
.kpi-card::before{
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    right: -50px;
    top: -60px;
    border-radius: 50%;
    background: var(--kpi-cor, var(--gm-blue));
    opacity: .14;
    filter: blur(8px);
    pointer-events: none;
}
.kpi-card .card-body{
    display: flex;
    align-items: center;
    gap: .9rem;
}
.kpi-icon{
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--kpi-cor, var(--gm-blue));
    background: color-mix(in srgb, var(--kpi-cor, var(--gm-blue)) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--kpi-cor, var(--gm-blue)) 40%, transparent);
}
.kpi-label{
    display: block;
    font-size: .75rem;
    color: var(--gm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-valor{
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.kpi-delta{
    font-size: .7rem;
    font-weight: 600;
    margin-left: .35rem;
    white-space: nowrap;
}
.kpi-delta.up{ color: var(--gm-green); }
.kpi-delta.down{ color: var(--gm-red); }
.kpi-delta.flat{ color: var(--gm-text-muted); }

/* Cards de gráfico */
.chart-card .card-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.chart-card .card-header h6{
    margin: 0;
    color: #fff;
    font-weight: 700;
}
.chart-card .card-header small{
    display: block;
    color: var(--gm-text-muted);
    font-size: .72rem;
}
.chart-wrap{
    position: relative;
    width: 100%;
}
.chart-wrap.h-260{ height: 260px; }
.chart-card .card-body.chart-grow{
    display: flex;
    flex-direction: column;
}
.chart-card .card-body.chart-grow .chart-wrap{
    flex: 1;
    min-height: 260px;
}
.chart-wrap.h-300{ height: 300px; }
.chart-empty{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gm-text-muted);
    font-size: .85rem;
    pointer-events: none;
}

/* Botões segmentados (toggle) */
.gm-seg{
    display: inline-flex;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.gm-seg button{
    border: 0;
    background: transparent;
    color: var(--gm-text-muted);
    font-size: .72rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: 7px;
    transition: background .15s ease, color .15s ease;
}
.gm-seg button:hover{ color: #fff; }
.gm-seg button.active{
    background: rgba(130,170,255,.2);
    color: #fff;
}

/* Navegação de mês */
.mes-nav{
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.mes-nav button{
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--gm-border);
    background: rgba(255,255,255,.05);
    color: var(--gm-text);
    font-size: .75rem;
}
.mes-nav button:hover:not(:disabled){ background: rgba(255,255,255,.12); }
.mes-nav button:disabled{ opacity: .35; }
.mes-nav span{
    min-width: 118px;
    text-align: center;
    font-weight: 600;
    font-size: .85rem;
    color: #fff;
    text-transform: capitalize;
}

/* Mini resumo do mês */
.mes-resumo{
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: .9rem;
}
.mes-resumo div small{
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    color: var(--gm-text-muted);
}
.mes-resumo div b{
    font-size: 1.25rem;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.dash-dot{
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Legenda HTML do gráfico de status */
.status-legenda{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 1rem;
}
.status-legenda a{
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--gm-text);
    text-decoration: none;
    padding: 3px 6px;
    border-radius: 8px;
}
.status-legenda a:hover{ background: rgba(255,255,255,.06); }
.status-legenda a .qtd{
    margin-left: auto;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.status-legenda a .pct{
    width: 38px;
    text-align: right;
    font-size: .72rem;
    color: var(--gm-text-muted);
}

/* Barra de prioridade empilhada */
.prio-bar{
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    gap: 2px;
    background: rgba(255,255,255,.06);
}
.prio-bar span{ height: 100%; }

/* Listas de atenção (feedback / autorização / travadas) */
.atencao-card .card-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.atencao-card .card-header h6{
    margin: 0;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.atencao-card .kpi-icon{
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 9px;
    font-size: .85rem;
}
.atencao-qtd{
    font-weight: 700;
    font-size: .75rem;
    padding: .2em .65em;
    border-radius: 999px;
    color: var(--kpi-cor);
    background: color-mix(in srgb, var(--kpi-cor) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--kpi-cor) 40%, transparent);
}
.atencao-item{
    display: block;
    text-decoration: none;
    padding: .6rem .75rem;
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--gm-border);
    border-left: 3px solid var(--kpi-cor);
    transition: background .15s ease;
}
.atencao-item:hover{ background: rgba(255,255,255,.07); }
.atencao-item .titulo{
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atencao-item .meta{
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .72rem;
    color: var(--gm-text-muted);
    margin-top: 2px;
}
.atencao-item .meta span:first-child{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.atencao-lista{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.atencao-vazio{
    text-align: center;
    color: var(--gm-text-muted);
    font-size: .85rem;
    padding: 1.5rem 0;
}

@media (prefers-reduced-motion: no-preference){
    .dash-fade{
        animation: gm-dash-fade .5s ease backwards;
    }
}
@keyframes gm-dash-fade{
    from{ opacity: 0; transform: translateY(8px); }
    to{ opacity: 1; transform: none; }
}


/* ==========================================================================
   Menu superior (desktop) - substitui a sidebar a partir de 992px
   ========================================================================== */
.gm-topnav{
    position: sticky;
    top: 0;
    z-index: 1030;
    background: color-mix(in srgb, var(--gm-bg-0) 72%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--gm-border);
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.gm-topnav-inner{
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 64px;
    padding: 0 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}
.gm-topnav-brand{
    display: flex;
    align-items: center;
    gap: .55rem;
    text-decoration: none;
    flex-shrink: 0;
}
.gm-topnav-brand img{
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(130,170,255,.3));
}
.gm-topnav-brand span{
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: .02em;
}
.gm-topnav-links{
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 1;
    min-width: 0;
}
.gm-topnav-links a{
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .9rem;
    border-radius: 10px;
    color: var(--gm-text-muted);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease;
}
.gm-topnav-links a i{
    font-size: .85rem;
    opacity: .85;
}
.gm-topnav-links a:hover{
    color: #fff;
    background: rgba(255,255,255,.06);
}
.gm-topnav-links a.active{
    color: #fff;
    background: rgba(255,255,255,.09);
}
.gm-topnav-links a.active i{
    color: var(--gm-cyan);
    opacity: 1;
}
.gm-topnav-links a.active::after{
    content: '';
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: -12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--gm-blue), var(--gm-cyan));
    box-shadow: 0 0 12px var(--gm-cyan);
}
.gm-topnav-right{
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}
.gm-topnav-user{
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .6rem .3rem .3rem;
    border-radius: 999px;
    border: 1px solid var(--gm-border);
    background: rgba(255,255,255,.04);
    color: var(--gm-text);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    transition: background .15s ease;
}
.gm-topnav-user:hover,
.gm-topnav-user.active,
.gm-topnav-user[aria-expanded="true"]{
    background: rgba(255,255,255,.1);
    color: #fff;
}
.gm-topnav-user .fa-chevron-down{
    font-size: .65rem;
    opacity: .7;
}
.gm-avatar{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: var(--gm-bg-0);
    background: linear-gradient(135deg, var(--gm-blue), var(--gm-cyan));
}
.gm-topnav .dropdown-menu{
    min-width: 230px;
    margin-top: 10px !important;
    border-radius: 14px;
    padding: .4rem;
    box-shadow: var(--gm-shadow);
}
.gm-topnav .dropdown-item{
    border-radius: 8px;
    padding: .5rem .75rem;
}
.gm-topnav .dropdown-divider{
    border-color: var(--gm-border);
}
/* telas lg menores: esconde o texto dos links e deixa só os ícones */
@media (min-width: 992px) and (max-width: 1180px){
    .gm-topnav-links a span{ display: none; }
    .gm-topnav-links a{ padding: .55rem .75rem; }
}


/* ==========================================================================
   Escolha de tema (Minha conta)
   ========================================================================== */
.tema-aviso{
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px dashed var(--gm-border);
    font-size: .85rem;
    color: var(--gm-text);
}
.tema-aviso > span{ font-size: 1.4rem; }
.tema-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.tema-opcao{
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--gm-border);
    background: rgba(255,255,255,.04);
    color: var(--gm-text);
    text-align: left;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.tema-opcao:hover{
    transform: translateY(-2px);
    background: rgba(255,255,255,.08);
}
.tema-opcao.selecionado{
    border-color: var(--gm-cyan);
    box-shadow: 0 0 0 1px var(--gm-cyan), 0 6px 20px rgba(0,0,0,.3);
}
.tema-opcao:disabled{ opacity: .6; cursor: wait; }
.tema-mini{
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,.08);
}
.tema-mini-barra{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 16%;
    border-bottom: 1px solid rgba(255,255,255,.12);
    filter: brightness(.8);
}
.tema-mini-card{
    position: absolute;
    left: 10%;
    bottom: 12%;
    width: 52%;
    height: 42%;
    border-radius: 5px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 0 8%;
}
.tema-mini-card i{
    display: block;
    height: 4px;
    border-radius: 4px;
}
.tema-mini-card i:first-child{ width: 80%; }
.tema-mini-card i:last-child{ width: 50%; }
.tema-mini-emoji{
    position: absolute;
    right: 8%;
    bottom: 8%;
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.tema-nome{
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
}
.tema-epoca{
    font-size: .68rem;
    color: var(--gm-text-muted);
}
.tema-check{
    position: absolute;
    top: 14px;
    left: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    color: var(--gm-bg-0);
    background: var(--gm-cyan);
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.tema-opcao.selecionado .tema-check{ display: flex; }


/* ==========================================================================
   Filtros da lista de tarefas
   ========================================================================== */
.status-chips{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.status-chip{
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .38rem .8rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--chip-cor) 35%, transparent);
    background: color-mix(in srgb, var(--chip-cor) 6%, transparent);
    color: var(--gm-text-muted);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.status-chip:hover{
    color: #fff;
    background: color-mix(in srgb, var(--chip-cor) 14%, transparent);
}
.status-chip:active{ transform: scale(.96); }
.status-chip-dot{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chip-cor);
}
.status-chip i{
    display: none;
    font-size: .65rem;
}
.status-chip.ativo{
    color: var(--chip-cor);
    border-color: var(--chip-cor);
    background: color-mix(in srgb, var(--chip-cor) 20%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--chip-cor) 25%, transparent);
}
.status-chip.ativo i{ display: inline-block; }
.status-chip.ativo .status-chip-dot{ display: none; }

.filtros-qtd{
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    color: var(--gm-bg-0);
    background: linear-gradient(135deg, var(--gm-blue), var(--gm-cyan));
}

/* mobile: filtros viram um painel que sobe de baixo */
@media (max-width: 991.98px){
    .gm-filtros.offcanvas-lg{
        height: auto;
        min-height: 80vh;
        max-height: 94vh;
        border-top-left-radius: 22px;
        border-top-right-radius: 22px;
        border-top: 1px solid var(--gm-border);
        background: color-mix(in srgb, var(--gm-bg-1) 94%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        color: var(--gm-text);
        box-shadow: 0 -12px 40px rgba(0,0,0,.45);
    }
    .gm-filtros .offcanvas-header{
        position: relative;
        padding-top: 1.4rem;
        border-bottom: 1px solid var(--gm-border);
    }
    .gm-filtros .btn-close{
        filter: invert(1) grayscale(100%) brightness(200%);
    }
    /* "alça" de puxar */
    .gm-filtros .offcanvas-header::before{
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        width: 44px;
        height: 4px;
        margin-left: -22px;
        border-radius: 4px;
        background: rgba(255,255,255,.25);
    }
    .gm-filtros .offcanvas-body{
        overflow-y: auto;
    }
    .gm-filtros .gm-filtros-campos{
        flex-direction: column;
        align-items: stretch !important;
    }
    .gm-filtros .gm-filtro-campo{
        min-width: 0 !important;
        margin-right: 0 !important;
        margin-bottom: .9rem !important;
    }
    .gm-filtros .gm-filtro-campo input[type="date"]{
        min-width: 0 !important;
        flex: 1;
    }
    .gm-filtros .offcanvas-footer{
        display: flex;
        gap: 8px;
        padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--gm-border);
    }
    .gm-filtros .status-chip{
        padding: .5rem .9rem;
        font-size: .82rem;
    }
}

/* ---------- PWA: banner de instalar app e ajuda do iOS ---------- */
.pwa-banner{
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    color: var(--gm-text);
    background: color-mix(in srgb, var(--gm-bg-1) 94%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--gm-border);
    box-shadow: 0 12px 36px rgba(0,0,0,.5);
    animation: pwa-sobe .35s ease;
}
@media (min-width: 992px){
    .pwa-banner{ left: auto; right: 24px; bottom: 24px; max-width: 380px; }
}
.pwa-banner img{ width: 42px; height: 42px; border-radius: 10px; }
.pwa-banner-txt{ flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pwa-banner-txt b{ color: #fff; font-size: .92rem; }
.pwa-banner-txt small{ color: var(--gm-text-muted); font-size: .74rem; }
.pwa-banner-x{ border: 0; background: transparent; color: var(--gm-text-muted); padding: 8px; }
.pwa-sheet-back{
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: flex-end;
    background: rgba(1,10,20,.6);
}
.pwa-sheet{
    width: 100%;
    padding: 1.4rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    color: var(--gm-text);
    background: var(--gm-bg-1);
    border-top: 1px solid var(--gm-border);
    animation: pwa-sobe .3s ease;
}
.pwa-sheet h5{ color: #fff; margin-bottom: .75rem; }
.pwa-sheet ol{ padding-left: 1.2rem; margin-bottom: 1.25rem; }
.pwa-sheet li{ margin-bottom: .5rem; }
@keyframes pwa-sobe{ from{ transform: translateY(24px); opacity: 0; } to{ transform: none; opacity: 1; } }
