/* style.css */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.4;
    padding: 20px;
}

a {
    color: #1976d2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin-bottom: 15px;
    font-weight: 600;
    color: #222;
}

.page {
    max-width: 960px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.page--login {
    max-width: 420px;
    margin-top: 60px;
}

header.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

header.page-header h1 {
    margin-bottom: 0;
}

.nav-links a {
    margin-left: 10px;
}

fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 18px 18px;
    margin-bottom: 20px;
}

legend {
    padding: 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 0.95rem;
    margin-bottom: 12px;
    transition: border 0.15s ease, box-shadow 0.15s ease;
    background-color: #fafbfc;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25,118,210,0.15);
    background-color: #fff;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.button,
button {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background-image: linear-gradient(135deg, #1976d2, #1565c0);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(21,101,192,0.35);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.button:hover,
button:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 14px rgba(21,101,192,0.45);
    transform: translateY(-1px);
}

.button--secondary {
    background-image: linear-gradient(135deg, #607d8b, #546e7a);
    box-shadow: 0 4px 10px rgba(84,110,122,0.35);
}

.button:disabled,
button:disabled {
    opacity: 0.65;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.table-wrapper {
    margin-top: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

th {
    background-color: #f7f9fb;
    font-weight: 600;
    color: #555;
}

tr:nth-child(even) td {
    background-color: #fafbfc;
}

tr:hover td {
    background-color: #f1f5ff;
}

.msg-ok,
.msg-erro {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.msg-ok {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

.msg-erro {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #e3f2fd;
    color: #1565c0;
}

textarea.orcamento-texto {
    width: 100%;
    min-height: 150px;
    margin-top: 10px;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
/* ========= LAYOUT COM MENU LATERAL FIXO ========= */

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
}

/* Sidebar fixa na esquerda */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 230px;
    background: #111827; /* cinza bem escuro */
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    box-sizing: border-box;
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    color: #ffffff;
}

.sidebar-user {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Navegação lateral */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.sidebar-section-label {
    margin-top: 16px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.sidebar-nav a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e5e7eb;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.sidebar-nav a:hover {
    background: #1f2937;
    transform: translateX(2px);
}

.sidebar-nav a.is-active {
    background: #2563eb;
    color: #ffffff;
}

/* Link de sair */
.sidebar-logout {
    margin-top: 20px;
    border-top: 1px solid #1f2937;
    padding-top: 10px;
    color: #fca5a5;
}
.sidebar-logout:hover {
    background: #7f1d1d;
    color: #fee2e2;
}

/* Área principal: só empurra o conteúdo pra direita pra não ficar embaixo do menu */
.page {
    max-width: 1000px;
    margin: 32px auto;
    margin-left: 280px; /* espaço extra do menu lateral */ /* espaço para o menu */
    padding: 24px 24px 32px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;

}

/* Login continua centralizado, sem menu lateral (basta não incluir o menu.php lá) */
.page.page--login {
    max-width: 420px;
    margin: 70px auto;
}

/* Cabeçalho interno opcional dentro da página */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.3rem;
}

/* Botões já existentes (deixa mais pill) */
.button,
button {
    border-radius: 999px;
}

/* Responsivo básico */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .page {
        margin: 12px;
        margin-left: auto; /* não empurra pro lado em telas pequenas */
    }
}
/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    white-space: nowrap;
}

/* pendente = amarelo */
.status-pendente {
    background-color: #f1c40f;
    color: #000;
}

/* aprovado = azul */
.status-aprovado {
    background-color: #3498db;
}

/* arte pendente = laranja */
.status-arte_pendente {
    background-color: #e67e22;
}

/* produção = roxo (não definido, escolhi uma cor neutra) */
.status-producao {
    background-color: #9b59b6;
}

/* concluído = azul (um azul mais escuro) */
.status-concluido {
    background-color: #2980b9;
}

/* cancelado (RECUSADO) = vermelho */
.status-cancelado {
    background-color: #e74c3c;
}


/* ==== Autocomplete de Matéria-prima (orcamento novo/editar) ==== */
.mp-lookup {
    position: relative;
}

.mp-lookup > input[type="text"],
.mp-lookup > input[type="search"] {
    width: 100%;
}

.mp-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    max-height: 220px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    z-index: 2500;
    padding: 4px 0;
    display: none;
}

.mp-suggestions button {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 0;
    text-align: left;
    background: transparent;
    font-size: 0.85rem;
    cursor: pointer;
}

.mp-suggestions button:hover {
    background: #f3f4f6;
}
