
:root{
  --green-900:#173b2b;
  --green-800:#1e5139;
  --green-700:#2b6a49;
  --green-600:#3d815a;
  --green-100:#e9f4ec;
  --cream:#f7f5ef;
  --white:#ffffff;
  --ink:#1c2922;
  --muted:#6b776f;
  --line:#dce4de;
  --danger:#b94b48;
  --danger-bg:#fbeceb;
  --warn:#a77716;
  --warn-bg:#fff6dd;
  --success:#28734b;
  --success-bg:#eaf6ee;
  --shadow:0 12px 35px rgba(23,59,43,.08);
  --radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:Arial,Helvetica,sans-serif;
  line-height:1.55;
}
button,input,select,textarea{font:inherit}
a{text-decoration:none;color:inherit}
button{cursor:pointer}
.topbar{
  background:var(--white);
  border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:20;
}
.topbar-inner{
  max-width:1240px;margin:auto;padding:15px 24px;
  display:flex;align-items:center;justify-content:space-between;gap:20px;
}
.brand{display:flex;align-items:center;gap:12px;font-weight:800;color:var(--green-900)}
.brand-mark{
  width:40px;height:40px;border-radius:12px;background:var(--green-900);
  color:#fff;display:grid;place-items:center;font-size:20px;
}
.nav{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.nav a{padding:9px 12px;border-radius:10px;color:#516057;font-size:14px}
.nav a:hover,.nav a.active{background:var(--green-100);color:var(--green-900)}
.user-chip{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted)}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--green-100);display:grid;place-items:center;color:var(--green-900);font-weight:800}
.page{max-width:1240px;margin:auto;padding:34px 24px 60px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:25px}
.page-head h1{margin:0;font-size:31px;letter-spacing:-.5px}
.page-head p{margin:5px 0 0;color:var(--muted)}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.btn{
  border:0;border-radius:11px;padding:11px 16px;font-weight:700;
  background:var(--green-900);color:#fff;display:inline-flex;align-items:center;justify-content:center;gap:8px
}
.btn:hover{background:var(--green-800)}
.btn.secondary{background:#fff;color:var(--green-900);border:1px solid var(--line)}
.btn.danger{background:var(--danger)}
.btn.small{padding:8px 11px;font-size:13px}
.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:21px;
}
.card h2,.card h3{margin:0 0 7px;color:var(--green-900)}
.card p{color:var(--muted)}
.stat{padding:20px}
.stat .label{font-size:13px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.5px}
.stat .value{font-size:31px;font-weight:800;margin:5px 0;color:var(--green-900)}
.stat .meta{font-size:12px;color:var(--muted)}
.iconbox{width:42px;height:42px;border-radius:12px;background:var(--green-100);display:grid;place-items:center;color:var(--green-900);font-weight:800}
.stat-top{display:flex;justify-content:space-between;align-items:center}
.badge{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}
.badge.high{background:var(--danger-bg);color:var(--danger)}
.badge.moderate{background:var(--warn-bg);color:var(--warn)}
.badge.low,.badge.healthy{background:var(--success-bg);color:var(--success)}
.badge.fair{background:#fff6dd;color:#8a6815}
.badge.review{background:#eef2f5;color:#52616a}
.badge.verified{background:var(--success-bg);color:var(--success)}
.badge.resolved{background:#edf1f4;color:#52616a}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:13px 12px;border-bottom:1px solid var(--line);font-size:14px;white-space:nowrap}
th{font-size:12px;text-transform:uppercase;letter-spacing:.45px;color:var(--muted);background:#fbfcfb}
tr:hover td{background:#fbfdfb}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.field{display:flex;flex-direction:column;gap:7px}
.field.full{grid-column:1/-1}
.field label{font-size:13px;font-weight:800;color:var(--green-900)}
input,select,textarea{
  width:100%;padding:12px 13px;border:1px solid #ccd8d0;border-radius:11px;
  background:#fff;color:var(--ink);outline:none
}
input:focus,select:focus,textarea:focus{border-color:var(--green-600);box-shadow:0 0 0 3px rgba(61,129,90,.12)}
textarea{min-height:110px;resize:vertical}
.options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.option{
  border:1px solid var(--line);border-radius:12px;padding:11px 12px;
  background:#fff;display:flex;align-items:center;gap:8px
}
.option input{width:auto}
.notice{padding:14px 16px;border-radius:12px;border:1px solid var(--line);background:#f8fbf9;color:#506058}
.notice.warn{background:var(--warn-bg);border-color:#f0dfad}
.notice.danger{background:var(--danger-bg);border-color:#efc9c7}
.notice.success{background:var(--success-bg);border-color:#cbe7d4}
.kpi-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.bar-list{display:grid;gap:13px}
.bar-line{display:grid;grid-template-columns:110px 1fr 45px;align-items:center;gap:10px;font-size:13px}
.bar{height:10px;background:#edf1ee;border-radius:99px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--green-700);border-radius:99px}
.bar.red i{background:var(--danger)}
.bar.yellow i{background:#c59626}
.analytics-progress{display:block;width:100%;height:10px;border:0;border-radius:99px;background:#edf1ee;appearance:none;overflow:hidden}
.analytics-progress::-webkit-progress-bar{background:#edf1ee;border-radius:99px}
.analytics-progress::-webkit-progress-value{background:var(--green-700);border-radius:99px}
.analytics-progress::-moz-progress-bar{background:var(--green-700);border-radius:99px}
.analytics-progress.high::-webkit-progress-value,.analytics-progress.high::-moz-progress-bar{background:var(--danger)}
.analytics-progress.moderate::-webkit-progress-value,.analytics-progress.moderate::-moz-progress-bar{background:#c59626}

.incident-analytics-section{margin-top:18px}
.incident-analytics-heading{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:14px}
.incident-analytics-heading h2{margin:4px 0 0}
.incident-risk-filter{display:flex;align-items:center;gap:10px}
.incident-risk-filter label{font-size:13px;font-weight:700}
.incident-risk-filter select{min-width:170px}
.incident-graph-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.incident-graph-card h3{margin:0;font-size:18px}
.incident-graph-card>p{margin:4px 0 16px;color:var(--muted);font-size:13px}
.incident-graph-rows{display:grid;gap:12px}
.incident-graph-row{display:grid;grid-template-columns:minmax(90px,1fr) minmax(80px,2fr) 32px;align-items:center;gap:10px;font-size:13px}
.incident-graph-row span{overflow-wrap:anywhere}
.incident-graph-row progress{display:block;width:100%;height:11px;border:0;border-radius:99px;background:#edf1ee;appearance:none;overflow:hidden}
.incident-graph-row progress::-webkit-progress-bar{background:#edf1ee;border-radius:99px}
.incident-graph-row progress::-webkit-progress-value{background:var(--green-700);border-radius:99px}
.incident-graph-row progress::-moz-progress-bar{background:var(--green-700);border-radius:99px}
.incident-graph-row.risk-high progress::-webkit-progress-value,.incident-graph-row.risk-high progress::-moz-progress-bar{background:var(--danger)}
.incident-graph-row.risk-moderate progress::-webkit-progress-value,.incident-graph-row.risk-moderate progress::-moz-progress-bar{background:#c59626}
.incident-risk-legend{display:flex;gap:10px;margin:-6px 0 14px;font-size:12px}
.incident-risk-legend span:before{content:"";display:inline-block;width:9px;height:9px;margin-right:5px;border-radius:50%;background:var(--green-700)}
.incident-risk-legend .moderate:before{background:#c59626}
.incident-risk-legend .high:before{background:var(--danger)}
.incident-graphs-empty{margin-top:14px;color:var(--muted)}
.donut{
  width:150px;height:150px;border-radius:50%;
  background:conic-gradient(var(--danger) 0 20%, #c59626 20% 60%, #3d815a 60% 100%);
  position:relative;margin:auto
}
.donut:after{content:"";position:absolute;inset:31px;background:#fff;border-radius:50%}
.legend{display:grid;gap:8px;margin-top:16px}
.legend span{display:flex;align-items:center;justify-content:space-between;font-size:13px}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;margin-right:7px}
.timeline{position:relative;margin:15px 0 0 13px;padding-left:28px;border-left:2px solid #dbe6df}
.timeline-item{position:relative;padding:0 0 25px}
.timeline-item:before{content:"";position:absolute;left:-36px;top:4px;width:13px;height:13px;border-radius:50%;background:var(--green-700);border:4px solid var(--green-100)}
.timeline-item strong{color:var(--green-900)}
.timeline-item small{display:block;color:var(--muted);margin-bottom:4px}
.map{
  min-height:430px;border-radius:16px;position:relative;overflow:hidden;
  background:
    linear-gradient(30deg,transparent 46%,#dfe9e2 47%,#dfe9e2 48%,transparent 49%) 0 0/90px 90px,
    linear-gradient(-20deg,transparent 46%,#dfe9e2 47%,#dfe9e2 48%,transparent 49%) 0 0/120px 120px,
    #edf4ee;
}
.map:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 30% 35%,rgba(61,129,90,.12),transparent 22%),radial-gradient(circle at 75% 62%,rgba(61,129,90,.1),transparent 25%)}
.marker{position:absolute;z-index:2;transform:translate(-50%,-50%);text-align:center}
.marker-pin{width:25px;height:25px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);display:grid;place-items:center;box-shadow:0 5px 13px rgba(0,0,0,.16)}
.marker-pin span{transform:rotate(45deg);font-size:10px;color:#fff;font-weight:900}
.marker.high .marker-pin{background:var(--danger)}
.marker.moderate .marker-pin{background:#c59626}
.marker.low .marker-pin{background:var(--green-700)}
.marker label{background:#fff;padding:3px 7px;border-radius:8px;font-size:11px;font-weight:800;box-shadow:0 4px 12px rgba(0,0,0,.1);display:block;margin-top:4px}
.login-page{min-height:100vh;display:grid;place-items:center;background-color:#edf5ef;background-image:linear-gradient(rgba(18,47,36,.28),rgba(18,47,36,.28)),url("farm-gallery/rice-paddy.jpg");background-position:center;background-size:cover}
.login-card{width:min(460px,calc(100% - 32px));background:#fff;border:1px solid var(--line);border-radius:24px;padding:35px;box-shadow:0 25px 70px rgba(23,59,43,.12)}
.login-card .brand{justify-content:center;margin-bottom:24px}
.login-card h1{text-align:center;margin:0;color:var(--green-900)}
.login-card .subtitle{text-align:center;color:var(--muted);margin:5px 0 25px}
.login-form{display:grid;gap:16px}
.login-footer{text-align:center;margin-top:16px;font-size:13px;color:var(--muted)}
.result-hero{padding:27px;border-radius:18px;background:linear-gradient(135deg,#edf7ef,#fff);border:1px solid #cfe5d4}
.result-level{font-size:35px;font-weight:900;color:var(--green-900);margin:8px 0}
.rule-box{background:#f7faf8;border:1px dashed #b8cdbf;border-radius:14px;padding:16px;font-family:monospace;font-size:13px}
.report-sheet{background:#fff;border:1px solid var(--line);padding:36px;max-width:900px;margin:auto}
.report-header{display:flex;justify-content:space-between;border-bottom:2px solid var(--green-900);padding-bottom:15px;margin-bottom:20px}
.no-print{}
.footer-note{text-align:center;color:var(--muted);font-size:12px;margin-top:35px}
.empty{text-align:center;padding:35px;color:var(--muted)}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{background:var(--green-100);color:var(--green-900);border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}
@media(max-width:980px){
  .nav{display:none}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .page{padding:24px 15px 45px}
  .topbar-inner{padding:12px 15px}
  .user-chip span{display:none}
  .page-head{align-items:flex-start;flex-direction:column}
  .grid-2,.grid-3,.grid-4,.kpi-row,.form-grid{grid-template-columns:1fr}
  .options{grid-template-columns:1fr}
  .page-head h1{font-size:26px}
}
@media print{
  body{background:#fff}
  .topbar,.no-print,.footer-note{display:none!important}
  .page{padding:0;max-width:none}
  .card{box-shadow:none}
  .report-sheet{border:0;padding:0;max-width:none}
}

/* Real interactive map */
.map-card{overflow:hidden}
.real-map{height:560px;width:100%;border-radius:16px;overflow:hidden;z-index:1}
.map-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:2px 2px 16px}
.map-legend{display:flex;gap:16px;flex-wrap:wrap;align-items:center;font-size:13px;font-weight:700;color:var(--text-muted,#65756b)}
.map-legend span{display:inline-flex;align-items:center;gap:7px}
.legend-dot{display:inline-block;width:11px;height:11px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.2)}
.legend-dot.high{background:#c83c3c}.legend-dot.moderate{background:#c59626}.legend-dot.low{background:#3d815a}.legend-dot.none{background:#7a8981}
.map-note{font-size:12px;color:var(--text-muted,#65756b)}
.map-summary-grid{margin-top:18px}
.location-card{display:flex;flex-direction:column;gap:16px}
.location-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.location-card h2{margin:2px 0 0}
.location-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.location-stats div{padding:12px;border:1px solid var(--border,#e3e9e5);border-radius:12px;background:#fafcfb}
.location-stats strong{display:block;font-size:21px;line-height:1.1}
.location-stats span{display:block;margin-top:4px;font-size:11px;color:var(--text-muted,#65756b)}
.btn.small{padding:9px 12px;font-size:12px;align-self:flex-start}
.map-popup{min-width:210px;font-family:inherit}
.map-popup-title{font-size:18px;font-weight:800;margin-bottom:3px;color:#203129}
.map-popup-risk{font-size:12px;font-weight:800;margin-bottom:12px}
.map-popup-grid{display:grid;grid-template-columns:1fr auto;gap:6px 18px;font-size:12px}
.map-popup-grid span{color:#65756b}.map-popup-grid strong{color:#203129}
.map-popup-action{margin-top:13px;border:0;border-radius:9px;padding:8px 10px;background:#203129;color:#fff;font-weight:700;cursor:pointer;width:100%}
.map-popup-action:hover{opacity:.9}
.leaflet-container{font-family:inherit;background:#e8eee9}
.leaflet-control-attribution{font-size:10px}
@media(max-width:760px){.real-map{height:430px}.map-toolbar{align-items:flex-start}.map-note{width:100%}.location-stats{grid-template-columns:repeat(4,1fr)}.location-stats div{padding:9px 6px}.location-stats strong{font-size:17px}.location-stats span{font-size:10px}}
@media(max-width:520px){.location-stats{grid-template-columns:repeat(2,1fr)}}

/* =========================================================
   ROLE-SPECIFIC UI
   Admin = operational / data-center interface
   Farmer = field / personal portal interface
   ========================================================= */
.role-label{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap}.role-mark{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;font-size:10px}.admin-theme{--role:#203a5f;--role-soft:#eaf0f8}.admin-theme .topbar{background:#142b46;border-bottom-color:#274968}.admin-theme .brand,.admin-theme .nav a,.admin-theme .user-chip{color:#fff}.admin-theme .brand-mark{background:#fff;color:#142b46}.admin-theme .nav a.active{background:#2a5279;color:#fff}.admin-theme .role-label{color:#d8e6f5}.admin-theme .role-mark{background:#fff;color:#142b46}.admin-theme .user-chip .avatar{background:#dceaf7;color:#17334f}.farmer-theme{--role:#477a55;--role-soft:#edf7ee}.farmer-theme .topbar{background:#fbfaf5;border-bottom-color:#dfe7dd}.farmer-theme .role-label{color:#477a55}.farmer-theme .role-mark{background:#dfeee0;color:#386744}.farmer-theme .nav a.active{background:#e4f0e4;color:#2d603a}.farmer-theme .user-chip .avatar{background:#dfeee0;color:#386744}
.admin-hero{background:linear-gradient(120deg,#142b46,#244d70);border-radius:22px;padding:30px 32px;color:#fff;display:flex;justify-content:space-between;gap:24px;align-items:flex-end;margin-bottom:20px;box-shadow:0 18px 45px rgba(20,43,70,.18)}.admin-hero.compact{align-items:center}.admin-hero h1{margin:5px 0 8px;color:#fff;font-size:31px}.admin-hero p{margin:0;color:#d9e6f2;max-width:680px}.eyebrow{font-size:10px;font-weight:900;letter-spacing:.14em;color:#7895af}.admin-hero .eyebrow{color:#b8cee1}.admin-hero-actions{display:flex;gap:9px;flex-wrap:wrap}.admin-btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:11px 15px;background:#fff;color:#193550;font-weight:850;text-decoration:none;cursor:pointer}.admin-btn.ghost{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.35)}.admin-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.admin-kpi{background:#fff;border:1px solid #dfe7ee;border-radius:15px;padding:18px;box-shadow:0 8px 25px rgba(25,51,75,.06);position:relative;overflow:hidden}.admin-kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#3c6f9d}.admin-kpi.danger:before{background:#c83c3c}.admin-kpi.success:before{background:#3d815a}.admin-kpi span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#6d7c88;font-weight:850}.admin-kpi strong{display:block;font-size:30px;color:#193550;margin:5px 0}.admin-kpi small{color:#7b8790}.admin-dashboard-grid{display:grid;grid-template-columns:1.4fr .8fr;gap:20px;margin-top:20px}.admin-panel{background:#fff;border:1px solid #dfe7ee;border-radius:17px;padding:20px;box-shadow:0 8px 25px rgba(25,51,75,.055)}.panel-title{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:18px}.panel-title h2{margin:4px 0 0;color:#193550}.panel-title a{font-size:12px;font-weight:850;color:#315f86;text-decoration:none}.admin-risk-list{display:grid;gap:15px}.admin-risk-row{display:grid;grid-template-columns:115px 1fr 35px;align-items:center;gap:12px}.admin-risk-row>div:first-child{display:flex;align-items:center;gap:7px}.risk-dot{width:9px;height:9px;border-radius:50%}.risk-dot.high{background:#c83c3c}.risk-dot.moderate{background:#c59626}.risk-dot.low{background:#3d815a}.risk-track{height:9px;background:#edf1f4;border-radius:20px;overflow:hidden}.risk-track i{display:block;height:100%;border-radius:20px}.risk-track i.high{background:#c83c3c}.risk-track i.moderate{background:#c59626}.risk-track i.low{background:#3d815a}.admin-risk-row b{font-size:12px;text-align:right}.admin-callout{margin-top:20px;padding:14px;background:#f1f5f8;border-left:4px solid #3c6f9d;border-radius:9px;display:flex;gap:12px;flex-direction:column}.admin-callout strong{font-size:12px;text-transform:uppercase;letter-spacing:.07em;color:#315f86}.admin-callout span{font-size:13px;color:#52626e}.admin-quick{display:grid;gap:9px}.admin-quick .panel-title{margin-bottom:3px}.admin-quick>a{border:1px solid #e3e9ee;border-radius:12px;padding:13px;text-decoration:none;display:flex;flex-direction:column;gap:3px;transition:.15s}.admin-quick>a:hover{background:#f6f9fb;border-color:#cddae5}.admin-quick b{color:#193550}.admin-quick span{font-size:12px;color:#71808b}.admin-form{display:grid;gap:18px}.admin-form-intro{display:grid;grid-template-columns:auto 1fr auto 1fr;gap:10px 12px;align-items:center;background:#eef4f8;border:1px solid #dce6ee;border-radius:15px;padding:14px 16px;margin-bottom:18px}.admin-form-intro>span{width:31px;height:31px;border-radius:9px;background:#193550;color:#fff;display:grid;place-items:center;font-size:11px;font-weight:900}.admin-form-intro b,.admin-form-intro small{display:block}.admin-form-intro b{font-size:12px;color:#193550}.admin-form-intro small{font-size:11px;color:#6b7983;margin-top:2px}.admin-choice-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.admin-choice-grid label{position:relative}.admin-choice-grid input{position:absolute;opacity:0}.admin-choice-grid span{display:block;border:1px solid #dce4ea;background:#fbfcfd;border-radius:10px;padding:11px;text-align:center;font-size:12px;font-weight:750;color:#52626e;cursor:pointer}.admin-choice-grid input:checked+span{background:#eaf1f7;border-color:#47759b;color:#193550;box-shadow:0 0 0 2px #d4e3ee}.admin-choice-grid.symptoms{grid-template-columns:repeat(3,1fr)}.admin-table th{background:#f3f6f8;color:#64737e}.admin-table tr:hover td{background:#f8fafb}
.farmer-welcome{background:linear-gradient(135deg,#eff8ed,#fdfaf0);border:1px solid #dce8d9;border-radius:24px;padding:27px 29px;display:flex;justify-content:space-between;gap:20px;align-items:center}.farmer-kicker{display:block;font-size:10px;letter-spacing:.14em;font-weight:900;color:#58805f}.farmer-welcome h1{font-size:34px;margin:5px 0;color:#294b32}.farmer-welcome p{margin:0;color:#66746a;max-width:650px}.farmer-season{background:#fff;border:1px solid #e1e8dc;border-radius:14px;padding:13px 17px;min-width:135px}.farmer-season span,.farmer-season strong{display:block}.farmer-season span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#879388}.farmer-season strong{margin-top:3px;color:#365f3e}.farmer-actions{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:13px;margin:18px 0}.farmer-primary,.farmer-action{display:flex;gap:13px;align-items:center;text-decoration:none;border-radius:16px;padding:16px 18px}.farmer-primary{background:#477a55;color:#fff;box-shadow:0 12px 28px rgba(71,122,85,.18)}.farmer-action{background:#fff;border:1px solid #dfe8dd;color:#294b32}.farmer-primary>span,.farmer-action>span{font-size:24px}.farmer-primary b,.farmer-primary small,.farmer-action b,.farmer-action small{display:block}.farmer-primary small{color:#dcecdf}.farmer-action small{color:#7b877e;margin-top:2px}.farmer-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.farmer-stats>div{background:#fff;border:1px solid #e0e8de;border-radius:15px;padding:16px}.farmer-stats span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:850;color:#7b887e}.farmer-stats strong{display:block;font-size:27px;color:#294b32;margin:4px 0}.farmer-stats small{color:#7b877e}.farmer-stats .attention{background:#fffaf0;border-color:#eee0bb}.farmer-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:20px;margin-top:20px}.farmer-panel{background:#fff;border:1px solid #e0e8de;border-radius:17px;padding:20px}.farmer-panel-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:16px}.farmer-panel-head h2{margin:4px 0 0;color:#294b32}.farmer-panel-head>a{font-size:12px;font-weight:850;color:#477a55;text-decoration:none}.farm-cards{display:grid;gap:9px}.farm-card{display:flex;gap:12px;align-items:center;padding:12px;border:1px solid #e4ebe2;border-radius:12px;background:#fbfdfb}.farm-crop-icon{width:38px;height:38px;border-radius:11px;background:#e7f2e5;display:grid;place-items:center}.farm-card b,.farm-card span,.farm-card small{display:block}.farm-card b{color:#365f3e}.farm-card span{font-size:12px;color:#68756b;margin-top:2px}.farm-card small{font-size:11px;color:#8a948b;margin-top:3px}.advisory-mini-list{display:grid;gap:11px}.advisory-mini-list>div{border-left:3px solid #80a783;padding-left:11px}.advisory-mini-list b,.advisory-mini-list small{display:block}.advisory-mini-list b{color:#365f3e;font-size:13px;margin-top:4px}.advisory-mini-list small{color:#7b877e;font-size:11px;margin-top:3px}.advisory-pill{display:inline-block;border-radius:999px;padding:4px 7px;font-size:9px;text-transform:uppercase;font-weight:900}.advisory-pill.high{background:#fbe5e3;color:#a83732}.advisory-pill.moderate{background:#fff1cc;color:#8b6815}.advisory-pill.low{background:#e4f2e5;color:#3e7048}.farmer-table th{background:#f5f8f3;color:#748077}.farmer-empty{padding:22px;text-align:center;background:#f8faf7;border-radius:11px;color:#7b877e;font-size:13px}.farmer-page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:18px}.farmer-page-heading h1{font-size:31px;margin:5px 0;color:#294b32}.farmer-page-heading p{margin:0;color:#718076;max-width:650px}.farmer-step{padding:10px 13px;border:1px solid #dfe8dd;border-radius:12px;background:#fff;color:#829084;font-size:10px;font-weight:900;letter-spacing:.1em}.farmer-step strong{color:#477a55;font-size:16px}.farmer-assessment{display:grid;gap:15px}.farmer-form-card{background:#fff;border:1px solid #dfe8dd;border-radius:18px;padding:22px;display:grid;grid-template-columns:46px 1fr;gap:18px}.form-number{width:38px;height:38px;border-radius:12px;background:#e6f1e5;color:#477a55;display:grid;place-items:center;font-size:12px;font-weight:900}.farmer-form-content h2{margin:5px 0 18px;color:#294b32}.farmer-choice-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.farmer-choice-grid label{position:relative}.farmer-choice-grid input{position:absolute;opacity:0}.farmer-choice-grid span{display:block;border:1px solid #dfe8dd;border-radius:11px;padding:11px;text-align:center;font-size:12px;font-weight:750;color:#657268;background:#fbfdfb;cursor:pointer}.farmer-choice-grid input:checked+span{background:#e7f2e5;border-color:#75a17b;color:#365f3e;box-shadow:0 0 0 2px #d6e7d5}.farmer-choice-grid.symptoms{grid-template-columns:repeat(3,1fr)}.farmer-help{margin-top:17px;padding:12px 14px;border-radius:10px;background:#f7faf5;color:#738076;font-size:11px;line-height:1.5}.farmer-submit-row{display:flex;justify-content:flex-end;gap:10px}.farmer-primary.submit{border:0;font:inherit;cursor:pointer}.farmer-cancel{padding:12px 15px;color:#68766c;text-decoration:none;font-weight:750}.farmer-theme .card{box-shadow:0 8px 25px rgba(60,92,64,.045)}
@media(max-width:980px){.role-label{display:none}.admin-kpis,.farmer-stats{grid-template-columns:1fr 1fr}.admin-dashboard-grid,.farmer-grid{grid-template-columns:1fr}.farmer-actions{grid-template-columns:1fr}.admin-choice-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:650px){.admin-hero,.farmer-welcome{flex-direction:column;align-items:flex-start}.admin-kpis,.farmer-stats{grid-template-columns:1fr}.admin-form-intro{grid-template-columns:auto 1fr}.admin-choice-grid,.admin-choice-grid.symptoms,.farmer-choice-grid,.farmer-choice-grid.symptoms{grid-template-columns:1fr 1fr}.farmer-form-card{grid-template-columns:1fr}.farmer-page-heading{align-items:flex-start;flex-direction:column}}
@media(max-width:700px){.incident-analytics-heading{align-items:stretch;flex-direction:column}.incident-risk-filter{align-items:flex-start;flex-direction:column}.incident-risk-filter select{width:100%}.incident-graph-grid{grid-template-columns:1fr}}

/* Final navigation cleanup: keep every desktop panel on one top row. */
.topbar-inner{max-width:1500px;padding:12px 22px;gap:12px}
.nav{flex:1 1 auto;flex-wrap:nowrap;gap:2px;justify-content:center;min-width:0;white-space:nowrap}
.nav a{padding:9px 10px;font-size:13px;white-space:nowrap}
.role-label{flex:0 0 auto}
.user-chip{flex:0 0 auto;white-space:nowrap}

/* Farmer farm directory */
.farm-profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.farm-profile-card{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid #dfe8dd;border-radius:18px;padding:18px;text-decoration:none;box-shadow:0 8px 25px rgba(60,92,64,.045);transition:.15s ease}
.farm-profile-card:hover{transform:translateY(-2px);border-color:#b8d1bb;box-shadow:0 13px 30px rgba(60,92,64,.09)}
.farm-profile-icon{width:48px;height:48px;border-radius:14px;background:#e7f2e5;display:grid;place-items:center;font-size:23px;flex:0 0 auto}
.farm-profile-main{min-width:0;flex:1}
.farm-profile-main h2{margin:0;color:#294b32;font-size:18px}
.farm-profile-main p{margin:3px 0 8px;color:#718076;font-size:13px}
.farm-profile-meta{display:flex;gap:8px;flex-wrap:wrap}
.farm-profile-meta span{font-size:11px;font-weight:750;color:#5e6c62;background:#f3f7f2;border:1px solid #e2eae0;border-radius:999px;padding:4px 8px}
.farm-arrow{font-size:21px;color:#477a55}

/* Report management / report status */
.admin-page-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:20px}
.admin-page-heading h1{margin:4px 0;color:#193550;font-size:31px}
.admin-page-heading p{margin:0;color:#71808b;max-width:760px}
.admin-report-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}
.admin-report-summary>div{background:#fff;border:1px solid #dfe7ee;border-radius:15px;padding:16px}
.admin-report-summary span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#73818c;font-weight:850}
.admin-report-summary strong{display:block;font-size:27px;color:#193550;margin-top:3px}
.admin-btn.light{background:#f3f6f8;color:#193550;border:1px solid #d8e2e9}
.admin-help{color:#6e7b85;font-size:13px;margin-top:0}
.report-status{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:850;white-space:nowrap}
.report-status.submitted{background:#eef2f5;color:#52616a}
.report-status.under-review{background:#fff1cc;color:#8a6815}
.report-status.reviewed{background:#e8f1fa;color:#315f86}
.report-status.resolved{background:#eaf6ee;color:#28734b}

@media(max-width:1180px){
  .topbar-inner{max-width:none}
  .nav{overflow-x:auto;justify-content:flex-start;padding-bottom:1px;scrollbar-width:none}
  .nav::-webkit-scrollbar{display:none}
  .nav a{padding-left:8px;padding-right:8px}
}
@media(max-width:980px){
  .role-label{display:none}
  .farm-profile-grid,.admin-report-summary{grid-template-columns:1fr 1fr}
  .nav{display:flex}
  .user-chip span:first-child{display:none}
}
@media(max-width:650px){
  .topbar-inner{align-items:center;padding:10px 12px}
  .brand>span:last-child{display:none}
  .nav{order:3;flex-basis:100%;overflow-x:auto}
  .topbar-inner{flex-wrap:wrap}
  .farm-profile-grid,.admin-report-summary{grid-template-columns:1fr}
}

/* ================================================================
   FARMER DASHBOARD - CLEAN ACTIONS AND VALIDATION
   ================================================================ */

.farmer-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid #ecd99d;
    border-radius: 16px;
    background: #fff9e8;
    color: #5f532d;
}

.farmer-notice strong {
    display: block;
    color: #765d0f;
}

.farmer-notice p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #82734a;
}

.farmer-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.farmer-action-grid .farmer-action {
    min-height: 78px;
}

.farmer-action.primary {
    background: #477a55;
    border-color: #477a55;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(71, 122, 85, 0.16);
}

.farmer-action.primary small {
    color: #e0eee2;
}

.action-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #edf5eb;
    font-size: 20px;
}

.farmer-action.primary .action-icon {
    background: rgba(255, 255, 255, 0.16);
}

.farm-status {
    font-weight: 800;
    margin-top: 6px;
}

.farm-status.approved {
    color: #176b42;
}

.farm-status.pending {
    color: #946200;
}

.farm-status.rejected {
    color: #a33a3a;
}

.farmer-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.farmer-status-grid > div {
    padding: 17px;
    border-radius: 14px;
    border: 1px solid transparent;
}

.farmer-status-grid span,
.farmer-status-grid strong,
.farmer-status-grid small {
    display: block;
}

.farmer-status-grid span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 850;
}

.farmer-status-grid strong {
    margin: 4px 0;
    font-size: 28px;
}

.farmer-status-grid small {
    font-size: 11px;
}

.farmer-status-grid .approved {
    background: #edf7ef;
    border-color: #d6ead9;
    color: #176b42;
}

.farmer-status-grid .pending {
    background: #fff8e7;
    border-color: #f0e0ad;
    color: #946200;
}

.farmer-status-grid .rejected {
    background: #fff0f0;
    border-color: #efd7d7;
    color: #a33a3a;
}

.empty-panel {
    padding: 60px 25px;
    text-align: center;
}

.empty-panel .empty-icon {
    font-size: 44px;
    margin-bottom: 10px;
}

.empty-panel h2 {
    margin: 0 0 8px;
    color: #193550;
}

.empty-panel p {
    max-width: 560px;
    margin: 0 auto 18px;
    color: #71808b;
}

@media (max-width: 1050px) {
    .farmer-action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .farmer-notice {
        align-items: flex-start;
        flex-direction: column;
    }

    .farmer-action-grid,
    .farmer-status-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   ADMIN DASHBOARD ACTION ROW
   ================================================================ */

.admin-action-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.admin-action-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 92px;
    padding: 16px;
    border: 1px solid #dfe7ee;
    border-radius: 14px;
    background: #f9fbfc;
    color: #193550;
    text-decoration: none;
    transition: 0.15s ease;
}

.admin-action-card:hover {
    transform: translateY(-2px);
    border-color: #b8cddd;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(25, 53, 80, 0.08);
}

.admin-action-card strong {
    font-size: 13px;
}

.admin-action-card span {
    color: #71808b;
    font-size: 11px;
    line-height: 1.4;
}

html[data-theme="dark"] {
    --green-900: #d9e8dc;
    --green-800: #bed5c3;
    --green-700: #8fbd99;
    --green-600: #78a983;
    --green-100: #2a4031;
    --cream: #171e19;
    --white: #222c25;
    --ink: #e6eee8;
    --muted: #a7b5aa;
    --line: #3b493f;
    --shadow: 0 12px 35px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] body {
    background: var(--cream);
    color: var(--ink);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-kpi,
html[data-theme="dark"] .admin-action-card,
html[data-theme="dark"] .farmer-panel,
html[data-theme="dark"] .farmer-stats > div,
html[data-theme="dark"] .farmer-season,
html[data-theme="dark"] .farmer-action,
html[data-theme="dark"] .farm-profile-card,
html[data-theme="dark"] .report-sheet,
html[data-theme="dark"] .login-card {
    background-color: var(--white);
    color: var(--ink);
    border-color: var(--line);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] th {
    background: #1b241e;
    color: var(--ink);
    border-color: var(--line);
}

html[data-theme="dark"] tr:hover td,
html[data-theme="dark"] .location-stats div {
    background: #27332b;
}

html[data-theme="dark"] .admin-kpi strong,
html[data-theme="dark"] .admin-page-heading h1,
html[data-theme="dark"] .panel-title h2,
html[data-theme="dark"] .farm-profile-main h2,
html[data-theme="dark"] .farmer-stats strong {
    color: var(--green-900);
}

html[data-theme="dark"] .farmer-welcome,
html[data-theme="dark"] .result-hero,
html[data-theme="dark"] .rule-box {
    background: #202b23;
    color: var(--ink);
    border-color: var(--line);
}

html[data-theme="dark"] .admin-theme .topbar {
    background: #142b46;
}

html[data-theme="dark"] .login-page {
    background-color: #202b23;
}

@media (max-width: 1150px) {
    .admin-action-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .admin-action-row {
        grid-template-columns: 1fr;
    }
}

/* Shared visual system for authenticated pages, forms, and printable views. */
:root {
    --green-900: #173c31;
    --green-800: #245846;
    --green-700: #32735a;
    --green-600: #46876b;
    --green-100: #e7f0e9;
    --cream: #f2f5f1;
    --white: #ffffff;
    --ink: #1b2b25;
    --muted: #64756c;
    --line: #d6e0d9;
    --shadow: 0 10px 28px rgba(24, 52, 40, .065);
    --radius: 12px;
}

body {
    background-color: var(--cream);
    background-image:
        linear-gradient(rgba(50, 91, 67, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(50, 91, 67, .025) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--ink);
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

.topbar {
    box-shadow: 0 4px 18px rgba(15, 39, 30, .08);
}

.topbar-inner {
    max-width: 1480px;
    min-height: 68px;
    padding: 10px 26px;
}

.brand {
    gap: 10px;
    font-size: 16px;
}

.brand-mark {
    border-radius: 10px;
}

.nav a {
    border-radius: 8px;
    font-weight: 650;
    transition: background-color .16s ease, color .16s ease;
}

.admin-theme .topbar {
    background: #173c35;
    border-bottom-color: #2d5149;
}

.admin-theme .brand-mark {
    color: #173c35;
}

.admin-theme .nav a.active,
.admin-theme .nav a:hover {
    background: rgba(255, 255, 255, .13);
    color: #ffffff;
}

.farmer-theme .topbar {
    background: #ffffff;
    border-bottom-color: #dce6df;
}

.page {
    max-width: 1360px;
    padding: 32px 28px 58px;
}

.page-head {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.page-head h1,
.admin-page-heading h1 {
    color: var(--green-900);
    font-size: 29px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: 0;
}

.page-head p {
    max-width: 720px;
    font-size: 14px;
}

.card {
    border-color: var(--line);
    padding: 20px;
}

.card h2,
.card h3 {
    color: var(--green-900);
    font-size: 19px;
    font-weight: 720;
}

.grid {
    gap: 16px;
}

.btn,
.admin-btn,
.map-popup-action {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.btn:hover,
.admin-btn:hover {
    box-shadow: 0 5px 14px rgba(23, 60, 49, .16);
    transform: translateY(-1px);
}

.btn.secondary {
    background: #ffffff;
}

input,
select,
textarea {
    min-height: 42px;
    border-color: #cbd8d0;
    border-radius: 8px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

textarea {
    min-height: 130px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(50, 115, 90, .14);
}

.field label {
    font-size: 12px;
    letter-spacing: .01em;
}

table {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

th,
td {
    padding: 12px 14px;
}

th {
    background: #edf3ef;
    color: #43594c;
    font-size: 11px;
    letter-spacing: .06em;
}

tr:hover td {
    background: #f5f9f6;
}

.badge,
.report-status {
    border-radius: 6px;
}

.flash,
.notice {
    border-radius: 9px;
}

.login-page {
    background-color: #eaf0eb;
    background-image:
        linear-gradient(135deg, rgba(23, 60, 49, .045) 25%, transparent 25%),
        linear-gradient(315deg, rgba(23, 60, 49, .035) 25%, transparent 25%);
    background-size: 24px 24px;
}

.login-card {
    border-color: #dce5de;
    border-radius: 14px;
    padding: 38px;
}

.login-card h1 {
    font-size: 26px;
    letter-spacing: 0;
}

.report-sheet {
    border-color: var(--line);
    border-radius: 4px;
    box-shadow: none;
}

.footer-note {
    padding: 0 20px 24px;
}

.advisory-create {
    margin-bottom: 30px;
    border-left: 4px solid var(--green-700);
}

.advisory-section-heading {
    margin-bottom: 18px;
}

.advisory-section-heading h2 {
    margin: 3px 0 4px;
    color: var(--green-900);
    font-size: 21px;
}

.advisory-section-heading p {
    margin: 0;
    color: var(--muted);
}

.advisory-kicker {
    color: var(--green-700);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.advisory-list {
    display: grid;
    gap: 4px;
}

.advisory-list .grid {
    align-items: stretch;
}

.advisory-list article.card {
    min-height: 100%;
    border-top: 3px solid #6d9279;
}

.advisory-title-link {
    color: inherit;
    text-decoration: none;
}

.advisory-title-link:hover {
    text-decoration: underline;
}

.advisory-list-image {
    display: block;
    width: min(100%, 520px);
    max-height: 300px;
    margin: 12px 0;
    border-radius: 4px;
    object-fit: cover;
}

.advisory-open-link {
    margin-top: 12px;
}

.advisory-detail-editor {
    margin-bottom: 18px;
}

.advisory-detail-content {
    max-width: 900px;
    margin-top: 18px;
}

.advisory-detail-image {
    display: block;
    width: 100%;
    max-height: 560px;
    margin-bottom: 22px;
    border-radius: 4px;
    object-fit: contain;
    background: #f2f5f2;
}

.advisory-detail-body {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.advisory-remove-image span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.advisory-remove-image input {
    width: 16px;
    height: 16px;
}

.farm-gallery-section {
    padding: 58px 28px;
}

.farm-gallery-section.public {
    background: #f1f5ef;
}

.farm-gallery-section.farmer {
    margin: 22px 0;
    padding: 24px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #f2f6f1;
}

.farm-gallery-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.farm-gallery-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.farm-gallery-kicker,
.farm-gallery-category {
    color: #477a55;
    font-size: 11px;
    font-weight: 800;
}

.farm-gallery-heading h2 {
    margin: 5px 0;
    color: #294b32;
    font-size: 27px;
    line-height: 1.2;
}

.farm-gallery-heading p {
    margin: 0;
    color: #66746a;
}

.farm-gallery-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 10px 13px;
    border: 1px solid #b9cbbd;
    border-radius: 6px;
    background: #ffffff;
    color: #294b32;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.farm-gallery-download:hover {
    border-color: #477a55;
}

.farm-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr);
    overflow: hidden;
    border: 1px solid #d5e0d4;
    border-radius: 8px;
    background: #ffffff;
}

.farm-gallery-visual {
    display: flex;
    min-width: 0;
    flex-direction: column;
    margin: 0;
    background: #e8eee8;
}

.farm-gallery-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #e8eee8;
}

.farm-gallery-credit {
    padding: 8px 12px;
    color: #5f6b61;
    font-size: 11px;
}

.farm-gallery-credit a {
    color: inherit;
}

.farm-gallery-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 24px;
}

.farm-gallery-copy-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.farm-gallery-count {
    color: #718076;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.farm-gallery-copy h3 {
    margin: 17px 0 8px;
    color: #294b32;
    font-size: 24px;
    line-height: 1.2;
}

.farm-gallery-copy p {
    margin: 0;
    color: #56655a;
    line-height: 1.6;
}

.farm-gallery-copy ul {
    display: grid;
    gap: 8px;
    margin: 16px 0 20px;
    padding-left: 19px;
    color: #425448;
    font-size: 13px;
    line-height: 1.5;
}

.farm-gallery-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.farm-gallery-controls button {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #cbd8cd;
    border-radius: 6px;
    background: #ffffff;
    color: #294b32;
    cursor: pointer;
    font-size: 18px;
}

.farm-gallery-controls button:hover,
.farm-gallery-controls button:focus-visible {
    border-color: #477a55;
    outline: 2px solid #477a55;
    outline-offset: 2px;
}

.farm-gallery-dots {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 8px;
}

.farm-gallery-dots button {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    min-width: 10px;
    min-height: 10px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: #bdcbbf;
}

.farm-gallery-dots button[aria-pressed="true"] {
    background: #356c48;
    outline: 2px solid #a7c0aa;
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .farm-gallery-section {
        padding: 38px 18px;
    }

    .farm-gallery-section.farmer {
        padding: 20px 14px;
    }

    .farm-gallery-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .farm-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .farm-gallery-image {
        aspect-ratio: 4 / 3;
    }

    .farm-gallery-copy {
        min-height: 290px;
        padding: 20px;
    }
}

.farm-status-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.farm-status-form label {
    font-weight: 700;
}

.farm-status-select {
    width: min(220px, 100%);
}

.farm-rejection-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: min(85vh, 760px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    color: var(--ink);
}

.farm-rejection-dialog::backdrop {
    background: rgb(15 25 18 / 55%);
}

.farm-rejection-form {
    display: grid;
    gap: 14px;
}

.farm-rejection-form fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.farm-rejection-form fieldset label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.farm-rejection-form fieldset input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.farm-rejection-form .actions {
    justify-content: flex-end;
}

.quick-preferences {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.language-control {
    position: relative;
    display: grid;
    width: 40px;
    height: 38px;
    place-items: center;
    border: 1px solid #bfcfc4;
    border-radius: 8px;
    background: #ffffff;
    color: var(--green-900);
    cursor: pointer;
}

.language-control:focus-within {
    outline: 3px solid rgba(50, 115, 90, .28);
    outline-offset: 2px;
}

.language-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    border: 1.7px solid currentColor;
    border-radius: 50%;
    pointer-events: none;
}

.language-icon::before {
    position: absolute;
    inset: -1px 4px;
    border-right: 1.4px solid currentColor;
    border-left: 1.4px solid currentColor;
    border-radius: 50%;
    content: "";
}

.language-icon::after {
    position: absolute;
    top: 7px;
    right: -1px;
    left: -1px;
    border-top: 1.4px solid currentColor;
    content: "";
}

.language-switch {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    opacity: 0;
    cursor: pointer;
}

.theme-toggle {
    display: grid;
    width: 40px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid #bfcfc4;
    border-radius: 8px;
    background: #ffffff;
    color: var(--green-900);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease;
}

.theme-icon {
    display: block;
    line-height: 1;
}

.theme-toggle:hover {
    background: var(--green-100);
    border-color: var(--green-600);
}

.admin-theme .theme-toggle {
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
}

.admin-theme .theme-toggle:hover {
    background: rgba(255, 255, 255, .2);
}

@media (max-width: 1350px) {
    .topbar-inner {
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        display: flex;
        flex: 1 0 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 2px 0 4px;
        scrollbar-width: thin;
    }

    .quick-preferences {
        order: 2;
    }

    .user-chip {
        order: 4;
    }

    .nav a {
        flex: 0 0 auto;
    }
}

@media (max-width: 700px) {
    .topbar-inner {
        padding: 10px 14px;
    }

    .quick-preferences {
        gap: 6px;
    }

    .page {
        padding: 24px 15px 42px;
    }

    .page-head h1,
    .admin-page-heading h1 {
        font-size: 25px;
    }

    .card {
        padding: 18px;
    }

    .login-card {
        padding: 28px 22px;
    }

    .report-sheet {
        padding: 22px;
    }
}

@media print {
    body {
        background: #ffffff;
        color: #111111;
        font-family: "Aptos", "Segoe UI", sans-serif;
    }

    .report-sheet {
        border-radius: 0;
        box-shadow: none;
    }
}

/* Equalize repeated card rows while letting each grid size to its content. */
.grid-2,
.grid-3,
.grid-4,
.grid,
.admin-kpis,
.admin-kpi-grid,
.admin-report-summary,
.farmer-stats,
.farmer-status-grid,
.farmer-action-grid,
.admin-action-row,
.farm-profile-grid,
.farm-cards,
.map-summary-grid,
.admin-dashboard-grid,
.farmer-grid {
    align-items: stretch;
    grid-auto-rows: 1fr;
    gap: 16px;
}

.admin-panel,
.farmer-panel,
.farmer-form-card {
    padding: 20px;
}

.admin-kpi,
.admin-report-summary > div,
.farmer-stats > div,
.farmer-status-grid > div {
    padding: 18px;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topbar-inner {
    flex-wrap: wrap;
}

.nav {
    flex-wrap: wrap;
    white-space: normal;
}

.nav a {
    white-space: normal;
    text-align: center;
}

.card,
.admin-panel,
.admin-kpi,
.admin-action-card,
.farmer-panel,
.farmer-season,
.farmer-action,
.farmer-status-grid > div,
.farm-profile-card,
.farm-card,
.farmer-form-card,
.admin-report-summary > div,
.admin-kpi-grid > .admin-kpi,
.farmer-stats > div,
.login-card {
    border-color: var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

@media (max-width: 700px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .grid,
    .admin-kpis,
    .admin-kpi-grid,
    .admin-report-summary,
    .farmer-stats,
    .farmer-status-grid,
    .farmer-action-grid,
    .admin-action-row,
    .farm-profile-grid,
    .farm-cards,
    .map-summary-grid,
    .admin-dashboard-grid,
    .farmer-grid {
        gap: 12px;
    }
}

@media (max-width: 1050px) {
    .admin-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .admin-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Public home and sign-in experience. */
.public-home {
    background: #f3f5f0;
    color: #21352c;
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

.public-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    padding: 10px max(28px, calc((100% - 1300px) / 2));
    border-bottom: 1px solid #dfe6df;
    background: rgba(250, 251, 248, .97);
}

.public-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: #173c31;
    font-size: 17px;
    font-weight: 800;
}

.public-brand .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #173c31;
    color: #ffffff;
    font-size: 18px;
}

.public-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
}

.public-nav a {
    color: #52645a;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.public-nav a:hover,
.public-footer a:hover {
    color: #317459;
}

.public-signin,
.public-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 16px;
    border: 1px solid #1c4939;
    border-radius: 6px;
    background: #1c4939;
    color: #ffffff;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.public-signin:hover,
.public-button:hover {
    background: #286048;
    color: #ffffff;
}

.public-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-hero {
    position: relative;
    display: flex;
    min-height: 590px;
    height: min(700px, calc(100svh - 72px));
    align-items: center;
    overflow: hidden;
    background: #294939;
    color: #ffffff;
}

.public-hero-image,
.public-hero-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.public-hero-image {
    object-fit: cover;
    object-position: center 55%;
}

.public-hero-shade {
    background: rgba(12, 34, 25, .52);
}

.public-hero-content {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 48px 42px 72px;
}

.public-kicker {
    margin: 0;
    color: #6b987b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
}

.public-hero .public-kicker {
    color: #d1e5d5;
}

.public-hero h1 {
    margin: 16px 0 12px;
    color: #ffffff;
    font-size: 68px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: 0;
}

.public-hero-copy {
    max-width: 590px;
    margin: 0;
    color: #f0f4ef;
    font-size: 20px;
    line-height: 1.5;
}

.public-hero-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 28px;
}

.public-button.light {
    border-color: #f2f5ef;
    background: #f2f5ef;
    color: #18392c;
}

.public-button.light:hover {
    background: #ffffff;
}

.public-text-link {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.public-text-link:hover {
    color: #d1e5d5;
}

.public-hero-caption {
    position: absolute;
    right: max(28px, calc((100% - 1300px) / 2));
    bottom: 22px;
    z-index: 1;
    color: rgba(255, 255, 255, .85);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .1em;
}

.public-hero-caption span {
    padding: 0 5px;
    color: #bbd1c0;
}

.public-section {
    padding: 76px 28px;
}

.public-section-inner {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.account-section {
    background: #f4f6f2;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
    gap: 72px;
}

.public-section-lead h2,
.about-heading h2,
.advisories-heading h2 {
    margin: 12px 0 0;
    color: #1d3e31;
    font-size: 32px;
    font-weight: 730;
    line-height: 1.2;
    letter-spacing: 0;
}

.account-details {
    border-top: 1px solid #cfd9d1;
}

.account-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding: 22px 0;
    border-bottom: 1px solid #cfd9d1;
}

.account-index,
.feature-index {
    color: #648071;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.account-row h3,
.feature-item h3 {
    margin: 0;
    color: #1d3e31;
    font-size: 17px;
}

.account-row p,
.feature-item p {
    margin: 7px 0 0;
    color: #617269;
    font-size: 13px;
    line-height: 1.65;
}

.account-row a {
    align-self: center;
    color: #28634a;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.about-section {
    background: #193c31;
    color: #ffffff;
}

.about-heading {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(260px, .6fr);
    column-gap: 60px;
    align-items: end;
}

.about-heading .public-kicker {
    grid-column: 1 / -1;
}

.about-heading h2 {
    max-width: 650px;
    color: #f5f7f3;
}

.about-heading > p:last-child {
    margin: 0;
    color: #c7d5cb;
    font-size: 13px;
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin-top: 52px;
}

.feature-item {
    min-height: 176px;
    padding-top: 18px;
    border-top: 1px solid rgba(236, 244, 237, .34);
}

.feature-index {
    display: block;
    margin-bottom: 18px;
    color: #b6cbb9;
}

.feature-item h3 {
    color: #ffffff;
}

.feature-item p {
    color: #c7d5cb;
}

.advisories-section {
    background: #edf1ec;
}

.advisories-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.advisories-heading h2 {
    margin-top: 8px;
}

.advisories-heading > p {
    max-width: 330px;
    margin: 0;
    color: #617269;
    font-size: 13px;
}

.public-advisory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 16px;
}

.public-advisory {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 22px;
    border: 1px solid #d4ded6;
    border-top: 3px solid #56816a;
    border-radius: 8px;
    background: #fbfcfa;
}

.public-advisory-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #596d61;
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.risk-mark {
    padding: 4px 7px;
    border-radius: 4px;
    background: #e7f1e8;
    color: #28634a;
}

.risk-mark.moderate {
    background: #fff2d6;
    color: #896114;
}

.risk-mark.high {
    background: #f8e5e2;
    color: #9a4038;
}

.public-advisory h3 {
    margin: 17px 0 7px;
    color: #203c30;
    font-size: 17px;
}

.public-advisory p {
    flex: 1;
    margin: 0 0 18px;
    color: #596b60;
    font-size: 12px;
    line-height: 1.65;
}

.public-advisory time {
    color: #718078;
    font-size: 10px;
    font-weight: 650;
}

.public-empty {
    padding: 24px 0;
    border-top: 1px solid #d4ded6;
    color: #617269;
}

.public-footer {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px max(28px, calc((100% - 1300px) / 2));
    background: #142f27;
    color: #e9f0e9;
}

.public-footer .public-brand {
    color: #ffffff;
}

.public-footer .brand-mark {
    background: #ffffff;
    color: #173c31;
}

.public-footer p {
    margin: 0;
    color: #c4d1c7;
    font-size: 11px;
}

.public-footer > a:last-child {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.signin-page {
    min-height: 100vh;
    background: #f1f4ef;
    color: #20372d;
}

.signin-layout {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr) minmax(440px, .88fr);
    align-items: center;
    background: #f1f4ef;
}

.signin-layout::before {
    position: absolute;
    inset: 0 50% 0 0;
    background-image: url("farm-gallery/rice-paddy.jpg");
    background-position: center;
    background-size: cover;
    content: "";
}

.signin-layout::after {
    position: absolute;
    inset: 0 50% 0 0;
    background: rgba(18, 47, 36, .45);
    content: "";
}

.signin-home-link {
    position: absolute;
    z-index: 2;
    top: 28px;
    left: 32px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.signin-panel {
    position: relative;
    z-index: 1;
    grid-column: 2;
    width: min(460px, calc(100% - 64px));
    justify-self: center;
    padding: 42px;
    border: 1px solid #dce5de;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(20, 49, 37, .1);
}

.signin-brand {
    margin-bottom: 28px;
}

.signin-panel h1 {
    margin: 9px 0 8px;
    color: #1d3e31;
    font-size: 29px;
    letter-spacing: 0;
}

.signin-intro {
    margin: 0 0 24px;
    color: #64756c;
    font-size: 13px;
    line-height: 1.6;
}

.signin-submit {
    width: 100%;
    margin-top: 5px;
}

.signin-register {
    margin: 22px 0 0;
    color: #617269;
    font-size: 12px;
    text-align: center;
}

.signin-register a {
    color: #28634a;
    font-weight: 750;
}

.demo-access {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #e0e7e1;
    color: #6a7a70;
    font-size: 11px;
}

.demo-access summary {
    cursor: pointer;
    font-weight: 700;
}

.demo-access p {
    line-height: 1.8;
}

.signin-footnote {
    position: absolute;
    z-index: 2;
    bottom: 24px;
    left: 32px;
    margin: 0;
    color: #e6eee7;
    font-size: 11px;
}

@media (max-width: 900px) {
    .public-header {
        flex-wrap: wrap;
        gap: 10px 20px;
        padding: 10px 20px;
    }

    .public-nav {
        order: 3;
        flex: 1 0 100%;
        justify-content: flex-start;
        gap: 22px;
        overflow-x: auto;
        padding: 7px 0 3px;
    }

    .public-signin {
        margin-left: auto;
    }

    .public-hero {
        min-height: 570px;
        height: min(650px, calc(100svh - 110px));
    }

    .account-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .signin-layout {
        grid-template-columns: minmax(0, .7fr) minmax(400px, 1fr);
    }

    .signin-layout::before,
    .signin-layout::after {
        right: 56%;
    }
}

.topbar-inner {
    flex-wrap: wrap;
}

.topbar-inner > .user-chip {
    order: 1;
    margin-left: auto;
}

.topbar-inner > .quick-preferences {
    order: 2;
}

.topbar-inner > .nav {
    order: 3;
    display: flex;
    flex: 1 0 100%;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
}

.topbar-inner > .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
}

.registration-verification {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.registration-verification h2 {
    margin: 0;
    color: #1d3e31;
    font-size: 20px;
}

.registration-verification > p {
    margin: 0;
    color: #64756c;
    font-size: 13px;
    line-height: 1.55;
}

.registration-verification .login-form {
    gap: 13px;
}

.registration-verification #verification_code {
    font-size: 20px;
    font-weight: 750;
    letter-spacing: .2em;
    text-align: center;
}

.registration-verification :disabled {
    cursor: not-allowed;
    opacity: .58;
}

.verification-actions {
    display: flex;
    gap: 10px;
}

.verification-actions form {
    flex: 1 1 0;
}

.verification-actions .btn {
    width: 100%;
}

@media (max-width: 650px) {
    .public-header {
        padding: 9px 14px;
    }

    .public-nav {
        gap: 18px;
    }

    .public-nav a {
        font-size: 12px;
    }

    .public-hero {
        min-height: 590px;
        height: calc(100svh - 100px);
        max-height: 720px;
    }

    .public-hero-image {
        object-position: 62% center;
    }

    .public-hero-content {
        padding: 45px 24px 65px;
    }

    .public-hero h1 {
        font-size: 56px;
    }

    .public-hero-copy {
        max-width: 430px;
        font-size: 17px;
    }

    .public-hero-caption {
        right: 18px;
        left: 18px;
        font-size: 8px;
        text-align: center;
    }

    .public-section {
        padding: 54px 20px;
    }

    .public-section-lead h2,
    .about-heading h2,
    .advisories-heading h2 {
        font-size: 27px;
    }

    .account-row {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 10px;
    }

    .account-row a {
        grid-column: 2;
        justify-self: start;
    }

    .about-heading {
        grid-template-columns: 1fr;
        row-gap: 14px;
    }

    .about-heading .public-kicker {
        grid-column: auto;
    }

    .feature-grid,
    .public-advisory-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 30px;
    }

    .feature-item {
        min-height: auto;
        padding-bottom: 12px;
    }

    .advisories-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .public-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
        padding: 22px 20px;
    }

    .signin-layout {
        display: block;
        min-height: 100svh;
        padding: 78px 16px 24px;
    }

    .signin-layout::before,
    .signin-layout::after {
        right: 0;
        bottom: auto;
        height: 230px;
    }

    .signin-home-link {
        top: 22px;
        left: 20px;
    }

    .signin-panel {
        width: min(460px, 100%);
        margin: 0 auto;
        padding: 28px 23px;
    }

    .signin-footnote {
        position: relative;
        bottom: auto;
        left: auto;
        margin: 19px auto 0;
        color: #627269;
        text-align: center;
    }
}

html[data-theme="dark"] .public-home {
    background: #171f1a;
    color: #e3ece5;
}

html[data-theme="dark"] .public-header {
    background: rgba(29, 41, 34, .97);
    border-bottom-color: #3b4b40;
}

html[data-theme="dark"] .public-brand,
html[data-theme="dark"] .public-nav a {
    color: #e3ece5;
}

html[data-theme="dark"] .public-brand .brand-mark {
    background: #e3ece5;
    color: #173c31;
}

html[data-theme="dark"] .public-signin {
    border-color: #8eb99a;
    background: #315e43;
    color: #ffffff;
}

html[data-theme="dark"] .public-header .language-control,
html[data-theme="dark"] .public-header .theme-toggle {
    border-color: #607566;
    background: #27352c;
    color: #e3ece5;
}

html[data-theme="dark"] .account-section,
html[data-theme="dark"] .advisories-section {
    background: #1e2822;
    color: #e3ece5;
}

html[data-theme="dark"] .public-section-lead h2,
html[data-theme="dark"] .advisories-heading h2 {
    color: #edf4ee;
}

html[data-theme="dark"] .account-details,
html[data-theme="dark"] .account-row {
    border-color: #405045;
}

html[data-theme="dark"] .account-row h3,
html[data-theme="dark"] .feature-item h3 {
    color: #edf4ee;
}

html[data-theme="dark"] .account-row p,
html[data-theme="dark"] .feature-item p,
html[data-theme="dark"] .advisories-heading > p {
    color: #b9c8bd;
}

html[data-theme="dark"] .public-advisory {
    border-color: #405045;
    background: #27332b;
}

html[data-theme="dark"] .public-advisory h3 {
    color: #edf4ee;
}

html[data-theme="dark"] .public-advisory p,
html[data-theme="dark"] .public-advisory time {
    color: #bdc9c0;
}

@media (max-width: 900px) {
    .public-header-actions {
        margin-left: auto;
    }
}

@media (max-width: 650px) {
    .public-header-actions {
        gap: 6px;
    }

    .public-header-actions .public-signin {
        min-height: 38px;
        gap: 6px;
        padding: 0 10px;
    }
}

/* Readability and touch-target defaults for comfortable everyday use. */
:root {
    --muted: #4f5d53;
    --line: #cbd6ce;
}

body {
    font-size: 16px;
    line-height: 1.65;
}

.btn,
.admin-btn,
.map-popup-action,
.public-signin,
.theme-toggle {
    min-height: 48px;
    font-size: 16px;
}

.btn {
    padding: 12px 18px;
}

.btn.small,
.admin-btn.small {
    min-height: 44px;
    padding: 9px 12px;
    font-size: 14px;
}

.theme-toggle {
    width: 48px;
    height: 48px;
}

.public-header-actions .public-signin {
    min-height: 48px;
    font-size: 16px;
}

.nav a,
.public-nav a,
.signin-home-link {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}

.nav a {
    font-size: 15px;
}

.nav a,
.public-nav a {
    padding: 12px 14px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
select,
textarea {
    min-height: 52px;
    font-size: 16px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    accent-color: var(--green-700);
}

.field label {
    font-size: 15px;
}

th,
td {
    font-size: 15px;
}

th,
.badge,
.report-status,
.stat .label,
.stat .meta,
.map-note,
.footer-note,
.signin-register,
.signin-footnote,
.demo-access,
.public-footer p,
.eyebrow,
.advisory-kicker {
    font-size: 14px;
}

.signin-intro {
    font-size: 16px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid #155c43;
    outline-offset: 3px;
}

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

/* Unified account options and responsive navigation. */
.account-options {
    position: relative;
    z-index: 40;
    flex: 0 0 auto;
}

.account-options-trigger {
    display: inline-flex;
    min-width: 104px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    font-size: 16px;
    font-weight: 750;
    list-style: none;
}

.account-options-trigger::-webkit-details-marker {
    display: none;
}

.account-options-trigger::after {
    content: "v";
    font-size: 12px;
}

.account-options[open] > .account-options-trigger::after {
    content: "^";
}

.account-options-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    width: min(320px, calc(100vw - 28px));
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 14px 36px rgba(15, 35, 24, .2);
}

.account-options[open] > .account-options-panel {
    display: grid;
}

.account-options-user {
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 750;
}

.account-options-language {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}

.account-options-select {
    position: static;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--white);
    color: var(--ink);
    font-size: 16px;
    opacity: 1;
}

.account-options-theme {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    font-size: 15px;
    text-align: left;
    white-space: normal;
}

.account-options-theme .theme-icon {
    flex: 0 0 22px;
    font-size: 21px;
    text-align: center;
}

.account-options-logout {
    display: flex;
    min-height: 48px;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    color: var(--green-900);
    font-size: 15px;
    font-weight: 750;
}

.admin-action-card span,
.admin-help,
.farmer-action span,
.farm-profile-main p,
.admin-report-summary span,
.location-stats span,
.map-note {
    color: var(--muted);
    font-size: 14px;
}

.account-options-trigger:hover,
.account-options-theme:hover,
.account-options-logout:hover {
    background: var(--green-100);
    color: var(--green-900);
}

.topbar-inner > .account-options {
    order: 2;
    margin-left: auto;
}

.account-options-panel select option {
    background: var(--white);
    color: var(--ink);
}

@media (max-width: 900px) {
    .public-nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px 10px;
        overflow: visible;
    }

    .public-nav a {
        min-height: 48px;
        padding: 10px 12px;
        font-size: 15px;
    }
}

@media (max-width: 650px) {
    .topbar-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding: 10px 12px;
    }

    .topbar-inner > .brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .topbar-inner > .brand > span:last-child {
        display: inline;
    }

    .topbar-inner > .role-label {
        display: none;
    }

    .topbar-inner > .account-options {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
    }

    .topbar-inner > .nav {
        grid-column: 1 / -1;
        order: 0;
        display: grid;
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        padding: 2px 0 0;
        white-space: normal;
    }

    .topbar-inner > .nav a {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        justify-content: flex-start;
        padding: 10px 11px;
        font-size: 15px;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .public-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 8px 12px;
    }

    .public-header > .public-brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .public-header-actions {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        gap: 8px;
    }

    .public-header-actions .public-signin {
        min-height: 48px;
        padding: 8px 12px;
        font-size: 15px;
    }

    .public-nav {
        grid-column: 1 / -1;
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, auto);
        grid-auto-flow: column;
        gap: 4px;
        padding: 0;
    }

    .public-nav a {
        min-width: 0;
        justify-content: flex-start;
        padding: 10px 11px;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Keep every major surface readable when dark mode is selected. */
html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --green-900: #e2eee4;
    --green-800: #c9dfce;
    --green-700: #9fc6a8;
    --green-600: #83b38e;
    --green-100: #304237;
    --cream: #141b16;
    --white: #202a23;
    --ink: #edf3ee;
    --muted: #c1cdc4;
    --line: #48574c;
    --shadow: 0 12px 35px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .public-home {
    background-color: var(--cream);
    background-image: none;
    color: var(--ink);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-kpi,
html[data-theme="dark"] .admin-action-card,
html[data-theme="dark"] .admin-report-summary > div,
html[data-theme="dark"] .farmer-panel,
html[data-theme="dark"] .farmer-form-card,
html[data-theme="dark"] .farmer-action,
html[data-theme="dark"] .farmer-season,
html[data-theme="dark"] .farmer-status-grid > div,
html[data-theme="dark"] .farmer-stats > div,
html[data-theme="dark"] .farm-profile-card,
html[data-theme="dark"] .farm-card,
html[data-theme="dark"] .location-stats div,
html[data-theme="dark"] .account-row,
html[data-theme="dark"] .account-details,
html[data-theme="dark"] .public-advisory,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .signin-panel,
html[data-theme="dark"] .report-sheet,
html[data-theme="dark"] .account-options-panel {
    border-color: var(--line);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .page-head p,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .admin-help,
html[data-theme="dark"] .stat .label,
html[data-theme="dark"] .stat .meta,
html[data-theme="dark"] .account-row p,
html[data-theme="dark"] .public-advisory p,
html[data-theme="dark"] .public-advisory time,
html[data-theme="dark"] .signin-intro,
html[data-theme="dark"] .signin-register,
html[data-theme="dark"] .demo-access {
    color: var(--muted);
}

/* Admin production assessment: keep translated content within its controls. */
.admin-page-heading {
    align-items: flex-start;
    gap: 18px;
}

.admin-page-heading > div {
    flex: 1 1 34rem;
    min-width: 0;
}

.admin-page-heading h1,
.admin-page-heading p,
.admin-form .panel-title h2,
.admin-form .field label {
    overflow-wrap: anywhere;
}

.admin-page-heading > .admin-btn {
    flex: 0 1 auto;
    max-width: 100%;
    text-align: center;
    white-space: normal;
}

.admin-form > .admin-panel,
.admin-form .panel-title > div,
.admin-form .field {
    min-width: 0;
}

.admin-form .admin-help {
    margin-top: 18px;
    padding: 13px 15px;
    border: 1px solid #dfe7ee;
    border-radius: 10px;
    background: #f7f9fb;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

html[data-theme="dark"] .admin-form .admin-help {
    border-color: var(--line);
    background: #202b23;
}

.admin-form > .actions .admin-btn {
    max-width: 100%;
    text-align: center;
    white-space: normal;
}

@media (max-width: 700px) {
    .admin-page-heading {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .admin-page-heading > .admin-btn {
        align-self: flex-start;
    }

    .admin-form .admin-panel {
        padding: 17px;
    }

    .admin-form .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-form .field.full {
        grid-column: auto;
    }

    .admin-form > .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-form > .actions .admin-btn {
        width: 100%;
    }
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] th {
    border-color: var(--line);
    background: #18211b;
    color: var(--ink);
}

html[data-theme="dark"] td,
html[data-theme="dark"] .account-options-user,
html[data-theme="dark"] .account-options-language,
html[data-theme="dark"] .account-options-trigger,
html[data-theme="dark"] .account-options-theme,
html[data-theme="dark"] .account-options-logout {
    color: var(--ink);
}

html[data-theme="dark"] .account-options-trigger,
html[data-theme="dark"] .account-options-theme,
html[data-theme="dark"] .account-options-select {
    border-color: var(--line);
    background: #18211b;
}

html[data-theme="dark"] .signin-panel h1,
html[data-theme="dark"] .signin-panel .public-brand,
html[data-theme="dark"] .signin-panel .field label {
    color: var(--green-900);
}

.report-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.report-table-wrap table {
    min-width: 680px;
}

.analytics-risk-table {
    table-layout: fixed;
}

.analytics-risk-table th,
.analytics-risk-table td {
    overflow-wrap: anywhere;
}

.account-options-trigger {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    gap: 0;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 35, 24, .12);
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.account-options-trigger::after {
    display: none;
}

.account-options-icon {
    font-family: "Segoe UI Symbol", sans-serif;
    font-size: 28px;
    line-height: 1;
}

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

.account-options-trigger:hover {
    border-color: var(--green-600);
    box-shadow: 0 3px 8px rgba(15, 35, 24, .14);
}

html[data-theme="dark"] .account-options-trigger:focus-visible {
    outline-color: #a9d9b3;
}

.account-options-theme {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
}

.account-options-theme .theme-toggle-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.theme-switch {
    display: inline-flex;
    width: 44px;
    height: 24px;
    flex: 0 0 44px;
    align-items: center;
    border: 1px solid #87958a;
    border-radius: 999px;
    background: #aab5ad;
    transition: background-color .16s ease, border-color .16s ease;
}

.theme-switch-thumb {
    width: 18px;
    height: 18px;
    margin-left: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .16s ease;
}

html[data-theme="dark"] .account-options-theme .theme-switch {
    border-color: #76aa83;
    background: #2b6a49;
}

html[data-theme="dark"] .account-options-theme .theme-switch-thumb {
    transform: translateX(20px);
}

.admin-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.admin-form > .admin-panel {
    border-color: var(--line);
    background: var(--white);
    box-shadow: var(--shadow);
}

.admin-form > .actions {
    grid-column: 1 / -1;
}

html[data-theme="dark"] .admin-btn.light {
    border-color: var(--line);
    background: #29382f;
    color: var(--ink);
}

@media (max-width: 980px) {
    .admin-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-form > .actions {
        grid-column: 1;
    }
}

@media (max-width: 650px) {
    .page {
        padding: 20px 14px 40px;
    }

    .admin-form {
        gap: 12px;
    }

    .admin-form .admin-panel {
        padding: 16px;
    }

    .admin-form .panel-title {
        gap: 10px;
        margin-bottom: 14px;
    }

    .admin-form .form-grid {
        gap: 14px;
    }

    .admin-form .admin-help {
        margin-top: 14px;
        padding: 12px;
    }

    .account-options-panel {
        max-height: calc(100vh - 88px);
        max-height: calc(100svh - 88px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .account-options-theme {
        height: auto;
        min-height: 54px;
        padding: 10px 11px;
    }

    .account-options-theme .theme-toggle-label {
        line-height: 1.35;
    }
}

@media (max-width: 380px) {
    .page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .topbar-inner {
        padding-right: 10px;
        padding-left: 10px;
    }

    .account-options-panel {
        width: calc(100vw - 20px);
        gap: 10px;
        padding: 12px;
    }

    .admin-form .admin-panel {
        padding: 14px;
    }

    .admin-form .panel-title h2 {
        font-size: 20px;
    }

    .admin-form .field label {
        font-size: 14px;
    }
}

@media print {
    .report-table-wrap {
        overflow: visible;
    }
}

/* Clearer secondary text across admin and farmer screens. */
:root {
    --muted: #46534a;
}

html[data-theme="dark"] {
    --muted: #c4d0c7;
}

.admin-kpi span,
.admin-kpi small,
.admin-report-summary span,
.admin-page-heading p,
.admin-help,
.admin-action-card span,
.farmer-kicker,
.farmer-welcome p,
.farmer-season span,
.farmer-action small,
.farmer-stats span,
.farmer-stats small,
.farm-profile-main p,
.farm-profile-meta span,
.farmer-status-grid span,
.farmer-status-grid small,
.location-stats span,
.map-note {
    color: var(--muted);
}

.admin-kpi span,
.admin-report-summary span,
.farmer-kicker,
.farmer-season span,
.farmer-stats span,
.farmer-status-grid span {
    font-size: 12px;
}

.admin-kpi small,
.admin-page-heading p,
.admin-help,
.farmer-welcome p,
.farmer-action small,
.farmer-stats small,
.farm-profile-main p,
.farm-profile-meta span,
.farmer-status-grid small {
    font-size: 14px;
}

html[data-theme="dark"] .farmer-welcome h1,
html[data-theme="dark"] .farmer-season strong {
    color: var(--green-900);
}

html[data-theme="dark"] .farmer-status-grid .approved {
    border-color: #45684d;
    background: #20392a;
    color: #a3d6ad;
}

html[data-theme="dark"] .farmer-status-grid .pending {
    border-color: #76602d;
    background: #3a311c;
    color: #ffda7d;
}

html[data-theme="dark"] .farmer-status-grid .rejected {
    border-color: #734141;
    background: #3d2424;
    color: #ffb2ae;
}

html[data-theme="dark"] .farm-status.approved {
    color: #a3d6ad;
}

html[data-theme="dark"] .farm-status.pending {
    color: #ffda7d;
}

html[data-theme="dark"] .farm-status.rejected {
    color: #ffb2ae;
}

html[data-theme="dark"] .farmer-theme .topbar {
    border-bottom-color: var(--line);
    background: #1d2821;
}

html[data-theme="dark"] .farmer-theme .brand,
html[data-theme="dark"] .farmer-theme .nav a,
html[data-theme="dark"] .farmer-theme .user-chip {
    color: var(--ink);
}

html[data-theme="dark"] .farmer-theme .brand-mark {
    background: #2b6846;
    color: #ffffff;
}

html[data-theme="dark"] .farm-profile-meta span {
    border-color: #45564a;
    background: #27352c;
    color: var(--muted);
}

.farmer-action.primary small {
    color: #ffffff;
}

/* Keep text neutral while retaining green as a surface and accent color. */
.brand,
.nav a.active,
.nav a:hover,
.avatar,
.farmer-action:not(.primary),
.btn.secondary,
.card h2,
.card h3,
.stat .value,
.iconbox,
.field label,
.timeline-item strong,
.login-card h1,
.result-level,
.chip,
.farmer-theme .nav a.active,
.farmer-theme .role-label,
.farm-profile-main h2,
.farmer-welcome h1,
.farmer-season strong,
.farmer-stats strong,
.public-brand,
.public-nav a:hover,
.public-footer a:hover,
.public-section-lead h2,
.about-heading h2,
.advisories-heading h2,
.account-row h3,
.feature-item h3,
.account-row a,
.public-advisory h3,
.signin-panel h1,
.signin-register a,
.badge.low,
.badge.healthy,
.badge.verified,
.badge.resolved,
.report-status.resolved,
.farm-status.approved,
.farm-status.pending,
.farm-status.rejected,
.farmer-status-grid .approved,
.farmer-status-grid .pending,
.farmer-status-grid .rejected {
    color: var(--ink);
}

.public-home {
    color: var(--ink);
}

.public-nav a,
.account-index,
.feature-index,
.account-row p,
.feature-item p,
.advisories-heading > p,
.public-advisory-meta,
.public-advisory p,
.public-advisory time,
.public-empty,
.public-footer p,
.signin-page,
.signin-intro,
.signin-register,
.demo-access,
.farmer-kicker,
.farmer-welcome p,
.farmer-season span,
.farmer-action small,
.farmer-stats span,
.farmer-stats small,
.farm-profile-main p,
.farm-profile-meta span,
.farm-status,
.farmer-status-grid span,
.farmer-status-grid small,
.map-legend,
.map-note,
.location-stats span {
    color: var(--muted);
}

.public-kicker {
    color: var(--muted);
}

.about-section .public-kicker,
.about-section .feature-index,
.about-section .feature-item h3,
.about-section .feature-item p,
.about-section .about-heading h2,
.public-hero .public-kicker,
.public-hero h1,
.public-hero-copy,
.public-text-link,
.public-footer,
.public-footer .public-brand,
.public-footer > a:last-child,
.admin-hero,
.admin-hero h1,
.admin-hero p,
.admin-hero .eyebrow,
.admin-theme .brand,
.admin-theme .nav a,
.admin-theme .user-chip,
.farmer-action.primary,
.farmer-action.primary small,
.marker-pin span {
    color: #ffffff;
}

.public-button.light {
    color: #222222;
}

.public-kicker,
.farmer-kicker,
.farmer-season span,
.farmer-stats span,
.farmer-status-grid span,
.admin-kpi span,
.admin-report-summary span {
    font-size: 13px;
}

.farmer-action.primary small {
    color: #ffffff;
}

html[data-theme="dark"] .admin-kpi strong,
html[data-theme="dark"] .admin-page-heading h1,
html[data-theme="dark"] .panel-title h2,
html[data-theme="dark"] .farm-profile-main h2,
html[data-theme="dark"] .farmer-stats strong,
html[data-theme="dark"] .farmer-welcome h1,
html[data-theme="dark"] .farmer-season strong,
html[data-theme="dark"] .farmer-status-grid .approved,
html[data-theme="dark"] .farmer-status-grid .pending,
html[data-theme="dark"] .farmer-status-grid .rejected,
html[data-theme="dark"] .farm-status.approved,
html[data-theme="dark"] .farm-status.pending,
html[data-theme="dark"] .farm-status.rejected,
html[data-theme="dark"] .public-section-lead h2,
html[data-theme="dark"] .advisories-heading h2,
html[data-theme="dark"] .account-row h3,
html[data-theme="dark"] .public-advisory h3,
html[data-theme="dark"] .public-brand,
html[data-theme="dark"] .public-nav a,
html[data-theme="dark"] .signin-panel h1 {
    color: var(--ink);
}

html[data-theme="dark"] .about-section .public-kicker,
html[data-theme="dark"] .about-section .feature-index,
html[data-theme="dark"] .about-section .feature-item h3,
html[data-theme="dark"] .about-section .feature-item p,
html[data-theme="dark"] .about-section .about-heading h2 {
    color: #f0f3f1;
}

html[data-theme="dark"] .public-button.light {
    color: #222222;
}

html[data-theme="dark"] .public-brand .brand-mark {
    color: #222222;
}

.advisory-compose-trigger {
    margin: 0 0 24px;
}

.advisory-composer-dialog {
    width: min(640px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    overflow: auto;
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    color: var(--ink);
}

.advisory-composer-dialog::backdrop {
    background: rgba(15, 25, 19, .62);
}

.advisory-composer-dialog .advisory-create {
    position: relative;
    margin: 0;
    border-left: 0;
    padding: 26px;
}

.advisory-composer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.advisory-feed {
    display: grid;
    max-width: 820px;
    gap: 14px;
}

.advisory-post {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(26, 45, 33, .06);
}

.advisory-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.advisory-post-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--green-800);
    color: var(--white);
    font-size: 19px;
    font-weight: 800;
}

.advisory-post-author strong,
.advisory-post-author span:not(.advisory-post-avatar) {
    display: block;
}

.advisory-post-author strong {
    color: var(--ink);
    font-size: 14px;
}

.advisory-post-author div span,
.advisory-post-date {
    color: var(--muted);
    font-size: 12px;
}

.advisory-post-meta {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--green-700);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.advisory-post h2 {
    margin: 4px 0 8px;
    color: var(--ink);
    font-size: 20px;
}

.advisory-post p {
    margin: 0 0 16px;
    color: var(--text-muted, var(--muted));
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.advisory-post-date {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.advisory-draft-card {
    border-style: dashed;
}

.advisory-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 520px) {
    .advisory-composer-dialog .advisory-create {
        padding: 22px 16px;
    }

    .advisory-post {
        padding: 16px;
    }
}

.public-footer .brand-mark,
.risk-mark.low {
    color: var(--ink);
}

:root {
    --ink: #222222;
    --muted: #505050;
}

html[data-theme="dark"] {
    --ink: #f2f2f2;
    --muted: #c8c8c8;
}

.password-input {
    position: relative;
    width: 100%;
}

.password-input > input {
    padding-right: 58px;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    display: grid;
    width: 46px;
    height: 46px;
    min-height: 46px;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.password-visibility-toggle:hover {
    background: rgba(80, 80, 80, .12);
}

.password-visibility-toggle svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.password-eye-slash {
    display: block;
}

.password-visibility-toggle[aria-pressed="true"] .password-eye-slash {
    display: none;
}

.password-visibility-toggle:focus-visible {
    outline: 3px solid #222222;
    outline-offset: 1px;
}

html[data-theme="dark"] .password-visibility-toggle:focus-visible {
    outline-color: #f2f2f2;
}

.farmer-notice {
    color: var(--ink);
}

.farmer-notice strong {
    color: var(--ink);
}

.farmer-notice p {
    color: var(--muted);
    font-size: 14px;
}

.farmer-cancel {
    color: var(--muted);
}

.production-rate-chart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
}

.crop-health-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: start;
    gap: 24px;
}

.production-rate-sidebar {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-left: 1px solid var(--line);
    text-align: center;
}

.production-rate-sidebar h3,
.production-rate-sidebar p {
    margin: 0;
}

.production-rate-sidebar p {
    color: var(--muted);
    font-size: 12px;
}

.production-rate-vertical-track {
    display: flex;
    width: 58px;
    height: 150px;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 5px;
    background: var(--line);
}

.production-rate-vertical-fill {
    width: 100%;
    border-radius: inherit;
    background: var(--green-800);
    transition: height 180ms ease;
}

.production-rate-sidebar strong {
    color: var(--green-900);
    font-size: 24px;
}

.incident-assessment-history {
    display: grid;
    gap: 14px;
    margin: 14px 0 20px;
}

.incident-assessment-entry {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.incident-assessment-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.incident-assessment-meta time,
.timeline-content .meta {
    color: var(--muted);
    font-size: 12px;
}

.incident-assessment-entry p {
    margin: 10px 0;
}

.incident-assessment-entry ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.incident-assessment-form,
.incident-procedure-options {
    display: grid;
    gap: 14px;
}

.incident-procedure-options {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.incident-procedure-options legend {
    padding: 0 6px;
    color: var(--green-900);
    font-size: 13px;
    font-weight: 800;
}

.incident-procedure-options label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
}

.incident-procedure-options input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
}

.timeline-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 18px;
    margin-top: 12px;
}

.timeline-detail-grid p {
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.timeline-detail-wide {
    grid-column: 1 / -1;
}

.timeline-detail-wide ul {
    margin: 5px 0;
    padding-left: 20px;
}

.result-production-rate {
    width: min(100%, 250px);
    border: 1px solid var(--line);
    border-radius: 6px;
}

@media (max-width: 700px) {
    .crop-health-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .production-rate-sidebar {
        min-height: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .timeline-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .timeline-detail-wide {
        grid-column: auto;
    }
}

.farmer-assessment .field output {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.production-rate-track {
    flex: 1;
    height: 14px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--line);
}

.production-rate-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--green-800);
    transition: width 180ms ease;
}

.production-rate-chart strong {
    min-width: 64px;
    color: var(--green-900);
    text-align: right;
}

.admin-theme .brand-mark {
    color: #222222;
}

html[data-theme="dark"] .farmer-notice {
    border-color: #766b4c;
    background: #282a25;
}

html[data-theme="dark"] .admin-theme .admin-btn.ghost {
    border-color: #d5d5d5;
    color: var(--ink);
}

html[data-theme="dark"] .admin-theme .brand-mark {
    color: #222222;
}

html[data-theme="dark"] .farmer-theme .farmer-notice,
html[data-theme="dark"] .farmer-theme .farmer-notice * {
    color: var(--ink);
}

html[data-theme="dark"] .btn:not(.danger),
html[data-theme="dark"] .admin-btn:not(.ghost) {
    border-color: #d8d8d8;
    background: #eeeeee;
    color: #222222;
}

html[data-theme="dark"] .admin-theme h1,
html[data-theme="dark"] .admin-theme h2,
html[data-theme="dark"] .admin-theme h3,
html[data-theme="dark"] .admin-theme p,
html[data-theme="dark"] .admin-theme span,
html[data-theme="dark"] .admin-theme strong,
html[data-theme="dark"] .admin-theme small,
html[data-theme="dark"] .admin-theme label,
html[data-theme="dark"] .admin-theme a,
html[data-theme="dark"] .farmer-theme h1,
html[data-theme="dark"] .farmer-theme h2,
html[data-theme="dark"] .farmer-theme h3,
html[data-theme="dark"] .farmer-theme p,
html[data-theme="dark"] .farmer-theme span,
html[data-theme="dark"] .farmer-theme strong,
html[data-theme="dark"] .farmer-theme small,
html[data-theme="dark"] .farmer-theme label,
html[data-theme="dark"] .farmer-theme a {
    color: var(--ink);
}

html[data-theme="dark"] .farmer-theme .nav a.active,
html[data-theme="dark"] .farmer-theme .nav a:hover {
    border-radius: 8px;
    background: #39443d;
    color: var(--ink);
}

html[data-theme="dark"] .farmer-theme .farmer-action.primary,
html[data-theme="dark"] .farmer-theme .farmer-action.primary * {
    color: #ffffff;
}

html[data-theme="dark"] .farmer-theme .farmer-status-grid .approved,
html[data-theme="dark"] .farmer-theme .farmer-status-grid .pending,
html[data-theme="dark"] .farmer-theme .farmer-status-grid .rejected,
html[data-theme="dark"] .farmer-theme .farm-status.approved,
html[data-theme="dark"] .farmer-theme .farm-status.pending,
html[data-theme="dark"] .farmer-theme .farm-status.rejected {
    color: var(--ink);
}

.advisory-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.advisory-subsection + .advisory-subsection {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.advisory-draft-card {
    border-left: 4px solid #8a7447;
}

.advisory-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

html[data-theme="dark"] .advisory-draft-card {
    border-left-color: #c7ad72;
}

@media (max-width: 600px) {
    .advisory-form-actions,
    .advisory-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .advisory-form-actions .btn,
    .advisory-card-actions .btn {
        width: 100%;
    }
}

/* Enforce readable foreground and surface colors for both appearance modes. */
html[data-theme="light"] {
    color-scheme: light;
    --cream: #ffffff;
    --white: #ffffff;
    --ink: #18231d;
    --muted: #46534a;
    --line: #d6e0d9;
}

html[data-theme="light"] body {
    background: #ffffff !important;
    color: var(--ink) !important;
}

html[data-theme="light"] body :where(.card, .admin-panel, .farmer-panel, .farmer-form-card, .farm-profile-card, .admin-kpi, .admin-action-card, .admin-report-summary > div, .farmer-stats > div, .farmer-season, .farmer-action, .report-sheet, .login-card, .signin-panel, .public-advisory, .account-options-panel) {
    border-color: var(--line);
    background-color: #ffffff;
}

html[data-theme="light"] .admin-theme .topbar,
html[data-theme="light"] .farmer-theme .topbar,
html[data-theme="light"] .public-header {
    border-color: var(--line);
    background: #ffffff;
}

html[data-theme="light"] .admin-hero {
    border: 1px solid var(--line);
    background: #f4f7f4;
    color: var(--ink);
}

html[data-theme="light"] .admin-hero :where(*) {
    color: var(--ink) !important;
}

html[data-theme="light"] .public-hero {
    background-color: #ffffff;
    color: var(--ink);
}

html[data-theme="light"] .public-hero-shade {
    background: rgba(12, 34, 25, .58);
}

html[data-theme="light"] .admin-theme .topbar {
    background: #ffffff;
}

html[data-theme="light"] .admin-theme .brand,
html[data-theme="light"] .admin-theme .nav a,
html[data-theme="light"] .admin-theme .user-chip {
    color: #18231d !important;
}

html[data-theme="light"] .admin-theme .role-label {
    color: #355a43;
}

html[data-theme="light"] .admin-theme .role-mark {
    background: #eaf1ec;
    color: #18231d;
}

html[data-theme="light"] .admin-theme .nav a.active,
html[data-theme="light"] .admin-theme .nav a:hover {
    background: #eaf1ec;
    color: #18231d !important;
}

html[data-theme="light"] .admin-theme .brand-mark,
html[data-theme="light"] .admin-theme .user-chip .avatar {
    background: #eaf1ec;
    color: #18231d !important;
}

html[data-theme="light"] .public-footer {
    background: #f4f7f4;
    color: var(--ink);
}

html[data-theme="light"] .btn,
html[data-theme="light"] .admin-btn,
html[data-theme="light"] .public-signin,
html[data-theme="light"] .public-button,
html[data-theme="light"] .farmer-primary,
html[data-theme="light"] .farmer-action.primary,
html[data-theme="light"] .map-popup-action,
html[data-theme="light"] .admin-theme .brand-mark,
html[data-theme="light"] .farmer-theme .brand-mark,
html[data-theme="light"] .public-brand .brand-mark {
    border-color: #cbd8cf !important;
    background: #eaf1ec !important;
    color: var(--ink) !important;
}

html[data-theme="light"] .admin-btn.ghost {
    border-color: #cbd8cf;
    background: #eaf1ec;
}

html[data-theme="light"] .marker-pin span {
    color: #ffffff !important;
}

html[data-theme="light"] .signin-layout::before {
    opacity: 1;
}

html[data-theme="light"] .signin-layout::after {
    background: rgba(18, 47, 36, .35);
}

html[data-theme="dark"] body :where(.card, .admin-panel, .farmer-panel, .farmer-form-card, .farm-profile-card, .admin-kpi, .admin-action-card, .admin-report-summary > div, .farmer-stats > div, .farmer-season, .farmer-action, .report-sheet, .login-card, .signin-panel, .public-advisory, .account-options-panel) {
    border-color: var(--line);
    background-color: #202a23;
}

html[data-theme="dark"] .admin-theme .topbar,
html[data-theme="dark"] .farmer-theme .topbar,
html[data-theme="dark"] .public-header,
html[data-theme="dark"] .admin-hero {
    border-color: var(--line);
    background: #202a23;
}

html[data-theme="dark"] .public-hero-shade {
    background: rgba(12, 24, 17, .72);
}

html[data-theme="dark"] .btn:not(.danger),
html[data-theme="dark"] .admin-btn:not(.ghost),
html[data-theme="dark"] .public-signin,
html[data-theme="dark"] .public-button,
html[data-theme="dark"] .farmer-primary,
html[data-theme="dark"] .farmer-action.primary,
html[data-theme="dark"] .map-popup-action {
    border-color: #53675a !important;
    background: #2a6847 !important;
    color: #f4f8f4 !important;
}

html[data-theme="dark"] .admin-btn.ghost {
    border-color: #75877a;
    background: transparent;
}

html[data-theme="dark"] .admin-theme .brand-mark,
html[data-theme="dark"] .farmer-theme .brand-mark,
html[data-theme="dark"] .public-brand .brand-mark {
    background: #2a6847;
    color: #f4f8f4 !important;
}

html[data-theme="dark"] .badge.high,
html[data-theme="dark"] .badge.danger {
    border-color: #70423f;
    background: #492d2b;
    color: #ffd5d1 !important;
}

html[data-theme="dark"] .badge.moderate,
html[data-theme="dark"] .badge.warn {
    border-color: #726039;
    background: #44391f;
    color: #ffe29d !important;
}

html[data-theme="dark"] .badge.low,
html[data-theme="dark"] .badge.healthy,
html[data-theme="dark"] .badge.verified,
html[data-theme="dark"] .badge.resolved {
    border-color: #45684d;
    background: #20392a;
    color: #c3ebcb !important;
}

html[data-theme="dark"] .marker-pin span {
    color: #ffffff !important;
}

/* Keep actions and selectable choices consistently green with white labels. */
html[data-theme="light"] body .btn,
html[data-theme="light"] body .admin-btn,
html[data-theme="light"] body .public-signin,
html[data-theme="light"] body .public-button,
html[data-theme="light"] body .farmer-primary,
html[data-theme="light"] body .farmer-action,
html[data-theme="light"] body .map-popup-action,
html[data-theme="light"] body .advisory-compose-trigger,
html[data-theme="light"] body button:not(.password-visibility-toggle):not(.advisory-composer-close):not(.theme-toggle):not(.danger):not(.secondary):not(.ghost) {
    border-color: #3d815a !important;
    background: #3d815a !important;
    color: #ffffff !important;
}

html[data-theme="light"] body .btn:hover,
html[data-theme="light"] body .admin-btn:hover,
html[data-theme="light"] body button:not(.password-visibility-toggle):not(.advisory-composer-close):not(.theme-toggle):not(.danger):not(.secondary):not(.ghost):hover {
    border-color: #32714f !important;
    background: #32714f !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(.farmer-choice-grid, .admin-choice-grid) span,
html[data-theme="light"] body .options .option,
html[data-theme="light"] body .incident-procedure-options label {
    border-color: #3d815a !important;
    background: #3d815a !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) span,
html[data-theme="dark"] body .options .option,
html[data-theme="dark"] body .incident-procedure-options label {
    border-color: #2b6a49 !important;
    background: #2b6a49 !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(.farmer-choice-grid, .admin-choice-grid) input:checked + span,
html[data-theme="light"] body :is(.farmer-choice-grid, .admin-choice-grid) span:hover {
    border-color: #32714f !important;
    background: #32714f !important;
    color: #ffffff !important;
}

/* Inclusive defaults for keyboard, touch, and low-vision users. */
.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    padding: 10px 16px;
    transform: translateY(calc(-100% - 16px));
    border: 2px solid #ffffff;
    border-radius: 8px;
    background: #173c31;
    color: #ffffff;
    font-size: 16px;
    font-weight: 750;
    transition: transform .16s ease;
}

.skip-link:focus {
    transform: translateY(0);
    color: #ffffff !important;
}

#main-content {
    scroll-margin-top: 24px;
}

.public-home {
    font-size: 17px;
}

.public-nav a,
.public-text-link,
.account-row a,
.public-footer > a:last-child {
    font-size: 16px;
}

.public-kicker {
    font-size: 14px;
}

.public-hero-caption {
    font-size: 12px;
}

.public-section-lead h2,
.about-heading h2,
.advisories-heading h2 {
    max-width: 22ch;
    text-wrap: balance;
}

.account-row h3,
.feature-item h3,
.public-advisory h3 {
    font-size: 19px;
    line-height: 1.35;
}

.account-row p,
.feature-item p,
.about-heading > p:last-child,
.advisories-heading > p,
.public-advisory p,
.public-empty {
    font-size: 16px;
    line-height: 1.7;
}

.public-advisory-meta,
.public-advisory time,
.public-footer p {
    font-size: 14px;
}

.public-button {
    min-height: 52px;
    font-size: 16px;
}

.public-advisory,
.signin-panel {
    border-radius: 14px;
}

.public-home :is(.account-row a, .public-text-link, .public-footer a) {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    text-underline-offset: .2em;
}

.public-home :is(.account-row a, .public-text-link, .public-footer a):hover {
    text-decoration: underline;
}

.signin-panel h1 {
    font-size: clamp(30px, 4vw, 36px);
    line-height: 1.2;
}

input::placeholder,
textarea::placeholder {
    color: #59695f;
    opacity: 1;
}

@media (max-width: 650px) {
    .public-home {
        font-size: 16px;
    }

    .public-section {
        padding: 56px 20px;
    }

    .public-hero-caption {
        font-size: 11px;
        line-height: 1.5;
    }

    .public-advisory {
        padding: 20px;
    }
}

html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) input:checked + span,
html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) span:hover {
    border-color: #1e5139 !important;
    background: #1e5139 !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(.farmer-choice-grid, .admin-choice-grid) input:focus-visible + span,
html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) input:focus-visible + span {
    outline: 3px solid #8fc69d;
    outline-offset: 2px;
}

html[data-theme="dark"] body :is(.notice, .flash, .farmer-help, .farmer-notice, .admin-help, .rule-box, .farmer-empty) {
    border-color: var(--line) !important;
    background: #202a23 !important;
    color: #f4f8f4 !important;
}

html[data-theme="dark"] body .notice.warn,
html[data-theme="dark"] body .farmer-notice {
    border-color: #726039 !important;
    background: #44391f !important;
    color: #ffe29d !important;
}

html[data-theme="dark"] body .notice.danger,
html[data-theme="dark"] body .flash.error {
    border-color: #70423f !important;
    background: #492d2b !important;
    color: #ffd5d1 !important;
}

html[data-theme="dark"] body .notice.success,
html[data-theme="dark"] body .flash.success {
    border-color: #45684d !important;
    background: #20392a !important;
    color: #c3ebcb !important;
}

/* Keep fixed-light farmer components in step with the workspace theme. */
html[data-theme="dark"] body .farm-gallery-section.farmer {
    border-color: var(--line) !important;
    background: #18211b !important;
}

html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-heading h2,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-heading p,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-kicker {
    color: var(--ink) !important;
}

html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery {
    border-color: var(--line) !important;
    background: #202a23 !important;
}

html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-copy,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-copy h3,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-copy p,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-copy ul,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-copy li,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-category,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-count {
    color: var(--ink) !important;
}

html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-download {
    border-color: var(--line) !important;
    background: #202a23 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-download:hover {
    border-color: #a9d5b2;
    background: #29382e;
}

html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-credit,
html[data-theme="dark"] body .farm-gallery-section.farmer .farm-gallery-credit a {
    color: #18231d !important;
}

html[data-theme="dark"] body .admin-callout {
    border-left-color: #78a983;
    background: #202a23 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] body .admin-callout strong {
    color: var(--green-700) !important;
}

html[data-theme="dark"] body .admin-callout span {
    color: var(--muted) !important;
}

html[data-theme="dark"] body .admin-form-intro {
    border-color: var(--line);
    background: #202a23 !important;
}

html[data-theme="dark"] body .admin-form-intro > span {
    background: #315f86;
    color: #ffffff !important;
}

html[data-theme="dark"] body .admin-form-intro b {
    color: var(--ink) !important;
}

html[data-theme="dark"] body .admin-form-intro small {
    color: var(--muted) !important;
}

html[data-theme="dark"] body .admin-quick > a:hover {
    border-color: var(--line);
    background: #29382e !important;
}

html[data-theme="dark"] body .admin-quick > a b {
    color: var(--ink) !important;
}

html[data-theme="dark"] body tr:hover td {
    background: #29382e;
    color: var(--ink);
}

html[data-theme="dark"] body .admin-table th {
    background: #29382e;
    color: var(--ink);
}

html[data-theme="dark"] body .marker label {
    color: #18231d !important;
}

html[data-theme="dark"] body .leaflet-popup-content-wrapper,
html[data-theme="dark"] body .leaflet-popup-tip {
    background: #202a23;
    color: var(--ink);
}

html[data-theme="dark"] body .leaflet-popup-content-wrapper .map-popup,
html[data-theme="dark"] body .leaflet-popup-content-wrapper .map-popup-title,
html[data-theme="dark"] body .leaflet-popup-content-wrapper .map-popup-grid strong {
    color: var(--ink) !important;
}

html[data-theme="dark"] body .leaflet-popup-content-wrapper .map-popup-grid span,
html[data-theme="dark"] body .leaflet-control-attribution,
html[data-theme="dark"] body .leaflet-control-attribution a,
html[data-theme="dark"] body .leaflet-bar a {
    color: var(--ink) !important;
}

html[data-theme="dark"] body .leaflet-control-attribution,
html[data-theme="dark"] body .leaflet-bar a {
    border-color: var(--line);
    background: #202a23;
}

/* Dark-mode actions use a light green surface with dark readable labels. */
html[data-theme="dark"] body .btn:not(.danger),
html[data-theme="dark"] body .admin-btn:not(.ghost),
html[data-theme="dark"] body .btn.danger,
html[data-theme="dark"] body .admin-btn.ghost,
html[data-theme="dark"] body .public-signin,
html[data-theme="dark"] body .public-button,
html[data-theme="dark"] body .farmer-primary,
html[data-theme="dark"] body .farmer-action,
html[data-theme="dark"] body .map-popup-action,
html[data-theme="dark"] body .advisory-compose-trigger,
html[data-theme="dark"] body button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost) {
    border-color: #83b38e !important;
    background: #9fc6a8 !important;
    color: #18231d !important;
}

html[data-theme="dark"] body .btn:not(.danger):hover,
html[data-theme="dark"] body .admin-btn:not(.ghost):not(.danger):hover,
html[data-theme="dark"] body button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):hover {
    border-color: #a9d2b0 !important;
    background: #c9dfce !important;
    color: #18231d !important;
}

html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) span,
html[data-theme="dark"] body .options .option,
html[data-theme="dark"] body .incident-procedure-options label {
    border-color: #83b38e !important;
    background: #9fc6a8 !important;
    color: #18231d !important;
}

html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) input:checked + span,
html[data-theme="dark"] body :is(.farmer-choice-grid, .admin-choice-grid) span:hover {
    border-color: #63896c !important;
    background: #c9dfce !important;
    color: #18231d !important;
    box-shadow: 0 0 0 3px #63896c !important;
}

html[data-theme="light"] body button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost) {
    border-color: #3d815a !important;
    background: #3d815a !important;
    color: #ffffff !important;
}

html[data-theme="light"] body button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):hover {
    border-color: #32714f !important;
    background: #32714f !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(.farmer-choice-grid, .admin-choice-grid) input:checked + span {
    box-shadow: 0 0 0 3px #1e5139 !important;
}

@keyframes agribaseButtonFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

html[data-theme] body .btn,
html[data-theme] body .admin-btn,
html[data-theme] body .public-signin,
html[data-theme] body .public-button,
html[data-theme] body .farmer-primary,
html[data-theme] body .farmer-action,
html[data-theme] body .map-popup-action,
html[data-theme] body .advisory-compose-trigger,
html[data-theme] body button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close),
html[data-theme] body :is(.farmer-choice-grid, .admin-choice-grid) span,
html[data-theme] body .options .option,
html[data-theme] body .incident-procedure-options label {
    animation: agribaseButtonFadeIn 280ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] body .btn,
    html[data-theme] body .admin-btn,
    html[data-theme] body .public-signin,
    html[data-theme] body .public-button,
    html[data-theme] body .farmer-primary,
    html[data-theme] body .farmer-action,
    html[data-theme] body .map-popup-action,
    html[data-theme] body .advisory-compose-trigger,
    html[data-theme] body button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close),
    html[data-theme] body :is(.farmer-choice-grid, .admin-choice-grid) span,
    html[data-theme] body .options .option,
    html[data-theme] body .incident-procedure-options label {
        animation: none;
    }
}

html[data-theme="dark"] body .notice.warn,
html[data-theme="dark"] body .farmer-notice {
    border-color: #726039 !important;
    background: #44391f !important;
    color: #ffe29d !important;
}

html[data-theme="dark"] body .notice.danger,
html[data-theme="dark"] body .flash.error {
    border-color: #70423f !important;
    background: #492d2b !important;
    color: #ffd5d1 !important;
}

html[data-theme="dark"] body .notice.success,
html[data-theme="dark"] body .flash.success {
    border-color: #45684d !important;
    background: #20392a !important;
    color: #c3ebcb !important;
}

/* Semantic control colors override legacy blanket button rules above. */
html[data-theme="light"] body :is(
    .btn:not(.secondary):not(.danger),
    .admin-btn:not(.ghost):not(.danger),
    .public-signin,
    .public-button:not(.secondary),
    .farmer-primary,
    .farmer-action.primary,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
) {
    border-color: #246b45 !important;
    background: #246b45 !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(
    .btn.secondary,
    .admin-btn.ghost,
    .public-button.secondary
) {
    border-color: #64736a !important;
    background: #f0f4f1 !important;
    color: #18231d !important;
}

html[data-theme="light"] body :is(
    .btn.danger,
    .admin-btn.danger,
    button.danger
) {
    border-color: #a5221b !important;
    background: #a5221b !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(
    .btn:not(:disabled),
    .admin-btn:not(:disabled),
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(:disabled):not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
):hover {
    filter: brightness(.92);
}

html[data-theme="dark"] body :is(
    .btn:not(.secondary):not(.danger),
    .admin-btn:not(.ghost):not(.danger),
    .public-signin,
    .public-button:not(.secondary),
    .farmer-primary,
    .farmer-action.primary,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
) {
    border-color: #a9d5b2 !important;
    background: #a9d5b2 !important;
    color: #18231d !important;
}

html[data-theme="dark"] body :is(
    .btn.secondary,
    .admin-btn.ghost,
    .public-button.secondary
) {
    border-color: #8da696 !important;
    background: #29382e !important;
    color: #f2f7f3 !important;
}

html[data-theme="dark"] body :is(
    .btn.danger,
    .admin-btn.danger,
    button.danger
) {
    border-color: #ffaaa4 !important;
    background: #ffaaa4 !important;
    color: #351412 !important;
}

html[data-theme="dark"] body :is(
    .btn:not(:disabled),
    .admin-btn:not(:disabled),
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(:disabled):not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
):hover {
    filter: brightness(1.08);
}

html[data-theme] body :is(
    .btn,
    .admin-btn,
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not([data-gallery-dot])
) * {
    color: inherit !important;
}

html[data-theme="light"] body .farm-gallery-dots button[data-gallery-dot] {
    border: 2px solid #246b45 !important;
    background: #a9d5b2 !important;
}

html[data-theme="light"] body .farm-gallery-dots button[data-gallery-dot][aria-pressed="true"] {
    background: #246b45 !important;
    outline-color: #246b45;
}

html[data-theme="dark"] body .farm-gallery-dots button[data-gallery-dot] {
    border: 2px solid #a9d5b2 !important;
    background: #29382e !important;
}

html[data-theme="dark"] body .farm-gallery-dots button[data-gallery-dot][aria-pressed="true"] {
    background: #a9d5b2 !important;
    outline-color: #d1ead6;
}

.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 22px;
    z-index: 100;
    color: #1c2922;
}

.chat-widget .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.chat-launcher {
    display: inline-flex;
    min-height: 58px;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #17643e;
    box-shadow: 0 8px 25px rgba(14, 41, 26, .28);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
}

.chat-launcher:hover {
    background: #104d30;
}

.chat-launcher-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
}

.chat-launcher-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8px;
}

.chat-unread,
.chat-thread-unread {
    display: inline-grid;
    min-width: 25px;
    min-height: 25px;
    place-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #b42318;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    width: min(390px, calc(100vw - 28px));
    height: min(600px, calc(100svh - 115px));
    min-height: 350px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd6ce;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 16px 48px rgba(15, 35, 24, .28);
}

.chat-panel[hidden],
.chat-widget [hidden] {
    display: none !important;
}

.chat-panel-header {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 17px;
    background: #173b2b;
    color: #ffffff;
}

.chat-panel-header > div {
    display: grid;
    gap: 2px;
}

.chat-panel-header strong {
    font-size: 17px;
}

.chat-panel-header span {
    color: #e3eee6;
    font-size: 14px;
}

.chat-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font-size: 27px;
    line-height: 1;
}

.chat-admin-layout {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: minmax(120px, 38%) minmax(0, 1fr);
}

.chat-conversations {
    display: grid;
    align-content: start;
    gap: 5px;
    overflow: auto;
    padding: 9px;
    border-right: 1px solid #dce4de;
    background: #f6f8f6;
}

.chat-conversation {
    position: relative;
    display: grid;
    min-height: 68px;
    align-content: center;
    gap: 3px;
    overflow: hidden;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #1c2922;
    text-align: left;
}

.chat-conversation[aria-pressed="true"] {
    border-color: #9fbea9;
    background: #e9f4ec;
}

.chat-conversation strong,
.chat-conversation > span:not(.chat-thread-unread) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-conversation strong {
    padding-right: 28px;
    font-size: 14px;
}

.chat-conversation > span:not(.chat-thread-unread) {
    color: #4f5d53;
    font-size: 12px;
}

.chat-conversation .chat-thread-unread {
    position: absolute;
    top: 7px;
    right: 7px;
    min-width: 21px;
    min-height: 21px;
    font-size: 11px;
}

.chat-list-empty {
    margin: 5px;
    color: #4f5d53;
    font-size: 14px;
}

.chat-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.chat-contact {
    padding: 10px 14px;
    border-bottom: 1px solid #dce4de;
    color: #173b2b;
    font-weight: 800;
}

.chat-messages {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 14px;
    background: #f8faf8;
}

.chat-message {
    display: grid;
    max-width: 88%;
    gap: 3px;
    padding: 9px 12px;
    border: 1px solid #dce4de;
    border-radius: 14px 14px 14px 4px;
    background: #ffffff;
    color: #1c2922;
    overflow-wrap: anywhere;
}

.chat-message.is-own {
    align-self: flex-end;
    border-color: #17643e;
    border-radius: 14px 14px 4px 14px;
    background: #17643e;
    color: #ffffff;
}

.chat-message-sender {
    font-size: 12px;
    font-weight: 800;
}

.chat-message p {
    margin: 0;
    color: inherit;
    font-size: 15px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.chat-message time {
    justify-self: end;
    color: inherit;
    font-size: 11px;
    opacity: .82;
}

.chat-empty {
    display: grid;
    min-height: 100px;
    flex: 1;
    place-items: center;
    padding: 22px;
    color: #4f5d53;
    font-size: 15px;
    text-align: center;
}

.chat-feedback {
    padding: 0 13px;
    color: #a1261c;
    font-size: 14px;
}

.chat-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #dce4de;
    background: #ffffff;
}

.chat-compose textarea {
    min-height: 54px;
    max-height: 120px;
    padding: 10px 12px;
    border-radius: 13px;
    font-size: 16px;
    resize: vertical;
}

.chat-send {
    min-width: 72px;
    min-height: 52px;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: #17643e;
    color: #ffffff;
    font-weight: 800;
}

.chat-send:disabled {
    cursor: wait;
    opacity: .65;
}

html[data-theme="dark"] .chat-widget {
    color: #e3ece5;
}

html[data-theme="dark"] .chat-panel {
    border-color: #45584a;
    background: #1e2822;
}

html[data-theme="dark"] .chat-panel-header {
    background: #203b2b;
}

html[data-theme="dark"] .chat-conversations,
html[data-theme="dark"] .chat-messages {
    border-color: #405045;
    background: #202b24;
}

html[data-theme="dark"] .chat-conversation {
    color: #edf4ee;
}

html[data-theme="dark"] .chat-conversation[aria-pressed="true"] {
    border-color: #658d70;
    background: #304738;
}

html[data-theme="dark"] .chat-conversation > span:not(.chat-thread-unread),
html[data-theme="dark"] .chat-list-empty,
html[data-theme="dark"] .chat-empty {
    color: #c0cec3;
}

html[data-theme="dark"] .chat-contact {
    border-color: #405045;
    color: #e3ece5;
}

html[data-theme="dark"] .chat-message {
    border-color: #4b5b4f;
    background: #2b372f;
    color: #edf4ee;
}

html[data-theme="dark"] .chat-message.is-own {
    border-color: #37764e;
    background: #276341;
    color: #ffffff;
}

html[data-theme="dark"] .chat-compose {
    border-color: #405045;
    background: #1e2822;
}

html[data-theme="dark"] .chat-compose textarea {
    border-color: #596b5d;
    background: #26342b;
    color: #edf4ee;
}

@media (min-width: 651px) {
    .chat-widget[data-role="admin"] .chat-panel {
        width: min(700px, calc(100vw - 48px));
    }
}

@media (max-width: 650px) {
    .chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .chat-launcher {
        min-height: 56px;
        padding: 8px 14px;
    }

    .chat-widget .chat-panel {
        right: -4px;
        bottom: 66px;
        width: calc(100vw - 24px);
        height: min(650px, calc(100svh - 92px));
        min-height: 320px;
    }

    .chat-admin-layout {
        grid-template-columns: minmax(104px, 34%) minmax(0, 1fr);
    }

    .chat-conversations {
        padding: 6px;
    }

    .chat-conversation {
        min-height: 62px;
        padding: 8px;
    }

    .chat-conversation strong {
        font-size: 13px;
    }

    .chat-message {
        max-width: 95%;
    }
}

@media (max-width: 380px) {
    .chat-admin-layout {
        grid-template-columns: minmax(90px, 32%) minmax(0, 1fr);
    }

    .chat-conversation > span:not(.chat-thread-unread) {
        font-size: 11px;
    }
}

html[data-theme="light"] body .chat-widget .chat-launcher,
html[data-theme="light"] body .chat-widget .chat-send {
    border-color: #17643e !important;
    background: #17643e !important;
    color: #ffffff !important;
}

html[data-theme="light"] body .chat-widget .chat-close {
    border-color: rgba(255, 255, 255, .7) !important;
    background: transparent !important;
    color: #ffffff !important;
}

html[data-theme="light"] body .chat-widget .chat-conversation {
    border-color: transparent !important;
    background: transparent !important;
    color: #1c2922 !important;
}

html[data-theme="light"] body .chat-widget .chat-conversation:hover,
html[data-theme="light"] body .chat-widget .chat-conversation[aria-pressed="true"] {
    border-color: #9fbea9 !important;
    background: #e9f4ec !important;
    color: #1c2922 !important;
}

html[data-theme="dark"] body .chat-widget .chat-launcher,
html[data-theme="dark"] body .chat-widget .chat-send {
    border-color: #a9d5b2 !important;
    background: #a9d5b2 !important;
    color: #18231d !important;
}

html[data-theme="dark"] body .chat-widget .chat-close {
    border-color: rgba(255, 255, 255, .7) !important;
    background: transparent !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body .chat-widget .chat-conversation {
    border-color: transparent !important;
    background: transparent !important;
    color: #edf4ee !important;
}

html[data-theme="dark"] body .chat-widget .chat-conversation:hover,
html[data-theme="dark"] body .chat-widget .chat-conversation[aria-pressed="true"] {
    border-color: #658d70 !important;
    background: #304738 !important;
    color: #edf4ee !important;
}

/* =========================================================
   THEME-AWARE NEUTRAL BUTTON SYSTEM
   Replaces green primary buttons with neutral slate colors.
   Light mode: dark slate + white text.
   Dark mode: light slate + dark text.
   ========================================================= */

html[data-theme="light"] body :is(
    .btn:not(.secondary):not(.danger),
    .admin-btn:not(.ghost):not(.danger),
    .public-signin,
    .public-button:not(.secondary),
    .farmer-primary,
    .farmer-action.primary,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
) {
    background: #334155 !important;
    border: 1px solid #334155 !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(
    .btn:not(.secondary):not(.danger),
    .admin-btn:not(.ghost):not(.danger),
    .public-signin,
    .public-button:not(.secondary),
    .farmer-primary,
    .farmer-action.primary,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
):hover {
    background: #1e293b !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
    filter: none !important;
}

html[data-theme="light"] body :is(
    .btn.secondary,
    .admin-btn.ghost,
    .public-button.secondary
) {
    background: #f1f5f9 !important;
    border: 1px solid #94a3b8 !important;
    color: #1e293b !important;
}

html[data-theme="light"] body :is(
    .btn.secondary,
    .admin-btn.ghost,
    .public-button.secondary
):hover {
    background: #e2e8f0 !important;
    border-color: #64748b !important;
    color: #0f172a !important;
    filter: none !important;
}

html[data-theme="light"] body :is(
    .btn.danger,
    .admin-btn.danger,
    button.danger
) {
    background: #b42318 !important;
    border: 1px solid #b42318 !important;
    color: #ffffff !important;
}

html[data-theme="light"] body :is(
    .btn.danger,
    .admin-btn.danger,
    button.danger
):hover {
    background: #8f1d16 !important;
    border-color: #8f1d16 !important;
    color: #ffffff !important;
    filter: none !important;
}

html[data-theme="dark"] body :is(
    .btn:not(.secondary):not(.danger),
    .admin-btn:not(.ghost):not(.danger),
    .public-signin,
    .public-button:not(.secondary),
    .farmer-primary,
    .farmer-action.primary,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
) {
    background: #cbd5e1 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="dark"] body :is(
    .btn:not(.secondary):not(.danger),
    .admin-btn:not(.ghost):not(.danger),
    .public-signin,
    .public-button:not(.secondary),
    .farmer-primary,
    .farmer-action.primary,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close):not(.danger):not(.secondary):not(.ghost):not([data-gallery-dot])
):hover {
    background: #e2e8f0 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    filter: none !important;
}

html[data-theme="dark"] body :is(
    .btn.secondary,
    .admin-btn.ghost,
    .public-button.secondary
) {
    background: #293442 !important;
    border: 1px solid #64748b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] body :is(
    .btn.secondary,
    .admin-btn.ghost,
    .public-button.secondary
):hover {
    background: #3b4758 !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    filter: none !important;
}

html[data-theme="dark"] body :is(
    .btn.danger,
    .admin-btn.danger,
    button.danger
) {
    background: #ef4444 !important;
    border: 1px solid #ef4444 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body :is(
    .btn.danger,
    .admin-btn.danger,
    button.danger
):hover {
    background: #f87171 !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
}

html[data-theme] body :is(
    .btn,
    .admin-btn,
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close)
) svg,
html[data-theme] body :is(
    .btn,
    .admin-btn,
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action,
    .map-popup-action,
    .advisory-compose-trigger,
    button:not(.theme-toggle):not(.password-visibility-toggle):not(.advisory-composer-close)
) i {
    color: inherit !important;
    stroke: currentColor !important;
}

html[data-theme] body :is(
    .btn,
    .admin-btn,
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action,
    .map-popup-action,
    .advisory-compose-trigger
) * {
    color: inherit !important;
}

html[data-theme="light"] body :is(
    .btn,
    .admin-btn,
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action
):disabled {
    background: #cbd5e1 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    opacity: 0.75;
    cursor: not-allowed;
}

html[data-theme="dark"] body :is(
    .btn,
    .admin-btn,
    .public-signin,
    .public-button,
    .farmer-primary,
    .farmer-action
):disabled {
    background: #475569 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
    opacity: 0.75;
    cursor: not-allowed;
}

html[data-theme="light"] body .farm-gallery-dots button[data-gallery-dot] {
    border: 2px solid #475569 !important;
    background: #cbd5e1 !important;
}

html[data-theme="light"] body .farm-gallery-dots button[data-gallery-dot][aria-pressed="true"] {
    background: #334155 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] body .farm-gallery-dots button[data-gallery-dot] {
    border: 2px solid #94a3b8 !important;
    background: #475569 !important;
}

html[data-theme="dark"] body .farm-gallery-dots button[data-gallery-dot][aria-pressed="true"] {
    background: #cbd5e1 !important;
    border-color: #cbd5e1 !important;
}

/* =========================================================
   MOBILE PANEL LAYOUT - CLEAN TWO-COLUMN PHONE VIEW
   Keeps small panels/cards compact instead of stacking every
   item into a long single column. Large content panels still
   stack when necessary for readability.
   ========================================================= */
@media (max-width: 650px) {
    /* Keep dashboard/stat panels in two compact columns. */
    .admin-kpis,
    .farmer-stats,
    .farmer-status-grid,
    .admin-action-row,
    .farmer-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    /* Compact small panels on phones. */
    .admin-kpi,
    .farmer-stats > div,
    .farmer-status-grid > div,
    .admin-action-card,
    .farmer-action-grid .farmer-action {
        min-width: 0;
        padding: 13px !important;
        border-radius: 13px;
    }

    .admin-kpi strong,
    .farmer-stats strong,
    .farmer-status-grid strong {
        font-size: 22px;
    }

    .admin-kpi span,
    .farmer-stats span,
    .farmer-status-grid span {
        font-size: 9px;
        line-height: 1.25;
    }

    .admin-kpi small,
    .farmer-stats small,
    .farmer-status-grid small,
    .admin-action-card span,
    .farmer-action-grid .farmer-action small {
        font-size: 11px;
        line-height: 1.35;
    }

    /* Keep action cards compact and readable. */
    .farmer-action-grid .farmer-action {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .farmer-action-grid .farmer-action > span,
    .farmer-action-grid .farmer-action .action-icon {
        flex: 0 0 auto;
        font-size: 20px;
    }

    .farmer-action-grid .farmer-action b {
        font-size: 12px;
        line-height: 1.25;
    }

    /* The primary action can span the phone width so it does not
       become cramped while the secondary actions remain 2-column. */
    .farmer-action-grid .farmer-action.primary {
        grid-column: 1 / -1;
    }

    /* Keep the two main dashboard panels readable rather than
       squeezing long lists/forms into tiny columns. */
    .admin-dashboard-grid,
    .farmer-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .admin-panel,
    .farmer-panel,
    .farmer-form-card,
    .card {
        padding: 14px !important;
        border-radius: 14px;
    }

    .panel-title,
    .farmer-panel-head {
        gap: 8px;
        margin-bottom: 12px;
    }

    .panel-title h2,
    .farmer-panel-head h2 {
        font-size: 18px;
    }

    /* Prevent long text from forcing horizontal overflow. */
    .admin-panel,
    .farmer-panel,
    .admin-kpi,
    .farmer-stats > div,
    .farmer-status-grid > div,
    .admin-action-card,
    .farmer-action-grid .farmer-action {
        overflow-wrap: anywhere;
    }

    /* Tables remain scrollable instead of breaking the page width. */
    .admin-table,
    .farmer-table,
    .table-wrap,
    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Farm cards can stay horizontal on small screens. */
    .farm-card {
        min-width: 0;
        padding: 10px;
    }
}

@media (max-width: 390px) {
    /* On very small phones, retain two columns but reduce spacing. */
    .admin-kpis,
    .farmer-stats,
    .farmer-status-grid,
    .admin-action-row,
    .farmer-action-grid {
        gap: 7px !important;
    }

    .admin-kpi,
    .farmer-stats > div,
    .farmer-status-grid > div,
    .admin-action-card,
    .farmer-action-grid .farmer-action {
        padding: 10px !important;
    }
}


/* =========================================================
   INCIDENT PHOTO UPLOAD / GALLERY
   ========================================================= */
.incident-photo-upload {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--line, #dfe6e1);
    border-radius: 14px;
    background: rgba(127,145,132,.06);
}
.incident-photo-upload > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}
.incident-photo-optional {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.incident-photo-upload input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px dashed var(--line, #cfd9d2);
    border-radius: 10px;
    background: var(--surface, #fff);
}
.incident-photo-help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
.incident-photo-preview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.incident-photo-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line, #dfe6e1);
}
.incident-photo-gallery-card {
    margin-top: 18px;
}
.incident-photo-gallery-note {
    color: var(--muted);
    margin-top: -6px;
}
.incident-photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.incident-photo-item {
    display: block;
    overflow: hidden;
    border-radius: 13px;
    border: 1px solid var(--line, #dfe6e1);
    background: var(--surface, #fff);
}
.incident-photo-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .18s ease;
}
.incident-photo-item:hover img {
    transform: scale(1.025);
}
html[data-theme="dark"] .incident-photo-upload,
html[data-theme="dark"] .incident-photo-item {
    background: #18211b;
}
html[data-theme="dark"] .incident-photo-upload input[type="file"] {
    background: #202b24;
    color: var(--ink);
    border-color: var(--line);
}
@media (max-width: 800px) {
    .incident-photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .incident-photo-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .incident-photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .incident-photo-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .incident-photo-upload { padding: 13px; }
}


/* =========================================================
   PEST CHECK PHOTO PREVIEW
   Keep selected images compact so the form/page never grows
   to the uploaded image's natural dimensions.
   ========================================================= */
.incident-photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: flex-start;
}
.incident-photo-preview-item {
    position: relative;
    width: 120px;
    flex: 0 0 120px;
    min-width: 0;
}
.incident-photo-preview-item img {
    display: block;
    width: 120px;
    height: 120px;
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line, #dfe6e1);
    background: var(--surface, #fff);
}
.incident-photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .82);
    color: #fff;
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
}
.incident-photo-remove:hover {
    background: #111827;
}
.incident-photo-preview-name {
    margin-top: 5px;
    width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
}
html[data-theme="dark"] .incident-photo-preview-item img {
    background: #202b24;
}
html[data-theme="dark"] .incident-photo-preview-name {
    color: var(--muted);
}

/* =========================================================
   CONSISTENT CHECKBOXES
   Match the compact checkbox treatment used by the
   Farm Rejection dialog across admin + farmer pages.
   ========================================================= */
input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    accent-color: #64748b !important;
    vertical-align: top;
}
html[data-theme="dark"] input[type="checkbox"] {
    accent-color: #cbd5e1 !important;
}

/* The rejection dialog remains the reference layout for checkbox rows. */
.farm-rejection-form fieldset label,
.incident-procedure-options label {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

/* Keep photo previews/gallery compact on every screen, especially phones. */
.incident-photo-preview {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: flex-start;
}
.incident-photo-preview-item {
    position: relative;
    width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    min-width: 0;
}
.incident-photo-preview-item img {
    display: block;
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    min-width: 120px !important;
    min-height: 120px !important;
    object-fit: cover !important;
}

/* Submitted photos shown to admins/farmers: fixed compact tiles instead of
   filling the entire card width. The image itself never uses natural size. */
.incident-photo-gallery {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}
.incident-photo-item {
    display: block;
    width: 150px !important;
    max-width: 150px !important;
    flex: 0 0 150px !important;
    overflow: hidden;
    border-radius: 13px;
}
.incident-photo-item img {
    display: block;
    width: 150px !important;
    height: 112px !important;
    max-width: 150px !important;
    max-height: 112px !important;
    object-fit: cover !important;
}

@media (max-width: 520px) {
    .incident-photo-gallery {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px;
    }
    .incident-photo-item {
        width: auto !important;
        max-width: none !important;
        min-width: 0;
        flex: none !important;
    }
    .incident-photo-item img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
        max-width: 100% !important;
        max-height: none !important;
    }
}

/* Use the same simple checkbox-row design for all visible choice checkboxes. */
html[data-theme="light"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]),
html[data-theme="dark"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) {
    position: static !important;
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
    padding: 2px 0 !important;
    text-align: left !important;
}
html[data-theme="light"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) input[type="checkbox"],
html[data-theme="dark"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) input[type="checkbox"] {
    position: static !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
html[data-theme="light"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) span,
html[data-theme="dark"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) span {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    text-align: left !important;
    font-weight: 600 !important;
    cursor: pointer;
}
html[data-theme="light"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) input[type="checkbox"]:checked + span,
html[data-theme="dark"] body :is(.admin-choice-grid, .farmer-choice-grid) label:has(input[type="checkbox"]) input[type="checkbox"]:checked + span {
    background: transparent !important;
    border: 0 !important;
    color: inherit !important;
    box-shadow: none !important;
}

/* =========================================================
   FINAL INCIDENT PHOTO DISPLAY FIX
   Uploaded photos must NEVER expand to their natural size.
   ========================================================= */

/* Farmer Pest Check: compact selected-photo thumbnails */
.incident-photo-upload .incident-photo-preview {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.incident-photo-upload .incident-photo-preview-item {
    position: relative !important;
    display: block !important;
    width: 120px !important;
    height: auto !important;
    min-width: 120px !important;
    max-width: 120px !important;
    flex: 0 0 120px !important;
    overflow: visible !important;
}

.incident-photo-upload .incident-photo-preview-item img {
    display: block !important;
    width: 120px !important;
    height: 120px !important;
    min-width: 120px !important;
    min-height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
}

.incident-photo-upload .incident-photo-preview-name {
    display: block !important;
    width: 120px !important;
    max-width: 120px !important;
    margin-top: 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
}

/* Admin Incident Details: small fixed thumbnail cards */
.incident-photo-gallery-card .incident-photo-gallery {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.incident-photo-gallery-card .incident-photo-item {
    display: block !important;
    position: relative !important;
    width: 170px !important;
    height: 128px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    flex: 0 0 170px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    border: 1px solid var(--line, #dfe6e1) !important;
    background: var(--surface, #fff) !important;
}

.incident-photo-gallery-card .incident-photo-item img {
    display: block !important;
    width: 170px !important;
    height: 128px !important;
    min-width: 170px !important;
    min-height: 128px !important;
    max-width: 170px !important;
    max-height: 128px !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center !important;
    box-sizing: border-box !important;
}

.incident-photo-gallery-card .incident-photo-item:hover img {
    transform: scale(1.02) !important;
}

@media (max-width: 600px) {
    .incident-photo-upload .incident-photo-preview-item,
    .incident-photo-upload .incident-photo-preview-item img,
    .incident-photo-upload .incident-photo-preview-name {
        width: 92px !important;
        min-width: 92px !important;
        max-width: 92px !important;
    }

    .incident-photo-upload .incident-photo-preview-item img {
        height: 92px !important;
        min-height: 92px !important;
        max-height: 92px !important;
    }

    .incident-photo-gallery-card .incident-photo-gallery {
        gap: 10px !important;
    }

    .incident-photo-gallery-card .incident-photo-item {
        width: 120px !important;
        height: 90px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        flex-basis: 120px !important;
    }

    .incident-photo-gallery-card .incident-photo-item img {
        width: 120px !important;
        height: 90px !important;
        min-width: 120px !important;
        min-height: 90px !important;
        max-width: 120px !important;
        max-height: 90px !important;
    }
}

/* ================================================================
   MOBILE FARMER NAVIGATION - CLEAN COMPACT PANELS
   Keeps the navigation neat without changing the desktop design.
   ================================================================ */
@media (max-width: 650px) {
    .topbar-inner > .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 4px 0 2px !important;
        align-items: stretch !important;
    }

    .topbar-inner > .nav a {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 42px !important;
        height: 42px !important;
        padding: 8px 12px !important;
        margin: 0 !important;
        border: 1px solid #dfe7e1 !important;
        border-radius: 10px !important;
        background: #fbfcfb !important;
        color: #536158 !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        text-align: left !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        overflow-wrap: normal !important;
        box-shadow: none !important;
    }

    .topbar-inner > .nav a:hover {
        background: #f3f7f3 !important;
        border-color: #cddbcf !important;
        color: #294b32 !important;
    }

    .topbar-inner > .nav a.active {
        background: #e4f0e4 !important;
        border-color: #c9ddcb !important;
        color: #2d603a !important;
        box-shadow: inset 3px 0 0 #477a55 !important;
    }

    html[data-theme="dark"] .topbar-inner > .nav a {
        background: #1d2821 !important;
        border-color: #35443a !important;
        color: #c7d1ca !important;
    }

    html[data-theme="dark"] .topbar-inner > .nav a:hover {
        background: #26352b !important;
        border-color: #46584b !important;
        color: #eef4ef !important;
    }

    html[data-theme="dark"] .topbar-inner > .nav a.active {
        background: #304538 !important;
        border-color: #557360 !important;
        color: #e7f2e9 !important;
        box-shadow: inset 3px 0 0 #8bb895 !important;
    }
}

@media (max-width: 390px) {
    .topbar-inner > .nav {
        gap: 6px !important;
    }

    .topbar-inner > .nav a {
        min-height: 40px !important;
        height: 40px !important;
        padding: 7px 10px !important;
        font-size: 12px !important;
    }
}

/* =========================================================
   ADMIN REPORT CENTER / PRINT REPORT UPGRADE
   ========================================================= */
.report-center-hero{
  display:flex;align-items:flex-end;justify-content:space-between;gap:24px;
  padding:26px 28px;margin-bottom:18px;border-radius:22px;
  background:linear-gradient(135deg,#173b2b,#2b6a49);
  color:#fff;box-shadow:0 16px 36px rgba(23,59,43,.16)
}
.report-center-hero h1{margin:5px 0 7px;font-size:32px;letter-spacing:-.7px;color:#fff}
.report-center-hero p{margin:0;max-width:720px;color:rgba(255,255,255,.82)}
.report-center-hero .eyebrow{color:#dcefe2}
.report-center-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.report-center-actions .admin-btn{white-space:nowrap}
.report-center-actions .admin-btn.ghost{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.28);color:#fff}
.report-filter-panel{margin-bottom:18px}
.report-filter-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;align-items:end}
.report-filter-grid label{display:grid;gap:6px;font-size:12px;font-weight:800;color:var(--green-900)}
.report-filter-submit{display:flex;align-items:end}
.report-filter-submit .admin-btn{width:100%}
.report-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin-bottom:18px}
.report-summary-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px;box-shadow:var(--shadow);min-height:112px}
.report-summary-card span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#73818c;font-weight:850}
.report-summary-card strong{display:block;font-size:28px;color:var(--green-900);margin-top:5px}
.report-summary-card small{display:block;color:var(--muted);margin-top:2px}
.report-summary-card.danger{border-top:4px solid var(--danger)}
.report-summary-card.warn{border-top:4px solid #c59626}
.report-section-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px}
.report-bars{display:grid;gap:14px}
.report-bar-row>div:first-child{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px;font-size:13px}
.report-bar-row span{color:var(--muted)}
.report-bar{height:10px;background:#edf1ee;border-radius:999px;overflow:hidden}
.report-bar i{display:block;height:100%;border-radius:999px;background:var(--green-700)}
.report-bar i.high{background:var(--danger)}
.report-bar i.moderate{background:#c59626}
.report-mini-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.report-mini-grid>div{padding:13px;border:1px solid var(--line);border-radius:12px;background:#fbfcfb}
.report-mini-grid strong{display:block;font-size:22px;color:var(--green-900)}
.report-mini-grid span{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.report-two-list{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.report-two-list h3{font-size:13px;margin:0 0 7px}
.report-two-list p{display:flex;justify-content:space-between;gap:8px;margin:0;padding:7px 0;border-bottom:1px solid var(--line);font-size:13px}
.report-two-list p span{color:var(--muted)}
.report-table-panel{margin-bottom:18px}
.report-table-panel .table-wrap{max-height:520px}
.report-table-panel table{min-width:980px}
.report-table-panel td{white-space:normal;min-width:90px}
.report-table-panel small{color:var(--muted)}
.admin-action-card.report-action{border-color:#bcd9c5;background:linear-gradient(180deg,#f7fcf8,#fff)}
.report-photo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:12px}
.report-photo-grid a{display:block;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#f8faf8}
.report-photo-grid img{display:block;width:100%;height:150px;object-fit:cover}
.report-photo-grid span{display:block;padding:8px 10px;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.report-history-item{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:10px 0;background:#fbfcfb}
.report-history-item p{margin:4px 0}

@media(max-width:1000px){
  .report-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .report-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .report-center-hero{align-items:flex-start;flex-direction:column}
  .report-center-actions{justify-content:flex-start}
}
@media(max-width:700px){
  .report-filter-grid,.report-section-grid{grid-template-columns:1fr}
  .report-summary-grid{grid-template-columns:1fr}
  .report-mini-grid{grid-template-columns:1fr 1fr}
  .report-two-list{grid-template-columns:1fr}
  .report-center-hero{padding:20px}
  .report-center-hero h1{font-size:26px}
  .report-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .report-photo-grid img{height:110px}
}

/* =========================================================
   INCIDENT PRINT REPORT
   ========================================================= */
.report-sheet .report-photo-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.report-sheet .report-photo-grid img{height:150px;object-fit:cover}

@media print{
  .report-sheet{box-shadow:none!important;border:0!important;max-width:none!important;margin:0!important}
  .report-sheet .report-photo-grid{grid-template-columns:repeat(3,1fr);gap:10px}
  .report-sheet .report-photo-grid a{break-inside:avoid;page-break-inside:avoid}
  .report-sheet .report-photo-grid img{height:145px;object-fit:cover}
  .report-sheet .report-history-item{break-inside:avoid;page-break-inside:avoid}
}

html[data-theme="dark"] .report-center-hero{background:linear-gradient(135deg,#132b20,#1e5139)}
html[data-theme="dark"] .report-summary-card,
html[data-theme="dark"] .report-mini-grid>div,
html[data-theme="dark"] .report-two-list p,
html[data-theme="dark"] .report-history-item,
html[data-theme="dark"] .report-photo-grid a{background:#18231e;border-color:#34463b}
html[data-theme="dark"] .report-summary-card strong,
html[data-theme="dark"] .report-mini-grid strong{color:#eef7f0}
html[data-theme="dark"] .report-filter-grid label{color:#dce9df}
