/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS
   ========================================================================== */

:root {
    --rosa: #181306;
    --rosa-escuro: #be185d;
    --rosa-claro: #fdf2f8;
    --verde: #22c55e;
    --verde-escuro: #16a34a;
    --bg-corpo: #f9fafb;
    --texto-escuro: #1f2937;
    --texto-cinza: #6b7280;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    margin: 0;
    background: var(--bg-corpo);
    color: var(--texto-escuro);
    min-height: 100vh;
}

/* ==========================================================================
   2. ESTRUTURA
   ========================================================================== */

.sidebar {
    width: 200px;
    background: #efc135;
    height: 100vh;
    padding: 20px;
    position: fixed;
    z-index: 1001;
}

.sidebar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-weight: 500;
}

.main-content {
    flex: 1;
    padding: 40px;
    margin-left: 200px;
    width: calc(100% - 200px);
}

/* ==========================================================================
   3. COMPONENTES
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.img-p {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

tr {
    transition: 0.2s;
}

tr:active {
    transform: scale(0.98);
}

td {
    word-break: break-word;
}

/* ==========================================================================
   4. RESPONSIVIDADE MOBILE
   ========================================================================== */

@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    body {
        flex-direction: column;
    }

    /* SIDEBAR */

    .sidebar {
        z-index: 10001;
    }

    .menu-toggle {
        z-index: 10002;
    }

    /* CONTEÚDO */

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* BOTÕES TOPO */

    .main-content > div[style*="display: flex"],
    header,
    .top-bar-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-content a[class*="btn"],
    .main-content button {
        flex: 1 1 45%;
        font-size: 12px;
        padding: 12px 5px;
    }

    /* FILTROS */

    .filtros-wrapper,
    .area-busca-flex {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .filtros-wrapper > div,
    .area-busca-flex > div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .btn-filtro {
        flex: 1 1 45%;
        text-align: center;
        font-size: 12px;
        padding: 10px;
    }

    /* BUSCA */

    .busca-container {
        width: 100%;
    }

    .busca-container input {
        width: 100%;
        font-size: 16px;
    }

    /* TABELA -> CARD */

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    table {
        min-width: 100%;
    }

    tr {
        background: #fff;
        margin-bottom: 15px;
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        border-left: 5px solid #f97316;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #f1f1f1;
        font-size: 14px;
        text-align: right;
    }

    td:last-child {
        border-bottom: none;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* LABELS */

    td:nth-child(1)::before {
        content: "Pedido";
        font-weight: bold;
    }

    td:nth-child(2)::before {
        content: "Hora";
        font-weight: bold;
    }

    td:nth-child(3)::before {
        content: "Tipo";
        font-weight: bold;
    }

    td:nth-child(4)::before {
        content: "Cliente";
        font-weight: bold;
    }

    td:nth-child(5)::before {
        content: "Whats";
        font-weight: bold;
    }

    td:nth-child(6)::before {
        content: "Produtos";
        font-weight: bold;
    }

    td:nth-child(7)::before {
        content: "Status";
        font-weight: bold;
    }

    td:nth-child(8)::before {
        content: "Entrega";
        font-weight: bold;
    }

    td::before {
        color: #999;
        font-size: 12px;
        text-align: left;
    }

    /* PRODUTOS */

    .col-produtos {
        font-size: 13px;
        line-height: 1.4;
        text-align: left;
        min-width: 220px;
    }

    /* AÇÕES */

    .col-acoes {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        min-width: 100%;
        padding-top: 15px;
        border-top: 1px solid #eee;
        white-space: normal;
    }

    .btn-acao {
        width: 42px;
        height: 42px;
        font-size: 18px;
        flex-shrink: 0;
    }

    /* SELECTS */

    .status-select,
    .motoboy-select {
        font-size: 14px;
    }
}