/* =====================================================================
   Alvra - Estrutura do painel: menu lateral + barra superior
   Usa as variáveis de alvra-theme.css (--od-*). Classes com prefixo os-.
   ===================================================================== */
:root { --os-sidebar-w: 248px; --os-topbar-h: 68px; }

.os-shell { display: flex; min-height: 100vh; background: var(--od-bg, #f1f5f9); }

/* ---------- Menu lateral ---------- */
.os-sidebar {
    width: var(--os-sidebar-w); flex: 0 0 var(--os-sidebar-w);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--od-primary-darker, #0e1a3a); border-right: 0;
    display: flex; flex-direction: column; padding: 1.25rem .875rem; gap: 2px;
    z-index: 1045;
}
.os-brand { display: flex; align-items: center; gap: .625rem; padding: 0 .625rem 1.125rem; color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.os-brand:hover { color: #fff; }
.os-group { font-size: .78rem; font-weight: 600; color: #7fa0ff; padding: 1.125rem .75rem .375rem; }
.os-link {
    display: flex; align-items: center; gap: .75rem; min-height: 42px; padding: 0 .75rem;
    border-radius: 10px; color: #e0e7ff; font-size: .92rem; font-weight: 500; text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.os-link i { font-size: 1.1rem; color: #7fa0ff; width: 1.25rem; text-align: center; }
.os-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.os-link.active { background: rgba(255, 255, 255, .2); color: #fff; font-weight: 600; }
.os-link.active i { color: #fff; }
.os-sidebar-foot { margin-top: auto; padding-top: .75rem; border-top: 1px solid rgba(255, 255, 255, .18); }
.os-sidebar .os-link:focus-visible { outline-color: #fff; }
.os-link:focus-visible, .os-iconbtn:focus-visible, .os-search input:focus-visible { outline: 2px solid var(--od-primary, #3d63f5); outline-offset: 2px; }

/* ---------- Coluna principal ---------- */
.os-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.os-topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--os-topbar-h);
    display: flex; align-items: center; gap: .75rem; padding: 0 1.75rem;
    background: #fff; border-bottom: 1px solid var(--od-border, #e2e8f0); box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.os-search { position: relative; flex: 0 1 380px; min-width: 0; }
.os-search i { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.os-search input {
    width: 100%; height: 42px; border: 1px solid transparent; border-radius: 12px; background: #f1f5f9;
    padding: 0 4.25rem 0 2.5rem; font-size: .9rem; color: #0f172a;
}
.os-search input::placeholder { color: #64748b; }
.os-search input:focus { background: #fff; border-color: var(--od-primary, #3d63f5); outline: none; }
.os-search kbd { position: absolute; right: .625rem; top: 50%; transform: translateY(-50%); font-size: .72rem; font-weight: 600; color: #64748b; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 1px 6px; }
.os-spacer { flex: 1 1 auto; }
.os-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
    border: 1px solid var(--od-border, #e2e8f0); border-radius: 12px; background: #fff; color: #334155; text-decoration: none; font-size: 1.15rem;
}
.os-iconbtn:hover { background: #f1f5f9; color: #0f172a; }
.os-newbtn { height: 42px; border-radius: 12px; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }
.os-user { display: flex; align-items: center; gap: .625rem; color: #0f172a; text-decoration: none; background: none; border: 0; padding: 0; text-align: left; }
.os-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--od-primary, #3d63f5); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem; object-fit: cover; flex: 0 0 40px; }
.os-user-name { font-size: .875rem; font-weight: 600; line-height: 1.25; max-width: 170px; }
.os-user-role { font-size: .75rem; color: #64748b; line-height: 1.25; }
.os-main { flex: 1 0 auto; width: 100%; max-width: 1600px; margin: 0 auto; padding: 1.5rem 1.75rem; }
.os-footer { padding: 1rem 1.75rem; font-size: .8rem; color: #64748b; display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: space-between; border-top: 1px solid var(--od-border, #e2e8f0); background: #fff; }
.os-footer a { color: #475569; text-decoration: none; }
.os-footer a:hover { text-decoration: underline; }
.os-backdrop { display: none; }

/* ---------- Telas menores: menu em gaveta ---------- */
@media (max-width: 991.98px) {
    .os-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
    .os-sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(15, 23, 42, .3); }
    .os-backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1044; }
    .os-topbar { padding: 0 1rem; }
    .os-main { padding: 1rem; }
    .os-footer { padding: 1rem; }
    .os-search { flex-basis: auto; }
}
@media (max-width: 575.98px) {
    .os-search { display: none; }
    .os-newbtn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .os-sidebar { transition: none; } }
@media print { .os-sidebar, .os-topbar, .os-footer, .os-backdrop { display: none !important; } .os-main { padding: 0; max-width: none; } }

.os-sidebar, .os-topbar, .os-main, .os-footer, .os-search input { box-sizing: border-box; }
.os-main > .container, .os-main > .container-fluid { max-width: none; padding-left: 0; padding-right: 0; }

/* Títulos de página com o mesmo peso e cor em todas as telas */
.os-main h1.h4, .os-main h2.h4 { font-weight: 700; color: var(--od-text, #0f172a); letter-spacing: -.01em; }
