/* AgroLogix R12 Administrador — BODY ONLY; R4 shell is LOCKED. */
body[data-r4-view="grazing"] #r3bRouteHost:has(>.g12a){height:var(--g12a-height,calc(100dvh - 82px));overflow:hidden;padding:0;min-height:0}
body[data-r4-view="grazing"] .g12a{--ad-navy:#08257f;--ad-green:#087443;--ad-border:#dce6f3;--ad-muted:#56709c;--ad-soft:#f4f8ff;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:clamp(63px,8.5vh,80px) clamp(61px,8.5vh,80px) clamp(85px,12vh,105px) minmax(0,1.22fr) minmax(0,.99fr) 14px;gap:clamp(6px,.9vh,10px);height:100%;min-height:0;padding:9px 13px 4px;background:var(--ad-soft);color:#193c78;font-family:inherit;overflow:hidden}
body[data-r4-view="grazing"] .g12a *{box-sizing:border-box}
body[data-r4-view="grazing"] .g12a button{cursor:pointer;font:inherit}
body[data-r4-view="grazing"] .g12a button:focus-visible,.g12a-dialog button:focus-visible,.g12a-dialog input:focus-visible{outline:2px solid #196ab6;outline-offset:2px}
body[data-r4-view="grazing"] .g12a-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0;border-bottom:1px solid #dfe9f3;padding-bottom:8px}
body[data-r4-view="grazing"] .g12a-title{display:flex;align-items:center;gap:11px;min-width:0}
body[data-r4-view="grazing"] .g12a-title .g12a-icon{width:42px;height:42px;object-fit:contain;flex:0 0 42px}
body[data-r4-view="grazing"] .g12a-title h1{font-size:clamp(21px,2vw,29px);color:var(--ad-navy);font-weight:800;line-height:1.1;margin:0;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-title p{font-size:clamp(10px,.83vw,13px);color:#5977ad;margin:5px 0 0;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-toolbar-actions{display:flex;justify-content:flex-end;gap:9px;min-width:0;flex-shrink:0}
body[data-r4-view="grazing"] .g12a :is(.g12a-positive,.g12a-link){background:#087443;color:white;border:1px solid #087443;border-radius:6px;font-weight:700;padding:8px 11px;white-space:nowrap}
body[data-r4-view="grazing"] .g12a :is(.g12a-positive,.g12a-link):hover{background:#065d37;color:white}
body[data-r4-view="grazing"] .g12a .g12a-secondary{background:white;color:#087443;border:1px solid #087443;border-radius:6px;font-weight:700;padding:8px 11px;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-filters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) auto;gap:8px;align-items:end;min-width:0;padding:1px 0 3px}
body[data-r4-view="grazing"] .g12a-filters label{display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:700;color:#1b3e81;min-width:0}
body[data-r4-view="grazing"] .g12a-filters select{width:100%;height:35px;padding:6px 8px;border:1px solid var(--ad-border);border-radius:6px;background:white;color:#12377e;font-size:11px;font-weight:600;min-width:0}
body[data-r4-view="grazing"] .g12a-filters button{height:35px;font-size:11px}
body[data-r4-view="grazing"] .g12a-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;min-width:0;min-height:0}
body[data-r4-view="grazing"] .g12a-kpi{display:grid;grid-template-columns:clamp(36px,3.4vw,51px) minmax(0,1fr) 11px;gap:7px;align-items:center;padding:9px;border:1px solid var(--ad-border);border-radius:9px;background:white;text-align:left;min-width:0;overflow:hidden}
body[data-r4-view="grazing"] .g12a-kpi>.g12a-icon{width:100%;max-height:58px;object-fit:contain}
body[data-r4-view="grazing"] .g12a-kpi span{display:flex;flex-direction:column;min-width:0;gap:3px}
body[data-r4-view="grazing"] .g12a-kpi small{font-size:clamp(10px,.72vw,12px);font-style:normal;color:#1a438f}
body[data-r4-view="grazing"] .g12a-kpi strong{font-size:clamp(20px,1.65vw,26px);font-weight:800;color:var(--ad-navy);line-height:1.1}
body[data-r4-view="grazing"] .g12a-kpi em{font-size:clamp(9px,.7vw,11px);font-style:normal;font-weight:700;color:#049c65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-r4-view="grazing"] .g12a-kpi>b{font-size:19px;color:#1671d8}
body[data-r4-view="grazing"] .g12a-middle{display:grid;grid-template-columns:minmax(0,1.82fr) minmax(0,1fr);gap:9px;min-height:0}
body[data-r4-view="grazing"] .g12a-bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;min-height:0}
body[data-r4-view="grazing"] .g12a-card{background:#fff;border:1px solid var(--ad-border);border-radius:8px;padding:10px;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;cursor:pointer}
body[data-r4-view="grazing"] .g12a-card:hover{border-color:#9ac8b5}
body[data-r4-view="grazing"] .g12a-card header{display:flex;align-items:center;gap:8px;min-height:29px;margin-bottom:7px;flex:0 0 auto}
body[data-r4-view="grazing"] .g12a-card header .g12a-icon{height:23px;width:23px;object-fit:contain;flex:0 0 23px}
body[data-r4-view="grazing"] .g12a-card h2{font-size:clamp(12px,1.02vw,16px);font-weight:800;color:var(--ad-navy);margin:0;flex:1;min-width:0;line-height:1.2}
body[data-r4-view="grazing"] .g12a-card header>button{font-size:10px;font-weight:600;padding:5px 7px;border:1px solid #dbe5ef;background:white;color:#087443;border-radius:6px;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-table-scroll{flex:1;overflow:auto;min-width:0;min-height:0}
body[data-r4-view="grazing"] .g12a-table-scroll table{width:100%;table-layout:auto;border-collapse:collapse;font-size:clamp(9px,.72vw,11px);color:#244780}
body[data-r4-view="grazing"] .g12a-table-scroll th{position:sticky;top:0;background:#edf4fc;padding:6px 5px;height:31px;white-space:nowrap;text-align:left;font-size:clamp(9px,.67vw,10px);z-index:1;color:#234781}
body[data-r4-view="grazing"] .g12a-table-scroll td{border-bottom:1px solid #e9eff5;padding:6px 5px;min-height:29px;white-space:nowrap;text-overflow:ellipsis;max-width:180px;overflow:hidden}
body[data-r4-view="grazing"] .g12a-table-scroll th:last-child,body[data-r4-view="grazing"] .g12a-table-scroll td:last-child{text-align:center}
body[data-r4-view="grazing"] .g12a-table-scroll button.g12a-link{font-size:10px;padding:4px 8px}
body[data-r4-view="grazing"] .g12a-pager{min-height:26px;padding-top:4px;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10px;color:#345e9a;flex:0 0 auto}
body[data-r4-view="grazing"] .g12a-pager>div{display:flex;align-items:center;gap:5px}
body[data-r4-view="grazing"] .g12a-pager button{background:white;border:1px solid #dce6f3;color:#087443;border-radius:5px;padding:3px 8px;font-size:12px}
body[data-r4-view="grazing"] .g12a-pager button:disabled{opacity:.45;cursor:default}
body[data-r4-view="grazing"] .g12a-status{display:inline-flex;padding:4px 6px;border-radius:5px;white-space:nowrap;font-size:10px;font-weight:700}
body[data-r4-view="grazing"] .g12a-status.active{background:#d2f6e2;color:#078e5c}
body[data-r4-view="grazing"] .g12a-status.rest{background:#fff0c2;color:#b97808}
body[data-r4-view="grazing"] .g12a-status.overdue{background:#ffe2e6;color:#c9263a}
body[data-r4-view="grazing"] .g12a-status.pending{background:#e0edff;color:#1a64b5}
body[data-r4-view="grazing"] .g12a-chart{background:transparent;border:0;display:grid;grid-template-columns:minmax(93px,1fr) 1.25fr;gap:10px;align-items:center;width:100%;height:100%;min-height:0;cursor:pointer;text-align:left}
body[data-r4-view="grazing"] .g12a-donut{width:min(100%,155px);aspect-ratio:1/1;display:grid;place-items:center;border-radius:50%;background:conic-gradient(#07b56c 0% var(--g12a-pct),#ffca28 var(--g12a-pct) 100%);justify-self:center}
body[data-r4-view="grazing"] .g12a-donut>strong{border-radius:50%;background:white;width:65%;height:65%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--ad-navy);font-size:clamp(17px,2vw,26px)}
body[data-r4-view="grazing"] .g12a-donut small{font-size:10px;font-weight:normal;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-legend{display:grid;gap:8px;min-width:0;font-size:11px;color:#264883}
body[data-r4-view="grazing"] .g12a-legend>span{display:grid;grid-template-columns:9px minmax(0,1fr);align-items:center;gap:5px}
body[data-r4-view="grazing"] .g12a-legend b{grid-column:2;font-size:10px}
body[data-r4-view="grazing"] .g12a-legend small{font-size:9px;color:#7489a9;line-height:1.2}
body[data-r4-view="grazing"] .g12a-bullet{width:9px;height:9px;display:inline-block;border-radius:50%}
body[data-r4-view="grazing"] .g12a-bullet.assigned{background:#07b56c}
body[data-r4-view="grazing"] .g12a-bullet.unassigned{background:#ffca28}
body[data-r4-view="grazing"] .g12a-nochart{font-size:11px;color:#7586a0;padding:20px}
body[data-r4-view="grazing"] .g12a-foot{font-size:9px;margin:0;color:#6480a3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.g12a-dialog{box-sizing:border-box;width:min(890px,calc(100vw - 42px));max-height:calc(100dvh - 40px);padding:0;border:1px solid #dbe7f1;border-radius:11px;box-shadow:0 14px 50px #19294b3b;color:#1c3981}
.g12a-dialog::backdrop{background:#11294763}
.g12a-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.g12a-dialog>header{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid #e5ebf5;padding:15px 17px}
.g12a-dialog>header h2{font-size:19px;color:#08257f;margin:0}
.g12a-dialog button{font:inherit;cursor:pointer;border-radius:6px;border:1px solid #087443;color:#fff;background:#087443;padding:7px 10px}
.g12a-dialog button[data-close],.g12a-dialog button[data-cancel]{background:#fff;color:#087443}
.g12a-dialog .g12a-dialog-body{flex:1 1 auto;overflow:auto;min-height:0;padding:14px 17px}
.g12a-dialog .g12a-dialog-body>p{font-size:13px;margin:7px 0 12px}
.g12a-dialog .g12a-modal-table{max-height:212px;overflow:auto}
.g12a-dialog .g12a-modal-table table{border-collapse:collapse;width:100%;font-size:12px}
.g12a-dialog .g12a-modal-table :is(td,th){padding:8px;border-bottom:1px solid #e5ebf5;text-align:left;white-space:nowrap}
.g12a-dialog .g12a-modal-table th{position:sticky;top:0;background:#edf4fc;color:#08257f}
.g12a-dialog footer{position:sticky;bottom:0;padding:10px 0 3px;background:#fff;border-top:1px solid #e5ebf5;display:flex;justify-content:flex-end;gap:8px}
.g12a-dialog .g12a-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.g12a-dialog .g12a-form label{display:grid;gap:5px;font-size:12px;color:#193c78}
.g12a-dialog .g12a-form :is(input,select,textarea){padding:8px;border:1px solid #dce6f3;border-radius:5px;color:#173c77;background:white;font:inherit;min-width:0}
.g12a-dialog .g12a-form fieldset,.g12a-dialog .g12a-form footer,.g12a-dialog .g12a-form .g12a-error,.g12a-dialog .g12a-form .g12a-wide{grid-column:1/-1}
.g12a-dialog .g12a-form [data-animals]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));max-height:140px;overflow:auto;gap:7px;font-size:12px}
.g12a-dialog .g12a-form [data-animals] label{display:flex;gap:5px;align-items:center}
.g12a-dialog .g12a-form .g12a-confirm{display:flex;flex-direction:row;align-items:center;gap:7px}
.g12a-dialog .g12a-form textarea{min-height:64px}
.g12a-dialog .g12a-error{font-size:12px;color:#c02629;margin:0}
.g12a-dialog button:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:1280px){body[data-r4-view="grazing"] .g12a{gap:6px;padding:7px;grid-template-rows:69px 55px 78px minmax(0,1.2fr) minmax(0,1fr) 12px}body[data-r4-view="grazing"] .g12a-title h1{font-size:23px}body[data-r4-view="grazing"] .g12a-title p{font-size:11px}body[data-r4-view="grazing"] .g12a-filters{gap:4px}body[data-r4-view="grazing"] .g12a-card{padding:7px}body[data-r4-view="grazing"] .g12a-card h2{font-size:13px}body[data-r4-view="grazing"] .g12a-chart{gap:4px}body[data-r4-view="grazing"] .g12a-legend{font-size:10px}}
@media(max-height:720px){body[data-r4-view="grazing"] .g12a{gap:5px;grid-template-rows:59px 50px 70px minmax(0,1.2fr) minmax(0,1fr) 12px}body[data-r4-view="grazing"] .g12a-kpi{padding:5px}body[data-r4-view="grazing"] .g12a-card{padding:6px}}

/* ADMIN active rows: fixed widths avoid inadvertent horizontal page scroll. */
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll table{table-layout:fixed;min-width:0}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(1){width:10%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(2){width:14%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(3){width:15%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(4){width:8%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(5){width:13%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(6){width:7%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(7){width:14%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(8){width:12%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(9){width:7%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll th{white-space:normal}

/* R12 ADMIN R2 - Scoped precision contract. No global CSS and no R4 shell changes. */
body[data-r4-view="grazing"] #r3bRouteHost:has(>.g12a){overflow:hidden}
body[data-r4-view="grazing"] .g12a{
  grid-template-rows:clamp(59px,7.8vh,73px) clamp(57px,7.8vh,67px) clamp(77px,10.5vh,95px) minmax(192px,1.06fr) minmax(203px,1.04fr) 12px;
  gap:7px; padding:7px 12px 3px;
}
body[data-r4-view="grazing"] .g12a-heading-mark{width:43px;height:43px;display:grid;place-items:center;background:#0a8b54;border-radius:7px;flex:0 0 43px}
body[data-r4-view="grazing"] .g12a-heading-mark img{width:32px;height:32px;object-fit:contain;filter:brightness(0) invert(1)}
body[data-r4-view="grazing"] .g12a-title h1{font-size:clamp(22px,1.8vw,28px)}
body[data-r4-view="grazing"] .g12a-filters{gap:8px;align-items:end;padding:0 0 2px}
body[data-r4-view="grazing"] .g12a-select-frame{position:relative;display:block;min-width:0}
body[data-r4-view="grazing"] .g12a-select-frame>.g12a-icon{position:absolute;left:9px;top:50%;transform:translateY(-50%);width:17px;height:17px;object-fit:contain;pointer-events:none}
body[data-r4-view="grazing"] .g12a-select-frame:has(>.g12a-icon)>select{padding-left:30px}
body[data-r4-view="grazing"] .g12a-filters select{height:34px;font-size:11px}
body[data-r4-view="grazing"] .g12a-kpi{padding:7px 9px}
body[data-r4-view="grazing"] .g12a-card{padding:8px;min-height:0}
body[data-r4-view="grazing"] .g12a-card header{min-height:25px;margin-bottom:4px;gap:6px}
body[data-r4-view="grazing"] .g12a-card header .g12a-icon{height:21px;width:21px;flex:0 0 21px}
body[data-r4-view="grazing"] .g12a-card h2{font-size:clamp(12px,.97vw,15px)}
body[data-r4-view="grazing"] .g12a-table-scroll{overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#b5c3d5 transparent}
body[data-r4-view="grazing"] .g12a-table-scroll table{width:100%;max-width:100%;table-layout:fixed;border-collapse:collapse}
body[data-r4-view="grazing"] .g12a-table-scroll :is(td,th){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body[data-r4-view="grazing"] .g12a-table-scroll th{height:25px;padding:4px 3px;font-size:9.5px}
body[data-r4-view="grazing"] .g12a-table-scroll td{height:24px;padding:3px 3px;font-size:10px}
body[data-r4-view="grazing"] .g12a-pager{min-height:21px;padding-top:2px;font-size:10px}
body[data-r4-view="grazing"] .g12a-table-scroll .g12a-link{padding:3px 6px;font-size:9px}
body[data-r4-view="grazing"] .g12a-row-actions{display:flex;align-items:center;justify-content:center;gap:3px}
body[data-r4-view="grazing"] .g12a-row-actions .g12a-review-action{background:#fff;border-color:#0d7b4b;color:#0d7b4b}
body[data-r4-view="grazing"] .g12a-row-actions .g12a-review-action:hover{background:#effaf3;color:#064c2f}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(1){width:9%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(2){width:13%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(3){width:15%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(4){width:7%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(5){width:11%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(6){width:8%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(7){width:13%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(8){width:11%}
body[data-r4-view="grazing"] .g12a-middle>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(9){width:13%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(1){width:17%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(2){width:14%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(3){width:25%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(4){width:12%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(5){width:12%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:first-child .g12a-table-scroll :is(td,th):nth-child(6){width:20%}
body[data-r4-view="grazing"] .g12a-cell-link,body[data-r4-view="grazing"] .g12a-status-button{border:0;background:transparent;padding:0;color:#244780;font-size:inherit;text-align:left;min-width:0;max-width:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-cell-link:hover{text-decoration:underline}
body[data-r4-view="grazing"] .g12a-status-button{display:inline-flex;align-items:center;justify-content:flex-start;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-status{padding:3px 4px;font-size:9px}
body[data-r4-view="grazing"] .g12a-supp-label{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:nth-child(2) .g12a-table-scroll :is(td,th):nth-child(1){width:18%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:nth-child(2) .g12a-table-scroll :is(td,th):nth-child(2){width:29%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:nth-child(2) .g12a-table-scroll :is(td,th):nth-child(3){width:12%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:nth-child(2) .g12a-table-scroll :is(td,th):nth-child(4){width:11%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:nth-child(2) .g12a-table-scroll :is(td,th):nth-child(5){width:17%}
body[data-r4-view="grazing"] .g12a-bottom>.g12a-card:nth-child(2) .g12a-table-scroll :is(td,th):nth-child(6){width:13%}
.g12a-dialog .g12a-disclosure{border:1px solid #e2eaf4;border-radius:6px;padding:9px;background:#f8fbff;color:#28466d}
@media(max-height:820px){body[data-r4-view="grazing"] .g12a{grid-template-rows:62px 56px 80px minmax(190px,1.04fr) minmax(195px,1.06fr) 12px;gap:6px}body[data-r4-view="grazing"] .g12a-card{padding:6px}body[data-r4-view="grazing"] .g12a-table-scroll td{height:23px;padding:2px 3px}body[data-r4-view="grazing"] .g12a-table-scroll th{height:24px;padding:3px}body[data-r4-view="grazing"] .g12a-card header{margin-bottom:3px;min-height:24px}body[data-r4-view="grazing"] .g12a-pager{min-height:19px;padding-top:1px}}
body[data-r4-view="grazing"] .g12a-title .g12a-heading-mark .g12a-icon{width:32px;height:32px;max-height:32px;object-fit:contain;filter:brightness(0) invert(1)}
