.diario-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #2d3748;
    margin-bottom: 10px;
}

.dashboard-header p {
    color: #718096;
    font-size: 1.1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2.5rem;
    /* Removido background-clip: text pois não funciona com emojis */
    /* Emojis já têm suas próprias cores nativas */
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.stat-content h3 {
    font-size: 2rem;
    color: #2d3748;
    margin: 0;
}

.stat-content p {
    color: #718096;
    margin: 0;
    font-size: 0.9rem;
}

.dashboard-actions {
    margin-bottom: 30px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Responsividade para tablets */
@media (max-width: 992px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .action-card {
        padding: 12px 8px;
    }

    .action-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .action-card h3 {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .action-card p {
        font-size: 10px;
    }
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
}

/* Info dinâmica visível apenas no mobile */
.mobile-card-info {
    display: none;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.action-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.action-card h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.action-card p {
    color: #718096;
    margin: 0;
}

.action-card-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.action-card-highlight::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
}

.action-card-highlight h3,
.action-card-highlight p {
    color: white;
}

.action-card-highlight:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

/* Rede Social Widget Card */
.action-card-social {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.action-card-social::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}

.action-card-social .action-icon {
    filter: grayscale(0);
}

.action-card-social h3,
.action-card-social > p {
    color: white;
}

.action-card-social:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.4);
}

.social-cta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.social-cta-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.social-cta-btn:hover {
    background: rgba(255,255,255,0.32);
}

.social-cta-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.social-cta-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .action-card-social > p {
        display: none;
    }

    .social-cta-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        margin-top: 8px;
    }

    .social-cta-btn {
        padding: 4px 6px;
        font-size: 9px;
        gap: 3px;
        border-radius: 6px;
    }

    .social-cta-icon {
        font-size: 11px;
    }

    .social-cta-label {
        display: none;
    }
}

/* === Super Widget: Central do Aquário === */
.action-card-aquarium-hub {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #0d9488 0%, #1e40af 100%);
    position: relative;
    overflow: hidden;
    cursor: default;
    text-align: left;
    padding: 24px 28px;
}

.action-card-aquarium-hub::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}

.action-card-aquarium-hub::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 30%;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

/* Header 2 colunas */
.aquarium-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.hub-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hub-header-left .action-icon {
    font-size: 2.2rem;
    margin-bottom: 0;
}

.aquarium-hub-title h3 {
    color: white;
    margin: 0 0 2px 0;
    font-size: 1.15rem;
}

.aquarium-hub-title p {
    color: rgba(255,255,255,0.75);
    margin: 0;
    font-size: 0.85rem;
}

/* Header actions (3 botões no header) */
.hub-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hub-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}
.hub-header-btn:hover { background: rgba(255,255,255,0.3); }
.hub-header-btn-highlight {
    background: rgba(255,255,255,0.25);
    font-weight: 600;
}

/* Botões duplos lado a lado */
.hub-cta-pair {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}
.hub-cta-pair .hub-cta-btn {
    flex: 1;
    text-align: center;
    margin-top: 0;
    font-size: 0.72rem;
    padding: 5px 6px;
}
.hub-cta-accent {
    background: rgba(255,255,255,0.3);
    font-weight: 600;
}
.hub-cta-accent:hover {
    background: rgba(255,255,255,0.45);
}

.aquarium-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hub-section {
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Hub section headers */
.hub-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.hub-section-title { color: white; font-weight: 600; font-size: 0.85rem; }
.hub-section-count { margin-left: auto; font-size: 0.75rem; color: rgba(255,255,255,0.6); font-weight: 700; }

/* Lista de aquários */
.hub-aquarium-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.hub-aquarium-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 8px; background: rgba(255,255,255,0.08); border-radius: 6px;
    color: white; text-decoration: none; font-size: 0.78rem; transition: background 0.2s;
}
.hub-aquarium-item:hover { background: rgba(255,255,255,0.2); }
.hub-aq-name { font-weight: 500; }
.hub-aq-counts { font-size: 0.7rem; opacity: 0.7; }

/* Lista de medições */
.hub-measurement-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.hub-measurement-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; background: rgba(255,255,255,0.08); border-radius: 6px;
    font-size: 0.78rem; color: white;
}
.hub-m-param { font-weight: 600; min-width: 35px; }
.hub-m-value { flex: 1; }
.hub-m-time { font-size: 0.68rem; opacity: 0.6; }

/* Lista de eventos */
.hub-event-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.hub-event-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 8px; background: rgba(255,255,255,0.08); border-radius: 6px;
    font-size: 0.78rem; color: white;
}
.hub-ev-title { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-ev-time { font-size: 0.68rem; opacity: 0.6; flex-shrink: 0; margin-left: 8px; }

/* Empty state */
.hub-empty { font-size: 0.78rem; color: rgba(255,255,255,0.5); text-align: center; padding: 12px 0; }

/* CTA buttons */
.hub-cta-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
}
.hub-cta-btn:hover {
    background: rgba(255,255,255,0.35);
    color: white;
}
.hub-cta-secondary { background: rgba(255,255,255,0.1); font-size: 0.72rem; margin-bottom: 4px; text-align: center; display: block; }

.action-card-aquarium-hub:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(13, 148, 136, 0.35);
}

/* === Ferramentas Salvas (gradiente roxo) === */
.action-card-saved-tools {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.action-card-saved-tools::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}
.action-card-saved-tools h3, .action-card-saved-tools > p { color: white; }
.action-card-saved-tools:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.4);
}
.saved-tools-last {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 8px 0;
    font-size: 0.75rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: white;
}
.stl-label { font-weight: 600; opacity: 0.85; }
.stl-title { font-weight: 500; }
.stl-time { font-size: 0.68rem; opacity: 0.6; }
.saved-tools-features {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto;
}
.stf-item {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 4px 8px;
}

/* === Card Comunidades === */
.action-card-communities {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    position: relative;
    overflow: hidden;
    cursor: default;
}
.action-card-communities::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}
.action-card-communities h3,
.action-card-communities > p { color: white; }
.action-card-communities:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.4);
}

.community-card-topics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}
.community-card-topic {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.12);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    transition: background 0.2s;
}
.community-card-topic:hover { background: rgba(255,255,255,0.25); }
.cct-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cct-replies { font-size: 0.7rem; opacity: 0.7; flex-shrink: 0; }
.community-card-empty {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 8px 0;
}
.community-card-user-list {
    margin: 8px 0 6px;
}
.community-card-user-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.community-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.community-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 5px 10px;
    text-decoration: none;
    color: white;
    font-size: 0.75rem;
    transition: background 0.2s;
}
.community-chip:hover {
    background: rgba(255,255,255,0.25);
    text-decoration: none;
    color: white;
}
.community-chip-icon { font-size: 0.85rem; }
.community-chip-name { font-weight: 600; }
.community-chip-stats { opacity: 0.7; font-size: 0.68rem; }
.action-card-communities .social-cta-grid {
    grid-template-columns: repeat(2, 1fr);
}
.action-card-communities .social-cta-grid .social-cta-highlight {
    grid-column: 1 / -1;
    background: rgba(255,255,255,0.25);
    justify-content: center;
}

/* Social grid com 5 itens */
.social-cta-grid-5 {
    grid-template-columns: repeat(2, 1fr);
}
.social-cta-grid-5 .social-cta-highlight {
    grid-column: 1 / -1;
    background: rgba(255,255,255,0.25);
    justify-content: center;
}

/* === Responsivo Super Widget === */
@media (max-width: 992px) {
    .action-card-aquarium-hub {
        grid-column: 1 / -1;
    }
    .aquarium-hub-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .action-card-aquarium-hub {
        grid-column: 1 / -1;
        padding: 14px 12px;
    }
    .hub-header-left .action-icon {
        font-size: 1.4rem;
    }
    .aquarium-hub-title h3 {
        font-size: 0.95rem;
    }
    .aquarium-hub-title p {
        display: none;
    }
    .hub-header-actions { gap: 4px; }
    .hub-header-btn { padding: 5px 8px; font-size: 0.7rem; }
    .aquarium-hub-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .hub-section {
        padding: 10px 6px;
        border-radius: 8px;
    }
    .hub-aquarium-list, .hub-measurement-list, .hub-event-list { display: none; }
    .hub-cta-secondary { display: none; }
    .hub-section-header { margin-bottom: 6px; padding-bottom: 4px; }
    .hub-cta-btn {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .hub-cta-pair { gap: 4px; }
    .hub-cta-pair .hub-cta-btn { font-size: 0.6rem; padding: 4px 4px; }
    .dashboard-widgets { grid-template-columns: 1fr; }
    .widget-card { padding: 16px; }

    /* === Cards Secundários: layout compacto 2 linhas no mobile === */
    .action-card-saved-tools,
    .action-card-social,
    .action-card-communities {
        grid-column: 1 / -1;
        text-align: left;
        padding: 12px 14px;
    }

    /* Linha 1: ícone + título inline */
    .action-card-saved-tools .action-icon,
    .action-card-social .action-icon,
    .action-card-communities .action-icon {
        display: inline;
        font-size: 1.3rem;
        margin-bottom: 0;
        margin-right: 6px;
        vertical-align: middle;
    }

    .action-card-saved-tools h3,
    .action-card-social h3,
    .action-card-communities h3 {
        display: inline;
        font-size: 0.95rem;
        margin-bottom: 0;
        vertical-align: middle;
    }

    /* Info dinâmica mobile (linha 2) */
    .mobile-card-info {
        display: block;
        font-size: 0.75rem;
        color: rgba(255,255,255,0.7);
        margin-top: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Esconder conteúdo desktop */
    .action-card-saved-tools > p,
    .action-card-social > p,
    .action-card-communities > p,
    .saved-tools-last,
    .saved-tools-features,
    .community-card-user-list,
    .community-card-topics,
    .community-card-empty {
        display: none;
    }

    /* Linha 3: CTAs em row */
    .action-card-social .social-cta-grid,
    .action-card-communities .social-cta-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 10px;
    }

    .action-card-social .social-cta-btn,
    .action-card-communities .social-cta-btn {
        flex: 1;
        padding: 6px 4px;
        font-size: 0.7rem;
        gap: 4px;
        border-radius: 8px;
        justify-content: center;
        text-align: center;
    }

    .action-card-social .social-cta-icon,
    .action-card-communities .social-cta-icon {
        font-size: 0.85rem;
    }

    /* Mostrar labels dos CTAs */
    .action-card-social .social-cta-label,
    .action-card-communities .social-cta-label {
        display: inline;
    }

    /* Rede Social: manter 3 CTAs principais */
    .action-card-social .social-cta-grid .social-cta-btn:nth-child(n+4) {
        display: none;
    }

    /* Comunidades: highlight sem grid-column override */
    .action-card-communities .social-cta-grid .social-cta-highlight {
        grid-column: auto;
    }

    /* Ferramentas Salvas: seta de navegação */
    .action-card-saved-tools::after {
        content: '→';
        float: right;
        font-size: 1.1rem;
        color: rgba(255,255,255,0.6);
        margin-top: -1.4rem;
    }
}

.dashboard-recent {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.recent-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recent-card h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.recent-list {
    max-height: 300px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.item-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.item-subtitle {
    font-size: 0.9rem;
    color: #718096;
}

.item-value {
    text-align: right;
}

.item-value strong {
    color: #2d3748;
    font-size: 1.1rem;
}

.item-time {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 2px;
}

.no-data {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
}

/* Preview + expand pattern for recent cards */
.recent-item-extra {
    display: none;
}

.recent-card.show-all .recent-item-extra {
    display: flex;
    animation: recentItemFadeIn 0.3s ease;
}

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

.show-more-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: none;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* === Widget Cards Modernos === */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
@media (max-width: 992px) {
    .dashboard-widgets { grid-template-columns: repeat(2, 1fr); }
}
/* Note: 768px mobile override already exists below (1fr) */
.widget-card {
    border-radius: 16px;
    padding: 22px;
    position: relative;
    overflow: hidden;
}
.widget-card::before {
    content: '';
    position: absolute;
    top: -25px;
    right: -25px;
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}
.widget-card-measurements {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
    color: white;
}
.widget-card-tasks {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    color: white;
}
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.widget-header h3 { color: white; font-size: 1.05rem; margin: 0; }
.widget-header-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: color 0.2s;
}
.widget-header-link:hover { color: white; }
.widget-list { display: flex; flex-direction: column; gap: 2px; }
.widget-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.widget-item:hover { background: rgba(255,255,255,0.1); }
.wi-icon { font-size: 1.2rem; width: 30px; text-align: center; flex-shrink: 0; }
.wi-content { flex: 1; }
.wi-title { font-weight: 600; font-size: 0.88rem; }
.wi-subtitle { font-size: 0.78rem; opacity: 0.75; }
.wi-value { text-align: right; }
.wi-value strong { font-size: 0.95rem; }
.wi-time { font-size: 0.72rem; opacity: 0.65; margin-top: 2px; }
.widget-empty {
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.6;
    padding: 20px 0;
    font-style: italic;
}
.widget-item-extra { display: none; }
.widget-card.show-all .widget-item-extra {
    display: flex;
    animation: widgetItemFadeIn 0.3s ease;
}
@keyframes widgetItemFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.widget-show-more {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s;
}
.widget-show-more:hover { background: rgba(255,255,255,0.25); }

.dashboard-charts {
    margin-bottom: 30px;
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.charts-header h3 {
    color: white;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chart-controls select {
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.15);
    color: white;
}
.chart-controls select option {
    background: #312e81;
    color: white;
}

.chart-controls select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
}

.charts-card {
    background: linear-gradient(135deg, #312e81 0%, #6366f1 100%);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: white;
    position: relative;
    overflow: hidden;
}
.charts-card::before {
    content: '';
    position: absolute;
    top: -25px;
    right: -25px;
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.charts-container {
    margin-top: 20px;
}

.chart-loading {
    text-align: center;
    color: rgba(255,255,255,0.7);
    padding: 40px;
    font-style: italic;
}

.chart-error {
    text-align: center;
    color: #fecaca;
    padding: 40px;
    background: rgba(239,68,68,0.2);
    border-radius: 8px;
}

/* === MEASUREMENT CHARTS v2 (Chart.js) === */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.chart-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chart-title-row h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chart-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Trend badge */
.chart-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.chart-trend.trend-up { background: #fef2f2; color: #dc2626; }
.chart-trend.trend-down { background: #eff6ff; color: #2563eb; }
.chart-trend.trend-stable { background: #f0fdf4; color: #16a34a; }

/* Stats badges */
.chart-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.chart-stats .stat {
    font-size: 0.72rem;
    color: #64748b;
    background: #f8fafc;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-weight: 500;
    white-space: nowrap;
}
.chart-stats .stat strong {
    color: #334155;
}

/* Chart canvas container */
.chart-canvas-wrapper {
    position: relative;
    height: 220px;
    background: #fafbfc;
    border-radius: 8px;
    padding: 8px 4px;
}

/* Range legend below chart */
.chart-range-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.7rem;
    color: #94a3b8;
    flex-wrap: wrap;
}
.chart-range-legend .range-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.chart-range-legend .range-color {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Export button */
.chart-export-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.chart-export-btn:hover {
    color: #475569;
    background: #f1f5f9;
}

/* Legacy compat */
.chart-container {
    background: white;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

.charts-upgrade {
    text-align: center;
    padding: 40px;
}

.upgrade-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 30px;
    border: 2px dashed #cbd5e0;
    max-width: 400px;
    margin: 0 auto;
}

.upgrade-card h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.upgrade-card p {
    color: #718096;
    margin-bottom: 20px;
}

.dashboard-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: #2d3748;
    margin-bottom: 15px;
}

.info-card ul, .info-card ol {
    color: #718096;
    line-height: 1.6;
}

.info-card li {
    margin-bottom: 8px;
}

/* Getting Started Guide (Dashboard Vazio) */
.getting-started-guide {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.guide-header {
    text-align: center;
    margin-bottom: 40px;
}

.guide-header h3 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.guide-header p {
    color: #718096;
    font-size: 1.1rem;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.guide-step {
    position: relative;
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.guide-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.step-content {
    padding-top: 10px;
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.step-content h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.step-content p {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 15px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.guide-features {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.guide-features h4 {
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.feature-badge {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.feature-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.badge-icon {
    font-size: 1.3rem;
}

.feature-badge span:last-child {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.95rem;
}

.guide-examples {
    margin-top: 30px;
}

.guide-examples h4 {
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.example-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.example-card:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.example-image {
    font-size: 3rem;
    margin-bottom: 15px;
}

.example-card h5 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.example-card p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
}

.diario-dashboard-guest {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.guest-content {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    max-width: 600px;
}

.guest-content h2 {
    color: #2d3748;
    margin-bottom: 15px;
}

.guest-content p {
    color: #718096;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.guest-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.feature-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.feature-item h3 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1rem;
}

.feature-item p {
    color: #718096;
    margin: 0;
    font-size: 0.9rem;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Notificação de Upgrade */
.diario-upgrade-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-text {
    flex: 1;
    font-weight: 500;
}

.notification-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .action-card {
        padding: 12px 8px;
    }

    .action-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .action-card h3 {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .action-card p {
        font-size: 10px;
    }

    /* Seções recolhíveis no mobile - Desktop: sempre visíveis */
    .section-header-mobile {
        display: none; /* Oculto no desktop */
    }

    .section-content-mobile {
        display: block !important; /* Visível por padrão no desktop */
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Ocultar headers originais no mobile */
    .recent-card > h3:not(.section-header-mobile h3),
    .charts-header > h3:not(.section-header-mobile h3),
    .investments-header > h3:not(.section-header-mobile h3) {
        display: block;
    }
    
    .dashboard-info {
        grid-template-columns: 1fr;
    }
    
    .guest-features {
        grid-template-columns: 1fr;
    }
    
    .diario-upgrade-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification-content {
        min-width: auto;
        padding: 12px 15px;
    }
}

/* Estilos para seção de Comunidades */
.dashboard-communities {
    margin-top: 32px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.communities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.communities-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.btn-view-all {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-view-all:hover {
    color: #0056b3;
    text-decoration: underline;
}

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

.community-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    transition: all 0.2s;
}

.community-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.community-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

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

.topic-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    text-decoration: none;
    margin-bottom: 6px;
    line-height: 1.4;
}

.topic-title:hover {
    color: #007bff;
}

.topic-meta {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

.topic-meta strong {
    color: #007bff;
}

.no-communities {
    padding: 32px 20px;
    text-align: center;
    color: #999;
    font-size: 15px;
}

.no-communities a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.no-communities a:hover {
    text-decoration: underline;
}

/* Banner de Mudança Agendada */
.scheduled-change-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 5px solid #ffc107;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-icon {
    font-size: 3rem;
    flex-shrink: 0;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

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

.banner-title {
    color: #856404;
    font-size: 1.3rem;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.banner-message {
    color: #6c5400;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.banner-message strong {
    color: #856404;
    font-weight: 700;
}

.banner-actions {
    flex-shrink: 0;
}

.btn-cancel-scheduled {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel-scheduled:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-cancel-scheduled:active {
    transform: translateY(0);
}

.btn-cancel-scheduled .btn-icon {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .scheduled-change-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .banner-icon {
        font-size: 2.5rem;
    }
    
    .banner-title {
        font-size: 1.1rem;
    }
    
    .banner-message {
        font-size: 0.95rem;
    }
    
    .btn-cancel-scheduled {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .communities-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .community-item {
        padding: 12px;
    }

    .community-icon {
        font-size: 24px;
    }

    .topic-title {
        font-size: 14px;
    }

    .topic-meta {
        font-size: 12px;
    }
}

/* ====== Investment Costs Section ====== */
.dashboard-investments {
    background: linear-gradient(135deg, #134e4a 0%, #0f766e 50%, #14b8a6 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: white;
    position: relative;
    overflow: hidden;
}
.dashboard-investments::before {
    content: '';
    position: absolute;
    top: -25px;
    right: -25px;
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.dashboard-investments::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: -15px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.investments-card {
    width: 100%;
    position: relative;
    z-index: 1;
}

.investments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.investments-header h3 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.investment-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.investment-controls select {
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}
.investment-controls select option {
    background: #134e4a;
    color: white;
}

.investment-controls select:hover {
    border-color: rgba(255,255,255,0.5);
}

.investment-controls select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

/* Contextual overrides for dark-bg investments */
.dashboard-investments .summary-loading {
    color: rgba(255,255,255,0.6);
}
.dashboard-investments .cost-chart-card {
    background: rgba(255,255,255,0.95);
}
.dashboard-investments .cost-chart-card .cost-chart-expand-btn {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
}
.dashboard-investments .cost-chart-card .cost-chart-expand-btn:hover {
    background: #ccfbf1;
}
.dashboard-investments .investment-total-bar {
    background: rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

/* kWh Configuration Section */
.kwh-config-section {
    background: rgba(0,0,0,0.2);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}

.kwh-config-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.kwh-label {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.kwh-help-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.kwh-help-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.kwh-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.9);
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kwh-currency, .kwh-unit {
    color: #666;
    font-weight: 600;
    font-size: 1rem;
}

#kwhCostInput {
    flex: 1;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 4px 8px;
    min-width: 100px;
}

#kwhCostInput:focus {
    outline: none;
    background: #f8f9fa;
    border-radius: 4px;
}

.kwh-save-status {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.kwh-save-status.saving {
    color: #f39c12;
}

.kwh-save-status.saved {
    color: #27ae60;
}

.kwh-save-status.error {
    color: #e74c3c;
}

/* Rate source badge */
.rate-source-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 500;
}
.rate-source-badge.crowdsourced {
    background: #fef3cd;
    color: #856404;
}
.rate-source-badge.user {
    background: #d4edda;
    color: #155724;
}

/* Crowdsourced hint below kWh input */
.kwh-crowdsourced-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
    padding-left: 2px;
}

/* Elegant Tooltip */
.kwh-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    z-index: 10000;
    animation: tooltipFadeIn 0.3s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.kwh-tooltip::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #f0f0f0;
}

.tooltip-header h4 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.tooltip-close {
    background: #e74c3c;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tooltip-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.tooltip-content {
    padding: 24px;
}

.tooltip-content ol {
    margin: 0 0 20px 0;
    padding-left: 24px;
}

.tooltip-content li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #34495e;
}

.tooltip-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.tooltip-warning strong {
    color: #856404;
    display: block;
    margin-bottom: 8px;
}

.tooltip-warning p {
    margin: 0;
    color: #6c5400;
    line-height: 1.5;
}

.tooltip-note {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 16px;
    border-radius: 8px;
}

.tooltip-note strong {
    color: #0c5460;
    display: block;
    margin-bottom: 8px;
}

/* Investments Summary */
.investments-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.summary-card.energy {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card.energy-large {
    grid-column: span 2;
}

.summary-card.fauna {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card.flora {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.summary-card.equipments {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Combined Fauna/Flora card */
.summary-card.combined-fauna-flora {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: transparent;
    box-shadow: none;
    gap: 0;
}

.summary-card-half {
    padding: 16px 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card-half.fauna-half {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 12px 12px 0 0;
}

.summary-card-half.flora-half {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 0 0 12px 12px;
}

.summary-card-half:only-child {
    border-radius: 12px;
}

.summary-card-divider {
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 20px;
    flex-shrink: 0;
}

.summary-card-half h4 {
    margin: 0 0 6px 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.summary-card-half .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.summary-card-half .detail {
    font-size: 0.8rem;
    margin-top: 6px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.summary-card h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.summary-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.summary-card .detail {
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.summary-card .detail.energy-items {
    font-size: 0.75rem;
    margin-top: 8px;
    line-height: 1.4;
    flex-wrap: wrap;
}

/* Energy card details grid */
.energy-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.energy-detail-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.energy-detail-col .detail {
    margin: 0;
    font-size: 0.85rem;
}

/* Equipments card stats */
.equipments-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.equipments-stats .detail {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.equipments-most-expensive {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.equipments-list {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.4;
    margin-top: 4px;
}

.summary-card .detail > * {
    position: relative;
    z-index: 0;
}

/* Ícone de informação de itens */
.items-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.3s ease;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    margin-left: 4px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.items-info-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: transparent;
    z-index: -1;
}

.items-info-icon:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.3);
}

.items-info-icon:active {
    transform: scale(0.95);
}

.items-info-icon * {
    pointer-events: none;
}

/* Tooltip de itens */
.items-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 400px;
    min-width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.items-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.items-tooltip.mobile-open {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 90vw;
    max-height: 80vh;
}

.tooltip-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.tooltip-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.tooltip-body {
    padding: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

.tooltip-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

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

.tooltip-item:hover {
    background: #f8f9fa;
}

.tooltip-item-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

.tooltip-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.tooltip-quantity {
    color: #667eea;
    font-weight: 600;
}

.tooltip-cost {
    color: #27ae60;
    font-weight: 600;
}

/* Scrollbar personalizada para tooltip */
.tooltip-body::-webkit-scrollbar {
    width: 6px;
}

.tooltip-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tooltip-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.tooltip-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsividade */
@media (max-width: 768px) {
    .items-tooltip {
        max-width: 90vw;
        min-width: 280px;
    }
    
    .items-tooltip.mobile-open {
        max-height: 85vh;
    }
    
    .tooltip-body {
        max-height: 70vh;
    }
}

.summary-loading, .chart-loading {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 1.1rem;
}

/* Investment Charts */
.investments-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* ==========================================
   Cost Charts v2 — Chart.js (replaced Canvas 2D)
   ========================================== */
.cost-chart-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.cost-chart-title {
    margin: 0 0 16px 0;
    color: #1a202c;
    font-size: 1.25rem;
    font-weight: 600;
}

.cost-chart-canvas-wrap {
    position: relative;
    height: 320px;
    width: 100%;
}

@media (max-width: 768px) {
    .cost-chart-canvas-wrap {
        height: 240px;
    }
    .cost-chart-card {
        padding: 16px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .investments-header {
        flex-direction: column;
        align-items: stretch;
    }

    .investment-controls {
        flex-direction: column;
    }

    .investment-controls select {
        width: 100%;
    }

    .kwh-tooltip {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .investments-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-card.energy-large {
        grid-column: span 1;
    }
    
    .energy-details-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .investments-charts {
        grid-template-columns: 1fr;
    }

    /* Seções recolhíveis no mobile */
    .section-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 0;
    }

    .section-header-mobile h3 {
        margin: 0;
        flex: 1;
    }

    /* Ocultar headers originais no mobile quando há section-header-mobile */
    .collapsible-section .recent-card > h3:not(.section-header-mobile h3),
    .collapsible-section .charts-header > h3:not(.section-header-mobile h3),
    .collapsible-section .investments-header > h3:not(.section-header-mobile h3) {
        display: none !important;
    }

    /* Ocultar controles originais no mobile quando dentro de wrapper */
    .collapsible-section .charts-header > .chart-controls:not(.chart-controls-wrapper .chart-controls) {
        display: none !important;
    }

    .collapsible-section .investments-header > .investment-controls:not(.investment-controls-wrapper .investment-controls) {
        display: none !important;
    }

    .section-toggle-btn {
        background: transparent;
        border: 2px solid #667eea;
        color: #667eea;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        font-weight: bold;
        transition: all 0.3s ease;
        flex-shrink: 0;
        padding: 0;
        line-height: 1;
    }

    .section-toggle-btn:hover {
        background: #667eea;
        color: white;
        transform: scale(1.1);
    }

    .section-toggle-btn:active {
        transform: scale(0.95);
    }

    .toggle-icon {
        display: inline-block;
        transition: transform 0.3s ease;
    }

    .section-toggle-btn.expanded .toggle-icon {
        transform: rotate(45deg);
    }

    .section-content-mobile {
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
        opacity: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: block !important;
    }

    .section-content-mobile.expanded {
        max-height: 5000px !important;
        opacity: 1 !important;
        margin-top: 16px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        overflow: visible !important;
    }

    /* Ajustes para seções específicas */
    .recent-card .section-header-mobile,
    .charts-header .section-header-mobile,
    .investments-header .section-header-mobile {
        margin-bottom: 0;
    }

    /* Garantir que wrappers funcionem corretamente */
    .chart-controls-wrapper.expanded,
    .investment-controls-wrapper.expanded,
    .charts-container-wrapper.expanded,
    .investments-content-wrapper.expanded {
        display: block;
    }
}

/* ============================================
   INVESTMENT DASHBOARD IMPROVEMENTS (2026-03-11)
   ============================================ */

/* Total investment bar */
.investment-total-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #2d3748, #4a5568);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.investment-total-bar .total-label {
    opacity: 0.8;
    font-size: 0.9rem;
}
.investment-total-bar .total-value {
    font-size: 1.5rem;
    font-weight: 700;
}
.investment-total-bar .total-energy {
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Empty state CTA */
.summary-card-half.no-cost-data {
    opacity: 0.85;
}
.empty-value {
    font-size: 1.5rem !important;
    opacity: 0.5;
}
.empty-cta {
    font-style: italic;
    font-size: 0.8rem !important;
    opacity: 0.9;
}

/* Energy card improvements */
.energy-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.energy-hours-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    white-space: nowrap;
}
.energy-hours-badge.default {
    opacity: 0.6;
}
.energy-metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 6px;
}
.energy-metric-separator {
    opacity: 0.4;
}
.energy-details-collapsible {
    margin-top: 8px;
    font-size: 0.82rem;
    opacity: 0.75;
}
.energy-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.energy-rate-info {
    margin-top: 4px;
}

/* Responsive adjustments for new investment elements */
@media (max-width: 480px) {
    .investment-total-bar {
        padding: 10px 14px;
        gap: 8px;
    }
    .investment-total-bar .total-value {
        font-size: 1.2rem;
    }
    .investment-total-bar .total-energy {
        margin-left: 0;
        width: 100%;
        font-size: 0.8rem;
    }
    .energy-metrics-row {
        font-size: 0.78rem;
    }
    .energy-details-collapsible {
        font-size: 0.75rem;
    }

    /* Charts v2 responsive */
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .chart-canvas-wrapper {
        height: 180px;
    }
    .chart-header {
        flex-direction: column;
    }
    .chart-actions-row {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================
   CHARTS + COSTS 2-COLUMN LAYOUT (2026-03-13)
   ============================================ */
.dashboard-charts-costs-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 30px;
}

/* Compact header for charts in 2-col layout */
.charts-header-compact {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.charts-header-compact .section-header-mobile h3 {
    font-size: 1.2rem;
}
.charts-header-compact .chart-controls {
    gap: 6px;
}
.charts-header-compact .chart-controls select {
    padding: 5px 8px;
    font-size: 0.82rem;
}

/* Force costs cards to single column in 2-col layout */
.dashboard-charts-costs-row .investments-summary {
    grid-template-columns: 1fr;
}
.dashboard-charts-costs-row .summary-card.energy-large {
    grid-column: span 1;
}

/* Costs section compact adjustments when in 2-col */
.dashboard-charts-costs-row .dashboard-investments {
    padding: 18px;
}
.dashboard-charts-costs-row .investments-header h3 {
    font-size: 1.3rem;
}
.dashboard-charts-costs-row .investment-controls {
    flex-direction: column;
    gap: 6px;
}
.dashboard-charts-costs-row .investment-controls select {
    font-size: 0.85rem;
    padding: 6px 10px;
}

/* Mini cost chart */
.cost-chart-mini {
    padding: 14px;
    margin-bottom: 12px;
}
.cost-chart-mini .cost-chart-title {
    font-size: 1rem;
    margin-bottom: 8px;
}
.cost-chart-mini .cost-chart-canvas-wrap {
    height: 160px;
}

/* Expand button */
.cost-chart-expand-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}
.cost-chart-expand-btn:hover {
    background: #e0e7ff;
}

/* Cost chart full modal */
.cost-chart-modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow-y: auto;
}
.cost-chart-modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90vw;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}
.cost-chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.cost-chart-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #1a202c;
}
.cost-chart-modal-close {
    background: #e74c3c;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.cost-chart-modal-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}
.cost-chart-modal-body .cost-chart-card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin-bottom: 0;
}
.cost-chart-modal-body .cost-chart-canvas-wrap {
    height: 400px;
}

/* Mobile: stack 2 columns */
@media (max-width: 900px) {
    .dashboard-charts-costs-row {
        grid-template-columns: 1fr;
    }
    .dashboard-charts-costs-row .investment-controls {
        flex-direction: row;
    }
    .cost-chart-modal-content {
        width: 95vw;
        padding: 16px;
    }
    .cost-chart-modal-body .cost-chart-canvas-wrap {
        height: 280px;
    }
}

/* === Wizard Card: Planejar Novo Aquário === */
.widget-card-wizard {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
    border: none;
    color: #78350f;
}
.widget-card-wizard .widget-header h3 {
    color: #78350f;
}
.wizard-desc {
    font-size: 0.88rem;
    color: #92400e;
    margin: 0 0 14px 0;
    line-height: 1.5;
}
.wizard-start-btn {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    margin-bottom: 14px;
}
.wizard-start-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
}
.wizard-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ws-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #78350f;
    text-decoration: none;
    transition: background 0.15s;
}
.ws-link:hover {
    background: rgba(255,255,255,0.95);
    color: #78350f;
}
.ws-link-loja {
    background: rgba(124,58,237,0.15);
    color: #5b21b6;
}
.ws-link-loja:hover {
    background: rgba(124,58,237,0.25);
    color: #5b21b6;
}
