/*
 * V.Sist UI - camada visual sobre o template Amezia/Bootstrap 5.
 * Carregada por config_tema.php depois de bootstrap/app, em todas as paginas.
 * Cores em variaveis para manter claro/escuro consistentes.
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --vs-sidebar-w: 240px;
    --vs-sidebar-w-collapsed: 76px;
    --vs-topbar-h: 64px;

    --vs-navy-900: #293338;
    --vs-navy-800: #303b40;
    --vs-navy-700: #3b484d;
    --vs-teal-600: #348b3c;
    --vs-teal-500: #287332;
    --vs-teal-100: #edf6ed;
    --vs-coral-500: #f26b4f;
    --vs-amber-500: #f5a524;
    --vs-blue-600: #2563eb;

    --vs-bg: #f4f7f4;
    --vs-surface: #ffffff;
    --vs-surface-2: #f7f9f7;
    --vs-border: #e3e9e3;
    --vs-text: #303b40;
    --vs-text-2: #59665e;
    --vs-muted: #6b786f;
    --vs-shadow: none;
    --vs-radius: 4px;
    --vs-radius-sm: 3px;

    --bs-primary: var(--vs-teal-600);
    --bs-primary-rgb: 52, 139, 60;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html[data-tema="dark"] {
    --vs-bg: #0e1621;
    --vs-surface: #151f2c;
    --vs-surface-2: #1a2635;
    --vs-border: #243244;
    --vs-text: #e6edf5;
    --vs-text-2: #b6c2d1;
    --vs-muted: #8695a8;
    --vs-teal-100: rgba(52, 139, 60, .16);
    --vs-shadow: none;
}

/* ---------- Base ---------- */
body {
    font-family: var(--bs-body-font-family);
    background: var(--vs-bg) !important;
    color: var(--vs-text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h4, .h5 { color: var(--vs-text); font-weight: 600; letter-spacing: -.01em; }
a { color: var(--vs-teal-600); }
a:hover { color: var(--vs-teal-500); }
.text-muted { color: var(--vs-muted) !important; }
.text-primary { color: var(--vs-teal-600) !important; }
.bg-primary { background-color: var(--vs-teal-600) !important; }
.bg-soft-primary { background-color: var(--vs-teal-100) !important; }

/* ---------- Topbar ---------- */
#page-topbar {
    left: var(--vs-sidebar-w);
    height: var(--vs-topbar-h);
    background: var(--vs-surface) !important;
    border-bottom: 1px solid var(--vs-border);
    box-shadow: none;
    transition: left .2s ease;
}
#page-topbar .navbar-header { height: var(--vs-topbar-h); padding: 0 20px 0 8px; gap: 12px; }
#page-topbar .navbar-brand-box { display: none; }
#page-topbar .header-item { height: var(--vs-topbar-h); color: var(--vs-text-2) !important; background: transparent !important; }
#page-topbar .noti-icon i, #page-topbar .header-item i { color: var(--vs-text-2) !important; }
body[data-topbar="dark"] #page-topbar { background: var(--vs-surface) !important; }

.vs-icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--vs-border); background: var(--vs-surface);
    color: var(--vs-text-2); font-size: 19px; transition: all .15s;
}
.vs-icon-btn:hover { background: var(--vs-surface-2); color: var(--vs-teal-600); }
.vs-icon-btn.vs-primary { background: var(--vs-teal-600); border-color: var(--vs-teal-600); color: #fff; }
.vs-icon-btn.vs-primary:hover { background: var(--vs-teal-500); color: #fff; }

.vs-search {
    position: relative; flex: 1 1 auto; max-width: 440px;
}
.vs-search input {
    width: 100%; height: 42px; border-radius: var(--vs-radius-sm);
    border: 1px solid var(--vs-border); background: var(--vs-surface-2);
    padding: 0 64px 0 40px; color: var(--vs-text); font-size: 13.5px; outline: none;
}
.vs-search input:focus { border-color: var(--vs-teal-500); box-shadow: 0 0 0 3px rgba(52, 139, 60, .15); background: var(--vs-surface); }
.vs-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--vs-muted); font-size: 18px; }
.vs-search kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: var(--vs-surface); color: var(--vs-muted); border: 1px solid var(--vs-border);
    font-size: 11px; padding: 2px 6px; border-radius: var(--vs-radius-sm); font-family: inherit;
}
.vs-search-results {
    position: absolute; top: 48px; left: 0; right: 0; z-index: 1100;
    background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: var(--vs-radius-sm);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14); padding: 6px; max-height: 380px; overflow: auto; display: none;
}
.vs-search-results.open { display: block; }
.vs-search-results a {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--vs-radius-sm);
    color: var(--vs-text); font-size: 13.5px;
}
.vs-search-results a small { margin-left: auto; color: var(--vs-muted); font-size: 11.5px; }
.vs-search-results a i { font-size: 17px; color: var(--vs-teal-600); }
.vs-search-results a.active, .vs-search-results a:hover { background: var(--vs-teal-100); }
.vs-search-results .vs-empty { padding: 12px; color: var(--vs-muted); font-size: 13px; }

.vs-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: var(--vs-radius-sm); }
.vs-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--vs-teal-600); color: #fff;
    font-weight: 600; font-size: 15px;
}
.vs-user-name { font-weight: 600; font-size: 13.5px; color: var(--vs-text); line-height: 1.2; text-align: left; }
.vs-user-role { font-size: 12px; color: var(--vs-muted); line-height: 1.2; text-align: left; }

/* ---------- Sidebar ---------- */
.vertical-menu {
    top: 0 !important;
    width: var(--vs-sidebar-w);
    background: var(--vs-navy-800) !important;
    box-shadow: none;
    z-index: 1004;
    display: flex; flex-direction: column;
    transition: width .2s ease;
}
.vs-brand {
    height: var(--vs-topbar-h); flex: 0 0 var(--vs-topbar-h);
    display: flex; align-items: center; gap: 10px; padding: 0 22px;
    color: #fff !important; font-weight: 700; font-size: 19px; letter-spacing: -.01em;
}
.vs-brand-mark {
    width: 36px; height: 36px; border-radius: var(--vs-radius-sm); flex: 0 0 36px;
    background: var(--vs-teal-600);
    display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.vs-brand small { display: block; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .55); letter-spacing: .02em; }
.vertical-menu > [data-simplebar] { flex: 1 1 auto; min-height: 0; }

#sidebar-menu { padding: 6px 0 16px; }
#sidebar-menu .menu-title {
    color: rgba(255, 255, 255, .42) !important; font-size: 10.5px; font-weight: 600;
    letter-spacing: .08em; padding: 16px 26px 6px !important;
}
#sidebar-menu ul li a {
    color: rgba(255, 255, 255, .74) !important;
    margin: 2px 12px; padding: 10px 14px !important;
    border-radius: var(--vs-radius-sm); border-left: 0 !important; font-size: 14px; font-weight: 500;
}
#sidebar-menu ul li a i { color: rgba(255, 255, 255, .62) !important; font-size: 18px; min-width: 30px; opacity: 1; }
#sidebar-menu ul li a:hover { color: #fff !important; background: rgba(255, 255, 255, .06); }
#sidebar-menu ul li a:hover i { color: #fff !important; }
#sidebar-menu ul li ul.sub-menu { padding: 2px 0 6px; }
#sidebar-menu ul li ul.sub-menu li a {
    padding: 7px 14px 7px 56px !important; font-size: 13px; font-weight: 400; margin: 1px 12px;
    color: rgba(255, 255, 255, .6) !important;
}
#sidebar-menu ul li ul.sub-menu li a::before {
    content: ""; position: absolute; left: 34px; top: 50%; width: 5px; height: 5px; border-radius: 50%;
    background: rgba(255, 255, 255, .28); transform: translateY(-50%);
}
#sidebar-menu ul li ul.sub-menu li a.active, #sidebar-menu ul li ul.sub-menu li a.vs-current {
    color: #fff !important; background: rgba(255, 255, 255, .07);
}
#sidebar-menu ul li ul.sub-menu li a.active::before, #sidebar-menu ul li ul.sub-menu li a.vs-current::before { background: #81c784; }
#sidebar-menu .has-arrow:after { color: rgba(255, 255, 255, .45); }

/* item ativo de primeiro nivel */
#sidebar-menu > ul > li > a.vs-current,
#sidebar-menu > ul > li.mm-active > a {
    background: var(--vs-teal-600) !important;
    color: #fff !important;
    box-shadow: none;
}
#sidebar-menu > ul > li > a.vs-current i, #sidebar-menu > ul > li.mm-active > a i { color: #fff !important; }
#sidebar-menu > ul > li.mm-active > a.has-arrow:after { color: #fff; }
.mm-active, .mm-active .active, .mm-active > a i, .mm-active > i { color: inherit !important; }
.mm-active > a { border-color: transparent !important; }

/* Bloco de acoes rapidas e rodape do menu */
.vs-quick {
    margin: 10px 16px 6px; padding: 12px 6px 6px; border-radius: var(--vs-radius-sm);
    border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03);
}
.vs-quick-title {
    display: flex; justify-content: space-between; align-items: center;
    color: rgba(255, 255, 255, .85); font-size: 12.5px; font-weight: 600; padding: 0 10px 6px;
}
.vs-quick a {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--vs-radius-sm);
    color: rgba(255, 255, 255, .7) !important; font-size: 13px;
}
.vs-quick a i { font-size: 16px; color: rgba(255, 255, 255, .55); }
.vs-quick a:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.vs-sidebar-footer {
    margin: 8px 16px 16px; padding: 14px; border-radius: var(--vs-radius-sm);
    background: rgba(255, 255, 255, .04); color: #fff;
}
.vs-sidebar-footer strong { display: block; font-size: 13.5px; }
.vs-sidebar-footer span { font-size: 12px; opacity: .8; }

/* Sidebar recolhida */
body.vertical-collpsed .vertical-menu { width: var(--vs-sidebar-w-collapsed) !important; position: fixed !important; }
body.vertical-collpsed #page-topbar { left: var(--vs-sidebar-w-collapsed); }
body.vertical-collpsed .main-content { margin-left: var(--vs-sidebar-w-collapsed) !important; }
body.vertical-collpsed .footer { left: var(--vs-sidebar-w-collapsed) !important; }
body.vertical-collpsed .vs-brand { padding: 0 20px; }
body.vertical-collpsed .vs-brand-text, body.vertical-collpsed .vs-quick, body.vertical-collpsed .vs-sidebar-footer { display: none !important; }
body.vertical-collpsed #sidebar-menu ul li a { margin: 2px 10px; padding: 12px 14px !important; }
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a { width: auto; background: var(--vs-navy-700) !important; }
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a span { display: none; }
body.vertical-collpsed .vertical-menu #sidebar-menu > ul ul {
    background: var(--vs-navy-800) !important; border-radius: var(--vs-radius-sm); left: 66px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3) !important;
}
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul a { width: 210px; padding: 8px 16px !important; margin: 1px 6px; }
body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul a::before { display: none; }

/* ---------- Conteudo ---------- */
.main-content { margin-left: var(--vs-sidebar-w); transition: margin-left .2s ease; }
.page-content { padding: calc(var(--vs-topbar-h) + 24px) 24px 80px; }
.footer {
    left: var(--vs-sidebar-w); background: transparent; border-top: 1px solid var(--vs-border);
    color: var(--vs-muted); font-size: 12.5px;
}
.page-title-box { padding-bottom: 20px; }
.page-title-box h4 { font-size: 22px !important; font-weight: 700; text-transform: none !important; }
.page-title-box .breadcrumb-item, .page-title-box .breadcrumb-item a { font-size: 13px; color: var(--vs-muted); }

.vs-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.vs-page-head h1 { font-size: 24px; margin: 0; font-weight: 700; }
.vs-page-head p { margin: 4px 0 0; color: var(--vs-muted); }
.vs-breadcrumb { font-size: 12.5px; color: var(--vs-muted); margin-bottom: 4px; }
.vs-breadcrumb a { color: var(--vs-muted); }
.vs-breadcrumb a:hover { color: var(--vs-teal-600); }

/* ---------- Cards ---------- */
.card {
    background: var(--vs-surface); border: 1px solid var(--vs-border) !important;
    border-radius: var(--vs-radius) !important; box-shadow: var(--vs-shadow) !important;
    margin-bottom: 24px;
}
.card-header { background: transparent; border-bottom: 1px solid var(--vs-border); padding: 16px 20px; border-radius: var(--vs-radius) var(--vs-radius) 0 0 !important; }
.card-body { padding: 20px; }
.card-title { font-size: 15.5px; font-weight: 600; color: var(--vs-text); }
.card-footer { background: var(--vs-surface-2); border-top: 1px solid var(--vs-border); }

.vs-kpi { display: flex; align-items: center; gap: 14px; }
.vs-kpi > div { min-width: 0; }
.vs-kpi-icon {
    width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 25px; color: #fff;
}
.vs-kpi-label { font-size: 13px; color: var(--vs-text-2); font-weight: 500; }
.vs-kpi-value { white-space: nowrap; font-size: 24px; font-weight: 700; color: var(--vs-text); line-height: 1.2; letter-spacing: -.02em; }
.vs-kpi-foot { font-size: 12px; color: var(--vs-muted); }
.vs-up { color: #12a150 !important; font-weight: 600; }
.vs-down { color: var(--vs-coral-500) !important; font-weight: 600; }
.vs-bg-teal { background: var(--vs-teal-600); }
.vs-bg-navy { background: var(--vs-navy-700); }
.vs-bg-coral { background: var(--vs-coral-500); }
.vs-bg-amber { background: var(--vs-amber-500); }
.vs-bg-blue { background: var(--vs-blue-600); }

.vs-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 8px; }
.vs-card-head h5 { margin: 0; font-size: 15.5px; font-weight: 600; }
.vs-card-head a { font-size: 13px; font-weight: 500; }

/* ---------- Botoes ---------- */
.btn { border-radius: var(--vs-radius-sm); font-weight: 500; font-size: 13.5px; }
.btn-sm { border-radius: var(--vs-radius-sm); font-size: 12.5px; }
.btn-primary, .btn-info {
    background: var(--vs-teal-600) !important; border-color: var(--vs-teal-600) !important; color: #fff !important;
}
.btn-primary:hover, .btn-info:hover, .btn-primary:focus, .btn-info:focus { background: #287332 !important; border-color: #287332 !important; }
.btn-outline-primary, .btn-outline-info { color: var(--vs-teal-600) !important; border-color: var(--vs-teal-600) !important; }
.btn-outline-primary:hover, .btn-outline-info:hover { background: var(--vs-teal-600) !important; color: #fff !important; }
.btn-dark { background: var(--vs-navy-700); border-color: var(--vs-navy-700); }
.btn-light { background: var(--vs-surface-2); border-color: var(--vs-border); color: var(--vs-text); }

/* ---------- Formularios ---------- */
.form-label, label { font-weight: 500; color: var(--vs-text-2); font-size: 13px; margin-bottom: 6px; }
.form-control, .form-select {
    border-radius: var(--vs-radius-sm); border: 1px solid var(--vs-border); background-color: var(--vs-surface);
    color: var(--vs-text); min-height: 40px; font-size: 13.5px;
}
.form-control-sm, .form-select-sm { min-height: 34px; border-radius: var(--vs-radius-sm); font-size: 13px; }
textarea.form-control { min-height: 90px; }
.form-control:focus, .form-select:focus {
    border-color: var(--vs-teal-500); box-shadow: 0 0 0 3px rgba(52, 139, 60, .15);
}
.form-control::placeholder { color: #a0aab8; }
.form-control[readonly] { background-color: var(--vs-surface-2); }
.input-group-text { border-radius: var(--vs-radius-sm); background: var(--vs-surface-2); border-color: var(--vs-border); color: var(--vs-muted); }
.form-check-input:checked { background-color: var(--vs-teal-600); border-color: var(--vs-teal-600); }
label.vs-required::after, .vs-required > label::after { content: " *"; color: var(--vs-coral-500); }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--vs-coral-500); }

/* Secoes de formulario de cadastro */
.vs-form-section { padding: 4px 0 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--vs-border); }
.vs-form-section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.vs-form-section-title {
    display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600;
    color: var(--vs-text); margin-bottom: 14px;
}
.vs-form-section-title i {
    width: 32px; height: 32px; border-radius: var(--vs-radius-sm); background: var(--vs-teal-100); color: var(--vs-teal-600);
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
}
.vs-form-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 20px; margin: 0 -20px -20px; background: var(--vs-surface);
    border-top: 1px solid var(--vs-border); border-radius: 0 0 var(--vs-radius) var(--vs-radius);
}

/* ---------- Tabelas ---------- */
.table { color: var(--vs-text); --bs-table-bg: transparent; }
.table > :not(caption) > * > * { border-bottom-color: var(--vs-border); padding: .7rem .75rem; }
.table thead th, .table-light th, thead.table-light th, .table thead.table-dark th {
    background: var(--vs-surface-2) !important; color: var(--vs-text-2) !important;
    font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--vs-border) !important; white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { background: rgba(52, 139, 60, .05); }
.table-bordered > :not(caption) > * > * { border-color: var(--vs-border); }
.table-sm > :not(caption) > * > * { padding: .45rem .5rem; }
.table-responsive { border-radius: var(--vs-radius-sm); }

/* ---------- Badges / alertas / dropdowns ---------- */
.badge { font-weight: 600; border-radius: var(--vs-radius-sm); padding: .38em .6em; }
.badge.bg-primary, .badge.bg-info { background: var(--vs-teal-600) !important; }
.alert { border-radius: var(--vs-radius-sm); border: 0; }
.dropdown-menu {
    border-radius: var(--vs-radius-sm); border: 1px solid var(--vs-border); background: var(--vs-surface);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14); padding: 6px;
}
.dropdown-item { border-radius: var(--vs-radius-sm); padding: 8px 12px; font-size: 13.5px; color: var(--vs-text); }
.dropdown-item:hover { background: var(--vs-teal-100); color: var(--vs-text); }
.dropdown-header { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--vs-muted); }
.nav-tabs .nav-link.active, .nav-pills .nav-link.active { color: var(--vs-teal-600); }
.nav-pills .nav-link.active { background: var(--vs-teal-600); color: #fff; }
.page-link { color: var(--vs-teal-600); border-color: var(--vs-border); }
.page-item.active .page-link { background: var(--vs-teal-600); border-color: var(--vs-teal-600); }
.modal-content { border-radius: var(--vs-radius); border: 0; background: var(--vs-surface); }

/* ---------- Central de relatorios ---------- */
.vs-report-card {
    display: flex; gap: 14px; align-items: flex-start; height: 100%;
    padding: 16px; border-radius: var(--vs-radius-sm); border: 1px solid var(--vs-border); background: var(--vs-surface);
    color: var(--vs-text); transition: all .15s;
}
.vs-report-card:hover { border-color: var(--vs-teal-500); box-shadow: 0 8px 22px rgba(52, 139, 60, .12); transform: translateY(-1px); color: var(--vs-text); }
.vs-report-card i {
    width: 42px; height: 42px; flex: 0 0 42px; border-radius: var(--vs-radius-sm); font-size: 21px;
    display: inline-flex; align-items: center; justify-content: center; background: var(--vs-teal-100); color: var(--vs-teal-600);
}
.vs-report-card strong { display: block; font-size: 14px; font-weight: 600; }
.vs-report-card span { font-size: 12.5px; color: var(--vs-muted); }

/* Lista simples (lembretes / atividades) */
.vs-list { list-style: none; margin: 0; padding: 0; }
.vs-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--vs-border); }
.vs-list li:last-child { border-bottom: 0; }
.vs-list .vs-dot {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-size: 17px; background: var(--vs-teal-100); color: var(--vs-teal-600);
}
.vs-list .vs-title { font-weight: 600; font-size: 13.5px; color: var(--vs-text); }
.vs-list .vs-sub { font-size: 12px; color: var(--vs-muted); }

.vs-progress { height: 8px; border-radius: var(--vs-radius-sm); background: var(--vs-surface-2); overflow: hidden; }
.vs-progress > span { display: block; height: 100%; border-radius: var(--vs-radius-sm); background: var(--vs-teal-600); }

/* Pipeline (etapas) */
.vs-pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.vs-stage {
    color: #fff; padding: 10px 14px; border-radius: var(--vs-radius-sm); position: relative;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 10px 50%);
}
.vs-stage:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.vs-stage strong { display: block; font-size: 13px; }
.vs-stage span { display: block; font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Clean agricultural theme: shared geometry and restrained emphasis. */
.vs-brand { background: var(--vs-surface); color: var(--vs-text) !important; border-bottom: 1px solid var(--vs-border); }
.vs-brand small { color: var(--vs-muted); }
.vs-brand-mark { background: transparent; color: var(--vs-teal-600); }
.vs-icon-btn, .vs-kpi-icon, .vs-list .vs-dot { border-radius: var(--vs-radius-sm); }
#sidebar-menu ul li a { margin: 2px 0; border-radius: 0; padding-inline: 24px !important; font-weight: 400; }
#sidebar-menu ul li ul.sub-menu li a { margin-inline: 0; border-radius: 0; }
.vs-sidebar-footer { border-top: 1px solid rgba(255,255,255,.12); background: transparent; }
.vs-kpi-icon { background: var(--vs-surface-2); color: var(--vs-text-2); }
.badge.rounded-pill { border-radius: var(--vs-radius-sm) !important; }
.nav-pills .nav-link, .page-link, .nav-tabs .nav-link { border-radius: var(--vs-radius-sm) !important; }
.vs-report-card:hover { box-shadow: none; transform: none; background: var(--vs-surface-2); }
.vs-stage, .vs-stage:first-child { clip-path: none; }
.btn:focus-visible, a:focus-visible, .vs-icon-btn:focus-visible { outline: 2px solid var(--vs-teal-600); outline-offset: 3px; }
.dashboard-toolbar .form-text { color: var(--vs-muted); }
.mini-stats-wid .card-body > .d-flex { align-items: center; gap: 14px; }
.mini-stats-wid .flex-grow-1 { min-width: 0; }
.mini-stats-wid .mini-stat-icon { order: -1; flex-shrink: 0; }
.mini-stat-icon, .mini-stat-icon .avatar-title { border-radius: var(--vs-radius-sm) !important; background: var(--vs-surface-2) !important; color: var(--vs-text-2) !important; }
.mini-stat-icon i { color: var(--vs-text-2) !important; }
.mini-stats-wid .text-muted { margin-bottom: 6px; }
.mini-stats-wid .kpi-value { font-size: clamp(18px, 1.6vw, 24px); overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
    .page-title-box { flex-wrap: wrap; gap: 8px; }
    .vs-page-head h1, .page-title-box h4 { font-size: 20px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .vertical-menu, .main-content, #page-topbar, .vs-report-card, .vs-icon-btn { transition: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
    #page-topbar { left: 0 !important; }
    #page-topbar .navbar-brand-box { display: none; }
    .main-content { margin-left: 0 !important; }
    .footer { left: 0 !important; }
    .vertical-menu { display: flex !important; transform: translateX(-100%); transition: transform .2s ease; width: var(--vs-sidebar-w) !important; }
    body.sidebar-enable .vertical-menu { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    body.sidebar-enable::after {
        content: ""; position: fixed; inset: 0; background: rgba(11, 32, 51, .45); z-index: 1003;
    }
    .vs-search { max-width: none; }
    .vs-search kbd, .vs-user-text { display: none; }
    .page-content { padding: calc(var(--vs-topbar-h) + 16px) 12px 80px; }
    .vs-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .vs-hide-xs { display: none !important; }
}

/* ---------- Ajustes do tema escuro do template ---------- */
html[data-tema="dark"] .table { color: var(--vs-text); }
html[data-tema="dark"] .form-control, html[data-tema="dark"] .form-select { background-color: var(--vs-surface-2); }
html[data-tema="dark"] .bg-white, html[data-tema="dark"] .bg-light { background-color: var(--vs-surface) !important; }
.vs-page-head form .form-select, .vs-page-head form .form-control { width: auto; min-width: 170px; }
@media (max-width: 575.98px) { .vs-page-head form, .vs-page-head form .form-select { width: 100%; } }

/* Etiquetas de situacao */
.vs-badge { display: inline-block; padding: 3px 9px; border-radius: var(--vs-radius-sm); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.vs-badge-success { background: #dcfce7; color: #15803d; }
.vs-badge-danger { background: #fde8e3; color: #c2410c; }
.vs-badge-warning { background: #fef3c7; color: #a16207; }
.vs-badge-secondary { background: var(--vs-surface-2); color: var(--vs-text-2); border: 1px solid var(--vs-border); }
html[data-tema="dark"] .vs-badge-success { background: rgba(34,197,94,.15); color: #4ade80; }
html[data-tema="dark"] .vs-badge-danger { background: rgba(242,107,79,.15); color: #fb923c; }
html[data-tema="dark"] .vs-badge-warning { background: rgba(245,165,36,.15); color: #fbbf24; }
.vs-quick a.active { color: #fff !important; background: rgba(255, 255, 255, .08); }
#sidebar-menu ul li a.active { color: #fff !important; }

/* ---------- Impressao Universal (A4 / PDF) ---------- */
@media print {
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }

    :root, html, html[data-tema="dark"] {
        --vs-bg: #ffffff !important;
        --vs-surface: #ffffff !important;
        --vs-surface-2: #f7f9f7 !important;
        --vs-border: #cccccc !important;
        --vs-text: #000000 !important;
        --vs-text-2: #111111 !important;
        --vs-muted: #333333 !important;
        color: #000000 !important;
        background: #ffffff !important;
    }

    #page-topbar, .vertical-menu, .footer, .right-bar, .no-print, .vs-form-actions, 
    .vs-search, .vs-page-head, .vs-breadcrumb, .btn, .btn-group, .dropdown, .rightbar-overlay,
    .vs-quick, .vs-sidebar-footer, nav, .pagination, header {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html, body {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, -apple-system, sans-serif !important;
    }

    #layout-wrapper, .main-content, .page-content, .container-fluid {
        display: block !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        float: none !important;
    }

    .card, .card-body {
        display: block !important;
        position: static !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .table-responsive {
        display: block !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .table, .rel-table {
        width: 100% !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        color: #000000 !important;
    }

    .table th, .table td, .rel-table th, .rel-table td,
    .table *, .rel-table *, .rel-print-head, .rel-print-head * {
        color: #000000 !important;
    }

    .table th, .table td, .rel-table th, .rel-table td {
        background: transparent !important;
        border: 1px solid #c0c0c0 !important;
    }

    .table thead th, .rel-table thead th {
        background-color: #f0f0f0 !important;
        font-weight: 700 !important;
    }

    .table tfoot td, .rel-table tfoot td {
        background-color: #f0f0f0 !important;
        font-weight: 700 !important;
    }

    .badge, .vs-badge {
        border: 0 !important;
        padding: 0 !important;
        color: #000000 !important;
        background: none !important;
    }
}
