/*
 * Sistema Expressa — layout no estilo do template Metis (Bootstrap 5).
 * Para usar o CSS oficial do Metis, copie os assets dele para public/metis
 * e troque o <link> em resources/views/layouts/app.blade.php.
 */
:root {
    --bs-primary: #e31e24;
    --bs-primary-rgb: 227, 30, 36;
    --brand-red: #e31e24;
    --brand-red-dark: #c4161c;
    --brand-black: #111111;
    --font-display: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
    --bs-body-font-family: Poppins, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-bg: #f6f6f6;
    --bs-body-color: #1a1a1a;
    --bs-link-color: #e31e24;
    --bs-link-hover-color: #c4161c;
    --bs-border-color: #e5e7eb;
    --sidebar-width: 248px;
    --header-height: 60px;
}

body { font-size: .9rem; }
.btn-primary { --bs-btn-bg: #e31e24; --bs-btn-border-color: #e31e24; --bs-btn-hover-bg: #c4161c; --bs-btn-hover-border-color: #c4161c; --bs-btn-active-bg: #a91217; --bs-btn-active-border-color: #a91217; --bs-btn-disabled-bg: #e31e24; --bs-btn-disabled-border-color: #e31e24; }
.btn-outline-primary { --bs-btn-color: #e31e24; --bs-btn-border-color: #e31e24; --bs-btn-hover-bg: #e31e24; --bs-btn-hover-border-color: #e31e24; --bs-btn-active-bg: #c4161c; --bs-btn-active-border-color: #c4161c; }
.form-control:focus, .form-select:focus { border-color: #e31e24; box-shadow: 0 0 0 .2rem rgba(227, 30, 36, .15); }
.form-check-input:checked { background-color: #e31e24; border-color: #e31e24; }
a { color: #e31e24; }
h1, h2, h3, .page-title, .stat-value { font-family: var(--font-display); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; }

/* ---------- Logo (wordmark) ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; text-decoration: none; color: var(--brand-black); }
.logo-word { font-family: Poppins, sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: -.04em; }
.logo-word .x { color: var(--brand-red); font-style: italic; }
.logo-tag { font-family: Poppins, sans-serif; font-weight: 600; font-size: .5rem; letter-spacing: .08em; align-self: flex-end; margin-top: 2px; }
.logo-lg .logo-word { font-size: 2.4rem; }
.logo-lg .logo-tag { font-size: .7rem; }
.logo-img { height: 34px; width: auto; }
.logo-lg .logo-img { height: 56px; }

/* ---------- Sidebar ---------- */
.app-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
    background: #fff; border-right: 1px solid var(--bs-border-color);
    display: flex; flex-direction: column; z-index: 1040; transition: transform .2s ease;
}
.app-sidebar .brand {
    height: var(--header-height); display: flex; align-items: center; gap: .6rem;
    padding: 0 1.25rem; text-decoration: none;
}
/* O menu cresceu: uma coluna só, rolagem vertical quando passar da altura da tela (Bootstrap .nav quebra linha e criava uma 2ª coluna). */
.app-sidebar .brand, .app-sidebar .sidebar-footer { flex-shrink: 0; }
.app-sidebar > .nav { flex: 1 1 auto; min-height: 0; flex-wrap: nowrap; overflow-x: hidden; overflow-y: auto; }
.app-sidebar > .nav > * { flex-shrink: 0; }
.app-sidebar .nav-link { white-space: nowrap; }
.app-sidebar .nav-section { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; padding: 1rem 1.25rem .4rem; }
.app-sidebar .nav-link {
    display: flex; align-items: center; gap: .7rem; color: #374151; padding: .5rem .9rem;
    margin: 1px .6rem; border-radius: 8px; font-weight: 500;
}
.app-sidebar .nav-link i { font-size: 1.05rem; color: #6b7280; }
.app-sidebar .nav-link:hover { background: #f3f4f6; color: #111827; }
.app-sidebar .nav-link.active { background: #fdecec; color: #c4161c; }
.app-sidebar .nav-link.active i { color: #e31e24; }
.app-sidebar .nav-link.active { box-shadow: inset 3px 0 0 #e31e24; }
.app-sidebar .nav-link.disabled { color: #9ca3af; }
.app-sidebar .nav-link .badge { margin-left: auto; font-weight: 500; }
.app-sidebar .sidebar-footer { margin-top: auto; padding: 1rem 1.25rem; font-size: .75rem; color: #9ca3af; border-top: 1px solid var(--bs-border-color); }

/* Barra de ações de formulário fixa no rodapé da tela. */
.form-actions {
    position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: .5rem;
    padding: .75rem 1rem; margin-top: 1rem; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--bs-border-color);
}

/* ---------- Header ---------- */
.app-main { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
    height: var(--header-height); background: #fff; border-bottom: 1px solid var(--bs-border-color);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 1030;
}
.app-header .search { max-width: 360px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: #fdecec; color: #c4161c;
    display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem;
}
.app-content { padding: 1.5rem; flex: 1; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-subtitle { color: #6b7280; font-size: .82rem; }

/* ---------- Cards ---------- */
.card { border-color: var(--bs-border-color); border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { background: #fff; border-bottom-color: var(--bs-border-color); font-weight: 600; padding: .9rem 1.25rem; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #f3f4f6; font-size: 1.2rem; color: #374151; }
.stat-card .stat-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.table > :not(caption) > * > * { padding: .75rem 1rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; font-weight: 600; background: #f9fafb; }

/* ---------- Auth ---------- */
.auth-wrapper { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: #f1f1f1; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card > .card { border-top: 4px solid var(--brand-red); }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    body.sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
    .app-main { margin-left: 0; }
    .app-content { padding: 1rem; }
}

/* ---------- Impressão (comprovante, OS) ---------- */
@media print {
    .app-sidebar, .app-header, .d-print-none { display: none !important; }
    .app-main { margin-left: 0; }
    .app-content { padding: 0; }
    body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .card { box-shadow: none; border: 0; }
}

/* ---------- Kanban de pedidos ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.kanban-col { background: #ececec; border-radius: 12px; padding: .6rem; min-height: 120px; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .02em; padding: .2rem .3rem .6rem; }
.kanban-card { display: block; background: #fff; border: 1px solid var(--bs-border-color); border-left: 4px solid #d1d5db; border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; color: inherit; text-decoration: none; }
.kanban-card:hover { border-color: var(--brand-red); border-left-color: var(--brand-red); }
.kanban-card.is-late { border-left-color: var(--brand-red); background: #fff7f7; }

/* ---------- Linha do tempo ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--bs-border-color); }
.timeline li { position: relative; padding: 0 0 .9rem .9rem; }
.timeline li::before { content: ""; position: absolute; left: -1.45rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: #d1d5db; border: 2px solid #fff; }
.timeline li.current::before { background: var(--brand-red); }
