:root {
    --eip-primary: #0063a2;
    --eip-primary-dark: #004874;
    --eip-primary-deep: #003452;
    --eip-primary-light: #dceef8;
    --eip-accent: #e8a13f;
    --eip-accent-hover: #cf8424;
    --eip-sidebar-bg: #004874;
    --eip-topbar-bg: #ffffff;
    --eip-page-bg: #f3f7fa;
    --eip-surface: #ffffff;
    --eip-text: #101011;
    --eip-text-muted: #65727c;
    --eip-border: #dce5eb;
    --eip-focus: rgba(0, 99, 162, .2);
    --primary: var(--eip-primary);
    --primary-dark: var(--eip-primary-dark);
    --ink: var(--eip-text);
    --muted: var(--eip-text-muted);
    --bg: var(--eip-page-bg);
    --line: var(--eip-border);
    --sidebar: var(--eip-sidebar-bg);
}

html { background: var(--eip-page-bg); }
body { background: var(--eip-page-bg); color: var(--eip-text); }
a { color: var(--eip-primary); }
a:hover { color: var(--eip-primary-dark); }

/* Identidade institucional */
.sidebar {
    background: linear-gradient(180deg, var(--eip-primary-dark) 0%, var(--eip-primary-deep) 100%);
    box-shadow: 8px 0 28px rgba(0, 52, 82, .12);
}
.sidebar .brand {
    min-height: 88px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
}
.brand-symbol {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: block;
    object-fit: contain;
}
.brand small { color: rgba(255, 255, 255, .66); }
.sidebar-scroll { scrollbar-color: rgba(232, 161, 63, .7) transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(232, 161, 63, .7); }
.sidebar .nav-link,
.nav-group-toggle { color: rgba(255, 255, 255, .78); }
.sidebar .nav-link > i,
.nav-group-toggle > i:first-child { color: rgba(255, 255, 255, .72); }
.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible,
.nav-group-toggle:hover,
.nav-group-toggle:focus-visible,
.nav-group-toggle[aria-expanded=true] {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}
.sidebar .nav-link:focus-visible,
.nav-group-toggle:focus-visible {
    outline: 3px solid rgba(232, 161, 63, .75);
    outline-offset: 1px;
}
.sidebar .nav-link.active {
    background: var(--eip-accent);
    color: #17212a;
    box-shadow: 0 7px 18px rgba(16, 16, 17, .18);
}
.sidebar .nav-link.active > i { color: #17212a; }
.nav-group-items { border-left: 0; margin-left: 0; }

/* Topbar com marca realmente centralizada */
.topbar {
    position: sticky;
    background: var(--eip-topbar-bg);
    border-bottom-color: var(--eip-border);
    box-shadow: 0 2px 14px rgba(0, 72, 116, .06);
}
.topbar-start,
.topbar-user { display: flex; align-items: center; gap: 1rem; position: relative; z-index: 2; }
.topbar-user { margin-left: auto; }
.topbar-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .2rem;
    border-radius: .5rem;
}
.topbar-brand:focus-visible { outline: 3px solid var(--eip-accent); outline-offset: 2px; }
.topbar-brand img { display: block; width: auto; height: 46px; max-width: min(330px, 34vw); object-fit: contain; }
.topbar .btn-light { color: var(--eip-primary-dark); border-color: var(--eip-border); background: #f7fafc; }
.topbar .btn-outline-secondary { color: var(--eip-primary-dark); border-color: #9db7c7; }
.topbar .btn-outline-secondary:hover { color: #fff; background: var(--eip-primary); border-color: var(--eip-primary); }

/* Componentes reutilizáveis */
.btn-primary {
    --bs-btn-bg: var(--eip-primary);
    --bs-btn-border-color: var(--eip-primary);
    --bs-btn-hover-bg: var(--eip-primary-dark);
    --bs-btn-hover-border-color: var(--eip-primary-dark);
    --bs-btn-active-bg: var(--eip-primary-deep);
    --bs-btn-active-border-color: var(--eip-primary-deep);
    --bs-btn-focus-shadow-rgb: 0, 99, 162;
}
.btn-outline-primary {
    --bs-btn-color: var(--eip-primary);
    --bs-btn-border-color: var(--eip-primary);
    --bs-btn-hover-bg: var(--eip-primary);
    --bs-btn-hover-border-color: var(--eip-primary);
    --bs-btn-active-bg: var(--eip-primary-dark);
    --bs-btn-active-border-color: var(--eip-primary-dark);
}
.form-control,
.form-select { border-color: #c8d5dd; background-color: #fff; }
.form-control:focus,
.form-select:focus { border-color: var(--eip-primary); box-shadow: 0 0 0 .2rem var(--eip-focus); }
.form-check-input:checked { background-color: var(--eip-primary); border-color: var(--eip-primary); }
.form-check-input:focus { border-color: var(--eip-primary); box-shadow: 0 0 0 .2rem var(--eip-focus); }
.panel,
.stat-card,
.card { border-color: var(--eip-border); }
.panel,
.stat-card { box-shadow: 0 7px 24px rgba(0, 72, 116, .055); }
.stat-card .stat-icon { color: var(--eip-primary); background: var(--eip-primary-light); }
.done-item { color: #234254; background: #f0f7fb; border-color: #d4e8f3; }
.table thead th { color: #516672; background: #edf5f9; border-bottom-color: var(--eip-border); }
.table tbody tr:hover > * { background-color: #f7fbfd; }
.table > :not(caption) > * > * { border-bottom-color: var(--eip-border); }
.code { color: var(--eip-primary-dark); background: #eaf2f7; }
.eyebrow { color: var(--eip-primary) !important; }
.progress-bar { background-color: var(--eip-primary); }
.pagination { --bs-pagination-color: var(--eip-primary); --bs-pagination-active-bg: var(--eip-primary); --bs-pagination-active-border-color: var(--eip-primary); }
.dropdown-item.active,
.dropdown-item:active { background-color: var(--eip-primary); }
.catalog-tabs .nav-link { color: var(--eip-primary-dark); background: #e7f0f5; }
.catalog-tabs .nav-link:hover { color: var(--eip-primary); background: #dcebf3; }
.catalog-tabs .nav-link.active { color: #fff; background: var(--eip-primary); }
.page-link { color: var(--eip-primary); }
.active > .page-link { background: var(--eip-primary); border-color: var(--eip-primary); }
.ajax-material-results { border-color: #c8d5dd; box-shadow: 0 12px 30px rgba(0, 72, 116, .16); }
.ajax-material-option:hover,
.ajax-material-option:focus { background: #e8f3f9; }
.modal-header { border-bottom-color: var(--eip-border); }
.modal-footer { border-top-color: var(--eip-border); }
.alert { border-radius: 12px; }

/* Login */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 12%, rgba(232, 161, 63, .2), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(0, 99, 162, .17), transparent 31%),
        linear-gradient(145deg, #f8fbfd 0%, #eaf3f8 100%);
}
.login-brand-logo { display: block; width: min(360px, 88%); height: auto; max-height: 112px; object-fit: contain; margin: 0 auto 1.3rem; }
.login-heading h1 { color: var(--eip-primary-dark); font-weight: 760; }
.login-card { border-top: 5px solid var(--eip-accent) !important; border-radius: 18px; box-shadow: 0 20px 55px rgba(0, 72, 116, .14) !important; }
.inventory-meta { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .8rem; }
.inventory-meta dt { color: var(--eip-text-muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.inventory-meta dd { margin: 0; }
.inventory-divergent > * { background-color: #fff8e8 !important; }
.inventory-count { min-width: 120px; }

@media (max-width: 991.98px) {
    .sidebar { box-shadow: 12px 0 32px rgba(0, 30, 48, .3); }
    .sidebar-backdrop { backdrop-filter: blur(2px); }
    .topbar-brand img { height: 40px; max-width: min(250px, 42vw); }
}

@media (max-width: 575.98px) {
    .topbar { height: 68px; padding-inline: 12px; }
    .topbar-context { display: none; }
    .topbar-start,
    .topbar-user { gap: .45rem; }
    .topbar-brand img { height: 34px; max-width: 48vw; }
    .topbar .btn { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
    .login-brand-logo { width: min(300px, 90%); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Hotfix v0.6.24 — exportação Excel em todas as tabelas */
.eip-table-exportbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    background: #fff;
    border-bottom: 1px solid var(--eip-border);
}
.eip-table-exportbar + table { margin-top: 0 !important; }
.eip-excel-export { white-space: nowrap; }
@media (max-width: 575.98px) {
    .eip-table-exportbar { padding: .55rem .6rem; }
    .eip-excel-export span { display: none; }
    .eip-excel-export { min-width: 40px; min-height: 38px; }
}
@media print { .eip-table-exportbar { display: none !important; } }

/* Nexus dashboard - estoque mínimo e acuracidade */
.dashboard-stat{height:100%;min-height:128px;border-width:1px!important}
.dashboard-stat strong{display:block;line-height:1.1;margin:.2rem 0}
.dashboard-stat small{font-size:.73rem}
@media(max-width:575.98px){.dashboard-stat{min-height:112px}.dashboard-stat strong{font-size:1.4rem}}
