/* =========================================================
   Al Rabia Farms — shared staff portal theme
   Loaded after each page's own styles so it wins on ties.
   ========================================================= */
:root{
  --st-brand:#0f4c3a;--st-brand-2:#1a6550;--st-brand-dark:#0c3d2f;--st-gold:#b0905a;--st-gold-2:#cdb385;
  --st-ink:#1c2a26;--st-muted:#5b6762;--st-line:#e3e7e5;--st-bg:#f4f6f5;--st-surface:#fff;--st-surface-2:#f0f3f1;
  --st-red:#b23a3a;--st-red-bg:#f8e7e7;--st-ok:#1a7f5a;--st-ok-bg:#e3f2ea;--st-warn-bg:#f5eedf;
  --st-radius:12px;--st-shadow:0 6px 20px -12px rgba(16,40,32,.25);
  --st-font:'Thmanyah Sans',system-ui,Arial,sans-serif;--st-kufi:'Thmanyah Sans',system-ui,Arial,sans-serif;--st-display:'Thmanyah Serif Display','Thmanyah Serif Text',serif;--st-text:'Thmanyah Serif Text','Thmanyah Sans',serif;
}
body.st{font-family:var(--st-font);background:var(--st-bg);color:var(--st-ink);margin:0;-webkit-font-smoothing:antialiased}
body.st main h1,body.st main h2{font-family:var(--st-display);font-weight:700;color:var(--st-ink)}
body.st :focus-visible{outline:3px solid var(--st-gold);outline-offset:2px}
.st-wrap{max-width:1240px;margin:auto;padding:0 20px}
.st-i{width:18px;height:18px;flex:none;display:block}

/* ---------- Top bar ---------- */
.st-top{background:var(--st-surface);border-bottom:1px solid var(--st-line);position:sticky;top:0;z-index:30;font-family:var(--st-font)}
.st-top .st-top-in{display:flex;align-items:center;gap:12px;min-height:64px}
.st-top a{color:var(--st-ink);text-decoration:none}
.st-top .st-brand{display:flex;align-items:center;gap:10px;flex:none;color:var(--st-ink)}
.st-top .st-mark{width:40px;height:40px;border-radius:9px;border:2px solid var(--st-gold);display:grid;place-items:center;color:var(--st-brand);font-family:var(--st-display);font-weight:700;font-size:19px;background:#fff}
.st-top .st-brand strong{display:block;font-size:15px;line-height:1.3}
.st-top .st-brand small{display:block;font-size:11.5px;color:var(--st-muted);font-weight:400}
.st-top .st-nav{display:flex;align-items:center;gap:2px;margin-inline-start:14px}
.st-top .st-nav a{display:inline-flex;align-items:center;gap:7px;padding:8px 11px;border-radius:8px;font-size:13.5px;font-weight:500;color:var(--st-muted);white-space:nowrap}
.st-top .st-nav a:hover{background:var(--st-surface-2);color:var(--st-ink)}
.st-top .st-nav a[aria-current="page"]{background:var(--st-brand);color:#fff}
.st-top .st-spacer{flex:1}
.st-top .st-ghost{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--st-muted);padding:8px 10px;border-radius:8px}
.st-top .st-ghost:hover{background:var(--st-surface-2);color:var(--st-ink)}
.st-top .st-tool{position:relative;display:inline-grid;place-items:center;width:38px;height:38px;flex:none;box-sizing:border-box;border:1px solid var(--st-line);border-radius:9px;background:var(--st-surface);color:var(--st-muted)}
.st-top .st-tool .st-i{width:19px;height:19px}
.st-top .st-tool:hover{background:var(--st-surface-2);color:var(--st-ink)}
.st-top .st-tool[aria-current="page"]{background:var(--st-brand);border-color:var(--st-brand);color:#fff}
.st-top .st-tool .n{position:absolute;top:-6px;inset-inline-end:-6px;min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:9px;background:var(--st-red);color:#fff;font:700 11px/18px var(--st-font);text-align:center;font-variant-numeric:tabular-nums;border:2px solid #fff}
.st-top .st-me{display:inline-flex;align-items:center;gap:8px;padding:4px 4px 4px 12px;border:1px solid var(--st-line);border-radius:10px;font-size:13px;max-width:220px}
.st-top .st-me b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
a.st-me{color:inherit;text-decoration:none;transition:border-color .15s,background-color .15s}
a.st-me:hover,a.st-me[aria-current]{border-color:var(--st-brand);background:#f3f9f5}
.st-top .st-avatar{width:30px;height:30px;border-radius:7px;background:var(--st-brand);color:#fff;display:grid;place-items:center;font-weight:700;flex:none}
.st-top form.st-out{margin:0;display:block}
.st-top form.st-out button,.st-top button.st-burger{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 12px;border:1px solid var(--st-line);border-radius:9px;background:var(--st-surface);font:600 13px var(--st-font);color:var(--st-red);cursor:pointer}
.st-top form.st-out button:hover{background:var(--st-red-bg)}
.st-top button.st-burger{display:none;color:var(--st-ink);padding:0 10px}
.st-top button:focus-visible{outline:3px solid var(--st-gold);outline-offset:2px}

/* ---------- Page heading ---------- */
.st-head{background:linear-gradient(180deg,var(--st-brand-dark),var(--st-brand));color:#fff;border-bottom:3px solid var(--st-gold);position:relative;overflow:hidden;font-family:var(--st-font)}
.st-head:before{content:'';position:absolute;inset:0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 0L40 20L20 40L0 20Z' fill='none' stroke='%23ffffff' stroke-opacity='.06'/%3E%3C/svg%3E");-webkit-mask-image:linear-gradient(90deg,#000,transparent 70%);mask-image:linear-gradient(90deg,#000,transparent 70%)}
.st-head .st-head-in{position:relative;display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding-top:22px;padding-bottom:22px}
.st-head h1{margin:2px 0 0;font-family:var(--st-display);font-size:clamp(21px,2.4vw,27px);font-weight:700;line-height:1.5;color:#fff}
.st-head p{margin:2px 0 0;color:#cfe0d9;font-size:14px}
.st-crumbs{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-size:12.5px;color:#b9cfc7}
.st-head .st-crumbs a{color:#cfe0d9;text-decoration:none}
.st-head .st-crumbs a:hover{color:#fff;text-decoration:underline}
.st-crumbs .st-i{width:14px;height:14px;opacity:.6}
.st-head-actions{display:flex;gap:10px;flex-wrap:wrap}
.st-head-actions a{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 16px;border-radius:9px;font-weight:600;font-size:14px;text-decoration:none;white-space:nowrap}
.st-head-actions .st-btn-gold{background:var(--st-gold);color:#1c2a26}
.st-head-actions .st-btn-gold:hover{filter:brightness(1.06)}
.st-head-actions .st-btn-line{border:1px solid rgba(255,255,255,.35);color:#fff;background:transparent}
.st-head-actions .st-btn-line:hover{background:rgba(255,255,255,.08)}

/* ---------- Footer ---------- */
.st-foot{border-top:1px solid var(--st-line);padding:18px 0;color:var(--st-muted);font-size:12.5px;font-family:var(--st-font)}
.st-foot .st-wrap{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}

/* ---------- Shared content defaults for legacy pages ---------- */
body.st > main{max-width:1240px;margin:auto;padding:26px 20px 48px;box-sizing:border-box}

/* Animals module (style.css) */
body.st-animals section,body.st-animals .filter-panel{border-color:var(--st-line);border-radius:var(--st-radius)}
/* Buttons: explicit colours per type so no generic rule can hide their text */
body.st-animals a.action-primary,body.st-animals button.action-primary,body.st-animals main button:not([class]){background:var(--st-brand);border:1px solid var(--st-brand);color:#fff;border-radius:9px}
body.st-animals a.action-primary:hover,body.st-animals button.action-primary:hover,body.st-animals main button:not([class]):hover{background:var(--st-brand-dark);color:#fff}
body.st-animals a.action-secondary,body.st-animals button.action-secondary{background:#fff;border:1px solid var(--st-line);color:var(--st-brand);border-radius:9px}
body.st-animals a.action-secondary:hover,body.st-animals button.action-secondary:hover{border-color:var(--st-brand);background:var(--st-surface-2);color:var(--st-brand)}
body.st-animals button.text-button{background:transparent;border:0;color:var(--st-muted)}
body.st-animals button.text-button:hover{color:var(--st-red)}
body.st-animals input,body.st-animals select,body.st-animals textarea{border-color:#cfd6d3;border-radius:9px;background:#fff}
body.st-animals input:focus,body.st-animals select:focus,body.st-animals textarea:focus{outline:0;border-color:var(--st-brand-2);box-shadow:0 0 0 3px rgba(26,101,80,.15)}
body.st-animals main a:not([class]),body.st-animals main .back-link,body.st-animals main .reset-link{color:var(--st-brand-2)}
body.st-animals .eyebrow{color:var(--st-gold)}
body.st-animals .registry-stats{border-color:var(--st-line);background:var(--st-line);border-radius:var(--st-radius)}
body.st-animals .stat-item>strong{color:var(--st-brand);font-family:var(--st-kufi)}
body.st-animals .animal-card,body.st-animals .barn-card{border-color:var(--st-line);border-radius:var(--st-radius)}
body.st-animals .animal-card:hover,body.st-animals .barn-card:hover{border-color:var(--st-brand-2);box-shadow:var(--st-shadow)}
body.st-animals .species-symbol,body.st-animals .barn-symbol,body.st-animals .empty-symbol{background:var(--st-surface-2);color:var(--st-brand)}
body.st-animals .animal-card-footer strong{color:var(--st-brand-2)}
body.st-animals .group-chip{background:var(--st-surface-2);border-radius:9px}
body.st-animals .group-chip b{background:#e3e9e6}
body.st-animals .barn-create,body.st-animals .group-create{border-color:#c9d3cf;border-radius:10px}
body.st-animals .barn-create summary,body.st-animals .group-create summary,body.st-animals .collar-filter summary{color:var(--st-brand-2)}
body.st-animals .housing-sections section{border-color:var(--st-line);border-radius:var(--st-radius)}
body.st-animals .summary p{background:var(--st-surface-2);border-radius:9px}
body.st-animals .tagchoice:has(input:checked){border-color:var(--st-brand);box-shadow:0 0 0 2px rgba(26,101,80,.15)}
body.st-animals table th{background:var(--st-surface-2);font-weight:600;font-size:13px;color:var(--st-muted)}
body.st-animals table th,body.st-animals table td{border-bottom-color:var(--st-line)}
body.st-animals fieldset{border-color:var(--st-line);border-radius:10px}

/* Health protocol */
body.st-health{
  --color-primary:#0f4c3a;--color-background:#f4f6f5;--color-surface-muted:#f0f3f1;--color-text:#1c2a26;
  --color-text-muted:#5b6762;--color-border:#e3e7e5;--color-warning-background:#f5eedf;--radius-card:12px;--radius-pill:8px;
}
body.st-health > main{max-width:1000px}
body.st-health .card h2{font-size:17px}
body.st-health .actions button:not(.primary){background:#fff;border:1px solid var(--st-line);color:var(--st-ink)}

/* Admin */
body.st-admin{--primary:#0f4c3a;--line:#e3e7e5;--bg:#f4f6f5;--ink:#1c2a26}
body.st-admin .card,body.st-admin .role,body.st-admin .perm{border-radius:var(--st-radius)}
body.st-admin button{border-radius:9px}
body.st-admin input,body.st-admin select{border-color:#cfd6d3}
body.st-admin th{background:var(--st-surface-2);color:var(--st-muted);font-weight:600}
body.st-admin .msg{background:var(--st-ok-bg);color:var(--st-ok)}
body.st-admin .error{background:var(--st-red-bg);color:var(--st-red)}

/* ---------- Login ---------- */
body.st-login{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}
.st-login-side{background:linear-gradient(180deg,var(--st-brand-dark),var(--st-brand));color:#fff;position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;padding:40px 48px;border-inline-end:4px solid var(--st-gold)}
.st-login-side:before{content:'';position:absolute;inset:0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 0L48 24L24 48L0 24Z' fill='none' stroke='%23ffffff' stroke-opacity='.07'/%3E%3C/svg%3E")}
.st-login-side > *{position:relative}
.st-login-side .st-brand{display:flex;align-items:center;gap:12px;color:#fff;text-decoration:none}
.st-login-side .st-mark{width:48px;height:48px;border-radius:10px;border:2px solid var(--st-gold);background:#fff;color:var(--st-brand);display:grid;place-items:center;font:700 22px var(--st-display)}
.st-login-side .st-brand strong{display:block;font-size:17px}
.st-login-side .st-brand small{display:block;font-size:12px;color:#cfe0d9}
.st-login-side h2{font:700 clamp(24px,2.6vw,34px)/1.5 var(--st-display);margin:0 0 10px;color:#fff}
.st-login-side p{color:#cfe0d9;margin:0;max-width:420px}
.st-login-side ul{list-style:none;padding:0;margin:26px 0 0;display:grid;gap:10px;font-size:14px;color:#e3eee9}
.st-login-side li{display:flex;align-items:center;gap:10px}
.st-login-side li:before{content:'';width:8px;height:8px;border-radius:2px;background:var(--st-gold);transform:rotate(45deg)}
.st-login-side small.copy{color:#9fbab0;font-size:12px}
.st-login-main{display:flex;align-items:center;justify-content:center;padding:40px 24px}
.st-login-card{width:100%;max-width:400px}
.st-login-card h1{font:700 24px/1.5 var(--st-display);margin:0 0 4px}
.st-login-card .muted{color:var(--st-muted);margin:0 0 24px;font-size:14px}
.st-login-card label{display:block;font-weight:600;font-size:13.5px;margin:16px 0 6px}
.st-login-card input{width:100%;box-sizing:border-box;height:48px;padding:0 14px;border:1px solid #cfd6d3;border-radius:9px;font:inherit;font-size:15px;background:#fff;color:var(--st-ink)}
.st-login-card input:focus{outline:0;border-color:var(--st-brand-2);box-shadow:0 0 0 3px rgba(26,101,80,.15)}
.st-login-card button{width:100%;height:50px;margin-top:24px;border:0;border-radius:9px;background:var(--st-brand);color:#fff;font:700 15px var(--st-font);cursor:pointer}
.st-login-card button:hover{background:var(--st-brand-dark)}
.st-login-card .error{background:var(--st-red-bg);color:var(--st-red);border:1px solid #efcfcf;padding:12px 14px;border-radius:9px;font-size:14px}
.st-login-card .back{display:inline-flex;align-items:center;gap:6px;margin-top:22px;font-size:13px;color:var(--st-muted);text-decoration:none}
.st-login-card .back:hover{color:var(--st-brand)}
@media (max-width:860px){
  body.st-login{grid-template-columns:1fr}
  .st-login-side{padding:24px 20px;border-inline-end:0;border-bottom:3px solid var(--st-gold)}
  .st-login-side .intro,.st-login-side small.copy{display:none}
}

/* Initial setup */
body.st-setup{padding:0}
body.st-setup main{border-color:var(--st-line);border-radius:var(--st-radius)}
body.st-setup button{background:var(--st-brand);border-radius:9px}

/* =========================================================
   Components for the native modules (tasks, breeding): body.st-app
   ========================================================= */
body.st-app{line-height:1.7}
body.st-app a{color:inherit;text-decoration:none}
.st-card{background:var(--st-surface);border:1px solid var(--st-line);border-radius:var(--st-radius);padding:18px 20px;margin-bottom:18px}
.st-card > h2,.st-sec-title{font-family:var(--st-text);font-size:16.5px;margin:0 0 14px;display:flex;align-items:center;gap:10px}
.st-sec-title:before,.st-card > h2:before{content:'';width:4px;height:17px;border-radius:2px;background:var(--st-gold);flex:none}
.st-card > h2 small{font-family:var(--st-font);font-weight:400;font-size:12.5px;color:var(--st-muted);margin-inline-start:auto}
.st-note{color:var(--st-muted);font-size:13px;margin:6px 0 0}
.st-cols{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:20px;align-items:start}
.st-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px 16px;align-items:end}
.st-form .full{grid-column:1/-1}
.st-field{display:grid;gap:6px;font-size:13px;font-weight:600;color:var(--st-ink);min-width:0}
.st-field small{font-weight:400;color:var(--st-muted);font-size:12px}
.st-field input,.st-field select,.st-field textarea,.st-input{font:inherit;font-size:14.5px;font-weight:400;color:var(--st-ink);background:#fff;border:1px solid #cfd6d3;border-radius:9px;padding:0 12px;height:44px;width:100%;box-sizing:border-box;min-width:0}
.st-field textarea{height:auto;min-height:84px;padding:10px 12px;resize:vertical}
.st-field input:focus,.st-field select:focus,.st-field textarea:focus,.st-input:focus{outline:0;border-color:var(--st-brand-2);box-shadow:0 0 0 3px rgba(26,101,80,.15)}
.st-field.req > span:after{content:' *';color:var(--st-red)}
.st-check{display:inline-flex;align-items:center;gap:8px;font-size:13.5px;font-weight:500}
.st-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;border-radius:9px;border:1px solid var(--st-brand);background:var(--st-brand);color:#fff!important;font:600 14px var(--st-font);cursor:pointer;white-space:nowrap;text-decoration:none;box-sizing:border-box}
.st-btn:hover{background:var(--st-brand-dark)}
.st-btn.line{background:#fff;color:var(--st-brand)!important;border-color:var(--st-line)}
.st-btn.line:hover{border-color:var(--st-brand)}
.st-btn.gold{background:var(--st-gold);border-color:var(--st-gold);color:#1c2a26!important}
.st-btn.danger{background:#fff;color:var(--st-red)!important;border-color:#efcfcf}
.st-btn.danger:hover{background:var(--st-red-bg)}
.st-btn.sm{height:34px;padding:0 12px;font-size:13px;border-radius:8px}
.st-btn .st-i{width:17px;height:17px}
/* Outline and gold buttons in the page body (links and buttons alike — a <button> had the browser's default look); the page head keeps its own look below */
.st-btn-line,.st-btn-gold{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 14px;border-radius:9px;font:600 13.5px var(--st-font);line-height:1;cursor:pointer;white-space:nowrap;text-decoration:none;box-sizing:border-box;transition:border-color .15s,background-color .15s,filter .15s}
.st-btn-line{background:#fff;border:1px solid #d3dbd7;color:var(--st-brand)}
.st-btn-line:hover{border-color:var(--st-brand);background:#f3f9f5}
.st-btn-gold{background:var(--st-gold);border:1px solid var(--st-gold);color:#1c2a26}
.st-btn-gold:hover{filter:brightness(1.06)}
.st-btn-line .st-i,.st-btn-gold .st-i{width:16px;height:16px}
.st-btn-line:focus-visible,.st-btn-gold:focus-visible,.st-btn:focus-visible{outline:2px solid var(--st-brand);outline-offset:2px}
.st-btn-line:disabled,.st-btn-gold:disabled,.st-btn:disabled{opacity:.55;cursor:default}
.st-btn-line.danger{color:var(--st-red);border-color:#efcfcf}
.st-btn-line.danger:hover{background:var(--st-red-bg);border-color:var(--st-red)}
.st-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.st-alert{display:flex;gap:10px;align-items:flex-start;border-radius:10px;padding:12px 14px;font-size:14px;margin:0 0 18px;border:1px solid}
.st-alert.ok{background:var(--st-ok-bg);color:var(--st-ok);border-color:#c8e6d6}
.st-alert.err{background:var(--st-red-bg);color:var(--st-red);border-color:#efcfcf}
.st-alert.warn{background:var(--st-warn-bg);color:#7a5c22;border-color:#e8d9b8}
.st-alert.info{background:var(--st-surface-2);color:var(--st-ink);border-color:var(--st-line)}
.st-badge{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;line-height:1.6;padding:1px 9px;border-radius:5px;white-space:nowrap;background:var(--st-surface-2);color:var(--st-muted)}
.st-badge.green{background:var(--st-ok-bg);color:var(--st-ok)}
.st-badge.blue{background:#e5edf8;color:#2c5d9b}
.st-badge.red{background:var(--st-red-bg);color:var(--st-red)}
.st-badge.gold{background:var(--st-warn-bg);color:#8a6d2f}
.st-badge.slate{background:#e9edf0;color:#465663}
.st-badge.teal{background:#e0f0f0;color:#0f6f74}
.st-table-wrap{overflow-x:auto;border:1px solid var(--st-line);border-radius:var(--st-radius);background:#fff}
.st-table{width:100%;border-collapse:collapse;font-size:13.5px}
.st-table th{background:var(--st-surface-2);color:var(--st-muted);font-weight:600;font-size:12.5px;text-align:start;padding:10px 12px;white-space:nowrap;border-bottom:1px solid var(--st-line)}
.st-table td{padding:10px 12px;border-bottom:1px solid var(--st-line);vertical-align:middle}
.st-table tr:last-child td{border-bottom:0}
.st-table tbody tr:hover{background:#fafbfa}
.st-table .num{font-variant-numeric:tabular-nums;white-space:nowrap}
.st-table a.link{color:var(--st-brand-2);font-weight:600}
.st-table a.link:hover{text-decoration:underline}
.st-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px;margin-bottom:18px}
.st-kpi{background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);padding:14px 16px}
.st-kpi small{display:block;color:var(--st-muted);font-size:12.5px}
.st-kpi b{display:block;font-family:var(--st-kufi);font-size:24px;line-height:1.5;color:var(--st-ink);font-variant-numeric:tabular-nums}
.st-kpi span{display:block;color:var(--st-muted);font-size:11.5px}
.st-kpi.accent{border-top:3px solid var(--st-gold)}
.st-kpi.warn b{color:var(--st-red)}
.st-filters{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.st-filters a{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;border:1px solid var(--st-line);background:#fff;font-size:13px;font-weight:500;color:var(--st-muted)}
.st-filters a:hover{border-color:var(--st-brand-2);color:var(--st-ink)}
.st-filters a.on{background:var(--st-brand);border-color:var(--st-brand);color:#fff}
.st-filters a b{font-weight:700;font-variant-numeric:tabular-nums}
.st-empty{text-align:center;color:var(--st-muted);padding:34px 16px;font-size:14px}
.st-dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px 18px;margin:0}
.st-dl dt{font-size:12px;color:var(--st-muted)}
.st-dl dd{margin:2px 0 0;font-weight:600;font-size:14px}
.st-timeline{list-style:none;margin:0;padding:0;display:grid;gap:0}
.st-timeline li{position:relative;padding:0 22px 16px 0;border-inline-start:2px solid var(--st-line);margin-inline-start:6px;padding-inline-start:18px}
.st-timeline li:before{content:'';position:absolute;inset-inline-start:-7px;top:6px;width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid var(--st-gold)}
.st-timeline li b{display:block;font-size:14px}
.st-timeline li small{color:var(--st-muted);font-size:12.5px}
details.st-more{border:1px dashed #c9d3cf;border-radius:10px;padding:10px 14px;margin-top:12px}
details.st-more summary{cursor:pointer;font-weight:600;color:var(--st-brand-2);font-size:14px}
details.st-more[open] summary{margin-bottom:12px}
.st-tagbadge{display:inline-grid;place-items:center;min-width:34px;height:24px;padding:0 6px;border-radius:12px;font-size:12px;font-weight:700;border:1px solid rgba(0,0,0,.25);direction:ltr}
.st-mono{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}

/* Tasks */
.st-task{display:grid;grid-template-columns:4px minmax(0,1fr) auto;gap:0 14px;background:#fff;border:1px solid var(--st-line);border-radius:10px;padding:12px 14px 12px 12px;margin-bottom:8px;align-items:center}
.st-task .bar{align-self:stretch;border-radius:3px;background:var(--st-line)}
.st-task.p-urgent .bar{background:var(--st-red)}.st-task.p-high .bar{background:var(--st-gold)}.st-task.p-normal .bar{background:var(--st-brand-2)}.st-task.p-low .bar{background:#b7c2bd}
.st-task h3{margin:0;font-size:14.5px;font-weight:600;line-height:1.5}
.st-task.done h3{text-decoration:line-through;color:var(--st-muted)}
.st-task .meta{display:flex;flex-wrap:wrap;gap:6px 12px;margin-top:4px;font-size:12.5px;color:var(--st-muted);align-items:center}
.st-task .meta .late{color:var(--st-red);font-weight:600}
.st-task .details{font-size:13px;color:var(--st-muted);margin-top:4px;white-space:pre-line}
.st-task form{margin:0}
.st-group-h{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:700;margin:18px 0 8px;color:var(--st-ink)}
.st-group-h b{font-variant-numeric:tabular-nums;background:var(--st-surface-2);border-radius:5px;padding:0 8px;font-size:12px}
.st-group-h.late{color:var(--st-red)}

/* Offspring rows */
.st-kids{display:grid;gap:10px}
.st-kid{display:grid;grid-template-columns:40px repeat(6,minmax(0,1fr));gap:10px;align-items:end;background:var(--st-surface-2);border-radius:10px;padding:12px}
.st-kid .n{align-self:center;width:32px;height:32px;border-radius:8px;background:var(--st-brand);color:#fff;display:grid;place-items:center;font-weight:700}

/* Decision indicators (dashboard + system pages) */
.st-dkpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin-bottom:26px}
.st-dkpi{position:relative;display:flex;flex-direction:column;gap:2px;background:#fff;border:1px solid var(--st-line);border-top:3px solid var(--st-line);border-radius:var(--st-radius);padding:13px 16px 14px;color:var(--st-ink);text-decoration:none;min-width:0}
a.st-dkpi:hover{box-shadow:var(--st-shadow);border-color:#cfd6d3}
.st-dkpi.warn{border-top-color:var(--st-red)}
.st-dkpi.good{border-top-color:var(--st-ok)}
.st-dkpi .sys{display:inline-flex;align-items:center;gap:5px;align-self:flex-start;font-size:11px;font-weight:600;color:var(--st-muted);background:var(--st-surface-2);border-radius:5px;padding:0 7px;margin-bottom:4px}
.st-dkpi .sys .st-i{width:13px;height:13px}
.st-dkpi small{font-size:12.5px;color:var(--st-muted);font-weight:500}
.st-dkpi b{font-family:var(--st-kufi);font-size:25px;line-height:1.45;font-variant-numeric:tabular-nums}
.st-dkpi.warn b{color:var(--st-red)}
.st-dkpi span.sub{font-size:12px;color:var(--st-muted);line-height:1.6}
.st-dkpi.warn span.sub{color:#8a3a3a}

/* System tiles (dashboard) */
.st-systems{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.st-sys{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:136px;padding:18px 12px;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);text-align:center;color:var(--st-ink);text-decoration:none;transition:border-color .15s,box-shadow .15s,transform .15s}
a.st-sys:hover{border-color:var(--st-brand-2);box-shadow:var(--st-shadow);transform:translateY(-2px)}
.st-sys .ic{width:58px;height:58px;border-radius:14px;display:grid;place-items:center;background:var(--st-surface-2);color:var(--st-brand)}
a.st-sys:hover .ic{background:var(--st-brand);color:#fff}
.st-sys .ic .st-i{width:28px;height:28px}
.st-sys strong{font-size:14.5px;font-weight:600;line-height:1.4}
.st-sys .n{position:absolute;top:10px;inset-inline-end:10px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--st-red);color:#fff;font-size:12px;font-weight:700;display:grid;place-items:center;font-variant-numeric:tabular-nums}
.st-sys .hd{margin-top:-6px;font-size:12px;color:var(--st-muted);font-variant-numeric:tabular-nums}
.st-units{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))}
.st-allsp{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:14px 0 30px;font-size:13px;color:var(--st-muted)}
.st-allsp .st-i{width:16px;height:16px}
.st-allsp a{color:var(--st-brand);text-decoration:underline;text-underline-offset:3px}
.st-sys.soon{opacity:.7;background:repeating-linear-gradient(-45deg,#fff,#fff 10px,var(--st-surface-2) 10px,var(--st-surface-2) 11px)}
.st-sys.soon .ic{color:var(--st-muted)}
.st-sys.soon em{font-style:normal;font-size:11px;font-weight:600;padding:1px 8px;border-radius:5px;background:var(--st-warn-bg);color:#8a6d2f}

/* Services inside a system page */
.st-svcs{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin-bottom:26px}
.st-svc{display:flex;align-items:center;gap:12px;padding:14px;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);font-weight:600;font-size:14px;color:var(--st-ink);text-decoration:none}
.st-svc .ic{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;background:var(--st-surface-2);color:var(--st-brand);flex:none}
.st-svc .chev{margin-inline-start:auto;opacity:.45;width:16px;height:16px}
.st-svc:hover{border-color:var(--st-brand-2);box-shadow:var(--st-shadow)}
.st-svc.primary{background:var(--st-brand);border-color:var(--st-brand);color:#fff}
.st-svc.primary .ic{background:rgba(255,255,255,.14);color:#fff}
.st-svc.primary:hover{background:var(--st-brand-dark)}
@media (max-width:520px){.st-systems{grid-template-columns:repeat(2,1fr)}.st-dkpis{grid-template-columns:1fr 1fr}.st-dkpi b{font-size:21px}}
@media (max-width:360px){.st-dkpis{grid-template-columns:1fr}}

/* Animal register */
.rg-species{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;margin-bottom:16px;scrollbar-width:none}
.rg-species a{display:flex;align-items:center;gap:10px;flex:none;min-width:170px;padding:10px 16px 10px 14px;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);color:var(--st-ink)}
.rg-species a:hover{border-color:var(--st-brand-2)}
.rg-species a.on{background:var(--st-brand);border-color:var(--st-brand);color:#fff;box-shadow:var(--st-shadow)}
.rg-species .sym{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--st-surface-2);color:var(--st-brand);font:700 17px var(--st-kufi);flex:none}
.rg-species a.on .sym{background:rgba(255,255,255,.15);color:#fff}
.rg-species b{display:block;font-family:var(--st-kufi);font-size:15px;line-height:1.4}
.rg-species small{display:block;font-size:12px;color:var(--st-muted)}
.rg-species a.on small{color:#cfe0d9}
.rg-species a.all{min-width:0;border-style:dashed}
.rg-species a.all.on{border-style:solid}
.rg-overview{background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);margin-bottom:16px;overflow:hidden}
.rg-stats{display:grid;grid-template-columns:repeat(5,1fr)}
.rg-stats div{padding:12px 18px;border-inline-start:1px solid var(--st-line)}
.rg-stats div:first-child{border-inline-start:0}
.rg-stats small{display:block;font-size:12px;color:var(--st-muted)}
.rg-stats b{font-family:var(--st-kufi);font-size:22px;line-height:1.5;font-variant-numeric:tabular-nums}
.rg-stats b i{font-style:normal;font-size:13px;font-family:var(--st-font);font-weight:500;color:var(--st-muted)}
.rg-locs{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:10px 14px;border-top:1px solid var(--st-line);background:#fafbfa}
.rg-locs a,.rg-locs span{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:7px;font-size:12.5px;font-weight:500;color:var(--st-muted);border:1px solid var(--st-line);background:#fff}
.rg-locs a.barn{font-weight:700;color:var(--st-ink);margin-inline-start:6px}
.rg-locs a.barn:first-child{margin-inline-start:0}
.rg-locs a .st-i{width:15px;height:15px}
.rg-locs a:hover{border-color:var(--st-brand-2);color:var(--st-ink)}
.rg-locs a.on{background:var(--st-brand);border-color:var(--st-brand);color:#fff}
.rg-locs b{font-variant-numeric:tabular-nums;color:inherit}
.rg-locs span.loose{border-style:dashed}
.rg-status{display:flex;gap:4px;box-shadow:inset 0 -1px var(--st-line);margin-bottom:14px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.rg-status a{padding:9px 14px;font-size:13.5px;font-weight:600;color:var(--st-muted);border-bottom:3px solid transparent;white-space:nowrap}
.rg-status a b{display:inline-block;min-width:22px;text-align:center;font-size:11.5px;padding:0 6px;border-radius:10px;background:var(--st-surface-2);margin-inline-start:4px}
.rg-status a:hover{color:var(--st-ink)}
.rg-status a.on{color:var(--st-brand);border-bottom-color:var(--st-gold)}
.rg-status a.on b{background:var(--st-brand);color:#fff}
.rg-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:12px}
.rg-toolbar select{height:36px;border:1px solid #cfd6d3;border-radius:8px;background:#fff;font:inherit;font-size:13px;padding:0 10px;color:var(--st-ink)}
.rg-search{position:relative;flex:1 1 280px;display:block}
.rg-search .st-i{position:absolute;top:9px;inset-inline-start:11px;color:var(--st-muted)}
.rg-search input{width:100%;box-sizing:border-box;height:36px;border:1px solid #cfd6d3;border-radius:8px;font:inherit;font-size:13.5px;padding:0 36px 0 12px;background:#fff}
.rg-toolbar select:focus,.rg-search input:focus{outline:0;border-color:var(--st-brand-2);box-shadow:0 0 0 3px rgba(26,101,80,.15)}
.rg-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.rg-chips a{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;padding:3px 10px;border-radius:14px;background:var(--st-ok-bg);color:var(--st-brand)}
.rg-chips a span{font-size:15px;line-height:1}
.rg-chips a.clear{background:none;color:var(--st-muted);text-decoration:underline}
.rg-table-wrap{background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);overflow-x:auto}
.rg-table{width:100%;border-collapse:separate;border-spacing:0;font-size:13.5px}
.rg-table th{background:var(--st-surface-2);color:var(--st-muted);font-weight:600;font-size:12.5px;text-align:start;padding:10px 12px;white-space:nowrap;border-bottom:1px solid var(--st-line)}
.rg-table th a{color:inherit;display:inline-flex;gap:3px}
.rg-table th a:hover,.rg-table th a.on{color:var(--st-brand)}
.rg-table td{padding:9px 12px;border-bottom:1px solid var(--st-line);vertical-align:middle;white-space:nowrap}
.rg-table td small{display:block;font-size:11.5px;color:var(--st-muted);line-height:1.4}
.rg-table tbody tr{cursor:pointer}
.rg-table tbody tr:hover td{background:#f6f9f7}
.rg-table tbody tr:last-child td{border-bottom:0}
.rg-table td.num{font-variant-numeric:tabular-nums}
.rg-table td.pid a{font-family:ui-monospace,Consolas,monospace;font-size:12.5px;color:var(--st-brand-2);font-weight:600;direction:ltr;unicode-bidi:isolate}
.rg-table td.pid a:hover{text-decoration:underline}
.rg-table td.flags{white-space:normal}
.rg-table .muted{color:#b7c2bd}
.rg-table .st-tagbadge{min-width:38px;height:26px;font-size:13px}
.rg-notag{font-size:12px;color:var(--st-red);font-weight:600}
.rg-sex{display:inline-flex;align-items:center;gap:6px}
.rg-sex:before{content:'';width:8px;height:8px;border-radius:50%;background:#b7c2bd}
.rg-sex.female:before{background:#c2577a}.rg-sex.male:before{background:#2c5d9b}
.rg-foot{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin-top:12px;font-size:13px;color:var(--st-muted)}
.rg-pages{display:flex;gap:4px;align-items:center}
.rg-pages a,.rg-pages span{min-width:34px;height:34px;display:grid;place-items:center;border-radius:8px;font-weight:600;font-variant-numeric:tabular-nums}
.rg-pages a{border:1px solid var(--st-line);background:#fff;color:var(--st-ink)}
.rg-pages a:hover{border-color:var(--st-brand-2)}
.rg-pages a.on{background:var(--st-brand);border-color:var(--st-brand);color:#fff}
@media (max-width:900px){.rg-stats{grid-template-columns:repeat(3,1fr)}.rg-stats div:nth-child(4){border-inline-start:0}.rg-stats div:nth-child(n+4){border-top:1px solid var(--st-line)}}
@media (max-width:760px){
  .rg-species a{min-width:140px}
  .rg-table-wrap{border:0;background:none;max-height:none;overflow:visible}
  .rg-table thead{display:none}
  .rg-table,.rg-table tbody{display:block}
  .rg-table tr{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);padding:12px 14px;margin-bottom:8px}
  .rg-table td{display:block;border:0;padding:0;white-space:normal;min-width:0}
  .rg-table td:before{content:attr(data-label);display:block;color:var(--st-muted);font-size:11px;line-height:1.5}
  .rg-table td small{display:inline;margin-inline-start:6px}
  .rg-table td.tag,.rg-table td.pid{display:flex;align-items:center;padding-bottom:8px;border-bottom:1px solid var(--st-line)}
  .rg-table td.tag:before,.rg-table td.pid:before{display:none}
  .rg-table td.pid{justify-content:flex-end}
  .rg-table td.flags{grid-column:1/-1}
  .rg-table td.flags.none,.rg-table td.m-hide{display:none}
  .rg-table tbody tr:hover td{background:none}
  .rg-toolbar select{flex:1 1 45%}
}
@media (max-width:520px){.rg-stats{grid-template-columns:repeat(2,1fr)}.rg-stats div{border-top:1px solid var(--st-line)}.rg-stats div:nth-child(-n+2){border-top:0}.rg-stats div:nth-child(odd){border-inline-start:0}.rg-stats div:nth-child(4){border-inline-start:1px solid var(--st-line)}}

/* Animal card */
body.st-app [hidden]{display:none!important}
.rc-hero{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px 24px;align-items:center;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);padding:18px 22px;margin-bottom:14px}
.rc-tag{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:96px}
.rc-tag small{font-size:11.5px;color:var(--st-muted);white-space:nowrap}
.st-tagbadge.xl{min-width:84px;height:56px;border-radius:28px;font-size:26px;font-family:var(--st-kufi);border-width:2px}
.rc-notag{display:grid;place-items:center;width:84px;height:56px;border-radius:28px;border:2px dashed #cfd6d3;color:var(--st-muted);font-size:22px}
.rc-id-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.rc-id h2{margin:0;font-size:22px;letter-spacing:.5px;color:var(--st-brand)}
.rc-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.rc-chips span{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;padding:2px 10px;border-radius:6px;background:var(--st-surface-2)}
.rc-loc{display:flex;align-items:center;gap:6px;margin:0;font-size:13.5px;color:var(--st-ink)}
.rc-loc .st-i{width:16px;height:16px;color:var(--st-muted)}
.rc-loc small{color:var(--st-muted);font-size:12px}
.rc-facts{display:grid;grid-template-columns:repeat(4,minmax(96px,auto));margin:0;border-inline-start:1px solid var(--st-line)}
.rc-facts div{padding:4px 18px;border-inline-end:1px solid var(--st-line)}
.rc-facts div:last-child{border-inline-end:0}
.rc-facts dt{font-size:12px;color:var(--st-muted)}
.rc-facts dd{margin:0;font-family:var(--st-kufi);font-weight:700;font-size:17px;font-variant-numeric:tabular-nums;white-space:nowrap}
.rc-facts dd i{font-style:normal;font-family:var(--st-font);font-weight:500;font-size:12px;color:var(--st-muted)}
.rc-facts small{display:block;font-size:11.5px;color:var(--st-muted)}
.rc-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.rc-tabs{display:flex;gap:4px;box-shadow:inset 0 -1px var(--st-line);margin-bottom:16px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scroll-margin-top:76px}
.rc-tabs a{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;font-size:14px;font-weight:600;color:var(--st-muted);border-bottom:3px solid transparent;white-space:nowrap}
.rc-tabs a b{font-size:11.5px;min-width:20px;text-align:center;padding:0 6px;border-radius:10px;background:var(--st-surface-2)}
.rc-tabs a:hover{color:var(--st-ink)}
.rc-tabs a.on{color:var(--st-brand);border-bottom-color:var(--st-gold)}
.rc-tabs a.on b{background:var(--st-brand);color:#fff}
.rc-tabs a.edit{margin-inline-start:auto}
.rc-tabs a .st-i{width:16px;height:16px}
.rc-list{list-style:none;margin:0;padding:0}
.rc-list li{display:grid;grid-template-columns:96px minmax(0,1fr);gap:0 12px;padding:9px 0;border-bottom:1px solid var(--st-line);font-size:13.5px;align-items:baseline}
.rc-list li:last-child{border-bottom:0}
.rc-list li > span:first-child{color:var(--st-muted);font-size:12.5px}
.rc-list li > span.late{color:var(--st-red);font-weight:600}
.rc-list small{grid-column:2;color:var(--st-muted);font-size:12px}
.rc-list .muted,.st-app .muted{color:#9aa6a1;font-weight:400}
.rc-list .st-badge{justify-self:start}
.st-app a.link{color:var(--st-brand-2);font-weight:600}
.st-app a.link:hover{text-decoration:underline}
.rc-notes{margin-top:14px;padding:12px 14px;background:var(--st-surface-2);border-radius:10px;font-size:13.5px}
.rc-notes p{margin:4px 0 0}
.rc-bars{display:flex;align-items:flex-end;gap:6px;height:130px;padding:18px 4px 0;margin-bottom:14px;border-bottom:1px solid var(--st-line)}
.rc-bars span{flex:1;max-width:46px;background:linear-gradient(180deg,var(--st-brand-2),var(--st-brand));border-radius:6px 6px 0 0;position:relative}
.rc-bars i{position:absolute;top:-18px;inset-inline:0;text-align:center;font-style:normal;font-size:11px;color:var(--st-muted)}
.st-table .pos{color:var(--st-ok);font-weight:600}.st-table .neg{color:var(--st-red);font-weight:600}
.rc-form .st-card > h2 small{font-weight:600;color:var(--st-brand)}
.rc-tagfilter{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:12px}
.rc-tagfilter .st-filters{margin:0}
.rc-tagfilter .st-input{max-width:200px;height:36px}
.rc-tags{display:flex;flex-wrap:wrap;gap:6px;max-height:220px;overflow:auto;padding:4px}
.rc-tags label{cursor:pointer;border-radius:16px;padding:2px;border:2px solid transparent}
.rc-tags input{position:absolute;opacity:0;pointer-events:none}
.rc-tags label:has(input:checked){border-color:var(--st-brand);box-shadow:0 0 0 3px rgba(26,101,80,.18)}
.rc-tags label:has(input:focus-visible){outline:3px solid var(--st-gold)}
.rc-tags .st-tagbadge{min-width:42px;height:28px;font-size:13px}
.rc-save{position:sticky;bottom:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 0;background:linear-gradient(180deg,rgba(244,246,245,0),var(--st-bg) 30%)}
.rc-save .rc-del{margin-inline-start:auto}
@media (max-width:1100px){.rc-hero{grid-template-columns:auto minmax(0,1fr)}.rc-facts{grid-column:1/-1;border-inline-start:0;border-top:1px solid var(--st-line);padding-top:12px}.rc-facts div:first-child{padding-inline-start:0}}
@media (max-width:640px){
  .rc-hero{padding:14px;gap:12px 14px}
  .rc-tag{min-width:0}
  .st-tagbadge.xl,.rc-notag{min-width:64px;width:auto;height:44px;font-size:20px}
  .rc-id h2{font-size:18px}
  .rc-facts{grid-template-columns:1fr 1fr;gap:10px 0}
  .rc-facts div{padding:0 12px 0 0;border:0}
  .rc-tabs a.edit{margin-inline-start:0}
}

/* Barns & movement */
.rg-stats div.warn b{color:var(--st-red)}
.rg-species .sym .st-i{width:20px;height:20px}
.hs-move{border-top:3px solid var(--st-gold)}
.hs-move-h{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.hs-move-h h2{margin:0;font-size:17px}
.hs-move-h .st-note{margin:2px 0 0}
.hs-move-h > a{margin-inline-start:auto}
.hs-move-h .st-tagbadge{min-width:52px;height:36px;font-size:17px}
.hs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px;margin-bottom:10px}
.hs-barn{display:flex;flex-direction:column;gap:12px;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);padding:16px}
.hs-barn.off{opacity:.7}
.hs-barn-h{display:flex;align-items:center;gap:12px;color:var(--st-ink)}
.hs-barn-h .ic{width:44px;height:44px;border-radius:11px;background:var(--st-surface-2);color:var(--st-brand);display:grid;place-items:center;flex:none}
.hs-barn-h .ic .st-i{width:24px;height:24px}
.hs-barn-h b{display:block;font-family:var(--st-text);font-size:16px}
.hs-barn-h small{display:block;font-size:12px;color:var(--st-muted)}
.hs-barn-h strong{margin-inline-start:auto;font-family:var(--st-kufi);font-size:28px;line-height:1;color:var(--st-brand);text-align:center}
.hs-barn-h strong i{display:block;font:500 11px var(--st-font);color:var(--st-muted)}
.hs-barn-h:hover b{color:var(--st-brand-2);text-decoration:underline}
.hs-barn > .st-badge{align-self:flex-start}
.hs-occ{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.hs-occ li{position:relative;background:var(--st-surface-2);border-radius:8px;overflow:hidden}
.hs-occ li a{position:relative;z-index:1;display:flex;justify-content:space-between;gap:8px;padding:7px 12px;font-size:13px;color:var(--st-ink)}
.hs-occ li a b{font-variant-numeric:tabular-nums}
.hs-occ li i{position:absolute;inset-block:0;inset-inline-start:0;background:rgba(26,101,80,.14);border-inline-end:2px solid var(--st-brand-2)}
.hs-occ li.loose i{background:rgba(176,144,90,.18);border-color:var(--st-gold)}
.hs-occ li.off a{color:var(--st-muted)}
.hs-occ li.none{padding:8px 12px;font-size:12.5px;color:var(--st-muted);background:none;border:1px dashed var(--st-line)}
.hs-occ li:hover{outline:1px solid var(--st-brand-2)}
.hs-open{align-self:flex-start;margin-top:auto}
.hs-new{border-style:dashed;justify-content:center}
.hs-new summary{cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:600;color:var(--st-brand-2);min-height:60px;list-style:none}
.hs-new summary::-webkit-details-marker{display:none}
.hs-legacy{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--st-line)}
.hs-legacy .rg-toolbar{margin:0}
.hs-unhoused{border-top:3px solid var(--st-red)}
.hs-barnhead{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.hs-barnhead h2{margin:0;font-size:20px;display:flex;align-items:center;gap:10px}
.hs-barnhead .st-note{margin:2px 0 0}
.hs-barnhead form{margin:0}
.hs-pop{position:relative}
.hs-pop summary{list-style:none;cursor:pointer}
.hs-pop summary::-webkit-details-marker{display:none}
.hs-pop[open] form{position:absolute;z-index:20;top:42px;inset-inline-end:0;width:280px;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);box-shadow:var(--st-shadow);padding:14px;grid-template-columns:1fr}
.hs-groups{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 6px;margin-bottom:14px;scrollbar-width:thin}
.hs-group{flex:none;min-width:150px;display:flex;flex-direction:column;background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);color:var(--st-ink)}
a.hs-group,.hs-group > a{display:grid;grid-template-columns:1fr auto;gap:0 10px;padding:10px 14px;color:inherit}
.hs-group b{font-size:14px}
.hs-group strong{grid-row:span 2;align-self:center;font-family:var(--st-kufi);font-size:22px;color:var(--st-brand)}
.hs-group small{font-size:11.5px;color:var(--st-muted)}
.hs-group:hover{border-color:var(--st-brand-2)}
.hs-group.on{border-color:var(--st-brand);box-shadow:0 0 0 2px rgba(15,76,58,.18);background:#f6faf8}
.hs-group.off{opacity:.65}
.hs-group.loose{border-style:dashed}
.hs-group-act{display:flex;align-items:center;justify-content:space-between;gap:6px;border-top:1px solid var(--st-line);padding:4px 10px}
.hs-group-act form{margin:0}
.hs-group-act button{all:unset;cursor:pointer;font-size:12px;font-weight:600;color:var(--st-muted);padding:3px 6px;border-radius:6px}
.hs-group-act button:hover{background:var(--st-surface-2);color:var(--st-ink)}
.hs-heads th.sel,.hs-heads td.sel{width:34px;text-align:center}
.hs-heads input[type=checkbox]{width:17px;height:17px;accent-color:var(--st-brand);cursor:pointer}
.hs-heads td.act{text-align:end}
.hs-heads tr.picked td{background:#eef6f1}
.hs-bulkbar{position:sticky;bottom:0;z-index:15;display:none;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-top:12px;padding:14px 16px;background:var(--st-brand-dark);color:#fff;border-radius:var(--st-radius);box-shadow:0 -8px 24px -12px rgba(0,0,0,.35)}
.hs-bulkbar.open{display:flex}
.hs-bulkbar strong{font-family:var(--st-kufi);font-size:16px;align-self:center;white-space:nowrap}
.hs-bulkbar .st-form{flex:1;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.hs-bulkbar .st-field{color:#e3eee9}
.hs-bulkbar .st-field.req > span:after{color:var(--st-gold-2)}
.hs-bulkbar .st-btn{background:var(--st-gold);border-color:var(--st-gold);color:#1c2a26!important}
@media (max-width:760px){
  .hs-heads td.sel{grid-column:auto;order:-1}
  .hs-heads td.act{grid-column:1/-1}
  .hs-heads td.act:before,.hs-heads td.sel:before{display:none}
  .hs-move-h{flex-wrap:wrap}
}

/* Neck tags */
.tg-swatch{display:inline-block;width:22px;height:22px;border-radius:50%;border:2px solid rgba(0,0,0,.15);vertical-align:middle;flex:none}
.rg-species .sym.tg-swatch{width:34px;height:34px;border-radius:50%}
.rg-species small.low{color:var(--st-red);font-weight:600}
.rg-species a.on small.low{color:#ffd2d2}
.tg-add{flex:none;position:relative}
.tg-add summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:6px;height:100%;min-height:58px;padding:0 16px;border:1px dashed #c9d3cf;border-radius:var(--st-radius);color:var(--st-brand-2);font-weight:600;background:#fff}
.tg-add summary::-webkit-details-marker{display:none}
.tg-add[open] form{position:fixed;z-index:40;top:140px;left:50%;transform:translateX(-50%);width:min(320px,90vw);background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);box-shadow:var(--st-shadow);padding:16px;grid-template-columns:1fr}
.tg-add input[type=color]{height:44px;padding:4px}
.tg-colorcard{border-top:3px solid var(--st-gold)}
.tg-colorhead{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.tg-colorhead h2{margin:0;font-size:18px;display:flex;align-items:center;gap:10px}
.tg-colorhead .st-note{margin:4px 0 0}
.tg-bar{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--st-surface-2)}
.tg-bar span{display:block;height:100%}
.tg-bar .assigned,.tg-legend .assigned:before{background:#2c5d9b}
.tg-bar .available,.tg-legend .available:before{background:var(--st-ok)}
.tg-bar .bad,.tg-legend .bad:before{background:var(--st-red)}
.tg-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin:8px 0 12px;font-size:12px;color:var(--st-muted)}
.tg-legend span{display:inline-flex;align-items:center;gap:6px}
.tg-legend span:not(.hint):before{content:'';width:10px;height:10px;border-radius:3px}
.tg-legend .hint{margin-inline-start:auto}
.tg-batches{display:flex;flex-wrap:wrap;gap:6px}
.tg-batches span{font-size:12.5px;padding:4px 10px;border-radius:7px;background:var(--st-surface-2);color:var(--st-muted)}
.tg-batches b{color:var(--st-ink);font-variant-numeric:tabular-nums}
.tg-views{display:inline-flex;margin-inline-start:auto;border:1px solid var(--st-line);border-radius:8px;overflow:hidden;background:#fff}
.tg-views a{padding:7px 14px;font-size:13px;font-weight:600;color:var(--st-muted)}
.tg-views a.on{background:var(--st-brand);color:#fff}
.tg-board{display:flex;flex-wrap:wrap;gap:6px;padding:16px}
.tg-board .tg-legend{flex-basis:100%;margin:10px 0 0}
.tg-cell{min-width:44px;height:30px;padding:0 6px;display:grid;place-items:center;border-radius:15px;font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--st-ink);border:2px solid var(--c);background:#fff;transition:transform .1s}
.tg-cell:hover{transform:scale(1.08)}
.tg-cell.assigned{background:var(--c);box-shadow:inset 0 0 0 2px rgba(0,0,0,.08)}
.tg-cell.lost,.tg-cell.damaged,.tg-cell.retired{border-style:dashed;color:var(--st-red);background:repeating-linear-gradient(-45deg,#fff,#fff 4px,var(--st-red-bg) 4px,var(--st-red-bg) 8px);text-decoration:line-through}
.tg-cell.retired{color:var(--st-muted);background:var(--st-surface-2)}
.tg-cell.on{outline:3px solid var(--st-brand);outline-offset:2px}
.tg-focus{border-top:3px solid var(--st-gold)}
.tg-focus-h{display:flex;align-items:center;gap:16px;margin-bottom:12px}
.tg-focus-h h2{margin:0;font-size:18px}
.tg-focus-h p{margin:4px 0 0;font-size:13.5px}
.tg-focus-h > a{margin-inline-start:auto}
.tg-focus h3{font-size:14.5px;margin:16px 0 8px}
.tg-state{padding:10px 12px;background:var(--st-surface-2);border-radius:10px}
.tg-state > span{font-weight:600;font-size:13.5px}
.tg-radio{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;padding:4px 10px;border-radius:8px;background:#fff;border:1px solid var(--st-line);cursor:pointer}
.tg-radio:has(input:checked){border-color:var(--st-brand);background:var(--st-ok-bg)}
.tg-radio input{accent-color:var(--st-brand)}
@media (max-width:640px){.tg-focus-h{flex-wrap:wrap}.tg-legend .hint{margin-inline-start:0}.tg-views{margin-inline-start:0}}

/* Owner delete link */
.st-del{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;color:var(--st-red)!important;padding:3px 8px;border-radius:6px;border:1px solid transparent;text-decoration:none!important;white-space:nowrap;vertical-align:middle}
.st-del:hover{background:var(--st-red-bg);border-color:#efcfcf}
.st-del .st-i{width:14px;height:14px}
.st-del span{display:inline}
td .st-del span{display:none}

/* ---------- Responsive ---------- */
/* the bar holds home + 6 systems + search/today/tasks/admin icons: the public-site and logout buttons stay icon-only (with titles) */
.st-top .st-ghost span,.st-top form.st-out button span{display:none}
/* icons of the main menu hidden up to 1500px (2026-10-19: with «التقارير» the bar overflowed at ~1300–1450px and cut the logout button) */
@media (max-width:1500px){ .st-top .st-nav a .st-i{display:none} .st-top .st-nav a{padding:8px 9px} }
@media (min-width:1101px) and (max-width:1380px){ .st-top .st-me b,.st-top .st-ghost{display:none} .st-top .st-me{padding:4px} .st-top .st-nav{margin-inline-start:8px} .st-top .st-nav a{padding:8px 7px;font-size:13px} }
@media (max-width:1100px){
  .st-top .st-me b{display:none}
  .st-top .st-me{padding:4px}
  .st-cols{grid-template-columns:1fr}
  .st-kid{grid-template-columns:40px repeat(3,minmax(0,1fr))}
}
@media (max-width:980px){   /* the shorter bar (home + 6 systems) fits inline down to ~1000px */
  .st-top .st-top-in{flex-wrap:wrap}
  .st-top button.st-burger{display:inline-flex}
  .st-top .st-nav{display:none;order:10;flex-basis:100%;flex-direction:column;align-items:stretch;margin:0 0 10px;gap:4px}
  .st-top .st-nav.open{display:flex}
  .st-top .st-nav a{padding:11px 12px;font-size:14.5px}
  .st-top .st-nav a .st-i{display:block}
}
@media (max-width:640px){
  .st-task{grid-template-columns:4px minmax(0,1fr)}
  .st-task > .st-actions{grid-column:2;margin-top:10px}
  .st-kid{grid-template-columns:1fr 1fr}
  .st-kid .n{grid-column:1/-1}
}
@media (max-width:900px){
  .st-head .st-head-in{flex-direction:column;align-items:flex-start}
}
@media (max-width:520px){
  .st-wrap{padding:0 16px}
  .st-top .st-brand small,.st-top form.st-out button span,.st-top .st-ghost{display:none}
  body.st > main{padding:18px 14px 40px}
  .st-head-actions{width:100%}.st-head-actions a{flex:1;justify-content:center}
}


/* ---------- Table tools (assets/table-tools.js): search bar, column filters, sortable headers ---------- */
.tt-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin:0 0 10px}
.tt-q{position:relative;flex:1 1 260px;max-width:420px}
.tt-q svg{position:absolute;top:50%;inset-inline-start:11px;width:17px;height:17px;transform:translateY(-50%);fill:none;stroke:var(--st-muted);stroke-width:2;stroke-linecap:round;pointer-events:none}
.tt-q input{width:100%;box-sizing:border-box;height:38px;border:1px solid #cfd6d3;border-radius:9px;background:#fff;font:inherit;font-size:13.5px;color:var(--st-ink);padding-inline:36px 10px}
.tt-q input:focus,.tt-filters input:focus,.tt-filters select:focus{outline:0;border-color:var(--st-brand-2);box-shadow:0 0 0 3px rgba(26,101,80,.13)}
.tt-count{font-size:12.5px;color:var(--st-muted);font-variant-numeric:tabular-nums}
.tt-bar.on .tt-count{color:var(--st-brand);font-weight:600}
.tt-bar button{height:32px;padding:0 12px;border-radius:8px;border:1px solid var(--st-line);background:#fff;font:600 12.5px var(--st-font);color:var(--st-ink);cursor:pointer}
.tt-bar button:hover{border-color:var(--st-brand-2)}
.tt-bar .tt-reset{color:var(--st-red);border-color:#efcfcf}
.tt-bar .tt-csv{margin-inline-start:auto}
.st-table th.tt-sort{cursor:pointer;user-select:none;position:relative;padding-inline-end:24px}
.st-table th.tt-sort:hover{color:var(--st-ink)}
.st-table th.tt-sort:after{content:'';position:absolute;inset-inline-end:9px;top:50%;width:0;height:0;border:4px solid transparent;border-top-color:#b9c3bf;margin-top:0;opacity:.8}
.st-table th.tt-sort:before{content:'';position:absolute;inset-inline-end:9px;top:50%;width:0;height:0;border:4px solid transparent;border-bottom-color:#b9c3bf;margin-top:-9px;opacity:.8}
.st-table th.tt-sort[aria-sort=ascending]{color:var(--st-brand)}
.st-table th.tt-sort[aria-sort=ascending]:before{border-bottom-color:var(--st-brand);opacity:1}.st-table th.tt-sort[aria-sort=ascending]:after{opacity:.25}
.st-table th.tt-sort[aria-sort=descending]{color:var(--st-brand)}
.st-table th.tt-sort[aria-sort=descending]:after{border-top-color:var(--st-brand);opacity:1}.st-table th.tt-sort[aria-sort=descending]:before{opacity:.25}
.st-table th.tt-sort:focus-visible{outline:2px solid var(--st-brand-2);outline-offset:-2px}
.st-table tr.tt-filters th{background:#fff;padding:6px 8px;border-bottom:1px solid var(--st-line)}
.tt-filters input,.tt-filters select{width:100%;min-width:72px;box-sizing:border-box;height:30px;border:1px solid #dbe1de;border-radius:7px;background:#fff;font:inherit;font-size:12.5px;font-weight:400;color:var(--st-ink);padding:0 7px}
.tt-filters input::placeholder{color:#a3aea9}
.st-table tr.tt-empty td{text-align:center;color:var(--st-muted);padding:18px}
@media print{.tt-bar,.tt-filters{display:none}}

/* ---------- System page (hub.php): indicators → services → tasks ---------- */
.hb-state{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;font-size:13.5px;font-weight:600;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.25);color:#fff;white-space:nowrap}
.hb-state .st-i{width:17px;height:17px}
.hb-state.warn{background:#fff;border-color:#fff;color:var(--st-red)}
.hb-state.good .st-i{color:#9fe0c2}
.hb .st-alert .st-i{width:18px;height:18px;flex:none;margin-top:2px}
.hb-sec{margin-bottom:34px}
.hb-h{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 16px;padding-bottom:10px;border-bottom:1px solid var(--st-line)}
.hb-h .no{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:var(--st-brand);color:#fff;font:700 13px var(--st-kufi);flex:none}
.hb-h h2{margin:0;font:700 17px var(--st-text)}
.hb-h small{color:var(--st-muted);font-size:12.5px}
.hb-h .all{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;color:var(--st-brand-2);text-decoration:none}
.hb-h .all .st-i{width:15px;height:15px}.hb-h .all:hover{text-decoration:underline}
.hb-sub{margin:0 0 10px;font-size:13px;font-weight:600;color:var(--st-muted);letter-spacing:.2px}
.hb-sub:not(:first-child){margin-top:4px}

/* Needs action: tinted cards with a tone badge and a call to action */
.hb-acts{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px;margin-bottom:22px}
.hb-act{position:relative;display:flex;flex-direction:column;gap:2px;padding:16px 16px 14px;border-radius:var(--st-radius);background:#fff;border:1px solid var(--st-line);color:var(--st-ink);text-decoration:none;min-width:0;transition:box-shadow .15s,transform .15s}
a.hb-act:hover{box-shadow:var(--st-shadow);transform:translateY(-1px)}
.hb-act.warn{background:linear-gradient(180deg,#fdf3f3,#fff 70%);border-color:#efcfcf}
.hb-act.good{background:linear-gradient(180deg,#f1f8f4,#fff 70%);border-color:#cfe6da}
.hb-act .tone{position:absolute;top:14px;inset-inline-end:14px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center}
.hb-act .tone .st-i{width:16px;height:16px}
.hb-act.warn .tone{background:var(--st-red);color:#fff}
.hb-act.good .tone{background:var(--st-ok-bg);color:var(--st-ok)}
.hb-act small{font-size:13px;color:var(--st-muted);font-weight:500;padding-inline-end:36px}
.hb-act b{font:700 30px/1.35 var(--st-kufi);font-variant-numeric:tabular-nums}
.hb-act.warn b{color:var(--st-red)}
.hb-act .sub{font-size:12.5px;color:var(--st-muted);line-height:1.6}
.hb-act.warn .sub{color:#8a3a3a}
.hb-act .go{display:inline-flex;align-items:center;gap:3px;margin-top:10px;padding-top:9px;border-top:1px dashed var(--st-line);font-size:12.5px;font-weight:600;color:var(--st-brand-2)}
.hb-act.warn .go{color:var(--st-red)}
.hb-act .go .st-i{width:14px;height:14px}

/* Current state (big tiles) beside performance (ledger rows) */
.hb-split{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:22px;align-items:start}
.hb-split.one{grid-template-columns:1fr}
.hb-states{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
.hb-stat{display:flex;flex-direction:column;gap:1px;padding:14px 16px;border-radius:var(--st-radius);background:#fff;border:1px solid var(--st-line);border-inline-start:4px solid var(--st-gold);color:var(--st-ink);text-decoration:none;min-width:0}
a.hb-stat:hover{box-shadow:var(--st-shadow)}
.hb-stat.warn{border-inline-start-color:var(--st-red)}.hb-stat.good{border-inline-start-color:var(--st-ok)}
.hb-stat small{font-size:12.5px;color:var(--st-muted);font-weight:500}
.hb-stat b{font:700 26px/1.4 var(--st-kufi);font-variant-numeric:tabular-nums}
.hb-stat.warn b{color:var(--st-red)}
.hb-stat .sub{font-size:12px;color:var(--st-muted);line-height:1.6}
.hb-perf{background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);overflow:hidden}
.hb-perf .row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 16px;border-bottom:1px solid var(--st-line);color:var(--st-ink);text-decoration:none}
.hb-perf .row:last-child{border-bottom:0}
.hb-perf a.row:hover{background:#fafbfa}
.hb-perf .l{min-width:0}.hb-perf .l b{display:block;font-size:13.5px;font-weight:600}
.hb-perf .l small{display:block;font-size:12px;color:var(--st-muted);line-height:1.5}
.hb-perf .v{font:700 18px var(--st-kufi);font-variant-numeric:tabular-nums;white-space:nowrap;padding:2px 10px;border-radius:8px;background:var(--st-surface-2)}
.hb-perf .row.warn .v{background:var(--st-red-bg);color:var(--st-red)}
.hb-perf .row.good .v{background:var(--st-ok-bg);color:var(--st-ok)}

/* Services: quick actions first, then the rest */
.hb-svcs{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}
.hb-svc{display:flex;align-items:center;gap:12px;min-height:66px;padding:12px 14px;border-radius:var(--st-radius);background:#fff;border:1px solid var(--st-line);color:var(--st-ink);text-decoration:none;font-weight:600;font-size:14px;transition:border-color .15s,box-shadow .15s}
.hb-svc:hover{border-color:var(--st-brand-2);box-shadow:var(--st-shadow)}
.hb-svc .ic{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:var(--st-surface-2);color:var(--st-brand);flex:none;transition:background .15s,color .15s}
.hb-svc:hover .ic{background:var(--st-brand);color:#fff}
.hb-svc .t{min-width:0;line-height:1.45}
.hb-svc .chev{margin-inline-start:auto;width:16px;height:16px;opacity:.4}
.hb-svc.quick{background:linear-gradient(135deg,var(--st-brand),var(--st-brand-2));border-color:var(--st-brand);color:#fff}
.hb-svc.quick .ic{background:var(--st-gold);color:#1c2a26}
.hb-svc.quick:hover{box-shadow:0 10px 24px -14px rgba(15,76,58,.8)}
.hb-svc.quick small{display:block;font-size:11px;font-weight:500;color:#cfe0d9}

/* Reference data & settings (collapsed under the daily services) */
.hb-ref{margin-top:14px;border:1px dashed #cfd6d3;border-radius:var(--st-radius);background:#fafbfa}
.hb-ref > summary{display:flex;align-items:center;gap:8px;padding:12px 16px;cursor:pointer;list-style:none;font-size:13.5px;font-weight:600;color:var(--st-muted)}
.hb-ref > summary::-webkit-details-marker{display:none}
.hb-ref > summary .st-i{width:17px;height:17px}
.hb-ref > summary small{min-width:22px;height:20px;padding:0 6px;border-radius:10px;background:var(--st-surface-2);font-size:12px;display:inline-grid;place-items:center}
.hb-ref > summary:after{content:'';margin-inline-start:auto;width:8px;height:8px;border-inline-start:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);transition:transform .15s}
.hb-ref[open] > summary:after{transform:rotate(135deg)}
.hb-ref[open] > summary{color:var(--st-ink)}
.hb-ref .hb-svcs{padding:0 14px 14px}
.hb-svc.ref{min-height:56px;background:#fff}
.hb-svc.ref .ic{width:34px;height:34px;background:var(--st-warn-bg);color:#8a6d2f}

/* Tasks */
.hb-tasks{background:#fff;border:1px solid var(--st-line);border-radius:var(--st-radius);overflow:hidden}
.hb-tcount{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid var(--st-line);background:var(--st-surface-2)}
.hb-tcount span{display:flex;align-items:baseline;justify-content:center;gap:6px;padding:12px 8px;font-size:12.5px;color:var(--st-muted);border-inline-start:1px solid var(--st-line)}
.hb-tcount span:first-child{border-inline-start:0}
.hb-tcount b{font:700 20px var(--st-kufi);color:var(--st-ink);font-variant-numeric:tabular-nums}
.hb-tcount .late b,.hb-tcount .late{color:var(--st-red)}
.hb-tcount .today b{color:#8a6d2f}
.hb-tlist{list-style:none;margin:0;padding:0}
.hb-tlist li{display:grid;grid-template-columns:118px minmax(0,1fr) auto;align-items:center;gap:14px;padding:12px 16px;border-bottom:1px solid var(--st-line);border-inline-start:4px solid #b7c2bd}
.hb-tlist li:last-child{border-bottom:0}
.hb-tlist li.p-urgent{border-inline-start-color:var(--st-red)}.hb-tlist li.p-high{border-inline-start-color:var(--st-gold)}.hb-tlist li.p-normal{border-inline-start-color:var(--st-brand-2)}
.hb-tlist .due{justify-self:start;font-size:12px;font-weight:600;padding:3px 10px;border-radius:999px;background:var(--st-surface-2);color:var(--st-muted);white-space:nowrap}
.hb-tlist .due.late{background:var(--st-red-bg);color:var(--st-red)}
.hb-tlist .due.today{background:var(--st-warn-bg);color:#8a6d2f}
.hb-tlist .body{min-width:0}
.hb-tlist .body b{display:block;font-size:14px;font-weight:600;line-height:1.5}
.hb-tlist .body small{display:flex;flex-wrap:wrap;align-items:center;gap:4px;font-size:12px;color:var(--st-muted)}
.hb-tlist .body small .st-i{width:13px;height:13px}
.hb-tlist .body small a{color:var(--st-brand-2);font-weight:600}
.hb-tlist .body em{font-style:normal;color:var(--st-red);font-weight:600}
.hb-tlist form{margin:0}
.hb-tlist .done{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:8px;border:1px solid var(--st-line);background:#fff;color:var(--st-ok);font:600 13px var(--st-font);cursor:pointer}
.hb-tlist .done .st-i{width:15px;height:15px}
.hb-tlist .done:hover{background:var(--st-ok-bg);border-color:#c8e6d6}
.hb-tasks .more{display:block;text-align:center;padding:11px;font-size:13px;font-weight:600;color:var(--st-brand-2);border-top:1px solid var(--st-line);text-decoration:none}
.hb-tasks .more:hover{background:#fafbfa}
.hb-clear{display:flex;align-items:center;justify-content:center;gap:8px;padding:26px 16px;color:var(--st-ok);font-size:14px;font-weight:500}
.hb-clear .st-i{width:20px;height:20px}
@media (max-width:980px){.hb-split{grid-template-columns:1fr}}
@media (max-width:640px){
  .hb-acts{grid-template-columns:1fr 1fr}.hb-act b{font-size:24px}.hb-act .tone{width:26px;height:26px;top:12px}
  .hb-states{grid-template-columns:1fr 1fr}.hb-stat b{font-size:22px}
  .hb-svcs{grid-template-columns:1fr}
  .hb-tcount{grid-template-columns:repeat(2,1fr)}.hb-tcount span:nth-child(3){border-inline-start:0}.hb-tcount span:nth-child(-n+2){border-bottom:1px solid var(--st-line)}
  .hb-tlist li{grid-template-columns:minmax(0,1fr) auto;gap:6px 12px}.hb-tlist .due{grid-column:1/-1}
  .st-head-actions .hb-state{white-space:normal}
}
@media (max-width:380px){.hb-acts,.hb-states{grid-template-columns:1fr}}

/* ---------- Layout fixes (2026-10-16) ----------
   A grid item's minimum width is its content by default, so a wide table or form inside a column widened the whole page
   (mobile overflow, boxes out of line). Columns may now shrink; wide tables scroll inside their own box. */
.st-cols > *, .hb-split > *, .st-kpis > *, .st-dkpis > *, .hs-grid > *, .hb-acts > *, .hb-states > *, .st-form > *, .st-dl > * { min-width: 0 }
@media (max-width:1100px){ .st-cols{grid-template-columns:minmax(0,1fr)} }
.st-card{min-width:0;max-width:100%}
main img, main video, main iframe{max-width:100%;height:auto}
.st-dl dd, .st-card h2{overflow-wrap:anywhere}
/* indicator boxes two per row on phones (one per row wasted the screen and broke the line-up with the other grids) */
@media (max-width:520px){ .st-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px} .st-kpi{padding:10px 12px} .st-kpi b{font-size:20px} }
/* ---------- Printing: one print control and one print layout for every page ---------- */
.st-print{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:42px;padding:0 16px;border-radius:9px;border:1px solid rgba(255,255,255,.35);background:transparent;color:#fff;font:600 14px var(--st-font);cursor:pointer;text-decoration:none;white-space:nowrap;box-sizing:border-box}
.st-print:hover{background:rgba(255,255,255,.08)}
.st-print .st-i{width:18px;height:18px;flex:none}
.st-print.in{height:34px;padding:0 12px;font-size:13px;border-radius:8px;border-color:var(--st-line);background:#fff;color:var(--st-brand)}
.st-print.in:hover{border-color:var(--st-brand);background:#fff}
.st-print.ic{width:34px;padding:0}
.st-head-actions .st-print{height:42px}
.st-print-h{display:none}
@page{size:A4;margin:12mm 10mm}
@media print{
  html,body{background:#fff!important;color:#000}
  body{font-size:12px;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .st-top,.st-foot,.st-crumbs,.st-head-actions,.st-burger,.st-print,.st-del,.st-filters,.tt-bar,.tt-filters,.no-print,
  form.st-form,.st-more:not([open]),.st-actions,button,.st-btn,.st-btn-gold,.st-btn-line{display:none!important}
  .st-head{background:none!important;color:#000;border:0;border-bottom:2px solid #000;margin-bottom:10px}
  .st-head::before,.st-head::after{display:none!important}
  .st-head-in{padding:0 0 8px!important;display:block}
  .st-head h1{color:#000!important;font-size:20px;margin:6px 0 2px}
  .st-head p{color:#333!important;font-size:11.5px;margin:0}
  .st-print-h{display:flex!important;justify-content:space-between;gap:12px;align-items:flex-end;border-bottom:1px solid #999;padding-bottom:6px;margin-bottom:4px}
  .st-print-h span{display:grid;gap:1px}.st-print-h b{font-size:13px}.st-print-h small{font-size:10.5px;color:#444}
  .st-print-h span:last-child{text-align:left}
  main,.st-wrap{max-width:none!important;padding:0!important;margin:0!important}
  .st-cols{display:block!important}.st-cols>*{width:auto!important}
  .st-card{box-shadow:none!important;border:1px solid #bbb!important;break-inside:avoid;page-break-inside:avoid;margin:0 0 10px!important;padding:10px!important}
  .st-kpis{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))!important;gap:6px!important}
  .st-kpi{box-shadow:none!important;border:1px solid #bbb!important;padding:6px 8px!important}
  .st-table-wrap{overflow:visible!important;max-height:none!important}
  table{font-size:10.5px;width:100%!important}
  thead{display:table-header-group}tr,img,svg{break-inside:avoid;page-break-inside:avoid}
  a{color:#000!important;text-decoration:none!important}
  .st-alert{border:1px solid #999!important;background:#fff!important}
}

/* ---------- Task compliance card (tasks/perf-model.php rtp_card; today.php, tasks/performance.php) ---------- */
.pc{background:#fff;border:1px solid var(--st-line);border-radius:18px;overflow:hidden;margin:0 0 18px;break-inside:avoid}
.pc-h{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid var(--st-line);background:linear-gradient(90deg,#f6faf8,#fff)}
.pc-h b{display:block;font-size:15.5px}.pc-h small{display:block;color:var(--st-muted);font-size:12.5px;margin-top:2px}
.pc-v{font-size:12.5px;font-weight:700;padding:5px 12px;border-radius:999px;background:var(--st-surface-2);color:var(--st-muted)}
.pc.ok .pc-v{background:var(--st-ok-bg);color:var(--st-ok)}.pc.warn .pc-v{background:var(--st-warn-bg);color:#7a5c22}.pc.bad .pc-v{background:var(--st-red-bg);color:var(--st-red)}
.pc-b{display:grid;grid-template-columns:190px minmax(0,1fr);gap:18px 26px;align-items:center;padding:18px 20px}
.pc-ring{position:relative;width:170px;height:170px;border-radius:50%;background:conic-gradient(var(--st-brand) var(--deg),#e7ece9 0);display:grid;place-items:center;margin:auto}
.pc.warn .pc-ring{background:conic-gradient(#c08a1e var(--deg),#e7ece9 0)}.pc.bad .pc-ring{background:conic-gradient(var(--st-red) var(--deg),#e7ece9 0)}
.pc-ring>span{width:132px;height:132px;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.pc-ring b{font:700 34px var(--st-kufi,inherit);line-height:1;font-variant-numeric:tabular-nums}.pc-ring b small{font-size:16px}
.pc-ring em{font-style:normal;font-size:12px;color:var(--st-muted);margin-top:4px}.pc-ring em.t{font-weight:700;color:var(--st-ink)}
.pc-tick{position:absolute;inset:0;pointer-events:none}
.pc-tick:before{content:'';position:absolute;top:-4px;left:50%;width:4px;height:26px;margin-left:-2px;border-radius:2px;background:var(--st-gold);box-shadow:0 0 0 2px #fff}
.pc-rates{display:flex;flex-direction:column;gap:10px;min-width:0}
.pc-rate{display:grid;grid-template-columns:78px minmax(0,1fr) 64px 70px;gap:10px;align-items:center;font-size:13.5px}
.pc-rate .lb{font-weight:600}.pc-rate b{font-size:17px;text-align:end;font-variant-numeric:tabular-nums}.pc-rate small{color:var(--st-muted);font-size:12px}
.pc-rate .tr{height:10px;border-radius:99px;background:#eef2f0;overflow:hidden}.pc-rate .tr i{display:block;height:100%;border-radius:99px}
.pc-rate.on .tr i{background:var(--st-ok,#1a6550)}.pc-rate.la .tr i{background:#d9a441}.pc-rate.mi .tr i{background:var(--st-red)}
.pc-rate.on b{color:var(--st-ok,#1a6550)}.pc-rate.la b{color:#a87717}.pc-rate.mi b{color:var(--st-red)}
.pc-stack{display:flex;height:8px;border-radius:99px;overflow:hidden;background:#eef2f0;margin-top:2px}
.pc-stack i.on{background:var(--st-ok,#1a6550)}.pc-stack i.la{background:#d9a441}.pc-stack i.mi{background:var(--st-red)}
.pc-meta{margin:2px 0 0;font-size:13px;color:var(--st-muted)}.pc-meta b{color:var(--st-ink)}
.pc-f{margin:0;font-size:12px;color:var(--st-muted);background:var(--st-surface-2);border-radius:8px;padding:7px 10px;line-height:1.7}
.pc-ft{padding:0 20px 16px;display:flex;justify-content:flex-end}
@media (max-width:720px){.pc-b{grid-template-columns:1fr}.pc-rate{grid-template-columns:70px minmax(0,1fr) 58px}.pc-rate small{display:none}}

/* phone-only tool in the top bar (layout.php: «تشغيلي اليوم») */
.st-top .st-tool.mob{display:none}
@media (max-width:820px){ .st-top .st-tool.mob{display:inline-grid} }

/* Logout (2026-10-23): the bar's exit icon in red so it reads as «exit»; on narrow screens the menu ends with «تسجيل الخروج» in words */
.st-top form.st-out button{color:var(--st-red);border-color:rgba(180,35,24,.35)}
.st-top .st-nav .st-nav-out{display:none;margin:4px 0 0}
.st-top .st-nav .st-nav-out button{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;padding:11px 12px;border-radius:9px;font:600 14.5px var(--st-font,inherit);color:var(--st-red);cursor:pointer;border:1px solid rgba(180,35,24,.3);background:var(--st-red-bg)}
@media (max-width:980px){ .st-top .st-nav .st-nav-out{display:block} }
/* Top bar never pushes its tools off screen (2026-10-23: the exit button was outside the screen above 1380px and between 981 and 1100px):
   a wider frame for the bar on large screens, and the links shrink (scrolling sideways if needed) while the tools, the name and exit stay */
.st-top .st-top-in{max-width:1680px}
@media (min-width:981px){
  .st-top .st-nav{flex:0 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
  .st-top .st-top-in > :not(.st-nav):not(.st-spacer){flex-shrink:0}
}