:root {
    --fonte-padrao: 12px;
    --altura-topo: 60px;
    --cor-cinza-escuro: #8a8888;
    --cor-cinza-claro: #e3e3e3;
    --erp-bg: #f4f6fb;
    --erp-surface: #ffffff;
    --erp-primary: #1f6fd6;
    --erp-primary-dark: #144ea6;
    --erp-accent: #00b3b3;
    --erp-text: #1a1f36;
    --erp-muted: #6b7280;
    --erp-border: #e6e9f2;
    --cor-azul-logo: #112d4e; 
}
.app-body::before {
  content: "";
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 145px;
  height: 60px;
  background: url('../imagens/logo_millflow_header.png') no-repeat center;
  background-size: contain;
  opacity: 0.15;
  pointer-events: none;
}
.montserrat {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.5px;
}
 

.app-body {
 
    color: var(--erp-text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-main {
    width: 100%;
    margin-left: 70px;
    transition: margin-left 0.3s;
    min-height: 100vh;
    margin-top: 64px;
}

#sidebar:not(.collapsed) ~ .app-main {
    margin-left: 250px;
}

.no-sidebar .app-main {
    margin-left: 0;
}

.barra-azul {
    width: 100%;
    background: linear-gradient(90deg, #7396de 0%, #112d4e 100%);
    
    padding: 12px 20px;
    max-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    
}

/* Ajustes visuais internos */
.barra-azul h1 {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: #fff;
    font-weight: 600;
}

.barra-azul .navbar-brand img {
    height: 32px;
    margin-right: 8px;
}

.barra-azul .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.titulo-central {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
}

.app-logo img {
    height: 40px;
    width: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    padding: 6px;
}

.app-title {
    line-height: 1.1;
}

.app-title-main {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.app-title-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-header {
    height: 36px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-header .avatar-circle {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
}

.barra-azul .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.barra-azul .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--erp-primary), var(--erp-accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.alert-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.75);
}

.alert-counter .bi-bell {
    font-size: 1.1rem;
    color: #fff;
}

.form-label {
    font-weight: bold;
}

/**Barra de menu lateral***/
/* Sidebar styles */

#sidebar {
    width: 250px;
    min-height: 100vh;
    transition: width 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    background: linear-gradient(180deg, #7396de 25%, #112d4e 100%);
    color: #fff;
    transition: background 0.3s, width 0.3s;
    padding: 14px 12px;
    padding-top: 22px;

}

#sidebar .nav-link {
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
}

#sidebar.collapsed {
    width: 70px;
    background-color: var(--cor-azul-logo);
;
}

#sidebar .nav-link:hover {
    background-color: var(--cor-azul-logo);
;
    color: #fff;
    /* hover suave */
}

#sidebar.collapsed {
    width: 70px;
}

#sidebar .nav-link span {
    transition: opacity 0.3s, margin 0.3s;
    opacity: 1;
    margin-left: 10px;
}

#sidebar.collapsed .nav-link span {
    opacity: 0;
    margin-left: 0;
    width: 0;
    display: inline-block;
}

#sidebar .sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

#sidebar ul.menu-lateral {
    position: relative;
    top: 20px;
}

#sidebar.collapsed .nav-link span {
    display: none;
    /* esconde o texto quando recolhido */
    position: absolute;
    left: 42px;
    background-color: var(--cor-azul-logo);
    padding: 12px 15px;
    border-left: 0;
    border-radius: 4px;
    white-space: nowrap;
    color: #fff;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s, margin 0.3s;
    opacity: 1;
    width: 180px;
    height: 50px;
    margin-top: -10px;
}

#sidebar.collapsed .nav-link:hover span {
    display: inline-block;
    opacity: 1;
}

#sidebar .sidebar-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.6);
    margin: 10px 10px 6px;
}

#main-navbar {
    z-index: 1050;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}


/* Mobile (até 768px) */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 64px;
        /* abaixo do navbar */
        left: -250px;
        /* escondida fora da tela */
        width: 250px;
        height: calc(100vh - 64px);
        transition: left 0.3s;
        z-index: 1050;
    }

    #sidebar ul.menu-lateral {
        position: relative;
        top: 5px;
    }


    #sidebar.active {
        left: 0;
        /* aparece quando tiver a classe active */
    }

    #main-navbar .titulo-central {
        font-size: 1rem;
        max-width: 60%;
        /* limita largura para não quebrar */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #main-navbar .btn,
    #main-navbar .text-light {
        font-size: 0.9rem;
    }

    .nome-funcionario {
        display: none;
    }

.content {
    margin-left: 0;
    /* ocupa 100% da tela */
}

.content {
    max-width: 100%;
    overflow-x: hidden;
}

    .app-main {
        margin-left: 0;
    }
}

#main-navbar .titulo-central {
    font-size: 1.2rem;
    /* menor no mobile */
}

.clientes-table {
    white-space: nowrap;
}

.app-content {
    padding: 0 24px 40px;
}

.content .card {
    border: 1px solid var(--erp-border);
    border-radius: 14px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.content .card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--erp-border);
    font-weight: 600;
}

/**pagina de pedido**/
.pedido {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    padding: 20px;
}

.pedido .card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}


.pedido .info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 10px;
    margin-bottom: 10px;
}

.pedido .info-row p {
    margin: 0;
}

.pedido .info-row strong {
    color: #555;
}

.pedido .valor-total {
    color: green;
    font-weight: bold;
    padding: 0 10px;
}

.pedido .scroll-box {
    max-height: 300px;
    overflow-y: auto;
}

.pedido table {
    width: 100%;
    border-collapse: collapse;
}

.pedido th,
.pedido td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.pedido th {
    background-color: #f0f0f0;
    color: #333;
    position: sticky;
    top: 0;
}

.pedido td {
    background-color: #fff;
}

.pedido .no-itens {
    font-style: italic;
    color: #777;
}

.pedido .btn-voltar {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 10px;
}

.pedido .btn-voltar:hover {
    background-color: #5a6268;
}

.btn-default {
    background-color: #f4f4f4 !important;
    color: #444 !important;
    border-color: #ddd !important;
    font-weight: 500 !important
}


.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.hover {
    background-color: #e7e7e7 !important
}


/***producao***/

.producao {
    font-size: var(--fonte-padrao);
}


.producao th,
.producao td {
    word-break: break-word;
    text-align: center;
}


.producao .scroll-box {
    overflow-x: auto;
}

/* Evita quebra de linha no grid do painel de producao. */
.producao .painel-producao-table th,
.producao .painel-producao-table td {
    word-break: normal;
    white-space: nowrap;
}

/***painel de pedidos***/

.faixa-label {
    font-weight: bold;
    background-color: #f2f2f2;
    font-size: 0.75em;

}

.linha-azul {
    background-color: #e0f0ff;
}

.linha-amarela {
    background-color: #fff8dc;
}

.linha-vermelha {
    background-color: #f8d7da;
}

.linha-marrom {
    background-color: #8b4513;
}

.linha-cinza {
    background-color: #a9a9a9;
}


.pedido {
    margin-bottom: 4px;
    padding: 6px;
    border-radius: 4px;
    font-weight: bold;
}

.linha-verde {
    background-color: #16c22d;
}


.linha-azul {
    background-color: #28bee4;
}

.linha-amarela {
    background-color: #f7e330;
}

.linha-vermelha {
    background-color: #e71123;
}

.linha-marrom {
    background-color: #b85c1b;
}

.linha-cinza {
    background-color: #a9a9a9;
}

.painel-pedidos {
    font-family: Arial, sans-serif;
}

.tbl-painel-pedido tr>th {
    background-color: var(--cor-cinza-escuro);
}

.tbl-painel-pedido tr>td:first-child {
    background-color: var(--cor-cinza-claro);
}

/*** alerta de notificação ***/


#alerta-notificacao {
    animation: piscarAlerta 1s infinite;
    font-weight: bold;
    border-radius: 5px;
    padding: 5px 10px;
    transition: opacity 0.5s ease-out;


    display: inline-block !important;
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    animation: piscarAlerta 1s infinite;
    transition: opacity 0.5s ease-out;

}

@keyframes piscarAlerta {
    0% {
        background-color: #ffc107;
    }

    50% {
        background-color: #ffecb3;
    }

    100% {
        background-color: #ffc107;
    }
}

.flleft div {
    display: inline-block;
    margin-right: 10px;
}

  .tooltip-inner {
    background-color: #0d6efd; /* azul Bootstrap */
    color: #fff;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    max-width: 250px;
    text-align: center;
  }

  .tooltip.bs-tooltip-top .tooltip-arrow::before,
  .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-top-color: #0d6efd !important;
    border-bottom-color: #0d6efd !important;
  }

  .tooltip.bs-tooltip-start .tooltip-arrow::before,
  .tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-left-color: #0d6efd !important;
    border-right-color: #0d6efd !important;
  }

.tbl-nowrap {
    white-space: nowrap;
}

/* Animação para alternar cor de fundo */
@keyframes blink-bg {
  0%   { background-color: #0d6efd; color: white; }   /* azul padrão Bootstrap */
  50%  { background-color: white; color: #0d6efd; }  /* fundo branco, texto azul */
  100% { background-color: #0d6efd; color: white; }
}

/* Classe que aplica o piscar */
.blinking-bg {
  animation: blink-bg 1s infinite;
}


#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.link-sem-underline {
    text-decoration: none;
}

.cliente-coluna {
    white-space: normal !important;
    line-height: 1.15;
  }

.cliente-linha-2 {
    font-size: 0.78rem;
  }

.mobile-sidebar-backdrop,
.mobile-bottom-nav {
    display: none;
}

/* Interface mobile: navegação por gaveta, atalhos inferiores e conteúdo mais respirável. */
@media (max-width: 767.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-body {
        background: #f6f8fc;
    }

    .app-body::before {
        display: none;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .app-main {
        margin-left: 0;
        margin-top: 64px;
        padding-bottom: 86px;
        min-height: calc(100vh - 64px);
    }

    .barra-azul {
        height: 64px;
        max-height: 64px;
        min-height: 64px;
        padding: 6px 10px !important;
        box-shadow: 0 8px 18px rgba(17, 45, 78, 0.2);
    }

    #main-navbar .container-fluid {
        flex-wrap: nowrap !important;
        gap: 8px;
        min-width: 0;
    }

    #mobile-menu-btn {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        margin-right: 0 !important;
        border-radius: 8px;
    }

    .barra-azul img {
        width: 104px;
        height: auto;
        max-height: 46px;
        object-fit: contain;
    }

    #main-navbar .titulo-central {
        display: none;
    }

    #main-navbar .container-fluid > .d-flex:first-of-type {
        min-width: 0;
        flex: 1 1 auto;
    }

    #main-navbar .container-fluid > .d-flex:last-child {
        flex: 0 0 auto;
        gap: 6px !important;
        margin-left: auto;
    }

    #main-navbar .btn-header {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 8px;
        justify-content: center;
    }

    #main-navbar .btn-header .avatar-circle {
        width: 30px;
        height: 30px;
    }

    #main-navbar .btn-header.dropdown-toggle::after,
    #main-navbar .btn-logout-header,
    #main-navbar .alert-counter .btn,
    #main-navbar .alert-counter .bi-bell {
        display: none !important;
    }

    #main-navbar .alert-counter {
        position: relative;
        width: 34px;
        height: 40px;
        justify-content: center;
        gap: 0;
    }

    #main-navbar #contador-alertas {
        min-width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.7rem;
    }

    #main-navbar #btnVoiceToggle {
        font-size: 1.05rem !important;
    }

    #main-navbar-extra {
        display: none;
    }

    #sidebar {
        top: 64px;
        left: 0;
        width: min(86vw, 320px);
        height: calc(100dvh - 64px);
        min-height: calc(100dvh - 64px);
        padding: 16px 12px 22px;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 1060;
        overflow-y: auto;
        border-top-right-radius: 8px;
        border-bottom-right-radius: 8px;
        box-shadow: 18px 0 36px rgba(15, 23, 42, 0.28);
    }

    #sidebar.active {
        transform: translateX(0);
        left: 0;
    }

    #sidebar.collapsed {
        width: min(86vw, 320px);
    }

    #sidebar.collapsed .nav-link span {
        display: inline-block;
        opacity: 1;
        width: auto;
        margin-left: 10px;
        position: static;
        background: transparent;
        padding: 0;
        height: auto;
        color: inherit;
    }

    #sidebar.collapsed .nav-link:hover span {
        display: inline-block;
    }

    #sidebar .nav-link {
        min-height: 48px;
        align-items: center;
        display: flex;
        border-radius: 8px;
        padding: 11px 12px;
        font-size: 0.98rem;
    }

    #sidebar .sidebar-section {
        margin-top: 0;
    }

    #sidebar .sidebar-footer {
        display: none;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        top: 64px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .mobile-menu-open .mobile-sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-open {
        overflow: hidden;
    }

    .app-content {
        padding: 12px 10px 28px;
    }

    .content {
        overflow-x: visible;
    }

    .content > .container,
    .content .container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .content .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .content h1,
    .content .h1 {
        font-size: 1.35rem;
    }

    .content h2,
    .content .h2 {
        font-size: 1.2rem;
    }

    .content h3,
    .content .h3,
    .content h4,
    .content .h4,
    .content h5,
    .content .h5 {
        font-size: 1rem;
    }

    .content .card {
        border-radius: 8px;
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
    }

    .content .card-body {
        padding: 0.9rem;
    }

    .content .btn {
        min-height: 40px;
        white-space: normal;
    }

    .content .input-group > .btn {
        min-height: auto;
    }

    .content .sticky-top {
        top: 64px;
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0 !important;
    }

    .table-responsive,
    .dataTables_wrapper,
    .dt-container,
    .scroll-box,
    .content .overflow-auto {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content table {
        font-size: 0.82rem;
    }

    .content th,
    .content td {
        vertical-align: middle;
    }

    .dt-container .row,
    .dataTables_wrapper .row {
        gap: 0.5rem;
    }

    .dt-container .dt-search,
    .dt-container .dt-length,
    .dataTables_filter,
    .dataTables_length {
        width: 100%;
        text-align: left !important;
    }

    .dt-container .dt-search input,
    .dataTables_filter input,
    .content input,
    .content select,
    .content textarea {
        max-width: 100%;
    }

    #flash-container {
        top: 64px !important;
        right: 10px !important;
        left: 10px !important;
        padding: 0.5rem !important;
    }

    #central-alertas {
        right: 8px !important;
        bottom: 82px !important;
        left: 8px !important;
        max-width: none !important;
        padding: 0 !important;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1070;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        min-height: 66px;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: #ffffff;
        border-top: 1px solid var(--erp-border);
        box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.12);
    }

    .mobile-bottom-nav-link {
        flex: 1 1 0;
        min-width: 0;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--erp-text);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 0.7rem;
        line-height: 1.1;
    }

    .mobile-bottom-nav-link i {
        font-size: 1.18rem;
        color: var(--erp-primary);
    }

    .mobile-bottom-nav-link:active,
    .mobile-bottom-nav-link:focus {
        background: #eef4ff;
        color: var(--erp-primary-dark);
    }

    .mobile-bottom-nav-button {
        font-family: inherit;
    }
}

@media (max-width: 380px) {
    .barra-azul img {
        width: 88px;
    }

    #main-navbar .btn-header,
    #mobile-menu-btn {
        width: 38px;
        height: 38px;
    }

    #main-navbar .container-fluid > .d-flex:last-child {
        gap: 4px !important;
    }
}
