/* =====================================================
   ESCALA GLOBAL DA INTERFACE
   Afeta todas as telas do sistema, inclusive o login.
===================================================== */

body {
    --ui-zoom: 1;
}

body[data-ui-size="compact"] {
    --ui-zoom: 0.90;
}

body[data-ui-size="normal"] {
    --ui-zoom: 1;
}

body[data-ui-size="large"] {
    --ui-zoom: 1.10;
}

@media (min-width: 901px) {
    body[data-ui-size] .app,
    body[data-ui-size] .login-screen {
        zoom: var(--ui-zoom);
    }
}

.global-ui-size-panel {
    margin-top: auto;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
}

.global-ui-size-title {
    display: block;
    margin-bottom: 7px;
    font-size: clamp(11px, 0.72vw, 13px);
    font-weight: 700;
    color: #f2eaf5;
}

.global-ui-size-panel .ui-size-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
}

.global-ui-size-panel .ui-size-button {
    min-width: 0;
    padding: 7px 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e8ddea;
    font-size: 10px;
}

.global-ui-size-panel .ui-size-button:hover,
.global-ui-size-panel .ui-size-button.active {
    background: #f2e8f8;
    color: #6d1c8c;
    border-color: #dfc9eb;
}

.global-ui-size-help {
    display: block;
    margin-top: 7px;
    line-height: 1.35;
    font-size: 9px;
    color: #bdaec2;
}

/* Tablets / notebooks */
@media (max-width: 1250px) {
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: clamp(190px, 19vw, 230px);
    }
}

/* Tablets pequenos */
@media (max-width: 900px) {
    .app {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
        height: auto;
        padding: 12px 14px;
    }

    .logo-area {
        display: none;
    }

    .menu {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .menu-item {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .logout-button {
        margin-top: 8px;
        width: auto;
    }

    .main {
        padding: 16px;
    }

    .admin-unified-header,
    .header,
    .catalog-header,
    .history-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-header-tools,
    .header-right {
        justify-content: flex-start;
    }

    body[data-ui-size] .app,
    body[data-ui-size] .login-screen {
        zoom: 1;
    }
}

/* Celulares */
@media (max-width: 640px) {
    .main {
        padding: 12px;
    }

    .stats,
    .history-stats,
    .catalog-summary,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .ui-size-control {
        width: 100%;
    }

    .ui-size-button {
        flex: 1 1 calc(50% - 6px);
    }

    .dashboard-table {
        min-width: 720px;
    }

    .order-card,
    .dashboard-panel,
    .admin-stat-card {
        border-radius: 10px;
    }
}


/* Ajuste do seletor global em tablets e celulares */
@media (max-width: 900px) {
    .global-ui-size-panel {
        margin: 8px 0 0;
        padding: 8px;
        width: 100%;
    }

    .global-ui-size-panel .ui-size-control {
        grid-template-columns: repeat(4, minmax(86px, 1fr));
        overflow-x: auto;
    }

    .global-ui-size-help {
        display: none;
    }
}

@media (max-width: 640px) {
    .global-ui-size-panel .ui-size-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .global-ui-size-panel .ui-size-button {
        font-size: 11px;
        padding: 8px 6px;
    }
}

/* =====================================================
   AUMENTO DE FONTES - TELAS PRINCIPAIS
   Ajuste sem alterar a Administração
===================================================== */

/* PEDIDOS */
#ordersPage {
    font-size: 16px;
}

#ordersPage h1,
#ordersPage h2,
#ordersPage h3 {
    font-size: 1.15em;
}

#ordersPage .order-card,
#ordersPage .order-card button,
#ordersPage .order-card input,
#ordersPage .order-card select,
#ordersPage .order-card textarea {
    font-size: 0.95rem;
}

#ordersPage .customer,
#ordersPage .product,
#ordersPage .address,
#ordersPage .payment,
#ordersPage .order-bottom {
    font-size: 0.95rem;
}

#ordersPage .status-button {
    font-size: 0.9rem;
}

/* HISTÓRICO */
#historyPage {
    font-size: 16px;
}

#historyPage h1,
#historyPage h2,
#historyPage h3 {
    font-size: 1.15em;
}

#historyPage input,
#historyPage select,
#historyPage button {
    font-size: 0.95rem;
}

.history-order {
    font-size: 0.95rem;
}

.history-order-number,
.history-customer,
.history-product,
.history-total,
.history-status {
    font-size: 0.95rem;
}

/* CARDÁPIO */
#catalogPage {
    font-size: 16px;
}

#catalogPage h1,
#catalogPage h2,
#catalogPage h3 {
    font-size: 1.15em;
}

#catalogPage input,
#catalogPage select,
#catalogPage button,
#catalogPage textarea {
    font-size: 0.95rem;
}

.catalog-product-card {
    font-size: 0.95rem;
}

.catalog-product-card h3 {
    font-size: 1.05rem;
}

.catalog-product-description,
.catalog-product-info {
    font-size: 0.92rem;
}

/* MODAL DE NOVO PEDIDO */
#orderModal {
    font-size: 16px;
}

#orderModal label,
#orderModal input,
#orderModal select,
#orderModal textarea,
#orderModal button {
    font-size: 0.95rem;
}

/* MODAL DO CARDÁPIO */
#catalogModal {
    font-size: 16px;
}

#catalogModal label,
#catalogModal input,
#catalogModal select,
#catalogModal textarea,
#catalogModal button {
    font-size: 0.95rem;
}

/* MENU LATERAL */
.sidebar,
.menu-item {
    font-size: 0.95rem;
}

/* TOPO */
.topbar,
.topbar button,
.topbar span {
    font-size: 0.95rem;
}

/* =====================================================
   PEDIDOS - LISTA + QUADRO POR STATUS
   Mescla a tela detalhada com a visualização em colunas.
===================================================== */

.orders-view-header {
    align-items: flex-start;
    gap: 18px;
    margin-top: 4px;
}

.orders-view-description {
    display: block;
    margin-top: 5px;
    color: #7b7582;
    font-size: 0.88rem;
    font-weight: 400;
}

.orders-view-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.orders-view-switch {
    display: inline-flex;
    padding: 4px;
    background: #f0edf4;
    border: 1px solid #e3dfe7;
    border-radius: 10px;
    gap: 3px;
}

.orders-view-button {
    border: 0;
    background: transparent;
    color: #655f69;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}

.orders-view-button:hover {
    background: rgba(255,255,255,.7);
    color: #5f1db3;
}

.orders-view-button.active {
    background: #ffffff;
    color: #6d21c8;
    box-shadow: 0 1px 5px rgba(57, 30, 70, .12);
}

.orders-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    margin: 12px 0 22px;
}

.orders-board-column {
    min-width: 0;
}

.orders-board-column-header {
    min-height: 42px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #e5e0e9;
    border-radius: 9px;
    margin-bottom: 9px;
    font-size: 0.88rem;
    font-weight: 800;
}

.orders-board-column-header span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.orders-board-column-header i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.orders-board-column-header strong {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.78rem;
}

.board-new .orders-board-column-header {
    background: #f6ebfb;
    border-color: #e5c9f0;
}
.board-new .orders-board-column-header i,
.board-new .orders-board-column-header strong {
    background: #9228b9;
}

.board-preparing .orders-board-column-header {
    background: #fff2df;
    border-color: #f5d3aa;
}
.board-preparing .orders-board-column-header i,
.board-preparing .orders-board-column-header strong {
    background: #ef6200;
}

.board-delivery .orders-board-column-header {
    background: #e9f5ec;
    border-color: #c5e0ca;
}
.board-delivery .orders-board-column-header i,
.board-delivery .orders-board-column-header strong {
    background: #24833a;
}

.board-delivered .orders-board-column-header {
    background: #e6f1fb;
    border-color: #c6ddee;
}
.board-delivered .orders-board-column-header i,
.board-delivered .orders-board-column-header strong {
    background: #1674c5;
}

.orders-board-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.orders-board-card {
    background: #ffffff;
    border: 1px solid #e2dfe5;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.025);
    min-width: 0;
}

.board-new .orders-board-card {
    border-color: #dfc6eb;
}

.board-preparing .orders-board-card {
    border-color: #f1d1b6;
}

.board-delivery .orders-board-card {
    border-color: #c9decf;
}

.board-delivered .orders-board-card {
    border-color: #c8ddec;
}

.orders-board-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.orders-board-card-top strong {
    color: #7021b8;
    font-size: 0.88rem;
}

.orders-board-card-top span {
    color: #938d97;
    font-size: 0.78rem;
}

.orders-board-card h4 {
    margin: 0 0 8px;
    color: #2b2230;
    font-size: 0.92rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.orders-board-product {
    margin: 0;
    min-height: 38px;
    color: #655f69;
    font-size: 0.83rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.orders-board-observation {
    margin: 8px 0 0;
    padding-top: 7px;
    border-top: 1px dashed #e8e3ea;
    color: #806f86;
    font-size: 0.78rem;
    line-height: 1.4;
}

.orders-board-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid #eeeaf0;
}

.orders-board-card-bottom > strong {
    color: #251c29;
    font-size: 0.92rem;
}

.board-action-button {
    border: 0;
    border-radius: 7px;
    min-height: 30px;
    padding: 0 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.board-action-button.new-action {
    background: #8424b7;
}

.board-action-button.preparing-action {
    background: #ed5e00;
}

.board-action-button.delivery-action {
    background: #1d7f35;
}

.board-action-button:hover {
    filter: brightness(.95);
}

.board-completed-label {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 9px;
    border-radius: 7px;
    background: #e7f4ff;
    color: #1268ae;
    font-size: 0.74rem;
    font-weight: 800;
}

.orders-board-empty {
    padding: 20px 10px;
    border: 1px dashed #dcd6df;
    border-radius: 9px;
    color: #8f8792;
    text-align: center;
    background: rgba(255,255,255,.55);
    font-size: 0.82rem;
}

.orders-detailed-view {
    margin-top: 4px;
}

.orders-list-title {
    margin: 0 0 10px;
}

.orders-list-title h3 {
    margin: 0 0 3px;
    color: #2a2130;
    font-size: 1rem;
}

.orders-list-title span {
    color: #817b85;
    font-size: 0.82rem;
}

#ordersPage .updated {
    font-size: 0.78rem;
}

/* Notebooks e telas médias */
@media (max-width: 1350px) {
    .orders-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet */
@media (max-width: 850px) {
    .orders-view-header {
        flex-direction: column;
    }

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

    .orders-board {
        grid-template-columns: 1fr;
    }
}

/* Celular */
@media (max-width: 560px) {
    .orders-view-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .orders-view-switch {
        width: 100%;
    }

    .orders-view-button {
        flex: 1;
        padding: 0 7px;
        font-size: 0.78rem;
    }

    .orders-board-card {
        padding: 11px;
    }
}


/* =====================================================
   MODO ENTREGADOR
===================================================== */

.app[data-role="delivery"] #historyMenu,
.app[data-role="delivery"] #catalogMenu,
.app[data-role="delivery"] #adminMenu,
.app[data-role="delivery"] #newOrderButton,
.app[data-role="delivery"] #ordersPage > .stats,
.app[data-role="delivery"] #ordersBoard,
.app[data-role="delivery"] .orders-view-switch {
    display: none !important;
}

.app[data-role="delivery"] #ordersDetailedView {
    display: block !important;
}

.app[data-role="delivery"] .orders-list-title h3 {
    font-size: 1.05rem;
}

.app[data-role="delivery"] .orders-list-title span {
    color: #77717c;
    font-size: 0.9rem;
}

.delivery-order-card {
    border-left: 4px solid #2f9d4a;
}

.delivery-order-time {
    color: #77717c;
    font-size: 0.9rem;
    font-weight: 600;
}

.delivery-order-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin: 2px 0 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #e7f5eb;
    color: #277d3c;
    font-size: 0.85rem;
    font-weight: 700;
}

.delivery-order-status .status-dot-small {
    background: #2f9d4a;
}

.delivery-address {
    padding: 13px;
    border-radius: 9px;
    background: #f7f5f9;
}

.delivery-order-bottom {
    align-items: center;
    gap: 14px;
}

.delivery-complete-button {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #2f9d4a;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease,
                transform .18s ease;
}

.delivery-complete-button:hover {
    background: #267f3c;
    transform: translateY(-1px);
}

.delivery-complete-button:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.delivery-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    min-height: 220px;
    padding: 30px;
    border: 1px dashed #d8d2dd;
    border-radius: 12px;
    background: #ffffff;
    color: #77717c;
    text-align: center;
}

.delivery-empty-state strong {
    color: #302b34;
    font-size: 1.05rem;
}

.delivery-empty-state span {
    max-width: 420px;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 700px) {

    .delivery-order-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .delivery-complete-button {
        width: 100%;
    }
}


