:root {
    --bg: #eef3f8;
    --bg-soft: #f7fafc;
    --panel: #ffffff;
    --panel-soft: #f8fbfd;
    --ink: #152033;
    --muted: #64748b;
    --line: #d8e1ea;
    --line-strong: #c7d3df;
    --primary: #1d5fd3;
    --primary-dark: #164da8;
    --green: #14744e;
    --teal: #0b766d;
    --amber: #a85d07;
    --red: #b42318;
    --shadow-sm: 0 8px 20px rgba(21, 32, 51, .06);
    --shadow-md: 0 18px 48px rgba(21, 32, 51, .1);
    --focus: 0 0 0 .2rem rgba(29, 95, 211, .16);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; background: radial-gradient(circle at top left, #f7fbff 0, var(--bg) 36%, #edf5f0 100%); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 0; box-shadow: var(--focus); }
.row > * { min-width: 0; }
.form-control, .form-select, .btn { min-width: 0; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 270px; max-width: calc(100vw - 22px); background: linear-gradient(180deg, #102033 0%, #0d1828 54%, #081321 100%); color: #fff; padding: 18px; position: fixed; inset: 0 auto 0 0; z-index: 1000; display: flex; flex-direction: column; border-right: 1px solid rgba(148, 163, 184, .16); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: .2px; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; display: inline-grid; place-items: center; background: linear-gradient(135deg, #7ddf9b, #22c55e); color: #052e16; font-weight: 900; box-shadow: 0 10px 24px rgba(34, 197, 94, .22); }
.sidebar .nav { display: flex; flex-flow: column nowrap; align-items: stretch; margin: 20px -6px 14px 0; padding-right: 6px; gap: 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #475569 transparent; }
.sidebar .nav-group, .sidebar .nav-group-items { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: 3px; }
.sidebar .nav-group-standalone + .nav-group-standalone { margin-top: -7px; }
.sidebar .nav-group-label { width: 100%; border: 0; background: transparent; padding: 0 12px 4px; color: #94a3b8; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.sidebar .nav-group-label:hover { color: #fff; }
.sidebar .nav-group-label i { font-size: .7rem; transition: transform .18s ease; }
.sidebar .nav-group.is-collapsed .nav-group-label i { transform: rotate(-90deg); }
.sidebar .nav-group.is-collapsed .nav-group-items { display: none; }
.sidebar .nav-link { width: 100%; color: #cbd5e1; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-weight: 650; border: 1px solid transparent; transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { background: rgba(30, 64, 104, .72); border-color: rgba(148, 163, 184, .16); color: #fff; }
.sidebar .nav-link.active { box-shadow: inset 3px 0 0 #7ddf9b; }
.sidebar .nav-link:hover { transform: translateX(2px); }
.sidebar .nav-link i { width: 20px; text-align: center; }
.sidebar-credit { margin-top: auto; padding: 14px 12px; border: 1px solid rgba(148, 163, 184, .22); border-radius: 8px; background: rgba(15, 23, 42, .5); color: #cbd5e1; font-size: .76rem; line-height: 1.35; }
.sidebar-credit strong, .sidebar-credit a { display: block; color: #fff; }
.sidebar-credit a { color: #86efac; font-weight: 700; }

.main { margin-left: 270px; flex: 1; min-width: 0; max-width: 100%; }
.topbar { min-height: 76px; background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 10px 24px; position: sticky; top: 0; z-index: 900; box-shadow: 0 8px 24px rgba(21, 32, 51, .04); backdrop-filter: blur(12px); }
.page-kicker { color: var(--muted); font-size: .78rem; text-transform: uppercase; font-weight: 700; }
.page-title { margin: 0; font-size: 1.35rem; font-weight: 850; letter-spacing: 0; }
.content { padding: 24px; min-width: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-header h2 { margin: 0; font-size: 1rem; font-weight: 850; color: #0f1f33; }
.summary-toggle { cursor: pointer; margin-bottom: 0; }
.summary-toggle h2 { display: flex; align-items: center; gap: 8px; }
.summary-toggle .btn { cursor: pointer; }
.summary-toggle-body { margin-top: 14px; }
.summary-toggle-body.collapsed { display: none; }
.summary-toggle-panel.expanded .toggle-icon { transform: rotate(90deg); }
.toggle-icon { transition: transform .16s ease; font-size: .9rem; }
.table { --bs-table-color: var(--ink); --bs-table-border-color: var(--line); margin-bottom: 0; }
.table thead th { background: #f2f6fa; color: #334155; font-size: .76rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; border-bottom: 1px solid var(--line-strong); }
.table tbody tr { transition: background-color .14s ease; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7fbff; }
.table tfoot th { border-top: 2px solid #cbd5e1; background: #f5f8fb; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive > .table { margin-bottom: 0; min-width: 720px; }
.table th, .table td { vertical-align: middle; overflow-wrap: anywhere; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; vertical-align: middle; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pagination-bar.top { margin: 0 0 12px; }
.back-to-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #14532d; color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(15, 23, 42, .22); z-index: 1200; opacity: .38; transform: translateY(0); transition: opacity .18s ease, transform .18s ease; }
.back-to-top.show { opacity: 1; transform: translateY(-2px); }
.back-to-top:hover { opacity: 1; }

.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.summary-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-card { display: flex; gap: 12px; align-items: center; background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-height: 92px; box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.summary-card:hover { border-color: var(--line-strong); box-shadow: 0 16px 36px rgba(21, 32, 51, .08); transform: translateY(-1px); }
.summary-icon { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; font-size: 1.25rem; background: #e9f2ff; color: var(--primary); flex: 0 0 auto; }
.summary-label { color: var(--muted); font-size: .8rem; font-weight: 700; }
.summary-value { font-size: 1.25rem; font-weight: 850; line-height: 1.15; overflow-wrap: anywhere; color: #0f172a; }
.summary-card.green .summary-icon { background: #dcfce7; color: var(--green); }
.summary-card.teal .summary-icon { background: #ccfbf1; color: var(--teal); }
.summary-card.amber .summary-icon { background: #fef3c7; color: var(--amber); }
.summary-card.red .summary-icon { background: #fee2e2; color: var(--red); }
.summary-card.blue .summary-icon { background: #dbeafe; color: var(--primary); }

.stacked-form { display: grid; gap: 12px; }
.modal-content.stacked-form { display: flex; gap: 0; }
.modal-body.stacked-form { display: grid; gap: 12px; overflow-y: auto; }
.modal-dialog-scrollable .modal-content { max-height: calc(100dvh - 24px); }
.stacked-form label { font-weight: 700; font-size: .86rem; color: #334155; }
.form-control, .form-select { border-color: #cbd5e1; border-radius: 8px; color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: var(--focus); }
.btn { border-radius: 8px; font-weight: 750; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); --bs-btn-active-bg: #123f89; --bs-btn-active-border-color: #123f89; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: #8fb2ee; --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); }
.btn-light { --bs-btn-bg: #f3f6fa; --bs-btn-border-color: #d8e1ea; --bs-btn-hover-bg: #e8eef5; --bs-btn-hover-border-color: #cbd5e1; }
.stacked-form .form-control, .stacked-form .form-select, .filter-bar .form-control, .filter-bar .form-select { border-color: #cbd5e1; border-radius: 8px; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; align-items: end; }
.filter-bar .btn { justify-self: start; white-space: nowrap; }
.approval-filter-bar { grid-template-columns: minmax(240px, 1fr) minmax(180px, auto) auto auto; align-items: center; }
.dashboard-filter { max-width: 560px; }
.reports-filter { grid-template-columns: 1.2fr 1.1fr 1fr .6fr 1fr .8fr .8fr auto; }
.reports-panel { padding-bottom: 14px; }
.reports-head { align-items: flex-start; }
.reports-filter-grid { display: grid; grid-template-columns: minmax(220px, 1.1fr) repeat(4, minmax(150px, 1fr)) auto; gap: 10px; align-items: end; }
.reports-filter-grid label { font-size: .8rem; font-weight: 700; color: #475569; }
.reports-filter-grid .form-control, .reports-filter-grid .form-select { margin-top: 4px; border-color: #cbd5e1; border-radius: 8px; }
.report-filter-report { grid-column: span 1; }
.report-filter-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.report-filter-field.is-hidden { display: none; }
.service-filter { grid-template-columns: 1.4fr .8fr .8fr .8fr 1fr auto; }
.cultivation-filter { grid-template-columns: minmax(120px, 160px) minmax(190px, .9fr) minmax(220px, 1fr) max-content; align-items: center; }
.cultivation-filter .btn { width: auto; justify-self: start; white-space: nowrap; }
.cultivation-filter #cultivationLiveTableMessage { grid-column: 1 / -1; margin-top: -6px; }
.linked-box { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px; background: #f8fafc; max-height: 190px; overflow: auto; }
.linked-box label { display: block; font-weight: 600; margin: 6px 0; }
.check-field { position: relative; }
.check-field .form-control { padding-right: 46px; }
.live-check { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e2e8f0; color: #475569; font-weight: 900; }
.live-check.ok { background: #dcfce7; color: #15803d; }
.live-check.bad { background: #fee2e2; color: #b91c1c; }
.check-field .form-control.is-valid { border-color: #16a34a; box-shadow: 0 0 0 .18rem rgba(22, 163, 74, .12); }
.check-field .form-control.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 .18rem rgba(220, 38, 38, .12); }
.cultivation-plr-message { line-height: 1.45; overflow-wrap: anywhere; }
.cultivation-invoice-line .form-control,
.cultivation-invoice-line .form-select { min-height: 42px; }
.cultivation-workspace { display: grid; gap: 14px; }
.cultivation-page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid #dbe7ef; border-radius: 8px; background: #f8fcfb; }
.cultivation-page-head h2, .cultivation-page-head h5 { margin: 0; font-weight: 850; }
.cultivation-page-head p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.cultivation-step { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.cultivation-step-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.cultivation-step-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cultivation-step-title i { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: #e0f2fe; color: #0369a1; flex: 0 0 auto; }
.cultivation-step-title strong { display: block; font-size: .96rem; }
.cultivation-step-title small { display: block; color: var(--muted); font-weight: 650; }
.cultivation-step-body { padding: 14px; }
.cultivation-summary-grid { display: grid; grid-template-columns: 1.4fr .85fr .75fr .85fr; gap: 10px; }
.cultivation-details-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cultivation-summary-item { border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: #fbfdff; min-height: 76px; }
.cultivation-summary-item small { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; }
.cultivation-summary-item strong, .cultivation-summary-item div { overflow-wrap: anywhere; }
.cultivation-summary-number { font-size: 1.12rem; font-weight: 850; }
.cultivation-saved-line { border: 1px solid #bfdbfe; border-left: 4px solid var(--primary); border-radius: 8px; background: #eff6ff; padding: 10px 12px; color: #1e3a8a; overflow-wrap: anywhere; }
.cultivation-empty-line { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 18px; background: #f8fafc; text-align: center; }
.cultivation-invoice-line { border: 1px solid #d8e2ee !important; border-left: 4px solid #0f766e !important; border-radius: 8px !important; background: #ffffff !important; padding: 14px !important; box-shadow: 0 8px 18px rgba(15, 23, 42, .035); }
.cultivation-line-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.cultivation-line-id { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 850; color: #0f172a; }
.cultivation-line-id i { color: var(--teal); }
.cultivation-total-card { border: 1px solid #bbf7d0; border-radius: 8px; background: #f0fdf4; padding: 14px; }
.cultivation-total-card small { color: #166534; font-weight: 800; text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; }
.cultivation-total-card strong { font-size: 1.2rem; }
.cultivation-modal .modal-content { border: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 24px 70px rgba(15, 23, 42, .22); }
.cultivation-modal .modal-header { background: #f8fafc; border-bottom-color: var(--line); }
.cultivation-modal .modal-footer { background: #fbfdff; border-top-color: var(--line); }
.cultivation-plr-modal .modal-body { background: #fbfdff; }
.cultivation-plr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cultivation-plr-stats label { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; }
.cultivation-plr-stats .form-control { border: 0; padding-left: 0; padding-right: 0; font-size: 1.05rem; font-weight: 850; background: transparent; box-shadow: none; }
.cultivation-modal-note { border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; padding: 10px 12px; color: #075985; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafc; }
.profile-grid span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.profile-grid strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.service-farmer-card { grid-template-columns: 1fr; }
.service-address-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafc; }
.service-address-box span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.service-address-box strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font-weight: 700; }

.duty-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.duty-card-grid.one-col { grid-template-columns: 1fr; }
.duty-card { border: 1px solid var(--line); border-left: 5px solid #dc2626; border-radius: 8px; padding: 14px; background: #fff; display: grid; gap: 10px; }
.duty-card.started { border-left-color: #d97706; }
.duty-card.completed { border-left-color: #16a34a; }
.duty-card.not-completed { border-left-color: #991b1b; }
.duty-card.tomorrow { border-left-color: var(--primary); background: #f8fbff; }
.duty-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.duty-card h3 { margin: 0; font-size: 1rem; font-weight: 850; }
.duty-card p { margin: 0; color: #334155; overflow-wrap: anywhere; }
.duty-card dl { display: grid; grid-template-columns: 110px 1fr; gap: 5px 8px; margin: 0; font-size: .88rem; }
.duty-card dt { color: var(--muted); font-weight: 800; }
.duty-card dd { margin: 0; overflow-wrap: anywhere; }
.duty-update-form { border-top: 1px dashed var(--line); padding-top: 10px; }
.memo-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.memo-form-grid .span-2 { grid-column: 1 / -1; }
.tomorrow-panel { border-top: 4px solid var(--primary); }
.gov-report-header { text-align: center; margin-bottom: 16px; }
.gov-report-header h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.gov-report-header h1 { margin: 6px 0 12px; font-size: 1.35rem; font-weight: 900; }
.report-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; text-align: left; border: 1px solid var(--line); padding: 10px; border-radius: 8px; }
.report-table { font-size: .86rem; }
.report-table th { background: #f1f5f9; vertical-align: middle; }
.report-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 70px; }
.report-signatures div { border-top: 1px solid #111827; padding-top: 8px; text-align: center; min-height: 48px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #eef8ff 0%, #e7f7f9 48%, #ddf8ed 100%); }
.login-shell { width: min(100%, 940px); min-height: 520px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid rgba(148, 163, 184, .35); border-radius: 8px; overflow: hidden; box-shadow: 0 26px 70px rgba(15, 23, 42, .16); }
.login-form-panel { display: grid; place-items: center; padding: 42px; background: #fff; }
.login-brand-panel { display: grid; place-items: center; align-content: center; gap: 16px; padding: 42px; background: #f4fbf7; border-right: 1px solid var(--line); text-align: center; }
.login-card { width: min(100%, 380px); }
.login-logo { display: block; width: min(330px, 88%); height: auto; }
.login-brand-copy h2 { margin: 0; color: #14532d; font-size: 2rem; font-weight: 900; letter-spacing: .3px; }
.login-brand-copy p { max-width: 330px; margin: 6px auto 0; color: var(--muted); font-weight: 700; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 48px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); min-width: 46px; height: 34px; border: 0; border-radius: 8px; background: #eef2ff; color: #1e293b; display: grid; place-items: center; font-size: .78rem; font-weight: 800; }
.login-credit { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .78rem; }
.login-credit strong { color: #14532d; }
.print-doc { background: #fff; }
.receipt { max-width: 820px; margin: 28px auto; padding: 28px; border: 1px solid var(--line); }
.receipt h1 { font-size: 1.4rem; text-align: center; }
.receipt h2 { font-size: 1.1rem; text-align: center; margin-bottom: 20px; }
.signature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; }
.signature-row div { border-top: 1px solid #111827; padding-top: 8px; text-align: center; }

@media (max-width: 1200px) {
    .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1400px) {
    .sidebar { width: 238px; padding: 14px; }
    .main { margin-left: 238px; }
    .sidebar .nav { gap: 10px; margin-top: 16px; }
    .sidebar .nav-link { padding: 8px 10px; gap: 10px; font-size: .92rem; }
    .sidebar-credit { padding: 10px; font-size: .72rem; }
    .content { padding: 18px; }
    .topbar { min-height: 66px; padding: 8px 18px; }
    .page-title { font-size: 1.16rem; }
    .summary-grid { gap: 10px; }
    .summary-card { min-height: 78px; padding: 12px; }
    .panel { padding: 16px; }
}
@media (max-width: 1180px) {
    .sidebar { width: 286px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 12px 0 40px rgba(15, 23, 42, .24); }
    .main { margin-left: 0; }
    #sidebarToggle { display: inline-flex !important; align-items: center; justify-content: center; }
    .content { padding: 16px; }
    .topbar { gap: 10px; }
    .topbar .ms-auto { display: none; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .service-filter, .reports-filter, .reports-filter-grid, .cultivation-filter { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .report-filter-report { grid-column: auto; }
    .report-filter-actions { justify-content: flex-start; }
    .cultivation-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .duty-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-brand-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px; }
    .login-form-panel { padding: 24px; }
    .login-logo { width: min(220px, 76%); }
    .summary-grid, .summary-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cultivation-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cultivation-plr-stats { grid-template-columns: 1fr; }
    .duty-card-grid, .memo-form-grid { grid-template-columns: 1fr; }
    .memo-form-grid .span-2 { grid-column: auto; }
    .reports-filter, .reports-filter-grid, .service-filter, .cultivation-filter, .filter-bar { grid-template-columns: 1fr; }
    .report-filter-report { grid-column: auto; }
    .report-filter-actions { justify-content: stretch; }
    .report-filter-actions .btn { flex: 1; }
    .cultivation-filter .btn { justify-self: stretch; width: 100%; }
}
@media (max-width: 576px) {
    .content { padding: 14px; }
    .login-page { padding: 14px; }
    .topbar { padding: 0 14px; gap: 10px; }
    .page-title { font-size: 1rem; }
    .summary-grid, .summary-grid.compact, .profile-grid, .cultivation-summary-grid { grid-template-columns: 1fr; }
    .cultivation-page-head, .cultivation-step-head, .cultivation-line-top { align-items: flex-start; flex-direction: column; }
    .cultivation-step-head .btn, .cultivation-page-head .btn, #saveInvoice { width: 100%; }
    .panel { padding: 14px; }
    .duty-card dl { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
    .topbar > div:not(.ms-auto) { min-width: 0; }
    .topbar .btn-outline-danger { padding-inline: 8px; }
    .table-actions, .panel-header { align-items: stretch; flex-direction: column; }
    .table-actions .btn, .filter-bar .btn, .report-filter-actions .btn { width: 100%; justify-content: center; }
    .summary-card { min-height: 72px; }
    .table-responsive > .table { min-width: 640px; }
    .modal-dialog { margin: 8px; }
}
@media print {
    .sidebar, .topbar, .no-print, .filter-bar, .btn { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .panel { box-shadow: none; border: 0; padding: 0; }
    body { background: #fff; }
    @page { size: A4 portrait; margin: 12mm; }
    .print-report { font-family: "Noto Sans Tamil", "Latha", "Arial Unicode MS", system-ui, sans-serif; }
    .report-meta { grid-template-columns: repeat(2, 1fr); border-radius: 0; }
    .report-signatures { break-inside: avoid; }
}
