@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    /* Tipografia padrao: todo texto do sistema deriva destes tokens. */
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fs-base: .875rem;
    --fs-grid: .8125rem;
    --fs-grid-head: .6875rem;
    --fs-label: .8125rem;
    --field-height: 36px;
    --grid-border: rgba(22, 63, 43, .09);
    --grid-head-bg: #f7f5ef;
    --grid-hover: rgba(111, 125, 60, .07);
    --coffee-green: #163f2b;
    --coffee-olive: #6f7d3c;
    --coffee-brown: #5a3825;
    --coffee-beige: #f4efe3;
    --coffee-gold: #c79b45;
    --coffee-white: #ffffff;
    --surface: #ffffff;
    --text: #253128;
    --muted: #6d756d;
}

[data-theme="dark"] {
    --surface: #18211c;
    --text: #f3f6ef;
    --muted: #c5cec0;
    --coffee-beige: #101712;
    --grid-border: rgba(255, 255, 255, .08);
    --grid-head-bg: #142019;
    --grid-hover: rgba(255, 255, 255, .05);
}

body {
    background: var(--coffee-beige);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
}

.auth-page {
    min-height: 100vh;
    background-image: linear-gradient(90deg, rgba(14, 31, 22, .82), rgba(14, 31, 22, .42)), var(--login-bg);
    background-size: cover;
    background-position: center;
}

.auth-card, .content-card, .metric-card {
    background: var(--surface);
    border: 1px solid rgba(22, 63, 43, .12);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(26, 38, 30, .08);
}

[data-theme="dark"] .content-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .topbar,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu {
    background: var(--surface);
    color: var(--text);
    border-color: rgba(255,255,255,.12);
}

[data-theme="dark"] .table,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .page-link {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    background-color: #111913;
    color: var(--text);
    border-color: rgba(255,255,255,.14);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--coffee-green), var(--coffee-olive));
}

.btn-coffee {
    --bs-btn-bg: var(--coffee-green);
    --bs-btn-border-color: var(--coffee-green);
    --bs-btn-hover-bg: #0f2d1f;
    --bs-btn-hover-border-color: #0f2d1f;
    color: #fff;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: #123120;
    color: #edf4ea;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    transition: width .2s ease, transform .2s ease;
    z-index: 1030;
}

.sidebar.collapsed { width: 82px; }
.sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-name, .sidebar.collapsed .module-title, .sidebar.collapsed .sidebar-parent-icon { display: none; }
.sidebar a { color: #edf4ea; text-decoration: none; }
.sidebar .nav-link { border-radius: 8px; padding: .72rem .85rem; margin: .12rem .75rem; }
.sidebar .nav-link.active, .sidebar .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .sidebar-parent {
    width: calc(100% - 1.5rem);
    color: #edf4ea;
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.sidebar .sidebar-parent-icon {
    font-size: .8rem;
    transition: transform .2s ease;
}
.sidebar .sidebar-parent[aria-expanded="true"] .sidebar-parent-icon {
    transform: rotate(180deg);
}
.sidebar .sidebar-submenu {
    margin: .15rem .75rem .35rem 1.25rem;
    padding-left: .35rem;
    border-left: 1px solid rgba(255,255,255,.16);
}
.sidebar .sidebar-submenu .nav-link {
    margin: .08rem 0;
    padding: .55rem .7rem;
    font-size: .92rem;
}
.sidebar.collapsed .sidebar-submenu {
    display: none;
}

.main {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    transition: margin-left .2s ease, width .2s ease;
}

.main.expanded {
    margin-left: 82px;
    width: calc(100% - 82px);
}

.topbar {
    min-height: 68px;
    background: var(--surface);
    border-bottom: 1px solid rgba(22, 63, 43, .1);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-content { padding: 1.25rem; }
.min-w-0 { min-width: 0; }
.topbar { gap: .75rem; }
.metric-card { padding: 1rem; }
.metric-icon { color: var(--coffee-gold); background: rgba(199, 155, 69, .14); width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; }
.badge-soft { background: rgba(111, 125, 60, .16); color: var(--coffee-green); }
.badge-status-active { background: rgba(22, 101, 52, .14); color: #166534; }
.badge-status-inactive { background: rgba(107, 114, 128, .18); color: #4b5563; }
[data-theme="dark"] .badge-status-active { color: #86efac; }
[data-theme="dark"] .badge-status-inactive { color: #d1d5db; }
.badge-state { font-weight: 600; }
.badge-state-success { background: rgba(22, 101, 52, .14); color: #166534; }
.badge-state-warning { background: rgba(199, 155, 69, .2); color: #7a5410; }
.badge-state-danger { background: rgba(180, 35, 24, .12); color: #9f1d14; }
.badge-state-info { background: rgba(37, 99, 235, .1); color: #1e4fb8; }
.badge-state-neutral { background: rgba(107, 114, 128, .16); color: #4b5563; }
[data-theme="dark"] .badge-state-success { color: #86efac; }
[data-theme="dark"] .badge-state-warning { color: #fcd34d; }
[data-theme="dark"] .badge-state-danger { color: #fca5a5; }
[data-theme="dark"] .badge-state-info { color: #93c5fd; }
[data-theme="dark"] .badge-state-neutral { color: #d1d5db; }
.footer { color: var(--muted); font-size: .8125rem; }

/* Selo de situação (StatusPresenter): cor e ícone pelo significado */
.status-badge {
    --status-bg: #f1f5f9;
    --status-color: #475569;
    --status-border: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    padding: .38rem .62rem;
    border: 1px solid var(--status-border);
    border-radius: 999px;
    background: var(--status-bg);
    color: var(--status-color);
    font-size: .75rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}
.status-badge .bi { font-size: .72rem; }
.status-success { --status-bg: #dcfce7; --status-color: #166534; --status-border: #bbf7d0; }
.status-danger { --status-bg: #fee2e2; --status-color: #b42318; --status-border: #fecaca; }
.status-warning { --status-bg: #fef3c7; --status-color: #92400e; --status-border: #fde68a; }
.status-info { --status-bg: #dbeafe; --status-color: #1d4ed8; --status-border: #bfdbfe; }
.status-progress { --status-bg: #ffedd5; --status-color: #c2410c; --status-border: #fed7aa; }
.status-purple { --status-bg: #ede9fe; --status-color: #6d28d9; --status-border: #ddd6fe; }
.status-neutral { --status-bg: #f1f5f9; --status-color: #475569; --status-border: #cbd5e1; }
[data-theme="dark"] .status-success { --status-bg: rgba(34,197,94,.17); --status-color: #86efac; --status-border: rgba(134,239,172,.3); }
[data-theme="dark"] .status-danger { --status-bg: rgba(239,68,68,.17); --status-color: #fca5a5; --status-border: rgba(252,165,165,.3); }
[data-theme="dark"] .status-warning { --status-bg: rgba(245,158,11,.18); --status-color: #fcd34d; --status-border: rgba(252,211,77,.3); }
[data-theme="dark"] .status-info { --status-bg: rgba(59,130,246,.18); --status-color: #93c5fd; --status-border: rgba(147,197,253,.3); }
[data-theme="dark"] .status-progress { --status-bg: rgba(249,115,22,.18); --status-color: #fdba74; --status-border: rgba(253,186,116,.3); }
[data-theme="dark"] .status-purple { --status-bg: rgba(139,92,246,.19); --status-color: #c4b5fd; --status-border: rgba(196,181,253,.3); }
[data-theme="dark"] .status-neutral { --status-bg: rgba(148,163,184,.14); --status-color: #cbd5e1; --status-border: rgba(203,213,225,.24); }
.admin-page-header .breadcrumb a { color: var(--coffee-olive); text-decoration: none; }

/* ===== Campos de formulario ===== */
.form-label { font-weight: 600; font-size: var(--fs-label); color: var(--text); margin-bottom: .3rem; }
.form-control, .form-select, .input-group-text { font-size: var(--fs-base); }
.form-control:not(textarea):not(.form-control-sm):not([type=file]), .form-select:not(.form-select-sm) { min-height: var(--field-height); }
.btn:not(.btn-sm):not(.btn-lg) { font-size: var(--fs-base); }
.form-text, .invalid-feedback { font-size: .75rem; }

/* ===== Painel de pesquisa (x-admin.filters) ===== */
.standard-filters .form-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 992px) { .standard-filters .col-lg-1 { min-width: 7rem; } }

/* ===== Grades (padrao unico) =====
   Wrapper: .grid-wrap (nunca .table-responsive: grades nao tem barra horizontal).
   Tabela:  .table.standard-grid (+ .grid-compact em grades de detalhe).
   Colunas: .col-code .col-date .col-num .col-status .col-truncate .actions-cell
   Prioridade de colunas pela LARGURA DA GRADE (container query, nao da janela, porque o menu
   lateral ocupa 82-280px): .col-hide-xl (<1100px) .col-hide-lg e .hide-mobile (<880px) .col-hide-md (<680px).
   Abaixo de 540px a grade vira lista empilhada (rotulo: valor). */
.grid-wrap { width: 100%; container: grid / inline-size; }
.content-card.grid-wrap { padding: 0; }
.standard-grid {
    width: 100%;
    margin-bottom: 0;
    font-size: var(--fs-grid);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--grid-border);
}
.standard-grid > thead > tr > th {
    background: var(--grid-head-bg);
    color: var(--muted);
    font-size: var(--fs-grid-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .6rem .75rem;
    vertical-align: bottom;
    border-bottom-width: 1px;
    overflow-wrap: normal;
    hyphens: manual;
}
.standard-grid > thead > tr > th.col-num { text-align: right; }
.standard-grid > thead > tr > th a { color: inherit; text-decoration: none; }
.standard-grid > tbody > tr > td,
.standard-grid > tfoot > tr > td,
.standard-grid > tfoot > tr > th { padding: .55rem .75rem; vertical-align: middle; overflow-wrap: break-word; }
.standard-grid > tbody > tr:last-child > td { border-bottom: 0; }
.standard-grid > tbody > tr:hover > * { --bs-table-bg-state: var(--grid-hover); }
.standard-grid > tbody > tr[data-row-href] { cursor: pointer; }
.standard-grid.grid-compact > thead > tr > th { padding: .45rem .6rem; }
.standard-grid.grid-compact > tbody > tr > td,
.standard-grid.grid-compact > tfoot > tr > * { padding: .4rem .6rem; }
.content-card.grid-wrap .standard-grid > * > tr > :first-child { padding-left: 1rem; }
.content-card.grid-wrap .standard-grid > * > tr > :last-child { padding-right: 1rem; }
.content-card.grid-wrap .standard-grid > thead > tr > th:first-child { border-top-left-radius: 8px; }
.content-card.grid-wrap .standard-grid > thead > tr > th:last-child { border-top-right-radius: 8px; }
.standard-grid .col-code, .standard-grid .col-date { white-space: nowrap; overflow-wrap: normal; }
.standard-grid .badge { white-space: normal; text-align: left; line-height: 1.25; }
.standard-grid .badge.badge-status-active, .standard-grid .badge.badge-status-inactive { white-space: nowrap; }
.standard-grid .col-num { text-align: right; white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.standard-grid .col-truncate, .text-truncate-cell { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.standard-grid .actions-cell { width: 1%; white-space: nowrap; text-align: right; overflow-wrap: normal; }
.standard-grid .badge { font-size: .72rem; font-weight: 600; }
.standard-grid .col-auto-hidden { display: none !important; }
.standard-grid.grid-squeeze > * > tr > * { white-space: normal !important; overflow-wrap: anywhere !important; }
.grid-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .75rem; font-size: .8125rem; color: var(--muted); }
.content-card.grid-wrap + .grid-footer, .content-card > .grid-footer { padding: .75rem 1rem; }
.pagination { --bs-pagination-color: var(--coffee-green); --bs-pagination-hover-color: var(--coffee-green); --bs-pagination-active-bg: var(--coffee-green); --bs-pagination-active-border-color: var(--coffee-green); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(22, 63, 43, .2); }

/* ===== Visual das grades do servidor: cabeçalho, zebra, ordenação no cabeçalho e paginação ===== */
.grid-enhanced {
    --grid-border: rgba(22, 101, 52, .13);
    --grid-head: #f4f8f4;
    --grid-stripe: rgba(47, 107, 79, .026);
    --grid-hover: rgba(47, 107, 79, .075);
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}
.grid-enhanced > thead > tr > th {
    position: relative;
    background: var(--grid-head);
    border-top: 1px solid var(--grid-border);
    border-bottom: 1px solid var(--grid-border);
    color: #294b3a;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .035em;
    padding: .72rem .62rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.grid-enhanced > thead > tr > th:first-child { border-left: 1px solid var(--grid-border); border-radius: 9px 0 0; }
.grid-enhanced > thead > tr > th:last-child { border-right: 1px solid var(--grid-border); border-radius: 0 9px 0 0; }
.grid-enhanced > tbody > tr:nth-child(even) > * { background-color: var(--grid-stripe); }
.grid-enhanced > tbody > tr > td {
    border-bottom-color: var(--grid-border);
    padding: .68rem .62rem;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.grid-enhanced > tbody > tr:hover > * {
    background-color: var(--grid-hover);
    box-shadow: inset 0 1px rgba(47, 107, 79, .03);
}
.grid-enhanced .grid-sortable {
    cursor: pointer;
    padding-right: 1.8rem;
    user-select: none;
}
.grid-enhanced .grid-sortable:hover,
.grid-enhanced .grid-sortable:focus-visible,
.grid-enhanced .grid-sortable.is-sorted {
    background: #e8f2ea;
    color: #14532d;
    outline: none;
}
.grid-sort-icon {
    font-size: .72rem;
    opacity: .38;
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
}
.grid-sortable.is-sorted .grid-sort-icon { color: #15803d; opacity: 1; }
.grid-pagination {
    align-items: center;
    border-top: 1px solid rgba(22, 101, 52, .1);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-top: .75rem;
    padding-top: .85rem;
}
.grid-pagination-summary,
.grid-page-size {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .78rem;
    gap: .55rem;
}
.grid-page-size .form-select { min-width: 78px; width: auto; }
.grid-pagination .page-link {
    border-color: rgba(22, 101, 52, .16);
    color: #285b43;
    min-width: 32px;
    text-align: center;
}
.grid-pagination .page-item.active .page-link {
    background: #216e4e;
    border-color: #216e4e;
    box-shadow: 0 4px 10px rgba(33, 110, 78, .2);
}
[data-theme="dark"] .grid-enhanced {
    --grid-border: rgba(148, 163, 184, .16);
    --grid-head: rgba(30, 41, 59, .82);
    --grid-stripe: rgba(148, 163, 184, .025);
    --grid-hover: rgba(34, 197, 94, .08);
}
[data-theme="dark"] .grid-enhanced > thead > tr > th { color: #d1fae5; }
[data-theme="dark"] .grid-enhanced .grid-sortable:hover,
[data-theme="dark"] .grid-enhanced .grid-sortable:focus-visible,
[data-theme="dark"] .grid-enhanced .grid-sortable.is-sorted { background: rgba(34, 197, 94, .12); color: #86efac; }
@media (max-width: 767.98px) {
    .grid-pagination { align-items: stretch; flex-direction: column; }
    .grid-pagination .pagination { justify-content: center; }
    .grid-pagination-summary { justify-content: space-between; }
}
.empty-state { color: var(--muted); }
.action-menu .dropdown-item { display: flex; align-items: center; gap: .5rem; }
.required-label::after { content: " *"; color: #b42318; }
.farm-map { min-height: 320px; width: 100%; }
.modal-backdrop.show { opacity: .55; }
.modal-content {
    background: #f6fbf7;
    border: 1px solid rgba(22, 101, 52, .16);
    border-radius: 8px;
    box-shadow: 0 22px 60px rgba(20, 40, 28, .22);
    overflow: hidden;
}
.modal-header {
    min-height: 56px;
    background: #fff;
    border-bottom: 1px solid rgba(22, 101, 52, .14);
    padding: .85rem 1rem;
}
.modal-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 800;
}
.modal-title::before {
    content: "✓";
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: #15955b;
    font-size: .82rem;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(21, 149, 91, .24);
}
.modal-body {
    background: #f6fbf7;
    padding: 1rem;
}
.modal-footer {
    background: #fff;
    border-top: 1px solid rgba(22, 101, 52, .12);
    padding: .85rem 1rem;
}
.modal .btn-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(22, 101, 52, .08);
    background-size: .75rem;
    opacity: .75;
}
.modal .btn-close:hover {
    background-color: rgba(22, 101, 52, .14);
    opacity: 1;
}
[data-theme="dark"] .modal-content {
    background: #132018;
    border-color: rgba(134, 239, 172, .16);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .46);
}
[data-theme="dark"] .modal-header {
    background: #101913;
    border-bottom-color: rgba(134, 239, 172, .14);
}
[data-theme="dark"] .modal-body {
    background: #132018;
}
[data-theme="dark"] .modal-footer {
    background: #101913;
    border-top-color: rgba(134, 239, 172, .12);
}
[data-theme="dark"] .modal .btn-close {
    filter: invert(1) grayscale(100%);
    background-color: rgba(255,255,255,.12);
}
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.68);
    display: grid;
    place-items: center;
    z-index: 2;
}
[data-theme="dark"] .loading-overlay { background: rgba(16, 23, 18, .72); }
.select2-container--default .select2-selection--single { min-height: 38px; border-color: #dee2e6; }
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-dropdown {
    background: #111913;
    color: var(--text);
    border-color: rgba(255,255,255,.14);
}

@container grid (max-width: 1100px) {
    .col-hide-xl { display: none; }
}
@container grid (max-width: 880px) {
    .col-hide-lg, .standard-grid .hide-mobile { display: none; }
}
@container grid (max-width: 680px) {
    .col-hide-md { display: none; }
}

/* Grade estreita (celular ou card pequeno): lista empilhada, sem barra horizontal. */
@container grid (max-width: 540px) {
    .standard-grid > thead { display: none; }
    .standard-grid, .standard-grid > tbody, .standard-grid > tbody > tr { display: block; width: 100%; }
    .standard-grid > tbody > tr { padding: .5rem 0; border-bottom: 1px solid var(--grid-border); }
    .standard-grid > tbody > tr:last-child { border-bottom: 0; }
    .standard-grid > tbody > tr > td {
        display: flex; justify-content: space-between; align-items: center; gap: .75rem;
        padding: .2rem .25rem !important; border: 0; text-align: right; white-space: normal;
    }
    .standard-grid > tbody > tr > td[data-label]::before {
        content: attr(data-label); flex: 0 0 auto; max-width: 45%;
        color: var(--muted); font-size: var(--fs-grid-head); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; text-align: left;
    }
    .standard-grid > tbody > tr > td.col-truncate { max-width: none; }
    .standard-grid > tbody > tr > td.actions-cell { width: 100%; justify-content: flex-end; }
    .standard-grid > tbody > tr > td.actions-cell::before { content: none; }
    .standard-grid > tbody > tr > td[colspan] { justify-content: center; text-align: center; }
    .standard-grid > tbody > tr > td:is(.col-hide-xl, .col-hide-lg, .col-hide-md, .hide-mobile) { display: none; }
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.mobile-open { transform: translateX(0); }
    .main, .main.expanded { margin-left: 0; width: 100%; }
}

@media (max-width: 767px) {
    .page-content { padding: .85rem; }
    .admin-page-header .btn { flex: 1 1 auto; }
    .hide-mobile { display: none; }
    .standard-grid .col-truncate, .text-truncate-cell { max-width: 160px; }
}

/* Pesquisa geral da barra superior */
.global-search { position: relative; width: clamp(220px, 28vw, 380px); }
.global-search .form-control { padding-left: 2.1rem; padding-right: 3.6rem; }
.global-search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.global-search-kbd { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); font-size: .6875rem; background: var(--coffee-beige); color: var(--muted); border: 1px solid var(--grid-border); pointer-events: none; }
.global-search .form-control:focus ~ .global-search-kbd { display: none; }
.global-search-results { width: max(100%, 420px); max-height: min(70vh, 520px); overflow-y: auto; right: 0; left: auto; top: calc(100% + 4px); }
.global-search-results .dropdown-item { font-size: var(--fs-grid); }
.global-search-results .dropdown-item.active, .global-search-results .dropdown-item:active { background: var(--coffee-green); color: #fff; }
.global-search-results .dropdown-item.active small { color: rgba(255, 255, 255, .75) !important; }
@media (max-width: 767.98px) {
    .global-search.is-open-mobile { display: block !important; position: fixed; top: 10px; left: 16px; right: 16px; width: auto; z-index: 1080; }
    .global-search.is-open-mobile .global-search-results { width: 100%; }
    .global-search-kbd { display: none; }
}

/* Sino de pendências */
.notification-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #b42318; color: #fff; font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center; }
.notifications-menu { width: 340px; max-width: calc(100vw - 32px); }
.notifications-menu .dropdown-item { font-size: var(--fs-grid); white-space: normal; }
.filter-count { font-size: .625rem; }

/* Avisos flutuantes e linhas navegáveis pelo teclado */
.toast-container { z-index: 1090; margin-top: 60px; }
.toast-body { font-size: var(--fs-base); }
.standard-grid tr[data-row-href]:focus-visible { outline: 2px solid var(--coffee-gold); outline-offset: -2px; }

/* Paginação no celular: só anterior, página atual e próxima */
@media (max-width: 540px) {
    .pagination .page-item:not(.active):not(:first-child):not(:last-child) { display: none; }
}
.is-invalid + .select2-container .select2-selection { border-color: var(--bs-form-invalid-border-color, #dc3545) !important; }

/* Filtro em tempo real: a grade fica esmaecida enquanto a nova lista é carregada */
.grid-loading > :not([data-filter-panel]) { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* Cartões de resumo (ex.: apontamento rápido da colheita) */
.harvest-summary .metric-card { display: flex; flex-direction: column; gap: .25rem; }
.metric-label { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.metric-label .bi { color: var(--coffee-gold); margin-right: .2rem; }
.metric-value { font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.metric-value small { font-size: .8rem; font-weight: 600; color: var(--muted); }
.metric-hint { color: var(--muted); font-size: .78rem; margin-top: auto; }
.harvest-summary .progress { height: 6px; }
.maturity-label { width: 5.6rem; font-size: .8rem; }

/* Ordem de colheita: resumo da programação, talhões e equipes */
.schedule-summary { border: 1px solid var(--grid-border); border-radius: 10px; padding: .85rem 1rem; background: var(--grid-head-bg); height: 100%; }
.schedule-summary-empty { color: var(--muted); font-size: .85rem; padding: .5rem 0; }
.schedule-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem 1rem; }
.schedule-summary-grid span { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.schedule-summary-grid strong { display: block; font-variant-numeric: tabular-nums; }
.schedule-summary-grid small { color: var(--muted); font-size: .75rem; }
.plot-rows-head { color: var(--muted); font-size: var(--fs-grid-head); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .35rem 0; border-bottom: 1px solid var(--grid-border); }
.plot-row { padding: .45rem 0; border-bottom: 1px solid var(--grid-border); }
.plot-rows-total { padding: .6rem 0 0; font-variant-numeric: tabular-nums; }
.team-option { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border: 1px solid var(--grid-border); border-radius: 8px; cursor: pointer; height: 100%; }
.team-option:has(input:checked) { border-color: var(--coffee-olive); background: rgba(111, 125, 60, .08); }

/* ===== Etapas do processo (x-admin.process-steps) ===== */
.process-steps { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process-step { flex: 1 1 0; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; min-width: 0; }
.process-step::before { content: ""; position: absolute; top: 17px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 3px; border-radius: 3px; background: var(--grid-border); }
.process-step:first-child::before { display: none; }
.process-step.is-done::before, .process-step.is-current::before, .process-step.is-warning::before, .process-step.is-cancelled::before { background: var(--coffee-olive); }
.process-step-marker { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; background: var(--surface); border: 2px solid var(--grid-border); color: var(--muted); }
.process-step.is-done .process-step-marker { background: var(--coffee-olive); border-color: var(--coffee-olive); color: #fff; }
.process-step.is-current .process-step-marker { background: var(--coffee-green); border-color: var(--coffee-green); color: #fff; box-shadow: 0 0 0 5px rgba(22, 63, 43, .14); }
.process-step.is-warning .process-step-marker { background: #f59e0b; border-color: #f59e0b; color: #fff; box-shadow: 0 0 0 5px rgba(245, 158, 11, .18); }
.process-step.is-cancelled .process-step-marker { background: #b42318; border-color: #b42318; color: #fff; }
.process-step-text strong { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.process-step.is-done .process-step-text strong { color: var(--text); }
.process-step.is-current .process-step-text strong, .process-step.is-warning .process-step-text strong { color: var(--text); font-weight: 700; }
.process-step-text small { display: block; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
    .process-steps { flex-direction: column; gap: .2rem; }
    .process-step { flex-direction: row; text-align: left; gap: .7rem; padding: .2rem 0; }
    .process-step::before { top: auto; bottom: calc(50% + 18px); left: 16px; right: auto; width: 3px; height: calc(100% - 20px); }
}
.process-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .85rem 1rem; border-radius: 10px; background: rgba(111, 125, 60, .08); border: 1px solid rgba(111, 125, 60, .22); }
.process-next.is-warning { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
.process-next.is-cancelled { background: rgba(180, 35, 24, .08); border-color: rgba(180, 35, 24, .3); }
.process-next-text small { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.process-next-text div { font-weight: 600; }
.process-next-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.process-next-actions form { display: inline-flex; gap: .4rem; margin: 0; }
.process-next-actions form .form-control { min-width: 180px; }

/* ===== Fluxo de volumes (previsto -> apontado -> consolidado -> enviado) ===== */
.volume-flow { display: flex; align-items: stretch; gap: .5rem; }
.volume-step { flex: 1 1 0; padding: 1rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.volume-step .progress { height: 6px; }
.volume-arrow { display: grid; place-items: center; color: var(--muted); }
@media (max-width: 991.98px) { .volume-flow { flex-wrap: wrap; } .volume-step { flex-basis: calc(50% - .5rem); } .volume-arrow { display: none; } }

/* ===== Dados resumidos com ícone ===== */
.order-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem 1.25rem; }
.order-facts > div { display: grid; grid-template-columns: 28px 1fr; column-gap: .5rem; align-items: start; }
.order-facts i { grid-row: span 3; color: var(--coffee-gold); font-size: 1.1rem; margin-top: .1rem; }
.order-facts span { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.order-facts strong { font-weight: 600; }
.order-facts small { color: var(--muted); font-size: .78rem; }
