* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f8f9fb;
    color: #536589;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap {
    max-width: 620px;
    margin: auto;
    padding: 22px 16px 60px;
}

/* CABEÇALHO */

.hero {
    padding: 18px 4px;
}

.brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #0874df;
}

.hero h1 {
    font-size: 28px;
    margin: 8px 0;
    color: #536589;
}

.hero p {
    margin: 0;
    color: #71809d;
}

/* CARDS */

.card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 4px 20px #0000000b;
}

label {
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
    color: #536589;
}

/* CAMPOS */

select,
input {
    width: 100%;
    padding: 14px;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    color: #536589;
}

/* MATERIAIS */

.materials {
    margin-top: 16px;
}

.material {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid #edf1f6;
}

.material span {
    font-weight: 650;
}

/* QUANTIDADE */

.qty {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #e7f1fc;
    font-size: 22px;
    color: #0874df;
    cursor: pointer;
}

.qty button:active {
    background: #d4e8fa;
}

.qty b {
    min-width: 24px;
    text-align: center;
    font-size: 18px;
    color: #536589;
}

/* BOTÃO PRINCIPAL */

.primary {
    width: 100%;
    border: 0;
    border-radius: 13px;
    padding: 15px;
    margin-top: 18px;
    background: #0874df;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.primary:active {
    background: #0665c5;
}

/* AVISOS */

.notice,
.closed {
    padding: 14px;
    border-radius: 12px;
    background: #edf4fb;
    color: #536589;
}

.notice {
    margin-top: 14px;
}

.hidden {
    display: none !important;
}

/* LINK ADMIN */

.adminLink {
    display: block;
    text-align: center;
    margin-top: 22px;
    color: #71809d;
    font-size: 13px;
    text-decoration: none;
}

/* ADMIN */

.adminGrid {
    display: grid;
    gap: 12px;
}

/* PEDIDOS */

.request {
    background: #dfecfa;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #d3e4f7;
    color: #536589;
}

.request.done {
    background: #e7f6ec;
    border-color: #b9dfc7;
}

.request h3 {
    margin: 0 0 12px;
    color: #536589;
}

/* ITENS DO PEDIDO */

.items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.items li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

/* BOTÃO CONCLUIR */

.check {
    margin-top: 12px;
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 10px;
    background: #0874df;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.request.done .check {
    background: #3b9d63;
}

/* ABAS ADMIN */

.tabs {
    display: flex;
    gap: 8px;
    overflow: auto;
    margin-bottom: 15px;
}

.tabs a {
    white-space: nowrap;
    padding: 9px 12px;
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    color: #536589;
}

.tabs a:hover {
    background: #e7f1fc;
    color: #0874df;
}

/* ESTATÍSTICAS */

.stat {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.stat div {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat b {
    display: block;
    font-size: 20px;
    color: #0874df;
}

/* CELULAR */

@media (max-width: 480px) {

    .wrap {
        padding: 16px 12px 40px;
    }

    .hero h1 {
        font-size: 25px;
    }

    .card {
        border-radius: 15px;
        padding: 15px;
    }

    .material {
        padding: 13px 0;
    }
}

/* =========================================================
   GERENCIAMENTO - CASAS E MATERIAIS
========================================================= */

.manage-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 62px;
    padding: 12px 0;

    border-bottom: 1px solid #edf1f6;
}

.manage-item:last-child {
    border-bottom: none;
}

.manage-name {
    min-width: 0;
    flex: 1;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 15px;
    font-weight: 650;
    color: #536589;
}

.manage-name > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inactive {
    flex-shrink: 0;

    padding: 4px 7px;
    border-radius: 6px;

    background: #eef1f5;
    color: #8995a8;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .7px;
}


/* AÇÕES */

.manage-actions {
    flex-shrink: 0;

    display: flex !important;
    align-items: center;
    gap: 6px;
}

.manage-actions form {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
}


/* BOTÕES DE ÍCONE */

.icon-btn {
    appearance: none;
    -webkit-appearance: none;

    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    border: none;
    border-radius: 9px;

    background: #f1f6fc;
    color: #536589;

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.icon-btn svg {
    width: 17px;
    height: 17px;

    stroke: currentColor;
    fill: none;

    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn:hover {
    background: #e3effc;
    color: #0874df;
}

.icon-btn:active {
    transform: scale(.94);
}


/* EXCLUIR */

.icon-btn.delete {
    background: #fff3f3;
    color: #c65c5c;
}

.icon-btn.delete:hover {
    background: #ffe5e5;
    color: #b83d3d;
}


/* ATIVAR */

.icon-btn.activate {
    background: #edf8f1;
    color: #438761;
}

.icon-btn.activate:hover {
    background: #dff2e6;
}


/* CELULAR */

@media (max-width: 480px) {

    .manage-item {
        min-height: 58px;
        gap: 8px;
    }

    .manage-actions {
        gap: 4px;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
    }
}

/* =========================================================
   CORREÇÃO DA EDIÇÃO INLINE
========================================================= */

.inline-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0;
}

.inline-edit.hidden {
    display: none !important;
}

.inline-edit .inline-edit-input {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 40px;

    margin: 0;
    padding: 0 12px;

    border: 1px solid #b9d5f1;
    border-radius: 9px;

    background: #fff;
    color: #536589;

    font-family: inherit;
    font-size: 15px;

    outline: none;
}

.inline-edit .inline-edit-input:focus {
    border-color: #0874df;
    box-shadow: 0 0 0 3px rgba(8, 116, 223, .08);
}


/* SALVAR E CANCELAR */

.inline-edit .mini-action {
    flex: 0 0 40px;

    width: 40px;
    height: 40px;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 9px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.inline-edit .mini-action.save {
    background: #0874df;
    color: #fff;
}

.inline-edit .mini-action.cancel {
    background: #eef2f6;
    color: #6f7c91;
}

.inline-edit .mini-action svg {
    display: block;

    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* DURANTE A EDIÇÃO */

.manage-info:has(.inline-edit:not(.hidden)) {
    width: 100%;
}

.manage-item:has(.inline-edit:not(.hidden)) {
    align-items: center;
}

/* CORREÇÃO DA LUPA DA BUSCA */

.manage-search {
    position: relative;
    width: 100%;
}

.manage-search svg {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;

    width: 18px !important;
    height: 18px !important;

    max-width: 18px !important;
    max-height: 18px !important;

    transform: translateY(-50%) !important;

    fill: none !important;
    stroke: #8491a7 !important;
    stroke-width: 2 !important;

    pointer-events: none;
}

.manage-search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
}

.manage-item.search-hidden {
    display: none !important;
}