/* style.css - Estilos básicos para o projeto */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    /* Ajusta o padding do body para acomodar o cabeçalho fixo */
    padding-top: 65px;
    /* Altura mais compacta para o header */
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

/* Novo estilo para o cabeçalho fixo */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    /* Por padrão, empilha itens (para mobile first) */
    align-items: center;
    padding: 5px 10px;
    /* Padding reduzido para cabeçalho menor */
    box-sizing: border-box;
}

/* Linha superior do cabeçalho (logo, título, hambúrguer) */
.header-top-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    /* Espaça logo, título e hambúrguer */
    align-items: center;
    min-height: 50px;
    /* Altura mínima para a linha superior */
}

.header-logo {
    max-width: 50px;
    /* Logo menor para caber no cabeçalho fixo */
    height: auto;
    display: block;
    margin-right: 10px;
    /* Espaço entre logo e título */
    border-radius: 8px;
    object-fit: contain;
}

.header-title {
    font-size: 1.1em;
    /* Título bem menor em mobile */
    margin: 0;
    color: #2c3e50;
    white-space: nowrap;
    /* Evita que o título quebre linha */
    text-overflow: ellipsis;
    /* Adiciona "..." se o título for muito longo */
    overflow: hidden;
    /* Garante que text-overflow funcione */
    flex-grow: 1;
    /* Permite que o título ocupe o espaço central */
    text-align: center;
    /* Centraliza o texto do título */
}

/* Estilos para o ícone do menu hambúrguer */
.menu-toggle {
    display: block;
    /* Exibe o ícone de hambúrguer em mobile */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 5px;
    margin-left: 10px;
    /* Espaço entre título e hambúrguer */
    width: 50px;
    /* Largura fixa para o botão do hambúrguer */
    text-align: center;
    /* Centraliza o ícone dentro do botão */
}

/* Estilos da navegação (o menu que aparece/desaparece) */
.main-nav {
    display: flex;
    flex-direction: column;
    /* Botões um abaixo do outro em mobile */
    gap: 8px;
    width: 100%;
    /* Ocupa toda a largura disponível */
    padding-top: 5px;
    /* Espaço entre a barra superior e os itens do menu */
    display: none;
    /* Oculta o menu por padrão em mobile */
}

.main-nav.expanded {
    display: flex;
    /* Exibe o menu quando expandido */
}

.main-nav .button {
    background-color: #495057;
    padding: 8px 15px;
    /* Padding menor para os botões do menu */
    text-decoration: none;
    color: white;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    margin-top: 0;
    font-size: 0.9em;
    width: 100%;
    /* Ocupa a largura total em mobile */
    text-align: center;
    /* Alinha o texto do botão ao centro */
}

.main-nav .button:hover {
    background-color: #343a40;
}

.main-nav .button.active {
    background-color: #007bff;
    font-weight: bold;
}


/* --- Conteúdo principal do container (resto da página) --- */
.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
    margin-bottom: 20px;
    flex-shrink: 0;
    /* Impede que o container encolha além do necessário */
}

h3,
h4,
h5 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: #007bff;
    outline: none;
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: auto;
    box-sizing: border-box;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.button {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.button:hover {
    background-color: #5a6268;
}

.button-small {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    width: auto;
}

.button-delete {
    background-color: #dc3545;
}

.button-delete:hover {
    background-color: #c82333;
}

.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}


table {
    width: 100%;
    max-width: 100%;
    /* Garante que a tabela não exceda a largura do pai */
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fdfdfd;
    border-radius: 8px;
    overflow: hidden;
    /* Adicionado para permitir rolagem horizontal em tabelas largas em mobile */
    overflow-x: auto;
    table-layout: fixed;
    /* Força o layout da tabela a respeitar larguras */
}

th,
td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
    word-break: break-word;
    /* Permite quebrar palavras longas */
    white-space: normal;
    /* Permite que o texto quebre linha */
}

th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

.cotacao-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: box-shadow .2s, border-color .25s, background .25s;
}
.cotacao-card:hover {
    box-shadow: 0 4px 14px rgba(37,99,235,.12);
}

.cotacao-card h4 {
    color: #2563eb;
    text-align: left;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
}

.cotacao-card h5 {
    color: #2c3e50;
    text-align: left;
    margin-top: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cotacao-card h5 span,
.cotacao-card h6 span {
    flex-grow: 1;
}

.cotacao-card h6 {
    color: #555;
    text-align: left;
    margin-top: 20px;
    /* Mais espaço acima */
    margin-bottom: 10px;
    font-size: 1em;
    border-bottom: 1px solid #ddd;
    /* Linha sólida e mais visível abaixo do título */
    padding-bottom: 10px;
    border-top: 2px solid #e0e0e0;
    /* Linha separadora visível acima do título */
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.search-form,
.filter-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-form .form-group,
.filter-form .form-group {
    flex-grow: 1;
    margin-bottom: 0;
    min-width: 180px;
}

.search-form button,
.filter-form button {
    width: auto;
    padding: 12px 20px;
    margin-top: 0;
}


/* Estilos para recolher/expandir */
.collapsible-content {
    display: none;
}

.collapsible-content.expanded {
    display: block;
}

.collapsible-content.collapsed {
    display: none;
}


/* Estilos para o Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    color: white;
    font-size: 1.2em;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* Estilo para o footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #777;
    font-size: 0.9em;
    width: 100%;
    max-width: 1000px;
    /* Alinha com o container */
    flex-shrink: 0;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Estilo para o botão flutuante */
.floating-button {
    background-color: #28a745;
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 105; /* below sidebar (200) and overlay (190) */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.floating-button:hover {
    background-color: #218838;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}


/* --- Responsividade --- */
@media (max-width: 768px) {
    body {
        padding-top: 100px;
        /* Ajusta padding para header compacto em mobile */
        padding-left: 10px;
        padding-right: 10px;
    }

    .fixed-header {
        flex-direction: column;
        /* Empilha a top-row e a nav */
        align-items: center;
        padding: 5px 10px;
        height: auto;
    }

    .header-top-row {
        flex-direction: row;
        /* Logo, title, toggle na mesma linha */
        justify-content: space-between;
        width: 100%;
        min-height: 40px;
        /* Altura mínima da linha superior */
    }

    .header-logo {
        max-width: 40px;
        /* Logo ainda menor */
        margin-right: 5px;
    }

    .header-title {
        font-size: 1em;
        /* Título menor */
        white-space: normal;
        text-align: left;
        flex-grow: 1;
        margin: 0 5px;
    }

    .menu-toggle {
        display: block;
        margin-left: 5px;
        width: 50px;
        /* Ajustado para 50px em mobile */
        font-size: 20px;
        /* Ícone menor */
    }

    .main-nav {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        display: none;
        padding-top: 10px;
        align-items: center;
    }

    .main-nav.expanded {
        display: flex;
    }

    .main-nav .button {
        width: 100%;
        margin: 0;
    }

    .container {
        padding: 15px;
        /* Menor padding interno */
        margin: 10px auto;
    }

    h2,
    h3,
    h4 {
        font-size: 1.3em;
        /* Títulos menores */
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        border-radius: 8px;
        overflow: hidden;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #555;
    }

    /* Mapeamento responsivo para client_root_dashboard.php */
    .client-root-table td:nth-of-type(1):before {
        content: "ID";
    }

    .client-root-table td:nth-of-type(2):before {
        content: "Usuário";
    }

    .client-root-table td:nth-of-type(3):before {
        content: "Função";
    }

    .client-root-table td:nth-of-type(4):before {
        content: "CODIGOCLI";
    }

    .client-root-table td:nth-of-type(5):before {
        content: "Nome Fornecedor";
    }

    .client-root-table td:nth-of-type(6):before {
        content: "Vendedor";
    }

    .client-root-table td:nth-of-type(7):before {
        content: "Email";
    }

    .client-root-table td:nth-of-type(8):before {
        content: "Telefone";
    }

    .client-root-table td:nth-of-type(9):before {
        content: "Status";
    }

    .client-root-table td:nth-of-type(10):before {
        content: "Ações";
    }

    /* Mapeamento responsivo para client_communication.php */
    .communication-table td:nth-of-type(1):before {
        content: "Fornecedor";
    }

    .communication-table td:nth-of-type(2):before {
        content: "Usuário";
    }

    .communication-table td:nth-of-type(3):before {
        content: "Vendedor";
    }

    .communication-table td:nth-of-type(4):before {
        content: "Email";
    }

    .communication-table td:nth-of-type(5):before {
        content: "Telefone";
    }

    .communication-table td:nth-of-type(6):before {
        content: "Último Convite";
    }

    .communication-table td:nth-of-type(7):before {
        content: "Ação";
    }

    /* Mapeamento para supplier_dashboard.php e supplier_closed_quotations.php */
    .product-table td:nth-of-type(1):before {
        content: "CÓDIGO";
    }

    .product-table td:nth-of-type(2):before {
        content: "COD. BARRAS";
    }

    .product-table td:nth-of-type(3):before {
        content: "DESCRIÇÃO";
    }

    .product-table td:nth-of-type(4):before {
        content: "UN";
    }

    .product-table td:nth-of-type(5):before {
        content: "Preço";
    }

    .product-table td:nth-of-type(6):before {
        content: "Prazo (dias)";
    }

    .product-table td:nth-of-type(7):before {
        content: "Ação";
    }


    .floating-button {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        padding: 12px 15px;
        font-size: 16px;
    }
}

/* Estilos para o botão de WhatsApp dentro da tabela */
.whatsapp-button {
    background-color: #25D366;
    /* Cor do WhatsApp */
    color: white;
    /* Texto branco */
    padding: 8px 15px;
    font-size: 0.9em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    /* Para alinhar ícone e texto */
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    /* Impede que o botão quebre linha */
    box-sizing: border-box;
    /* Garante que padding e border sejam incluídos na largura */
}

.whatsapp-button:hover {
    background-color: #1DA851;
}

.whatsapp-icon {
    margin-right: 5px;
}

/* Estilos para Modais */
.modal {
    /* Garante que o modal cubra toda a tela */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Fundo semi-transparente */
    display: flex;
    /* Usa flexbox para centralizar o conteúdo */
    justify-content: center;
    /* Centraliza horizontalmente */
    align-items: center;
    /* Centraliza verticalmente */
    z-index: 1001;
    /* Maior que o header fixo */

    /* Oculto por padrão, ativado via JavaScript com a classe 'active' */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    display: flex;
    /* Força a exibição como flex para centralizar */
}

.modal-content {
    background-color: #fefefe;
    padding: 25px;
    border: 1px solid #888;
    border-radius: 12px;
    width: 90%;
    /* Largura em mobile */
    max-width: 550px;
    /* Largura máxima em desktop */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    /* Para posicionar o botão de fechar */
    overflow-y: auto;
    /* Adiciona scroll se o conteúdo for muito grande */
    max-height: 90vh;
    /* Limita a altura do modal para que caiba na tela */
    box-sizing: border-box;
    /* Inclui padding e border na largura/altura */
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 30px;
    font-weight: bold;
    position: absolute;
    /* Posiciona o botão de fechar */
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Login Page Client ID Toggle */
.client-id-wrapper {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Aligns the toggle to the right */
}

.client-id-toggle {
    cursor: pointer;
    font-size: 0.85em;
    color: #aaa;
    /* Discreet color */
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
    user-select: none;
    padding: 5px;
}

.client-id-toggle:hover {
    color: #777;
}

.client-id-input-container.hidden {
    display: none !important;
}

.client-id-input-container {
    width: 100%;
    /* Ensures the input takes full width when visible */
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Supplier Icon Rail Sidebar ─────────────────────────────────────── */
:root {
  --s-rail-w:    60px;
  --s-full-w:   220px;
  --s-topbar-h: 54px;
  /* Light sidebar colours */
  --s-bg:        #ffffff;
  --s-border:    #e2e8f0;
  --s-link:      #64748b;
  --s-link-hover-bg: #f1f5f9;
  --s-link-hover-fg: #1e293b;
  --s-active-bg: #eff6ff;
  --s-active-fg: #2563eb;
  --s-active-bd: #2563eb;
  --s-divider:   #e2e8f0;
  --s-logo-fg:   #1e293b;
  --s-user-fg:   #94a3b8;
  --s-toggle-fg: #94a3b8;
  --s-toggle-hover: #475569;
}

/* Body reset */
body.s-layout {
  padding-top: 0; padding-bottom: 0;
  display: block; align-items: unset; justify-content: unset;
  background: #f1f5f9;
  transition: background .25s, color .25s;
}

/* Sidebar container */
.s-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--s-rail-w);
  background: var(--s-bg);
  border-right: 1px solid var(--s-border);
  box-shadow: 2px 0 8px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
  transition: width .22s ease, background .25s, border-color .25s, box-shadow .25s;
  overflow: hidden; overflow-y: auto;
  z-index: 200;
}
.s-sidebar.expanded { width: var(--s-full-w); }

/* Logo area */
.s-logo-area {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; justify-content: center; min-height: 62px;
  flex-shrink: 0; border-bottom: 1px solid var(--s-border);
}
.s-sidebar.expanded .s-logo-area { padding: 14px 16px; justify-content: flex-start; }
.s-logo-area img { width: 32px; height: 32px; border-radius: 6px; object-fit: contain; flex-shrink: 0; }
.s-logo-text {
  font-size: .82rem; font-weight: 700; color: var(--s-logo-fg);
  white-space: nowrap; overflow: hidden;
  opacity: 0; width: 0; transition: opacity .15s, width .15s, color .25s;
}
.s-sidebar.expanded .s-logo-text { opacity: 1; width: auto; }

/* Nav links */
.s-nav { flex: 1; padding: 8px 0; }
.s-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; justify-content: center;
  color: var(--s-link); text-decoration: none;
  font-size: .88rem; font-weight: 500;
  border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden;
  transition: color .15s, background .15s;
  position: relative;
}
.s-sidebar.expanded .s-nav-link { padding: 11px 18px; justify-content: flex-start; }
.s-nav-link i { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }
.s-nav-link span { opacity: 0; width: 0; overflow: hidden; transition: opacity .15s; }
.s-sidebar.expanded .s-nav-link span { opacity: 1; width: auto; }
.s-nav-link:hover { color: var(--s-link-hover-fg); background: var(--s-link-hover-bg); }
.s-nav-link.active {
  color: var(--s-active-fg); background: var(--s-active-bg);
  border-left-color: var(--s-active-bd);
}

/* Tooltip on collapsed desktop */
.s-nav-link::after {
  content: attr(data-tip);
  position: absolute; left: calc(var(--s-rail-w) + 8px); top: 50%;
  transform: translateY(-50%);
  background: #1e293b; color: #fff; border-radius: 6px;
  padding: 4px 10px; font-size: .8rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s;
  z-index: 300; border: 1px solid #334155;
}
.s-sidebar:not(.expanded) .s-nav-link:hover::after { opacity: 1; }

/* Nav divider */
.s-nav-divider { height: 1px; background: var(--s-divider); margin: 4px 8px; }

/* User info (expanded only) */
.s-user-info {
  padding: 10px 18px; font-size: .75rem; color: var(--s-user-fg);
  border-top: 1px solid var(--s-border); display: none;
  overflow: hidden; white-space: nowrap; flex-shrink: 0;
  transition: color .25s, border-color .25s;
}
.s-sidebar.expanded .s-user-info { display: block; }

/* Dark mode toggle button */
.s-darkmode-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px 0; width: 100%; cursor: pointer;
  background: none; border: none; border-top: 1px solid var(--s-border);
  color: var(--s-toggle-fg); font-size: .82rem;
  transition: color .15s, border-color .25s;
}
.s-sidebar.expanded .s-darkmode-btn { padding: 10px 18px; justify-content: flex-start; }
.s-darkmode-btn i { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.s-darkmode-btn span { opacity: 0; width: 0; overflow: hidden; transition: opacity .15s; }
.s-sidebar.expanded .s-darkmode-btn span { opacity: 1; width: auto; }
.s-darkmode-btn:hover { color: var(--s-toggle-hover); }

/* Collapse toggle button */
.s-toggle {
  display: flex; align-items: center; justify-content: center;
  padding: 11px; cursor: pointer; color: var(--s-toggle-fg);
  background: none; border: none; border-top: 1px solid var(--s-border);
  width: 100%; transition: color .15s, border-color .25s; flex-shrink: 0;
}
.s-toggle:hover { color: var(--s-toggle-hover); }
.s-toggle i { transition: transform .22s; }
.s-sidebar.expanded .s-toggle i { transform: rotate(180deg); }

/* Main content area */
.s-main {
  margin-left: var(--s-rail-w);
  padding: 24px 20px 80px;
  min-height: 100vh;
  transition: margin-left .22s ease;
  box-sizing: border-box;
}
.s-main.sidebar-expanded { margin-left: var(--s-full-w); }

/* .pg alias */
body.s-layout .pg { max-width: 900px; margin: 0 auto; }

/* Center container inside s-main */
body.s-layout .container { margin-left: auto; margin-right: auto; }

/* Overlay */
.s-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 190;
}
.s-overlay.open { display: block; }

/* Top bar */
.s-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--s-topbar-h); background: #fff;
  border-bottom: 1px solid #e2e8f0; align-items: center;
  padding: 0 12px; gap: 8px; z-index: 150;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  transition: background .25s, border-color .25s;
}
/* Topbar inner layout: [hamburger] [center: logo+title] [spacer] */
.s-topbar-center {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 8px; overflow: hidden; min-width: 0;
}
.s-topbar-logo { height: 34px; width: 34px; border-radius: 7px; object-fit: contain; flex-shrink: 0; }
.s-topbar-title {
  font-size: .88rem; font-weight: 700; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .25s;
}
.s-topbar-spacer { width: 34px; flex-shrink: 0; } /* mirrors hamburger width to keep center truly centered */
.s-hamburger {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: #475569; padding: 4px 6px; line-height: 1;
  flex-shrink: 0; width: 34px; text-align: center;
}
.s-close-btn {
  background: none; border: none; font-size: 1.1rem;
  cursor: pointer; color: #64748b; padding: 6px; display: none; flex-shrink: 0;
}

/* Mobile breakpoint */
@media (max-width: 991px) {
  .s-topbar { display: flex; }
  .s-toggle  { display: none; }
  .s-close-btn { display: block; }
  .s-sidebar {
    width: 260px; transform: translateX(-100%);
    transition: transform .25s ease, background .25s;
    box-shadow: none;
  }
  .s-sidebar.open { transform: translateX(0); width: 260px; }
  .s-sidebar.open .s-logo-text,
  .s-sidebar.open .s-nav-link span,
  .s-sidebar.open .s-darkmode-btn span { opacity: 1; width: auto; }
  .s-sidebar.open .s-logo-area    { padding: 14px 16px; justify-content: space-between; }
  .s-sidebar.open .s-nav-link     { padding: 11px 18px; justify-content: flex-start; }
  .s-sidebar.open .s-darkmode-btn { padding: 10px 18px; justify-content: flex-start; }
  .s-sidebar.open .s-user-info    { display: block; }
  .s-sidebar:not(.expanded) .s-nav-link::after { display: none; }
  .s-main {
    margin-left: 0 !important;
    padding: calc(var(--s-topbar-h) + 16px) 14px 80px;
  }
}

/* ── Dark mode ─────────────────────────────────────────────────────── */
body.dark-mode {
  background: #0f172a !important;
  color: #e2e8f0;
  --s-bg:        #1e293b;
  --s-border:    #334155;
  --s-link:      #94a3b8;
  --s-link-hover-bg: rgba(255,255,255,.07);
  --s-link-hover-fg: #ffffff;
  --s-active-bg: #0369a1;
  --s-active-fg: #ffffff;
  --s-active-bd: #38bdf8;
  --s-divider:   #334155;
  --s-logo-fg:   #e2e8f0;
  --s-user-fg:   #64748b;
  --s-toggle-fg: #64748b;
  --s-toggle-hover: #ffffff;
}
body.dark-mode .s-layout,
body.dark-mode.s-layout  { background: #0f172a !important; }
body.dark-mode .s-main   { background: transparent; }
body.dark-mode .s-sidebar { box-shadow: 2px 0 12px rgba(0,0,0,.4); }
body.dark-mode .s-topbar { background: #1e293b; border-bottom-color: #334155; }
body.dark-mode .s-topbar-title { color: #e2e8f0; }
body.dark-mode .s-hamburger { color: #94a3b8; }
body.dark-mode .container  { background: #1e293b; box-shadow: 0 2px 12px rgba(0,0,0,.3); color: #e2e8f0; }
body.dark-mode .cotacao-card { background: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .cotacao-card h4 { color: #60a5fa !important; }
body.dark-mode .cotacao-card h5,
body.dark-mode .cotacao-card h6 { color: #cbd5e1 !important; }
body.dark-mode h3 { color: #e2e8f0; }
body.dark-mode p  { color: #94a3b8; }
body.dark-mode label { color: #cbd5e1; }
body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
  background: #0f172a; border-color: #334155; color: #e2e8f0;
}
body.dark-mode .filter-form, body.dark-mode .search-form { background: transparent; }
body.dark-mode .so-filter-bar { background: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .order-card { background: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .order-card .oc-meta span { color: #94a3b8 !important; }