
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #172b4d;
}

.admin-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 35px 18px 70px;
}

/* ENCABEZADO */

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 16px;
}

.admin-brand svg {
    width: 22px;
}

h1 {
    font-size: 29px;
    margin: 0 0 8px;
}

.admin-top p {
    color: #64748b;
    margin: 0;
}

.admin-count {
    border-radius: 20px;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    white-space: nowrap;
}

/* BUSCADOR */

.admin-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 25px;
}

.admin-search > svg {
    width: 22px;
    margin-left: 8px;
    color: #64748b;
}

.admin-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 10px 0;
}

.admin-search button,
.pedido-ver {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.clear-search {
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
}

/* TARJETAS */

.admin-list {
    display: grid;
    gap: 15px;
}

.pedido-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 24px;
}

.pedido-main {
    flex: 1;
    min-width: 0;
}

.pedido-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.pedido-header h2 {
    margin: 0;
    font-size: 19px;
}

.estado {
    display: inline-block;
    padding: 6px 11px;
    background: #f1f5f9;
    border-radius: 20px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.estado-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.estado-confirmado {
    background: #dcfce7;
    color: #166534;
}

.estado-cancelado {
    background: #fee2e2;
    color: #991b1b;
}

.estado-entregado {
    background: #dbeafe;
    color: #1d4ed8;
}

.pedido-datos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    color: #64748b;
    font-size: 13px;
}

.pedido-datos span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.pedido-datos svg {
    width: 16px;
    height: 16px;
}

.pedido-lateral {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.pedido-total {
    font-size: 21px;
    font-weight: 800;
}

.pedido-ver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pedido-ver svg {
    width: 17px;
}

/* SIN RESULTADOS */

.admin-empty {
    background: white;
    padding: 65px 15px;
    border-radius: 15px;
    text-align: center;
}

.admin-empty > svg {
    width: 42px;
    height: 42px;
    color: #94a3b8;
}

.admin-empty h2 {
    font-size: 19px;
}

.admin-empty p {
    color: #64748b;
}

/* DETALLE */

.admin-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 25px;
}

.admin-back svg {
    width: 18px;
}

.detalle-header,
.detalle-productos,
.detalle-total {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.detalle-title {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
}

.detalle-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #64748b;
}

.detalle-title h1 {
    margin: 7px 0 0;
}

.detalle-datos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.detalle-datos > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detalle-datos small,
.detalle-producto-subtotal small {
    color: #64748b;
}

.detalle-productos h2 {
    margin: 0 0 25px;
    font-size: 20px;
}

.detalle-producto {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
}

.detalle-producto img {
    width: 105px;
    height: 105px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    flex-shrink: 0;
}

.detalle-producto-info {
    flex: 1;
    min-width: 0;
}

.detalle-producto-info h3 {
    font-size: 16px;
    margin: 0 0 8px;
}

.detalle-producto-id {
    font-size: 12px;
    color: #94a3b8;
}

.detalle-producto-info p {
    font-size: 14px;
}

.detalle-cantidad {
    font-size: 14px;
}

.detalle-producto-subtotal {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.detalle-producto-subtotal strong {
    font-size: 18px;
}

.detalle-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.detalle-total h2 {
    font-size: 19px;
    margin: 0 0 8px;
}

.detalle-total p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

.detalle-total > strong {
    font-size: 26px;
    white-space: nowrap;
}

/* CELULARES */

@media (max-width: 650px) {
    .admin-container {
        padding: 22px 12px 50px;
    }

    h1 {
        font-size: 24px;
    }

    .admin-top {
        align-items: flex-start;
    }

    .admin-count {
        font-size: 11px;
        padding: 8px;
    }

    .admin-search {
        flex-wrap: wrap;
    }

    .admin-search input {
        flex-basis: calc(100% - 55px);
    }

    .admin-search button {
        flex: 1;
    }

    .pedido-card {
        align-items: stretch;
        flex-direction: column;
        padding: 18px;
        gap: 18px;
    }

    .pedido-lateral {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .pedido-total {
        font-size: 19px;
    }

    .detalle-datos {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    .detalle-header,
    .detalle-productos,
    .detalle-total {
        padding: 17px;
    }

    .detalle-producto {
        flex-wrap: wrap;
        gap: 12px;
    }

    .detalle-producto img {
        width: 85px;
        height: 85px;
    }

    .detalle-producto-subtotal {
        align-items: flex-start;
        width: 100%;
        padding-left: 97px;
    }

    .detalle-total > strong {
        font-size: 21px;
    }
}
