/**
 * LAMAPA - Estilos Personalizados
 * Sidebar com menu lateral (como era antes)
 */

/* ============ Variáveis ============ */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #27ae60;
    --accent-color: #e67e22;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #ecf0f1;
    --dark-sidebar: #1a252f;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 0px;
    --transition-speed: 0.3s;
}

/* ============ Reset & Base ============ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--primary-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ============ Wrapper ============ */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark-sidebar) 0%, #2c3e50 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all var(--transition-speed);
    z-index: 1000;
    transform: translateX(0);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Esconde sidebar quando colapsada */
.sidebar.collapsed {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-header {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-logo {
    font-size: 20px;
    margin-bottom: 2px;
    color: var(--secondary-color);
}

/* Logo da empresa (Desktop apenas) */
.sidebar-logo-image {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-logo-image img {
    max-width: 200px;
    max-height: 80px;
    object-fit: contain;
}

/* Esconder logo em mobile, mostrar em desktop */
.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--secondary-color);
}

.sidebar-subtitle {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 8px 0;
}

.empresa-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(39, 174, 96, 0.2);
    color: var(--secondary-color);
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 9px;
    font-weight: 600;
    margin-bottom: 5px;
}

.database-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(39, 174, 96, 0.2);
    color: var(--secondary-color);
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.sidebar-section {
    display: block;
    padding: 6px 10px 3px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar .components {
    padding: 0;
    list-style: none;
}

.sidebar .components li {
    position: relative;
}

.sidebar .components li a {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 12px;
}

.sidebar .components li a i {
    font-size: 14px;
    width: 18px;
    margin-right: 6px;
}

.sidebar .components li a span {
    flex: 1;
}

.sidebar .components li:hover a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .components li.active a {
    background: rgba(39, 174, 96, 0.2);
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
}

/* ============ Content ============ */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all var(--transition-speed);
}

#content.expanded {
    width: 100%;
    margin-left: 0;
}

/* ============ Topbar ============ */
.topbar {
    display: none !important;
}

.btn-toggle {
    position: fixed;
    top: 5px;
    left: 265px;
    background: white;
    border: 1px solid #ddd;
    color: var(--primary-color);
    font-size: 14px;
    padding: 2px 5px;
    transition: all 0.2s;
    border-radius: 3px;
    cursor: pointer;
    height: 22px;
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-toggle:hover {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.05);
}

.sidebar.collapsed ~ #content .btn-toggle {
    left: 85px;
}

.btn-toggle:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 14px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--primary-color);
}

.navbar-nav .nav-link {
    color: var(--primary-color);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-nav .nav-link:hover {
    background: var(--light-bg);
    border-radius: 8px;
}

/* ============ Main Content ============ */
.main-content {
    flex: 1;
}

/* ============ Cards ============ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 18px 20px;
    font-weight: 600;
    font-size: 16px;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    padding: 20px;
}

/* ============ Stat Cards ============ */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border-left: 4px solid;
}

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

.stat-card.primary {
    border-left-color: var(--info-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card .icon {
    font-size: 36px;
    opacity: 0.2;
    position: absolute;
    top: 20px;
    right: 20px;
}

.stat-card .label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-card .sub-value {
    font-size: 13px;
    color: #7f8c8d;
}

.stat-card .progress {
    height: 4px;
    border-radius: 2px;
    margin-top: 15px;
}

/* ============ Tables ============ */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    border-radius: 12px;
}

.table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: none;
    padding: 15px;
    white-space: nowrap;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* ============ Filters ============ */
.filters-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--light-bg);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary-color);
}

.chip .btn-close {
    font-size: 10px;
    padding: 0;
    margin: 0;
    width: 14px;
    height: 14px;
}

/* ============ Badges ============ */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-certificada {
    background: #d4edda;
    color: #155724;
}

.badge-nao-certificada {
    background: #f8d7da;
    color: #721c24;
}

/* ============ Buttons ============ */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* ============ Pagination ============ */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    margin: 0 3px;
    padding: 8px 14px;
}

.page-link:hover {
    background: var(--light-bg);
    color: var(--secondary-color);
}

.page-item.active .page-link {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* ============ Footer ============ */
.footer {
    background: white;
    padding: 8px 0;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.footer p {
    color: #7f8c8d;
    font-size: 11px;
    margin: 0;
}

/* ============ Charts ============ */
.chart-container {
    position: relative;
    height: 300px;
}

/* ============ Modern Dashboard Shell ============ */
body {
    background:
        radial-gradient(circle at top left, rgba(39, 174, 96, 0.08), transparent 26%),
        linear-gradient(180deg, #eef3f5 0%, #f7fafb 100%);
    color: #183247;
}

.sidebar {
    background:
        radial-gradient(circle at top left, rgba(39, 174, 96, 0.18), transparent 32%),
        linear-gradient(180deg, #102130 0%, #163246 46%, #1d4458 100%);
    box-shadow: 16px 0 34px rgba(10, 24, 35, 0.16);
}

.sidebar-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    background: linear-gradient(145deg, #27ae60 0%, #1f8e4d 100%);
    box-shadow: 0 14px 24px rgba(39, 174, 96, 0.18);
    flex-shrink: 0;
}

.sidebar-brand-copy {
    min-width: 0;
    text-align: left;
}

.sidebar-kicker {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.56);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
}

.sidebar-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.66);
    margin: 4px 0 0;
    line-height: 1.4;
}

.sidebar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.sidebar-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.84);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-chip-user {
    background: rgba(39, 174, 96, 0.16);
}

.sidebar-body {
    padding: 12px 10px 16px;
}

.sidebar-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 12px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.42);
}

.sidebar .components li a {
    padding: 11px 12px;
    margin: 3px 0;
    border-left: none;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
    font-weight: 600;
}

.sidebar .components li a i {
    width: 20px;
    margin-right: 10px;
    font-size: 15px;
}

.sidebar .components li:hover a {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar .components li.active a {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.26), rgba(39, 174, 96, 0.14));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.16);
}

#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    background: transparent;
}

.content-topbar {
    position: sticky;
    top: 0;
    z-index: 990;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(247, 250, 251, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(24, 50, 71, 0.08);
}

.content-topbar-left,
.content-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-topbar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.content-topbar-kicker {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6a7d89;
}

.content-topbar-info strong {
    font-size: 15px;
    color: #183247;
}

.topbar-database-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(24, 50, 71, 0.10);
    color: #345066;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(24, 50, 71, 0.06);
}

.btn-toggle {
    position: static;
    left: auto;
    top: auto;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(24, 50, 71, 0.10);
    background: #ffffff;
    color: #183247;
    font-size: 18px;
    padding: 0;
    box-shadow: 0 8px 18px rgba(24, 50, 71, 0.08);
}

.btn-toggle:hover {
    background: #183247;
    color: #ffffff;
    transform: translateY(-1px);
}

.sidebar.collapsed ~ #content .btn-toggle {
    left: auto;
}

.user-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    border-radius: 16px;
    border: 1px solid rgba(24, 50, 71, 0.10);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(24, 50, 71, 0.06);
}

.user-menu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #183247 0%, #2f566d 100%);
    color: #ffffff;
    font-size: 14px;
}

.user-menu-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-menu-copy strong {
    font-size: 13px;
    color: #183247;
}

.user-menu-copy small {
    font-size: 11px;
    color: #728592;
}

.user-menu-caret {
    color: #728592;
    font-size: 12px;
}

.modern-dropdown {
    border: 1px solid rgba(24, 50, 71, 0.08);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 18px 34px rgba(24, 50, 71, 0.12);
}

.modern-dropdown .dropdown-header,
.modern-dropdown .dropdown-item {
    font-size: 13px;
}

.modern-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 9px 12px;
}

.main-content {
    flex: 1;
    padding: 22px 18px 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 18px 22px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(24, 50, 71, 0.08);
    box-shadow: 0 14px 28px rgba(24, 50, 71, 0.06);
}

.page-header h2 {
    color: #183247;
    font-size: 26px;
    font-weight: 800;
}

.page-header-meta,
.page-header .text-muted {
    color: #6f808c !important;
    font-size: 14px;
}

.page-header-actions .btn,
.page-action-btn {
    border-radius: 14px;
    border-color: rgba(24, 50, 71, 0.10);
    background: #f8fbfc;
    color: #183247;
    padding: 10px 16px;
}

.page-header-actions .btn:hover,
.page-action-btn:hover {
    background: #eef4f6;
    color: #183247;
}

.card {
    border: 1px solid rgba(24, 50, 71, 0.06);
    border-radius: 22px;
    box-shadow: 0 16px 32px rgba(24, 50, 71, 0.06);
    background: rgba(255, 255, 255, 0.92);
}

.card:hover {
    box-shadow: 0 18px 36px rgba(24, 50, 71, 0.09);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(24, 50, 71, 0.08);
    padding: 18px 20px;
    font-weight: 700;
}

.chart-card-header {
    gap: 12px;
}

.chart-toolbar {
    flex-wrap: wrap;
}

.chart-select {
    width: auto !important;
    min-width: 170px;
    border-radius: 12px;
    border: 1px solid rgba(24, 50, 71, 0.10);
    background-color: #f8fbfc;
}

.stat-card-modern {
    overflow: hidden;
}

.quick-links-card .card-body {
    padding-top: 10px;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    padding: 22px;
    border-radius: 20px;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid rgba(24, 50, 71, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(24, 50, 71, 0.10);
    text-decoration: none;
}

.quick-link-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.quick-link-title {
    display: block;
    font-size: 18px;
    font-weight: 800;
}

.quick-link-subtitle {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: #6a7d89;
}

.quick-link-primary {
    color: #24536c;
}

.quick-link-primary .quick-link-icon {
    background: rgba(52, 152, 219, 0.12);
    color: #2a7db7;
}

.quick-link-success {
    color: #1f7a48;
}

.quick-link-success .quick-link-icon {
    background: rgba(39, 174, 96, 0.12);
    color: #27ae60;
}

.quick-link-warning {
    color: #b36a11;
}

.quick-link-warning .quick-link-icon {
    background: rgba(243, 156, 18, 0.14);
    color: #d48814;
}

.quick-link-dark {
    color: #183247;
}

.quick-link-dark .quick-link-icon {
    background: rgba(24, 50, 71, 0.10);
    color: #183247;
}

.footer {
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(24, 50, 71, 0.08);
    padding: 12px 18px;
}

.footer p {
    color: #728592;
    font-size: 12px;
}

@media (max-width: 991px) {
    .content-topbar,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .content-topbar {
        padding: 12px 14px;
    }

    .main-content {
        padding: 16px 12px 12px;
    }

    .sidebar-header {
        padding: 18px 16px 14px;
    }

    .quick-link-card {
        min-height: 150px;
    }
}



/* ============ Animations ============ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ============ Print styles ============ */
@media print {
    .sidebar,
    .topbar,
    .btn-toggle,
    .footer {
        display: none !important;
    }

    #content {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
