/* ===================================
   ADMIN PANEL STYLES
   =================================== */

.admin-body {
    background: #f5f7fa !important;
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.admin-body::before {
    display: none;
}

/* === SIDEBAR === */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2C2C2C 0%, #1a1a1a 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    height: 80px;
    width: auto;
    margin: 0 auto 1rem;
    clip-path: inset(0 0 15% 0);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--primary);
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--primary);
}

.nav-item.active {
    background: rgba(212, 165, 116, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-site,
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-site {
    background: var(--primary);
    color: white;
}

.btn-site:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.btn-logout:hover {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

/* === MAIN CONTENT === */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.admin-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.header-search input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.header-btn:hover {
    color: var(--primary);
}

.header-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4d4d;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1rem;
    background: var(--secondary);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu:hover {
    background: var(--secondary-dark);
}

.user-menu img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.user-menu span {
    font-weight: 500;
    color: var(--dark);
}

/* === SECTIONS === */
.admin-section {
    display: none;
    padding: 2rem;
    flex: 1;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2rem;
    color: var(--dark);
    margin: 0;
}

.section-header p {
    color: var(--gray);
    margin: 0.5rem 0 0 0;
}

/* === BUTTONS === */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--light-gray);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--cream);
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info h3 {
    font-size: 1.8rem;
    margin: 0 0 0.3rem 0;
    color: var(--dark);
}

.stat-info p {
    color: var(--gray);
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

.stat-change.neutral {
    color: var(--gray);
}

/* === CHARTS === */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--dark);
}

.chart-placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    border-radius: 8px;
    color: var(--gray);
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.top-products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--cream);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-item:hover {
    background: var(--secondary);
}

.product-item .rank {
    width: 30px;
    height: 30px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.product-item .name {
    flex: 1;
    font-weight: 500;
    color: var(--dark);
}

.product-item .sales {
    color: var(--gray);
    font-size: 0.9rem;
}

/* === TABLES === */
.table-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    margin-bottom: 2rem;
}

.table-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--dark);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--cream);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--light-gray);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    color: var(--gray);
}

.data-table tbody tr {
    transition: background 0.3s ease;
}

.data-table tbody tr:hover {
    background: var(--cream);
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.info {
    background: #dbeafe;
    color: #1e40af;
}

/* === FILTERS === */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    flex: 0 0 auto;
}

.filter-select {
    padding: 0.8rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-search {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.filter-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.filter-search input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-family: var(--font-body);
}

/* === ALERTS === */
.alert-card {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.alert-card.warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.alert-card i {
    font-size: 1.5rem;
    color: #f59e0b;
}

.alert-card strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--dark);
}

.alert-card p {
    margin: 0;
    color: var(--gray);
}

/* === PROMOÇÕES GRID === */
.promocoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.promocao-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.promocao-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* === FINANCIAL CARDS === */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.financial-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.financial-card i {
    font-size: 2.5rem;
}

.financial-card.receita i {
    color: #10b981;
}

.financial-card.despesa i {
    color: #ef4444;
}

.financial-card.lucro i {
    color: #3b82f6;
}

.financial-card h3 {
    font-size: 0.9rem;
    color: var(--gray);
    margin: 0 0 0.5rem 0;
}

.financial-card h2 {
    font-size: 1.8rem;
    margin: 0 0 0.3rem 0;
    color: var(--dark);
}

.financial-card .period {
    font-size: 0.85rem;
    color: var(--gray);
}

/* === STATS SMALL === */
.stat-card-small {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card-small h4 {
    margin: 0 0 0.5rem 0;
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-card-small h2 {
    margin: 0 0 0.5rem 0;
    color: var(--dark);
    font-size: 1.8rem;
}

.stat-card-small p {
    margin: 0;
    color: var(--gray);
    font-size: 0.9rem;
}

/* === CONFIG GRID === */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.config-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.config-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.config-card h3 i {
    color: var(--primary);
}

/* === FORMS === */
.config-form,
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* === ACTION BUTTONS === */
.action-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
    font-size: 1.1rem;
}

.action-btn:hover {
    color: var(--primary);
}

.action-btn.delete:hover {
    color: #ef4444;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header .menu-toggle {
        display: block;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }
}