/**
 * Dashboard Admin - Design Clean
 * Prefeitura Municipal de Angra dos Reis
 */

/* ========================================
   BASE STYLES
   ======================================== */
.dashboard-admin {
    padding: 1.5rem 2rem;
    background-color: #f8fafc;
    min-height: calc(100vh - 120px);
}

/* ========================================
   HEADER COM BUSCA
   ======================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.dashboard-header-left {
    flex-shrink: 0;
}

.dashboard-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--primary-admin, var(--primary, #0d6efd));
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-title i {
    font-size: 1.1rem;
}

.dashboard-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* ========================================
   CAMPO DE BUSCA
   ======================================== */
.dashboard-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: #f9fafb;
    transition: all 0.2s ease;
    color: #1f2937;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-admin, var(--primary, #0d6efd));
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: #e5e7eb;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
    pointer-events: none;
}

/* ========================================
   INFO DOS MÓDULOS
   ======================================== */
.modules-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.25rem;
    margin-bottom: 1rem;
}

.modules-count {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modules-count i {
    color: #9ca3af;
}

.modules-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modules-hint i {
    color: #fbbf24;
}

/* ========================================
   GRID DE MÓDULOS
   ======================================== */
.modules-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1.25rem 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 120px;
}

.module-card:hover {
    border-color: var(--primary-admin, var(--primary, #0d6efd));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.module-card:active {
    transform: translateY(0);
}

.module-card.hidden {
    display: none !important;
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--primary-admin, var(--primary, #0d6efd));
    color: #ffffff;
    transition: all 0.2s ease;
}

.module-card:hover .module-icon {
    transform: scale(1.08);
}

.module-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.module-card:hover .module-name {
    color: var(--primary-admin, var(--primary, #0d6efd));
}

/* ========================================
   ESTADOS VAZIOS
   ======================================== */
.empty-modules,
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    grid-column: 1 / -1;
}

.empty-modules i,
.no-results i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-modules p,
.no-results p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.empty-modules small,
.no-results small {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* ========================================
   RESPONSIVIDADE - TELA GRANDE
   ======================================== */
@media (min-width: 1600px) {
    .modules-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .module-card {
        min-height: 130px;
        padding: 1.5rem 1rem;
    }

    .module-icon {
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
    }

    .module-name {
        font-size: 0.85rem;
    }
}

/* ========================================
   RESPONSIVIDADE - TABLET
   ======================================== */
@media (max-width: 992px) {
    .dashboard-admin {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .dashboard-search {
        max-width: none;
    }
}

/* ========================================
   RESPONSIVIDADE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 1.15rem;
    }

    .modules-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .module-card {
        padding: 1rem 0.75rem;
        min-height: 100px;
    }

    .module-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .module-name {
        font-size: 0.7rem;
    }

    .search-shortcut {
        display: none;
    }
}

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

/* ========================================
   ANIMAÇÕES
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-card {
    animation: fadeIn 0.2s ease forwards;
}

.module-card:nth-child(1) { animation-delay: 0.01s; }
.module-card:nth-child(2) { animation-delay: 0.02s; }
.module-card:nth-child(3) { animation-delay: 0.03s; }
.module-card:nth-child(4) { animation-delay: 0.04s; }
.module-card:nth-child(5) { animation-delay: 0.05s; }
.module-card:nth-child(6) { animation-delay: 0.06s; }
.module-card:nth-child(7) { animation-delay: 0.07s; }
.module-card:nth-child(8) { animation-delay: 0.08s; }
.module-card:nth-child(9) { animation-delay: 0.09s; }
.module-card:nth-child(10) { animation-delay: 0.10s; }

/* ========================================
   SEÇÃO DE OUTROS SISTEMAS
   ======================================== */
.external-systems-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.dashboard-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-section-title i {
    font-size: 1.25rem;
}
