:root {
    --bg-body: #f4f7f5;
    --bg-sidebar: #ffffff;
    --panel: #ffffff;
    --text-main: #14201a;
    --text-muted: #647067;
    --accent: #15803d;
    --accent-hover: #166534;
    --accent-soft: #ecfdf3;
    --line: #e2e8e4;
    --line-strong: #cbd5ce;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --warning: #d97706;
    --radius-sm: 9px;
    --radius-md: 13px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 12px 28px -20px rgba(15, 23, 42, 0.32);
    --shadow-lg: 0 24px 55px -25px rgba(15, 23, 42, 0.35);
    --transition: 180ms ease;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--text-main);
    background: var(--bg-body);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a, button { transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
img { max-width: 100%; }

.shell {
    display: grid;
    grid-template-columns: 278px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 240ms ease;
}

.shell.collapsed { grid-template-columns: 86px minmax(0, 1fr); }

.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden auto;
    padding: 18px 18px 28px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
}

.brand {
    display: flex;
    align-items: center;
    min-height: 82px;
    margin: 0 5px 20px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
}

.brand:hover { color: var(--text-main); }

.brand-logo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 82px;
    object-fit: contain;
    object-position: left center;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 16px 16px 16px 5px;
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #0f6a32);
    box-shadow: 0 16px 28px -18px rgba(21, 128, 61, 0.75);
    font-size: 15px;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.brand-mark-lg { width: 64px; height: 64px; flex-basis: 64px; border-radius: 21px 21px 21px 7px; font-size: 20px; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 20px; letter-spacing: -0.03em; }
.brand-copy small { margin-top: 5px; color: var(--text-muted); font-size: 11px; }

.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }

.nav-link, .nav-group summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 13px;
    border: 0;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 620;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link > i, .nav-group-main > i { flex: 0 0 auto; color: #47805b; font-size: 21px; }
.nav-link > span, .nav-group-main > span { overflow: hidden; text-overflow: ellipsis; }
.nav-link:focus, .nav-group summary:focus { outline: 0; }
.nav-link:focus-visible, .nav-group summary:focus-visible { color: var(--accent); background: #f6faf7; }
.nav-link:hover, .nav-link.active, .nav-group summary:hover, .nav-group[open] > summary { color: var(--accent); background: var(--accent-soft); }
.nav-link.active { box-shadow: none; }
.nav-link.disabled { cursor: default; opacity: 0.58; }
.nav-link.disabled:hover { color: var(--text-muted); background: transparent; }
.nav-link small { margin-left: auto; padding: 2px 6px; border-radius: 999px; background: #eef2ef; color: #78857b; font-size: 9px; font-weight: 700; }

.nav-group { display: grid; gap: 4px; }
.nav-group summary { justify-content: space-between; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-caret { flex: 0 0 auto; font-size: 13px; transition: transform var(--transition); }
.nav-group[open] .nav-caret { transform: rotate(180deg); }
.nav-submenu { display: grid; gap: 4px; padding-left: 17px; }
.nav-submenu .nav-link { min-height: 41px; padding-block: 8px; font-size: 13px; }
.nav-submenu .nav-link > i { font-size: 18px; }
.nav-section-label { margin: 18px 13px 5px; color: #9aa59d; font-size: 10px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }

.shell.collapsed .sidebar { padding-inline: 13px; }
.shell.collapsed .brand { justify-content: center; margin-inline: 0; }
.shell.collapsed .brand-logo { width: 54px; height: 54px; object-fit: cover; object-position: left center; }
.shell.collapsed .brand-copy,
.shell.collapsed .nav-link > span,
.shell.collapsed .nav-link > small,
.shell.collapsed .nav-group-main > span,
.shell.collapsed .nav-caret,
.shell.collapsed .nav-submenu,
.shell.collapsed .nav-section-label { display: none; }
.shell.collapsed .nav-link, .shell.collapsed .nav-group summary { justify-content: center; padding-inline: 10px; }
.shell.collapsed .nav-link.active { box-shadow: none; }

.main-wrapper { min-width: 0; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.topbar-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 12px; color: var(--text-muted); background: transparent; cursor: pointer; font-size: 22px; }
.icon-button:hover { color: var(--accent); background: var(--accent-soft); border-color: #cef1d8; }
.topbar-context { display: grid; min-width: 0; line-height: 1.25; }
.topbar-context strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-context span { margin-top: 4px; color: var(--text-muted); font-size: 11px; }

.profile-menu { position: relative; }
.profile-menu > summary { display: flex; align-items: center; gap: 10px; padding: 6px 9px; border-radius: 14px; cursor: pointer; list-style: none; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu > summary:hover, .profile-menu[open] > summary { background: #f5f8f6; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #16a34a, #047857); font-weight: 800; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-lg { width: 52px; height: 52px; flex-basis: 52px; border: 2px solid rgba(255,255,255,.55); }
.profile-copy { display: grid; min-width: 0; line-height: 1.25; }
.profile-copy strong { max-width: 180px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.profile-menu > summary > i { color: var(--text-muted); font-size: 12px; }

.profile-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 280px; overflow: hidden; padding: 7px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-lg); }
.profile-card { display: flex; align-items: center; gap: 13px; margin: -7px -7px 7px; padding: 20px; color: #fff; background: linear-gradient(135deg, #15803d, #047857); }
.profile-card > div { display: grid; line-height: 1.3; }
.profile-card small { margin-top: 4px; opacity: .8; }
.profile-dropdown a, .dropdown-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; color: var(--text-main); background: transparent; cursor: pointer; font-weight: 600; text-align: left; }
.profile-dropdown a:hover, .dropdown-action:hover { color: var(--accent); background: var(--accent-soft); }
.dropdown-action.danger { color: var(--danger); }
.dropdown-action.danger:hover { background: var(--danger-soft); }

.profile-dialog { width: min(460px, calc(100vw - 28px)); max-width: none; padding: 0; overflow: visible; border: 0; border-radius: var(--radius-lg); color: var(--text-main); background: transparent; box-shadow: var(--shadow-lg); }
.profile-dialog::backdrop { background: rgba(15, 23, 42, .52); backdrop-filter: blur(3px); }
.profile-dialog-card { overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius-lg); background: #fff; }
.profile-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 21px 22px 16px; border-bottom: 1px solid var(--line); }
.profile-dialog-header h2 { margin: 3px 0 0; font-size: 20px; }
.profile-dialog-header .icon-button { width: 35px; height: 35px; flex: 0 0 35px; font-size: 17px; }
.profile-dialog-body { display: grid; gap: 15px; padding: 21px 22px; }
.profile-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px 20px; border-top: 1px solid var(--line); background: #fbfdfb; }
.profile-form-message { padding: 10px 12px; border: 1px solid #fecaca; border-radius: 10px; color: #b91c1c; background: var(--danger-soft); font-size: 12px; font-weight: 650; }
.profile-form-message.success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.profile-avatar-editor { justify-items: center; }
.profile-avatar-preview { display: grid; place-items: center; width: 128px; height: 128px; overflow: hidden; border: 4px solid #fff; border-radius: 36px; color: #fff; background: linear-gradient(135deg, #16a34a, #047857); box-shadow: 0 12px 28px -18px rgba(21,128,61,.8); font-size: 42px; font-weight: 850; }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-input { width: 100%; }

.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-header h1 { margin: 3px 0 8px; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -0.04em; }
.page-header p { max-width: 760px; margin: 0; color: var(--text-muted); }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--text-muted); }
.date-chip { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); background: #fff; font-size: 12px; font-weight: 650; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card { position: relative; display: flex; align-items: flex-start; gap: 14px; min-width: 0; min-height: 142px; overflow: hidden; padding: 20px; border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius-lg); color: var(--text-main); background: linear-gradient(160deg, #fff, var(--metric-bg)); box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -48px; bottom: -64px; width: 140px; height: 140px; border-radius: 50%; background: var(--metric-bg); content: ""; }
.metric-card:hover { z-index: 1; color: var(--text-main); border-color: color-mix(in srgb, var(--metric-color) 25%, #fff); box-shadow: 0 22px 38px -29px var(--metric-color); transform: translateY(-3px); }
.metric-card.green { --metric-color: #15803d; --metric-bg: #eaf9ef; }
.metric-card.blue { --metric-color: #2563eb; --metric-bg: #edf4ff; }
.metric-card.amber { --metric-color: #b45309; --metric-bg: #fff7e6; }
.metric-card.violet { --metric-color: #7c3aed; --metric-bg: #f5efff; }
.metric-card.rose { --metric-color: #e11d48; --metric-bg: #fff0f3; }
.metric-card.cyan { --metric-color: #0e7490; --metric-bg: #eafafd; }
.metric-icon { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 45px; height: 45px; flex: 0 0 45px; border-radius: 15px; color: var(--metric-color); background: rgba(255,255,255,.72); box-shadow: inset 0 0 0 1px rgba(255,255,255,.9); font-size: 24px; }
.metric-copy { position: relative; z-index: 1; display: grid; min-width: 0; }
.metric-copy small { color: var(--metric-color); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.metric-copy strong { margin-top: 10px; font-size: 30px; line-height: 1; letter-spacing: -.05em; }
.metric-copy em { margin-top: 7px; color: var(--text-muted); font-size: 11px; font-style: normal; }

.panel { min-width: 0; padding: 23px; border: 1px solid rgba(226,232,228,.92); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-sm); }
.panel-narrow { max-width: 980px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.02em; }
.text-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 20px; }

.roadmap-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.roadmap-list li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 13px; }
.roadmap-list li.active { background: var(--accent-soft); }
.roadmap-list li > span { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px; flex: 0 0 31px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-muted); background: #fff; font-size: 12px; font-weight: 800; }
.roadmap-list li.done > span { color: #fff; border-color: var(--success); background: var(--success); }
.roadmap-list li.active > span { color: #fff; border-color: var(--accent); background: var(--accent); }
.roadmap-list li > div { display: grid; }
.roadmap-list strong { font-size: 13px; }
.roadmap-list small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.filter-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; flex: 1; }
.filter-field { display: grid; gap: 5px; min-width: 150px; }
.filter-field.grow { min-width: min(280px, 100%); flex: 1; }
.filter-field label { color: var(--text-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.filter-field input, .filter-field select { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fff; color: var(--text-main); }
.filter-field input:focus, .filter-field select:focus { border-color: #70c98c; box-shadow: 0 0 0 3px rgba(34,197,94,.11); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; padding: 9px 15px; border: 1px solid var(--accent); border-radius: 11px; color: #fff; background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 10px 18px -14px rgba(21,128,61,.8); cursor: pointer; font-weight: 700; }
.button:hover { color: #fff; background: linear-gradient(135deg, #15803d, #166534); transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button.subtle { color: var(--text-main); border-color: var(--line); background: #fff; box-shadow: none; }
.button.subtle:hover { color: var(--accent); border-color: #b9dfc4; background: var(--accent-soft); }
.button.danger { border-color: var(--danger); background: var(--danger); }
.button.danger:hover { background: #b91c1c; }
.button.small { min-height: 33px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }
.button.icon-only { width: 34px; padding-inline: 0; }
.button-block { width: 100%; min-height: 48px; }

.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--text-muted); background: #f8faf8; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
thead th:first-child { border-radius: 11px 0 0 11px; }
thead th:last-child { border-radius: 0 11px 11px 0; }
tbody tr:hover { background: #fbfdfb; }
tbody tr:last-child td { border-bottom: 0; }
td { font-size: 13px; }
td strong { color: var(--text-main); }
.cell-actions { display: flex; justify-content: flex-end; gap: 7px; min-width: 84px; }
.cell-muted { color: var(--text-muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; color: #475569; background: #f1f5f9; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; opacity: .7; }
.badge.success, .badge.active, .badge.approved, .badge.confirmed { color: #15803d; background: #ecfdf3; }
.badge.warning, .badge.preparing, .badge.planned, .badge.pending, .badge.draft { color: #b45309; background: #fff7e6; }
.badge.danger, .badge.inactive, .badge.closed, .badge.suspended, .badge.rejected, .badge.cancelled { color: #b91c1c; background: #fef2f2; }
.badge.info, .badge.cultivating, .badge.quarantined { color: #1d4ed8; background: #eff6ff; }

.empty-state { display: grid; place-items: center; min-height: 250px; padding: 32px; color: var(--text-muted); text-align: center; }
.empty-state.compact { min-height: 170px; }
.empty-state > i { color: #9fc9aa; font-size: 44px; }
.empty-state h3 { margin: 12px 0 4px; color: var(--text-main); }
.empty-state p { margin: 0; }

.form-layout { display: grid; gap: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-row { display: grid; align-content: start; gap: 7px; min-width: 0; }
.form-row label { color: #34423a; font-size: 12px; font-weight: 750; }
.form-span-2 { grid-column: 1 / -1; }
.required { margin-left: 3px; color: var(--danger); }
.form-control { width: 100%; min-height: 43px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; color: var(--text-main); background: #fff; }
textarea.form-control { min-height: 92px; resize: vertical; }
.form-control:focus { border-color: #5ac177; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.form-row.has-error .form-control { border-color: #ef4444; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--accent); }
.checkbox-row { display: flex; align-items: center; gap: 9px; min-height: 43px; cursor: pointer; }
.helptext { color: var(--text-muted); font-size: 10px; }
.errorlist { margin: 0; padding: 0; color: var(--danger); font-size: 11px; list-style: none; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.form-status { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 11px; color: #b91c1c; background: var(--danger-soft); font-size: 12px; }

.confirmation-panel { display: grid; place-items: center; padding-block: 38px; text-align: center; }
.confirmation-panel h2 { margin: 14px 0 0; }
.confirmation-panel p { color: var(--text-muted); }
.confirmation-icon { display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; border-radius: 22px; color: var(--danger); background: var(--danger-soft); font-size: 35px; }

.filter-checkbox { align-self: end; min-height: 40px; padding: 0 8px; white-space: nowrap; }
.document-panel { margin-bottom: 20px; }
.line-form-stack { display: grid; gap: 12px; margin-bottom: 20px; }
.line-form-card { position: relative; display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) minmax(110px, .55fr) minmax(130px, .7fr) minmax(160px, 1fr) auto; align-items: end; gap: 12px; padding: 17px 17px 17px 46px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfb; }
.line-number { position: absolute; top: 18px; left: 15px; display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 800; }
.line-delete { min-width: 90px; padding-bottom: 9px; }
.document-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); gap: 20px; margin-bottom: 20px; }
.section-gap { margin-top: 20px; }
.period-filter-panel { margin-bottom: 20px; }
.period-filter-panel .toolbar { margin-bottom: 0; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.detail-list > div { display: grid; gap: 5px; padding: 14px; background: #fff; }
.detail-list .detail-span-2 { grid-column: 1 / -1; }
.detail-list.single-column { grid-template-columns: 1fr; }
.detail-list span { color: var(--text-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.detail-list strong { font-size: 13px; }
.document-note { margin-top: 14px; padding: 13px; border-radius: 12px; color: var(--text-muted); background: #f8faf8; }
.action-panel h2 { margin: 6px 0 5px; }
.action-panel p { margin: 0 0 18px; color: var(--text-muted); font-size: 12px; }

.management-snapshot { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.management-snapshot article { display: grid; gap: 7px; min-width: 0; padding: 16px 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.management-snapshot article > span { color: var(--text-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.management-snapshot article > strong { min-height: 25px; font-size: 18px; }
.management-snapshot article > small { color: var(--text-muted); font-size: 10px; }
.area-snapshot { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.area-snapshot .snapshot-warning { border-color: #fecaca; background: #fff8f8; }
.area-snapshot .snapshot-warning > strong { color: var(--danger); }

.growing-area-map { position: relative; z-index: 1; width: 100%; height: min(68vh, 680px); min-height: 440px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #edf3ee; }
.growing-area-map.detail-map { height: 410px; min-height: 360px; }
.map-filter-panel .toolbar { margin-bottom: 16px; }
.map-notice { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 13px; border: 1px solid #fde68a; border-radius: 11px; color: #92400e; background: #fffbeb; font-size: 12px; }
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 13px; color: var(--text-muted); font-size: 11px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor; }
.map-dot.planned { color: #d97706; background: #d97706; }
.map-dot.cultivating { color: #15803d; background: #15803d; }
.map-dot.resting { color: #2563eb; background: #2563eb; }
.map-dot.suspended { color: #dc2626; background: #dc2626; }
.map-missing-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 9px; }
.map-missing-list a { display: grid; gap: 3px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-main); background: #fbfdfb; }
.map-missing-list a:hover { border-color: #9bd3ab; background: var(--accent-soft); }
.map-missing-list small { color: var(--text-muted); }
.map-load-error { display: grid; place-content: center; gap: 5px; height: 100%; padding: 24px; color: var(--text-muted); text-align: center; }
.map-load-error strong { color: var(--text-main); }
.map-empty-notice { padding: 9px 12px; border-radius: 9px; color: var(--text-main); background: rgba(255,255,255,.94); box-shadow: var(--shadow-md); font-size: 11px; font-weight: 700; }
.map-popup { display: grid; gap: 7px; min-width: 230px; color: var(--text-main); }
.map-popup > strong { font-size: 15px; }
.map-popup-code { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.map-popup dl { display: grid; gap: 4px; margin: 2px 0; }
.map-popup dl div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; }
.map-popup dt { color: var(--text-muted); font-size: 10px; }
.map-popup dd { margin: 0; font-size: 11px; font-weight: 650; }
.map-popup > a { margin-top: 3px; font-size: 11px; font-weight: 750; }
.map-coordinate { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--text-muted); font-size: 10px; }

.growing-area-detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 20px; align-items: start; }
.standard-card-list { display: grid; gap: 10px; }
.standard-card-list article { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfb; }
.standard-card-list article > i { flex: 0 0 auto; color: var(--accent); font-size: 27px; }
.standard-card-list article > div { display: grid; }
.standard-card-list small { color: var(--accent); font-size: 9px; font-weight: 800; }
.standard-card-list p { margin: 5px 0 0; color: var(--text-muted); font-size: 11px; }
.standard-management-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.standard-management-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; min-height: 195px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(150deg, #fff, #f7fcf8); }
.standard-management-card h2 { margin: 2px 0 6px; font-size: 18px; }
.standard-management-card p { margin: 0; color: var(--text-muted); font-size: 12px; }
.standard-card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 27px; }
.standard-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.standard-stats span { padding: 6px 9px; border-radius: 9px; color: var(--text-muted); background: #eef5f0; font-size: 10px; }
.standard-stats strong { color: var(--text-main); }
.rank-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 39px; height: 31px; padding-inline: 8px; border-radius: 10px; color: #6d28d9; background: #f3e8ff; font-size: 12px; font-weight: 850; }
.text-danger { color: var(--danger); }
.badge.performance-good { color: #15803d; background: #ecfdf3; }
.badge.performance-watch { color: #b45309; background: #fff7e6; }
.badge.performance-weak { color: #b91c1c; background: #fef2f2; }
.badge.performance-unrated { color: #64748b; background: #f1f5f9; }
.alert-summary-list { display: grid; gap: 8px; }
.alert-summary-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-main); background: #fbfdfb; }
.alert-summary-list a:hover { border-color: #9bd3ab; background: var(--accent-soft); }
.alert-summary-list span { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.alert-summary-list i { color: var(--warning); font-size: 19px; }
.alert-summary-list strong { min-width: 28px; color: var(--danger); font-size: 16px; text-align: right; }

/* POS bán lẻ: bố cục lấy cảm hứng từ iFShop, đồng bộ nhận diện VAP. */
.pos-page { margin: -8px; }
.pos-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.pos-toolbar h1 { margin: 3px 0 5px; font-size: 30px; letter-spacing: -.04em; }
.pos-toolbar p { margin: 0; color: var(--text-muted); }
.pos-shift-summary { display: flex; align-items: center; gap: 12px; }
.pos-shift-summary > span { display: grid; gap: 3px; min-width: 100px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pos-shift-summary small { color: var(--text-muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.pos-shift-summary strong { font-size: 13px; }
.csrf-token { display: none; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .72fr); gap: 18px; align-items: start; }
.pos-catalog, .pos-cart { min-height: calc(100vh - 190px); }
.pos-search { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 13px; background: #fff; }
.pos-search:focus-within { border-color: #5ac177; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.pos-search > i { color: var(--accent); font-size: 20px; }
.pos-search input { width: 100%; height: 46px; border: 0; outline: 0; color: var(--text-main); background: transparent; }
.pos-search span { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.pos-category-tabs { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 3px; scrollbar-width: thin; }
.pos-category-tabs button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pos-category-tabs button.active, .pos-category-tabs button:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.pos-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 11px; }
.pos-product-card { display: grid; overflow: hidden; min-height: 188px; padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--text-main); background: #fff; box-shadow: 0 8px 20px -20px #111; cursor: pointer; text-align: left; }
.pos-product-card:hover { border-color: #8fd1a2; box-shadow: 0 16px 25px -22px #166534; transform: translateY(-2px); }
.pos-product-card img, .pos-product-placeholder { width: 100%; height: 100px; object-fit: cover; }
.pos-product-placeholder { display: grid; place-items: center; color: #72b987; background: linear-gradient(145deg, #f0fdf4, #dcfce7); font-size: 42px; }
.pos-product-info { display: grid; align-content: start; gap: 4px; padding: 11px; }
.pos-product-info strong { min-height: 34px; overflow: hidden; font-size: 12px; line-height: 1.35; }
.pos-product-info small { overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-info b { margin-top: 3px; color: #dc2626; font-size: 13px; }
.pos-cart { position: sticky; top: 86px; display: flex; flex-direction: column; max-height: calc(100vh - 104px); }
.pos-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; margin-left: 4px; border-radius: 999px; color: #fff; background: var(--accent); font-size: 10px; vertical-align: middle; }
.pos-customer-row { display: grid; gap: 6px; margin-bottom: 12px; }
.pos-customer-row label { color: var(--text-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pos-cart-lines { min-height: 150px; overflow-y: auto; margin-inline: -8px; padding-inline: 8px; }
.pos-cart-line { display: grid; grid-template-columns: minmax(100px, 1fr) auto 88px 25px; align-items: center; gap: 9px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.pos-cart-line > div:first-child { display: grid; min-width: 0; }
.pos-cart-line > div:first-child strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pos-cart-line small { color: var(--text-muted); font-size: 9px; }
.pos-cart-line > b { font-size: 11px; text-align: right; }
.pos-quantity { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.pos-quantity button, .pos-remove { display: grid; place-items: center; width: 27px; height: 30px; border: 0; color: var(--text-main); background: #f8faf8; cursor: pointer; }
.pos-quantity button:hover { color: #fff; background: var(--accent); }
.pos-quantity input { width: 42px; height: 30px; border: 0; outline: 0; font-size: 10px; font-weight: 700; text-align: center; }
.pos-remove { width: 25px; color: var(--danger); background: transparent; }
.pos-payment { margin-top: auto; padding-top: 14px; border-top: 2px solid var(--line); }
.pos-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; font-size: 12px; }
.pos-total-row.grand { margin-top: 4px; padding-top: 9px; border-top: 1px dashed var(--line-strong); font-size: 16px; }
.pos-total-row.grand strong { color: #dc2626; font-size: 20px; }
.money-input { width: 125px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; text-align: right; }
.pos-payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 10px 0; }
.pos-payment-methods button { display: grid; place-items: center; gap: 3px; min-height: 52px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-muted); background: #fff; cursor: pointer; font-size: 9px; font-weight: 700; }
.pos-payment-methods button i { font-size: 19px; }
.pos-payment-methods button.active { color: var(--accent); border-color: #78c88f; background: var(--accent-soft); }
.pos-payment .form-row { margin-top: 9px; }
.pos-split-payments { display: grid; gap: 9px; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.pos-split-payments[hidden] { display: none; }
.pos-split-payments .form-row { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 7px; margin: 0; }
.pos-split-payments .form-row input + input { grid-column: 2; }
.pos-split-payments small { color: var(--text-muted); font-weight: 700; }
.pos-change { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; padding: 9px 11px; border-radius: 10px; color: #0f766e; background: #ecfdf5; font-size: 11px; }
.pos-checkout { font-size: 14px; }
.pos-success { display: grid; gap: 8px; margin-top: 10px; padding: 11px; border: 1px solid #bbf7d0; border-radius: 11px; color: #166534; background: #f0fdf4; font-size: 11px; text-align: center; }
.shift-metrics { grid-template-columns: repeat(2, minmax(220px, 1fr)); max-width: 980px; }
.commerce-metrics { margin-top: 3px; }
.household-metrics { grid-template-columns: repeat(3, minmax(190px, 1fr)); }
.tag-list { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.tag-list .badge { white-space: normal; text-align: left; }
.sale-return-line { grid-template-columns: minmax(240px, 1.6fr) minmax(100px, .5fr) minmax(130px, .7fr) minmax(180px, 1fr) auto; }
.badge.completed, .badge.returned { color: #15803d; background: #ecfdf3; }
.badge.allowed, .badge.compliant { color: #15803d; background: #ecfdf3; }
.badge.restricted { color: #b45309; background: #fff7e6; }
.badge.prohibited, .badge.violation { color: #b91c1c; background: #fef2f2; }
.badge.in, .badge.paid { color: #15803d; background: #ecfdf3; }
.badge.out, .badge.unpaid { color: #b91c1c; background: #fef2f2; }
.badge.partial, .badge.quality_pending { color: #b45309; background: #fff7e6; }
.badge.received, .badge.passed { color: #15803d; background: #ecfdf3; }
.badge.failed, .badge.quarantine { color: #b91c1c; background: #fef2f2; }
.badge.expiring, .badge.scheduled { color: #b45309; background: #fff7e6; }
.badge.expired, .badge.terminated { color: #b91c1c; background: #fef2f2; }
.timeline { position: relative; display: grid; gap: 13px; padding-left: 25px; }
.timeline::before { position: absolute; top: 5px; bottom: 5px; left: 8px; width: 2px; background: #d9e8dd; content: ""; }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; top: 16px; left: -23px; z-index: 1; width: 13px; height: 13px; border: 3px solid #fff; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px #bbf7d0; }
.timeline-dot.warning { background: #d97706; box-shadow: 0 0 0 2px #fde68a; }
.timeline-dot.violation { background: var(--danger); box-shadow: 0 0 0 2px #fecaca; }
.timeline-card { display: grid; gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfb; }
.timeline-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.timeline-card header > div { display: grid; gap: 3px; }
.timeline-card header small { color: var(--text-muted); font-size: 10px; }
.timeline-card p { margin: 0; font-size: 12px; }
.trace-code { display: flex; align-items: center; gap: 20px; }
.trace-code img { width: 150px; height: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; }
.trace-code > div { display: grid; gap: 5px; min-width: 0; }
.trace-code span { color: var(--text-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.trace-code strong { overflow-wrap: anywhere; }

.message-stack { display: grid; gap: 9px; margin-bottom: 18px; }
.message { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #bae6c5; border-radius: 12px; color: #166534; background: #f0fdf4; box-shadow: var(--shadow-sm); }
.message.error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.message.warning { color: #a16207; border-color: #fde68a; background: #fffbeb; }
.message span { flex: 1; font-size: 12px; font-weight: 600; }
.message button { display: inline-flex; border: 0; color: currentColor; background: transparent; cursor: pointer; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination a, .pagination > span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-muted); background: #fff; font-size: 12px; font-weight: 700; }
.pagination a:hover, .pagination span.active { color: #fff; border-color: var(--accent); background: var(--accent); }
.pagination span.disabled { opacity: .45; }
.pagination span.ellipsis { border-color: transparent; background: transparent; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; margin: -1px; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Nền sáng trung tính giúp nhận diện xanh của VAP luôn rõ nét. */
html:has(body.retail-login-body) { background: #f1f4f8; }
body.retail-login-body { min-height: 100vh; background: #f1f4f8; }
.retail-login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; overflow-x: hidden; padding: 24px 16px; background: radial-gradient(circle at 16% 14%, rgba(250,204,21,.18), transparent 29%), radial-gradient(circle at 86% 84%, rgba(14,116,144,.12), transparent 32%), linear-gradient(135deg, #f8fafc 0%, #edf1f6 56%, #fff7ed 100%); }
.retail-login-box { width: 100%; max-width: 400px; min-width: 0; margin: 0 auto; }
.retail-login-logo { display: flex; align-items: center; justify-content: center; max-width: 100%; margin-bottom: 16px; }
.retail-login-logo img { display: block; width: 100%; height: auto; max-height: 150px; object-fit: contain; }
.retail-login-card { overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.97); box-shadow: 0 15px 35px rgba(0,0,0,.3); }
.retail-login-card-body { padding: 30px 25px; }
.retail-login-card h1 { margin: 0 0 24px; color: #333; font-size: 16px; font-weight: 600; text-align: center; }
.retail-login-error { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #fca5a5; border-radius: 7px; color: #b91c1c; background: #fee2e2; font-size: 13px; }
.retail-login-field { margin-bottom: 16px; }
.retail-login-input-group { display: flex; min-width: 0; }
.retail-login-input-group .form-control { height: 45px; min-height: 45px; flex: 1 1 auto; min-width: 0; padding: 9px 12px; border: 2px solid #e0e0e0; border-right: 0; border-radius: 8px 0 0 8px; font-size: 15px; transition: border-color .3s ease, box-shadow .3s ease; }
.retail-login-input-group .form-control:focus { border-color: #22c55e; box-shadow: -3px 0 0 3px rgba(34,197,94,.12); }
.retail-login-input-addon { display: inline-flex; align-items: center; justify-content: center; width: 46px; flex: 0 0 46px; border: 2px solid #e0e0e0; border-left: 0; border-radius: 0 8px 8px 0; color: #64748b; background: transparent; font-size: 18px; }
button.retail-login-input-addon { padding: 0; cursor: pointer; }
.retail-login-input-group:focus-within .retail-login-input-addon { border-color: #22c55e; color: #15803d; box-shadow: 3px 0 0 3px rgba(34,197,94,.12); }
.retail-remember { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; margin: 2px 0 18px; color: #555; cursor: pointer; font-size: 14px; font-weight: 400; user-select: none; }
.retail-remember .form-check-input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: #22c55e; cursor: pointer; }
.retail-login-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 48px; padding: 12px 0; border: 0; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #22c55e, #15803d); box-shadow: none; cursor: pointer; font-size: 16px; font-weight: 700; transition: transform .3s ease, box-shadow .3s ease, background .3s ease; }
.retail-login-button:hover { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 5px 15px rgba(34,197,94,.35); transform: translateY(-2px); }
.retail-login-button:disabled { cursor: wait; opacity: .72; transform: none; }
.retail-login-field > label { display: block; margin: 0 0 7px; color: #334155; font-size: 13px; font-weight: 700; }
.retail-login-field > .form-control { width: 100%; min-height: 45px; padding: 9px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 15px; }
.retail-login-field > .form-control:focus { outline: 0; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.retail-login-help { margin: -14px 0 18px; color: #64748b; font-size: 13px; line-height: 1.55; text-align: center; }
.retail-login-link { display: block; margin-top: 18px; color: #15803d; font-size: 13px; font-weight: 700; text-align: center; }
.account-delete-warning { display: flex; gap: 9px; margin-bottom: 18px; padding: 12px; border: 1px solid #fed7aa; border-radius: 8px; color: #9a3412; background: #fff7ed; font-size: 12px; line-height: 1.5; }
.account-delete-warning i { margin-top: 2px; flex-shrink: 0; font-size: 18px; }
.account-delete-confirm { width: 100%; align-items: flex-start; line-height: 1.45; }
.account-delete-button { background: linear-gradient(135deg, #dc2626, #991b1b); }
.account-delete-button:hover { background: linear-gradient(135deg, #b91c1c, #7f1d1d); box-shadow: 0 5px 15px rgba(220,38,38,.28); }
.account-delete-success { color: #166534; text-align: center; }
.account-delete-success i { font-size: 48px; }
.account-delete-success h1 { margin: 8px 0 10px; color: #166534; }
.account-delete-success p { margin: 0; color: #475569; font-size: 13px; line-height: 1.6; }

.mobile-backdrop { display: none; }

@media (max-width: 1380px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
}

@media (max-width: 1020px) {
    .shell { grid-template-columns: 86px minmax(0, 1fr); }
    .sidebar { padding-inline: 13px; }
    .brand { justify-content: center; margin-inline: 0; }
    .brand-logo { width: 54px; height: 54px; object-fit: cover; object-position: left center; }
    .brand-copy, .nav-link > span, .nav-link > small, .nav-group-main > span, .nav-caret, .nav-submenu, .nav-section-label { display: none; }
    .nav-link, .nav-group summary { justify-content: center; padding-inline: 10px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .management-snapshot { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
    .area-snapshot { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
    .growing-area-detail-grid { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: static; max-height: none; }
    .pos-catalog, .pos-cart { min-height: 0; }
}

@media (max-width: 760px) {
    body.menu-open { overflow: hidden; }
    .shell, .shell.collapsed { display: block; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(285px, calc(100vw - 52px));
        padding: 18px;
        box-shadow: var(--shadow-lg);
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }
    .shell.mobile-nav-open .sidebar { transform: translateX(0); }
    .sidebar .brand { justify-content: flex-start; margin-inline: 5px; }
    .shell .sidebar .brand-logo { width: 100%; height: auto; max-height: 82px; object-fit: contain; object-position: left center; }
    .sidebar .brand-copy, .sidebar .nav-link > span, .sidebar .nav-link > small, .sidebar .nav-group-main > span, .sidebar .nav-caret, .sidebar .nav-section-label { display: initial; }
    .sidebar .nav-link, .sidebar .nav-group summary { justify-content: flex-start; padding-inline: 13px; }
    .sidebar .nav-submenu { display: grid; }
    .mobile-backdrop { position: fixed; inset: 0; z-index: 35; display: block; visibility: hidden; border: 0; background: rgba(15,23,42,.42); opacity: 0; pointer-events: none; transition: opacity 220ms ease, visibility 220ms ease; }
    .shell.mobile-nav-open .mobile-backdrop { visibility: visible; opacity: 1; pointer-events: auto; }
    .topbar { height: 66px; padding-inline: 15px; }
    .topbar-context span, .profile-copy, .profile-menu > summary > i { display: none; }
    .content { padding: 19px 14px 30px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .metric-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 11px; }
    .household-metrics { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    .metric-card { min-height: 125px; padding: 15px; }
    .metric-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 21px; }
    .metric-copy strong { font-size: 25px; }
    .panel { padding: 17px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .filter-form { align-items: stretch; }
    .filter-field, .filter-field.grow { min-width: calc(50% - 5px); }
    .form-grid { grid-template-columns: 1fr; }
    .form-span-2 { grid-column: auto; }
    .line-form-card { grid-template-columns: 1fr 1fr; }
    .document-detail-grid { grid-template-columns: 1fr; }
    .pos-page { margin: 0; }
    .pos-toolbar, .pos-shift-summary { align-items: stretch; flex-direction: column; }
    .pos-shift-summary { display: grid; grid-template-columns: 1fr 1fr; }
    .pos-shift-summary .button { grid-column: 1 / -1; }
    .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .sale-return-line { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .retail-login-page { padding: 20px 12px; }
    .retail-login-card-body { padding: 24px 18px; }
    .metric-grid { grid-template-columns: 1fr; }
    .household-metrics { grid-template-columns: 1fr; }
    .metric-card { min-height: 110px; }
    .filter-field, .filter-field.grow { min-width: 100%; }
    .filter-form .button { flex: 1; }
    .date-chip { display: none; }
    .cell-actions { justify-content: flex-start; }
    .line-form-card, .detail-list { grid-template-columns: 1fr; }
    .detail-list .detail-span-2 { grid-column: auto; }
    .management-snapshot { grid-template-columns: 1fr; }
    .area-snapshot { grid-template-columns: 1fr; }
    .growing-area-map { height: 58vh; min-height: 380px; }
    .standard-management-grid { grid-template-columns: 1fr; }
    .standard-management-card { grid-template-columns: auto minmax(0, 1fr); }
    .standard-management-card > .cell-actions { grid-column: 1 / -1; }
    .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .pos-product-card { min-height: 165px; }
    .pos-product-card img, .pos-product-placeholder { height: 82px; }
    .pos-cart-line { grid-template-columns: minmax(90px, 1fr) auto; }
    .pos-cart-line > b { text-align: left; }
    .shift-metrics { grid-template-columns: 1fr; }
}

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