/* PTP interface refinement — loaded after all five theme palettes. Visual only. */
:root{--ui-space:clamp(16px,2vw,28px)}
html{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
body{min-width:320px}
button,input,select,textarea{transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}
:is(button,input,select,textarea,a):focus-visible{outline:3px solid var(--focus,var(--accent));outline-offset:3px}
html[data-theme=forest]{--hero-shade:rgba(4,29,26,.91);--hero-soft:rgba(4,29,26,.42)}
html[data-theme=ocean]{--hero-shade:rgba(8,27,55,.92);--hero-soft:rgba(11,62,103,.42)}
html[data-theme=sandstone]{--hero-shade:rgba(42,28,19,.91);--hero-soft:rgba(90,56,32,.43)}
html[data-theme=midnight]{--hero-shade:rgba(6,16,33,.94);--hero-soft:rgba(19,48,82,.52)}
html[data-theme=plum]{--hero-shade:rgba(29,14,37,.93);--hero-soft:rgba(69,35,80,.48)}
/* Staff sign-in: readable photo treatment, centered form and theme-aware fields. */
html[data-theme] .login-wrap{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(440px,.88fr);min-height:100svh;background:var(--bg)}
html[data-theme] .login-art{min-height:100svh;box-sizing:border-box;isolation:isolate;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:clamp(44px,7vw,120px);background:linear-gradient(90deg,var(--hero-shade) 0%,var(--hero-shade) 20%,var(--hero-soft) 100%),linear-gradient(0deg,rgba(4,24,22,.55),transparent 65%),url('/static/buffalo-pasture.jpg') center/cover no-repeat!important;color:#fff!important}
html[data-theme] .login-art:after{opacity:.13;pointer-events:none;z-index:0}
html[data-theme] .login-art>*{position:relative;z-index:2}
html[data-theme] .login-art .login-chip{display:inline-flex;align-items:center;max-width:100%;width:auto;padding:10px 15px;border-radius:100px;border:1px solid rgba(255,255,255,.55);background:rgba(3,24,22,.48);backdrop-filter:blur(12px);color:#fff!important;font-size:10px;font-weight:800;letter-spacing:.12em;line-height:1.5}
html[data-theme] .login-art :is(h1,p){color:#fff!important;-webkit-text-fill-color:#fff!important;opacity:1!important}
html[data-theme] .login-art h1{font-size:clamp(38px,3.9vw,65px);line-height:1.075;letter-spacing:-.05em;font-weight:850;max-width:660px;text-wrap:balance;margin:30px 0 27px;text-shadow:0 3px 24px #0008}
html[data-theme] .login-art p{font-size:clamp(14px,1.07vw,17px);line-height:1.75;max-width:530px;text-shadow:0 2px 14px #0008;margin:0 0 10px}
html[data-theme] .login-art>span:last-child{display:block;margin-top:29px!important;padding-top:22px;border-top:1px solid #ffffff55;color:#e9fff5!important;-webkit-text-fill-color:#e9fff5!important;font-size:13px;font-weight:700}
html[data-theme] .login-form{min-height:100svh;display:grid;place-items:center;padding:clamp(24px,3vw,50px) clamp(18px,3vw,52px);background:radial-gradient(circle at 85% 5%,var(--subtle),transparent 40%),var(--bg)!important}
html[data-theme] .login-card{display:block;width:min(100%,480px);max-width:480px;min-width:0;box-sizing:border-box;padding:clamp(26px,3vw,40px)!important;margin:0;background:var(--paper);border:1px solid var(--border);border-radius:24px;box-shadow:0 22px 65px #051e1817;color:var(--ink)}
html[data-theme] .login-card .mark{display:grid;place-items:center;width:54px;height:54px;margin:0 0 23px!important;border-radius:15px;background:linear-gradient(145deg,var(--mark-from),var(--mark-to));color:var(--sidebar-bg);font-size:28px;font-weight:900}
html[data-theme] .login-card .eyebrow{font-size:10px;letter-spacing:.2em;margin-bottom:10px;color:var(--accent-ink)}
html[data-theme] .login-card h2{font-size:clamp(27px,2.35vw,36px);letter-spacing:-.045em;line-height:1.12;font-weight:850;color:var(--ink);margin:0 0 8px}
html[data-theme] .login-card>p{margin:0 0 25px;color:var(--muted);font-size:13px;line-height:1.65}
html[data-theme] .login-card .formgroup{margin-bottom:17px}
html[data-theme] .login-card .formgroup label{font-size:12px;color:var(--ink);font-weight:750;margin:0 0 8px}
html[data-theme] .login-card input.control{min-height:48px;width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:11px;background:var(--input-bg);color:var(--ink);font-size:14px;box-shadow:none}
html[data-theme] .login-card input.control:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--subtle)}
html[data-theme] .login-card button[type=submit]{min-height:48px;font-size:13px;font-weight:850;border-radius:11px;box-shadow:0 7px 16px #073f301f}
html[data-theme] .login-card .demo-access{padding:18px 18px 15px;border:1px solid var(--border);border-radius:15px;background:var(--subtle);color:var(--ink);margin:22px 0 0}
html[data-theme] .demo-access>b{display:block;font-size:13px;color:var(--ink);margin-bottom:2px}
html[data-theme] .demo-access>p{margin:3px 0 12px;color:var(--muted);line-height:1.55;font-size:12px}
html[data-theme] .demo-buttons{display:grid;grid-template-columns:1fr;gap:8px;margin:11px 0}
html[data-theme] .login-card .demo-role{display:flex;width:100%;justify-content:space-between;text-align:left;min-height:40px;padding:9px 13px;background:var(--paper);border:1px solid var(--border);border-radius:9px;color:var(--accent-ink);font-size:12px;font-weight:800}
html[data-theme] .login-card .demo-role:hover{background:var(--surface-hover);border-color:var(--accent)}
html[data-theme] .demo-access>small{display:block;margin:11px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
html[data-theme] .login-card .login-error:empty{display:none}
html[data-theme] .login-card .login-error:not(:empty){display:block;padding:11px 12px;border-radius:9px;background:var(--danger-bg);color:var(--danger-ink);font-size:12px;margin:0 0 14px}
html[data-theme] .login-card .ptp-auth-footer{display:flex;flex-direction:column;gap:7px;margin-top:20px;padding-top:15px;border-top:1px solid var(--border);font-size:11px;line-height:1.55;color:var(--muted)}
html[data-theme] .login-card .ptp-auth-footer a{color:var(--accent-ink);font-weight:800;text-decoration:underline;text-underline-offset:3px}
/* Developer sign-in: isolated, responsive and consistent with the same palettes. */
html[data-theme] .login:not(.login-wrap){min-height:100svh;padding:clamp(20px,4vw,44px);background:radial-gradient(circle at 5% 10%,var(--sidebar-active),transparent 42%),linear-gradient(130deg,var(--sidebar-bg),var(--bg) 120%);display:grid;place-items:center}
html[data-theme] .login:not(.login-wrap) .login-card{width:min(480px,100%);padding:clamp(26px,3vw,42px)!important;border:1px solid var(--border);border-radius:22px;background:var(--paper);box-shadow:0 27px 76px #0003}
html[data-theme] .login:not(.login-wrap) .login-card .logo{font-size:13px;font-weight:900;letter-spacing:.06em;color:var(--accent-ink);display:inline-flex;align-items:center;background:var(--subtle);border-radius:100px;padding:10px 14px;margin-bottom:22px}
html[data-theme] .login:not(.login-wrap) .login-card h1{font-size:clamp(26px,2.3vw,33px);letter-spacing:-.04em;color:var(--ink);margin:0 0 11px}
html[data-theme] .login:not(.login-wrap) .login-card>p{font-size:13px;line-height:1.65;color:var(--muted);margin-bottom:20px}
html[data-theme] .login:not(.login-wrap) .login-card label{display:block;color:var(--ink);font-size:12px;font-weight:750;margin:16px 0 8px}
html[data-theme] .login:not(.login-wrap) .login-card input{min-height:46px;width:100%;border:1px solid var(--border);border-radius:10px;background:var(--input-bg);color:var(--ink);padding:11px 14px}
html[data-theme] .login:not(.login-wrap) .login-card .btn.primary{min-height:46px;width:100%;color:var(--on-accent);background:var(--accent);border-radius:10px;font-weight:850;margin-top:22px}
html[data-theme] .login:not(.login-wrap) .login-card .hint{padding:13px 15px;border:1px solid var(--border);border-radius:11px;background:var(--subtle);color:var(--muted);margin:17px 0;font-size:11px}
html[data-theme] .login:not(.login-wrap) .login-card>a{color:var(--accent-ink);font-weight:800;font-size:12px;text-decoration:none}
html[data-theme] .login:not(.login-wrap) .login-card>a:hover{text-decoration:underline}
/* Common operational hierarchy, focus, tables and dialogs. */
html[data-theme] .main{min-width:0}
html[data-theme] .page{padding-top:clamp(19px,2.3vw,32px)}
html[data-theme] .panel,html[data-theme] .metric,html[data-theme] .card{border:1px solid var(--border);box-shadow:var(--shadow);transition:border-color .16s ease,box-shadow .16s ease}
html[data-theme] .panel:hover,html[data-theme] .metric:hover{box-shadow:0 16px 34px #0001}
html[data-theme] .heading h1{font-weight:850;letter-spacing:-.042em}
html[data-theme] .heading p{line-height:1.6}
html[data-theme] .topbar{border-bottom:1px solid var(--border);backdrop-filter:blur(12px)}
html[data-theme] :is(.select,.control,input:not([type=checkbox]),select,textarea){min-height:40px}
html[data-theme] :is(.scope-strip,.banner,.callout){line-height:1.6}
html[data-theme] .sidebar .nav{border-radius:10px}
html[data-theme] .sidebar .nav.active{font-weight:800}
html[data-theme] .gridtable th{font-weight:800;letter-spacing:.065em}
html[data-theme] .gridtable tbody tr:hover td{background:var(--surface-hover)}
html[data-theme] :is(.topbar .btn,.topbar .iconbutton,.topbar .select){min-height:38px}
html[data-theme] .modal{background:var(--paper);color:var(--ink);border:1px solid var(--border)}
html[data-theme] .top{gap:16px;flex-wrap:wrap}
html[data-theme] .top .brand{letter-spacing:-.02em}
html[data-theme] .tabs{gap:6px}
html[data-theme] .tabs button{min-height:39px}
html[data-theme] .card{overflow-wrap:break-word}
@media(max-width:1100px){
html[data-theme] .login-wrap{grid-template-columns:minmax(0,1fr) minmax(405px,1fr)}
html[data-theme] .login-art{padding:clamp(28px,5vw,70px)}
html[data-theme] .login-art h1{font-size:clamp(34px,4.2vw,51px)}
html[data-theme] .login-card{padding:28px!important}
}
@media(max-width:820px){
html[data-theme] .login-wrap{display:flex;flex-direction:column;min-height:100svh}
html[data-theme] .login-art{display:flex!important;min-height:245px;max-height:none;justify-content:center;padding:34px clamp(20px,7vw,52px);background-position:center 56%}
html[data-theme] .login-art:after{display:none}
html[data-theme] .login-art h1{font-size:clamp(27px,5vw,38px);margin:15px 0 8px;max-width:740px}
html[data-theme] .login-art p{font-size:12px;line-height:1.6;max-width:580px;margin:0}
html[data-theme] .login-art>span:last-child{display:none}
html[data-theme] .login-form{min-height:unset;display:flex;align-items:flex-start;justify-content:center;flex:1;padding:24px clamp(14px,5vw,38px) 32px;background:var(--bg)!important}
html[data-theme] .login-card{width:min(100%,520px);max-width:520px;box-shadow:var(--shadow)}
}
@media(max-width:420px){
html[data-theme] .login-art{min-height:205px;padding:23px 20px}
html[data-theme] .login-art h1{font-size:27px;line-height:1.12;margin:14px 0 7px}
html[data-theme] .login-art .login-chip{font-size:8px;padding:7px 10px}
html[data-theme] .login-art p{display:none}
html[data-theme] .login-form{padding:16px 10px 27px}
html[data-theme] .login-card{border-radius:17px;padding:23px 20px!important}
html[data-theme] .login-card h2{font-size:28px}
html[data-theme] .login-card .demo-access{padding:14px}
}
@media(prefers-reduced-motion:reduce){html[data-theme] .panel,html[data-theme] .metric{transition:none}}

/* PTP date scopes, selectable option search, profile menu and user-defined result colors */
html[data-theme] .date-toolbar{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:0 0 18px;padding:14px 18px;border:1px solid var(--border);border-radius:15px;background:var(--paper);box-shadow:var(--shadow)}
html[data-theme] .date-toolbar .date-title{flex:1 1 205px;min-width:165px;display:flex;flex-direction:column;gap:3px;color:var(--ink)}
html[data-theme] .date-title b{font-size:13px;letter-spacing:-.012em}
html[data-theme] .date-title small{font-size:11px;line-height:1.45;color:var(--muted);max-width:410px}
html[data-theme] .date-toolbar label{font-size:11px;font-weight:750;color:var(--muted);display:flex;flex-direction:column;gap:5px;flex:0 1 166px}
html[data-theme] .date-toolbar input[type=date]{width:100%;min-height:39px;padding:6px 10px;border:1px solid var(--border);border-radius:9px;background:var(--input-bg,var(--paper));color:var(--ink);color-scheme:inherit}
html[data-theme] .date-toolbar button{min-height:39px;padding:8px 14px;border-radius:9px}
html[data-theme] .profile-holder{position:relative;flex:0 0 auto;z-index:40}
html[data-theme] .profile-trigger{display:inline-flex;align-items:center;gap:9px;padding:5px 9px;border:1px solid var(--border);background:var(--paper);border-radius:13px;color:var(--ink);min-height:45px;text-align:left}
html[data-theme] .profile-trigger .account{padding:0;border:0;gap:9px}
html[data-theme] .profile-trigger .account .avatar{width:34px;height:34px;min-width:34px}
html[data-theme] .profile-trigger .account b{font-size:12px;white-space:nowrap}
html[data-theme] .profile-trigger .account small{font-size:10px}
html[data-theme] .profile-chevron,html[data-theme] .profile-arrow{font-size:15px;color:var(--muted)}
html[data-theme] .profile-popover{position:absolute;right:0;top:calc(100% + 9px);width:min(280px,86vw);padding:8px;background:var(--paper);color:var(--ink);border:1px solid var(--border);border-radius:14px;box-shadow:0 18px 55px #0003;z-index:80}
html[data-theme] .profile-popover[hidden]{display:none!important}
html[data-theme] .profile-identity{display:flex;flex-direction:column;gap:4px;padding:11px 13px 13px;border-bottom:1px solid var(--border);margin-bottom:4px}
html[data-theme] .profile-identity small{color:var(--muted);overflow-wrap:anywhere}
html[data-theme] .profile-popover button{display:block;width:100%;text-align:left;background:transparent;border:0;border-radius:9px;padding:12px 13px;color:var(--ink);font-weight:700}
html[data-theme] .profile-popover button:hover{background:var(--subtle)}
html[data-theme] .profile-popover .profile-exit{color:var(--danger-ink,#b33742)}
html[data-theme] .searchable-select{display:flex;flex-direction:column;gap:5px;width:100%;min-width:0;position:relative}
html[data-theme] .searchable-select select{width:100%;min-width:0}
html[data-theme] .option-search{width:100%;min-width:0;min-height:34px!important;padding:6px 10px;border:1px solid var(--border);border-radius:9px;background:var(--input-bg,var(--paper));color:var(--ink);font-size:12px}
html[data-theme] .option-search:focus{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:0}
html[data-theme] .top-filters{min-width:0}
html[data-theme] .top-filters .filter-control:has(.searchable-select){min-width:168px}
html[data-theme] .top-filters .searchable-select{width:min(195px,100%)}
html[data-theme] /* Legacy badge palette replaced by the unified preview/status rule below. */
html[data-theme] .status-palette-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:16px;margin:22px 0}
html[data-theme] .status-palette-group{border:1px solid var(--border);background:var(--paper);border-radius:14px;padding:13px}
html[data-theme] .status-palette-group h3{font-size:13px;padding:3px 5px 13px;margin:0;color:var(--ink)}
html[data-theme] .status-color-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--border);padding:9px 5px}
html[data-theme] .status-color-preview{display:inline-block;color:var(--status-hue);background:color-mix(in srgb,var(--status-hue) 12%,var(--paper) 88%);border:1px solid color-mix(in srgb,var(--status-hue) 35%,var(--border) 65%);border-radius:100px;padding:5px 9px;font-size:12px;font-weight:800}
html[data-theme] .status-color-actions{display:flex;align-items:center;gap:7px}
html[data-theme] .status-color-actions input[type=color]{width:42px;min-height:33px;height:33px;border:1px solid var(--border);border-radius:8px;padding:3px;background:var(--paper);cursor:pointer}
html[data-theme] .status-color-actions code{font-size:10px;color:var(--muted)}
html[data-theme] .status-palette-footer{flex-wrap:wrap;gap:14px}
@media(max-width:1260px){html[data-theme] .topbar{height:auto;min-height:72px;flex-wrap:wrap;gap:9px;padding:10px 15px}html[data-theme] .top-filters{order:3;flex:1 0 100%;justify-content:flex-start}html[data-theme] .top-filters .filter-control{max-width:235px}html[data-theme] .profile-holder{margin-left:auto}}
@media(max-width:750px){html[data-theme] .date-toolbar .date-title{flex-basis:100%}html[data-theme] .date-toolbar label{flex:1 1 145px}html[data-theme] .profile-trigger .account>span:first-child{display:none}}
@media(max-width:460px){html[data-theme] .date-toolbar{gap:9px;padding:12px}html[data-theme] .date-toolbar .btn{flex:1}html[data-theme] .top-filters .filter-control{flex:1;max-width:50%;min-width:0}html[data-theme] .top-filters .filter-control:has(.searchable-select){min-width:0}html[data-theme] .top-filters .searchable-select{width:100%}html[data-theme] .date-toolbar label{flex:1 1 125px}}


/* Dedicated Developer Status Studio — theme-safe, independent of Branding form. */
html[data-theme] .ptp-status-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:18px;margin:20px 0 22px}
html[data-theme] .ptp-status-group{background:var(--paper);border:1px solid var(--border);border-radius:16px;padding:17px 19px;box-shadow:var(--shadow)}
html[data-theme] .ptp-status-group h3{margin:0 0 9px;font-size:14px;color:var(--ink);letter-spacing:-.015em}
html[data-theme] .ptp-status-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--border);min-width:0}
html[data-theme] .ptp-status-name{min-width:0;display:flex;align-items:flex-start;flex-direction:column;gap:6px}
html[data-theme] .ptp-status-name small{font-size:10px;line-height:1.4;color:var(--muted);overflow-wrap:anywhere}
/* Developer preview and all record badges share the exact same soft status treatment. */
html[data-theme] .ptp-swatch-label,
html[data-theme] .status.custom-status{
  --status-hue:#64748b;
  display:inline-flex;
  align-items:center;
  padding:6px 11px;
  border:1px solid color-mix(in srgb,var(--status-hue) 45%,var(--border) 55%) !important;
  border-radius:100px;
  background:color-mix(in srgb,var(--status-hue) 15%,var(--paper) 85%) !important;
  color:color-mix(in srgb,var(--status-hue) 77%,var(--ink) 23%) !important;
  font-size:12px;
  font-weight:850;
  line-height:1.4;
  max-width:100%;
  white-space:nowrap;
  box-shadow:none !important;
}
html[data-theme] .ptp-status-hex{display:flex;align-items:center;gap:7px;flex-shrink:0}
html[data-theme] .ptp-status-hex input[type=color]{width:41px;min-width:41px;height:40px;min-height:40px;border:1px solid var(--border);padding:3px;background:var(--paper);border-radius:10px;cursor:pointer}
html[data-theme] .ptp-status-hex input[type=text]{height:40px;min-height:40px;width:86px;max-width:86px;text-transform:lowercase;border:1px solid var(--border);border-radius:9px;padding:9px 8px;font-size:12px;background:var(--input-bg,var(--paper));color:var(--ink);font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
html[data-theme] .ptp-status-hex input:invalid{border-color:var(--danger-ink,#bc3939)!important}
html[data-theme] .ptp-status-demo{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;border:1px solid var(--border);border-radius:16px;background:var(--paper);padding:18px;margin-top:20px;box-shadow:var(--shadow)}
html[data-theme] .ptp-status-demo>div{display:flex;flex-direction:column;gap:12px}
html[data-theme] .ptp-status-demo small{font-size:10px;letter-spacing:.09em;font-weight:900;color:var(--muted)}
html[data-theme] .ptp-status-demo>div>div{display:flex;flex-wrap:wrap;gap:7px}
html[data-theme] .ptp-palette-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--border);border-radius:15px;background:var(--paper);padding:16px}
html[data-theme] .ptp-palette-actions>div:last-child{display:flex;flex-wrap:wrap;gap:7px}
html[data-theme] #paletteMessage{flex:1;min-width:190px;color:var(--accent-ink,var(--ink));font-size:12px;line-height:1.5;font-weight:800}
html[data-theme] #paletteMessage.error{color:var(--danger-ink,#bd3939)}
html[data-theme] .tabs{overflow-x:auto;scrollbar-width:thin;white-space:nowrap}
@media(max-width:790px){html[data-theme] .ptp-status-demo{grid-template-columns:1fr}html[data-theme] .ptp-status-grid{grid-template-columns:1fr}}
@media(max-width:420px){html[data-theme] .ptp-status-group{padding:14px 12px}html[data-theme] .ptp-status-choice{gap:8px}html[data-theme] .ptp-status-hex input[type=text]{width:77px;max-width:77px;font-size:11px}html[data-theme] .ptp-palette-actions>div:last-child button{flex:1 1 auto}}

/* Scoped record filters: the controls are readable in all five system themes. */
html[data-theme] .list-filter-bar{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;background:var(--paper);border:1px solid var(--border);border-radius:15px;padding:15px 17px;margin:0 0 16px;box-shadow:var(--shadow)}
html[data-theme] .list-filter-heading{display:flex;flex-direction:column;gap:4px;min-width:180px;flex:1 1 180px}
html[data-theme] .list-filter-heading b{font-size:13px;color:var(--ink)}
html[data-theme] .list-filter-heading small{font-size:11px;color:var(--muted)}
html[data-theme] .list-filter-controls{display:flex;flex:3 1 600px;flex-wrap:wrap;align-items:flex-end;gap:10px}
html[data-theme] .list-filter-controls>label{display:flex;flex:1 1 155px;flex-direction:column;gap:5px;color:var(--muted);font-weight:750;font-size:11px;min-width:130px;max-width:245px}
html[data-theme] .list-filter-controls select{width:100%;min-height:40px;border-radius:9px;background:var(--input-bg,var(--paper));border:1px solid var(--border);color:var(--ink)}
html[data-theme] .list-filter-actions{display:flex;align-items:center;gap:8px;flex:0 1 auto}
html[data-theme] .list-filter-actions .btn{min-height:40px}
html[data-theme] .custom-status{display:inline-flex;align-items:center;justify-content:center;min-height:23px;border-radius:100px;line-height:1.3;padding:5px 9px;font-weight:800;box-shadow:0 1px 3px rgba(0,0,0,.10)}
html[data-theme] .metric:has(.badgeicon[style]){border-top-width:3px}
@media(max-width:880px){html[data-theme] .list-filter-heading{flex-basis:100%}html[data-theme] .list-filter-controls{flex-basis:100%}html[data-theme] .list-filter-actions{margin-left:auto}}
@media(max-width:500px){html[data-theme] .list-filter-bar{padding:12px}html[data-theme] .list-filter-controls>label{max-width:unset;flex:1 1 125px}html[data-theme] .list-filter-actions{width:100%}html[data-theme] .list-filter-actions .btn{flex:1}}


/* Compact record filters: accessible in-app modal rather than a large panel. */
html[data-theme] .filter-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;min-height:40px;border:1px solid var(--accent);color:var(--accent-ink);background:var(--subtle);font-weight:800}
html[data-theme] .filter-trigger:hover{border-color:var(--accent);background:var(--surface-hover)}
html[data-theme] .filter-count{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:100px;background:var(--accent);color:var(--on-accent,#fff);font-size:11px;line-height:1}
html[data-theme] .filter-dialog-form{display:flex;flex-direction:column;gap:18px}
html[data-theme] .filter-dialog-intro{font-size:13px;line-height:1.6;color:var(--muted);margin:0}
html[data-theme] .filter-dialog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}
html[data-theme] .filter-dialog-field,html[data-theme] .filter-date-pair label{display:flex;flex-direction:column;gap:7px;min-width:0}
html[data-theme] .filter-dialog-field>span,html[data-theme] .filter-date-pair label>span{color:var(--ink);font-size:12px;font-weight:750}
html[data-theme] .filter-dialog-field>select,html[data-theme] .filter-date-pair .control{width:100%;min-height:43px;background:var(--input-bg,var(--paper));color:var(--ink);border:1px solid var(--border);border-radius:10px;padding:10px 12px}
html[data-theme] .filter-date-fieldset{border:1px solid var(--border);border-radius:12px;padding:15px;margin:2px 0 0;min-width:0}
html[data-theme] .filter-date-fieldset legend{color:var(--muted);font-size:11px;font-weight:800;padding:0 7px}
html[data-theme] .filter-date-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
html[data-theme] .filter-dialog-footer{display:flex;align-items:center;gap:10px;border-top:1px solid var(--border);padding-top:18px;flex-wrap:wrap}
html[data-theme] .filter-dialog-footer .btn{min-height:42px}
html[data-theme] .filter-dialog-spacer{flex:1}
html[data-theme] .filter-form-error:not([hidden]){display:block;background:var(--danger-bg,#fff0eb);color:var(--danger-ink,#ba423b);border-radius:9px;padding:12px;font-size:12px}
html[data-theme] .filter-form-error[hidden]{display:none}
html[data-theme] .filter-dialog-field .searchable-select{width:100%}
html[data-theme] .filter-dialog-field .searchable-select .option-search{width:100%}
/* Always honor server-validated and Developer-selected HEX values. Inline color/background
   are assigned directly to each badge and take precedence over legacy neutral palettes. */
html[data-theme] .gridtable .status.custom-status,
html[data-theme] .task .status.custom-status{border-radius:999px;letter-spacing:.01em;box-shadow:none !important}
@media(max-width:750px){html[data-theme] .filter-dialog-grid{grid-template-columns:1fr}html[data-theme] .filter-dialog-footer>.btn{flex:1}html[data-theme] .filter-dialog-spacer{display:none}}
@media(max-width:430px){html[data-theme] .data-head .actions{gap:7px}html[data-theme] .data-head .actions .field-search{min-width:130px;flex:1 1 100%}html[data-theme] .filter-dialog-footer{gap:7px}}


/* PTP scoped topbar: one compact picker replaces stacked District/LPA controls. */
html[data-theme] .topbar{gap:12px;min-height:72px}
html[data-theme] .top-filters{display:flex;flex:0 1 275px;min-width:0;max-width:290px;align-items:center}
html[data-theme] .scope-picker{
 display:flex;align-items:center;gap:10px;width:100%;min-width:0;min-height:45px;
 background:var(--paper);border:1px solid var(--border);border-radius:12px;
 color:var(--ink);padding:7px 11px;cursor:pointer;text-align:left;
 box-shadow:0 1px 3px rgba(0,0,0,.025)
}
html[data-theme] .scope-picker:hover{background:var(--subtle);border-color:var(--accent)}
html[data-theme] .scope-picker-icon{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:8px;background:var(--subtle);color:var(--accent-ink);font-size:17px}
html[data-theme] .scope-picker-text{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}
html[data-theme] .scope-picker-text small{font-size:9px;font-weight:850;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
html[data-theme] .scope-picker-text b{display:block;min-width:0;max-width:100%;font-size:11px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5}
html[data-theme] .scope-picker-chevron{font-size:15px;color:var(--muted);flex-shrink:0}
html[data-theme] .top-filters .assigned-scope{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--subtle);color:var(--accent-ink)}
html[data-theme] .topbar>.profile-holder{margin-left:0}
html[data-theme] .scope-strip{display:flex;flex-wrap:wrap;align-items:center;gap:10px;min-height:46px;padding:8px 14px}
html[data-theme] .scope-strip>.scope-summary{flex:1 1 200px;min-width:0;line-height:1.5;overflow-wrap:anywhere}
html[data-theme] .scope-strip-actions{display:flex;align-items:center;gap:9px;margin-left:auto;flex-shrink:0}
html[data-theme] .scope-action{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:34px;white-space:nowrap;background:var(--paper);border:1px solid var(--border);border-radius:9px;padding:6px 12px;color:var(--accent-ink);font-size:11px;font-weight:850;cursor:pointer}
html[data-theme] .scope-action:hover,html[data-theme] .scope-action.selected{background:var(--subtle);border-color:var(--accent)}
html[data-theme] .scope-action .filter-count{background:var(--accent);color:var(--on-accent,#fff)}
/* Modal scope picker includes a search field for large LPA lists, but no global toolbar text field. */
html[data-theme] .scope-dialog-field{display:flex;flex-direction:column;gap:7px;min-width:0;color:var(--ink);font-size:12px;font-weight:750}
html[data-theme] .scope-dialog-field>.control{min-height:45px;width:100%;border-radius:10px;border:1px solid var(--border);background:var(--input-bg,var(--paper));color:var(--ink);padding:10px 12px}
html[data-theme] .scope-locked{display:flex;flex-direction:column;gap:7px;background:var(--subtle);border:1px solid var(--border);border-radius:11px;padding:12px 14px}
html[data-theme] .scope-locked>span{font-size:11px;color:var(--muted);font-weight:750}
html[data-theme] .scope-locked strong{font-size:13px;color:var(--ink)}
html[data-theme] .scope-result-hint{font-size:11px;color:var(--muted);margin-top:-11px}
html[data-theme] .date-quick-options{display:flex;flex-wrap:wrap;gap:9px}
html[data-theme] .date-quick{min-height:34px;padding:7px 12px;border-radius:9px;background:var(--subtle);color:var(--accent-ink);border:1px solid var(--border);font-size:11px;font-weight:800}
html[data-theme] .date-quick:hover,html[data-theme] .date-quick.active{border-color:var(--accent);background:var(--surface-hover)}
/* The old responsive toolbar used to wrap search/select widgets onto another line;
   this compact selector stays aligned across viewport sizes. */
@media(max-width:1260px){
 html[data-theme] .topbar{height:auto;min-height:72px;flex-wrap:nowrap;gap:9px;padding:9px 16px}
 html[data-theme] .top-filters{order:initial;flex:0 1 245px;min-width:0;max-width:245px;justify-content:flex-start}
 html[data-theme] .profile-holder{margin-left:0}
 html[data-theme] .topbar .breadcrumbs{white-space:nowrap}
}
@media(max-width:700px){
 html[data-theme] .topbar{display:flex;flex-wrap:wrap;row-gap:8px;column-gap:9px;padding:10px 14px}
 html[data-theme] .topbar>.spacer{flex:1}
 html[data-theme] .topbar .profile-holder{order:1}
 html[data-theme] .topbar .top-filters{order:2;flex:1 1 auto;max-width:none;min-width:0}
 html[data-theme] .topbar #reload{order:3}
 html[data-theme] .scope-picker{min-height:42px}
 html[data-theme] .scope-strip{align-items:flex-start}
 html[data-theme] .scope-strip-actions{margin-left:0}
}
@media(max-width:460px){
 html[data-theme] .topbar .profile-trigger .account>span:first-child{display:none}
 html[data-theme] .topbar .profile-trigger{padding:4px 8px}
 html[data-theme] .scope-strip-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}
 html[data-theme] .scope-strip-actions .scope-action{flex:1}
 html[data-theme] .filter-date-pair{grid-template-columns:1fr}
 html[data-theme] .date-quick-options .date-quick{flex:1 1 110px}
}

/* Date-range action now sits alongside Add Farmer in the dashboard heading. */
html[data-theme] .heading .actions .date-filter-trigger{
  min-height:41px;
  padding:9px 15px;
  border-radius:10px;
  font-size:12px;
  font-weight:800;
  gap:8px;
}
html[data-theme] .heading .actions .date-filter-trigger.selected{
  border-color:var(--accent);
}
@media(max-width:700px){
  html[data-theme] .heading .actions{width:100%;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
  html[data-theme] .heading .actions .date-filter-trigger{flex:0 0 auto}
}
@media(max-width:460px){
  html[data-theme] .heading .actions .date-filter-trigger{min-height:40px}
}
