/* EPA Inventory V12.2 — UI polish layer (loads AFTER style.css, so it wins without editing the old file) */
:root{--epa-yellow:#ffcc00;--epa-yellow-dark:#e6b800;--epa-navy:#06396b;--ink:#0c2c52}
html{-webkit-text-size-adjust:100%}
body{background:linear-gradient(180deg,#f3f8fd 0,#e9f2fb 100%) fixed;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}

/* Accessibility: visible keyboard focus everywhere */
:focus-visible{outline:3px solid rgba(255,204,0,.95)!important;outline-offset:2px}
.sidebar :focus-visible{outline-color:#fff!important}

/* SVG icons */
.ico{width:1.15em;height:1.15em;flex:none;display:block}
.nav-item b{display:grid!important;place-items:center;width:24px!important;height:24px}
.nav-item b .ico{width:20px;height:20px}
.nav-item{min-height:44px}
.menu-toggle{display:none;place-items:center;width:44px;height:44px}
.menu-toggle .ico{width:24px;height:24px}
.global-search-icon{display:grid;place-items:center;color:#70829a}
.global-search-icon .ico{width:18px;height:18px}
.global-search-submit .ico{width:20px;height:20px}
.sidebar-logout{display:flex!important;align-items:center;justify-content:center;gap:8px}
.sidebar-logout .ico{width:18px;height:18px}
@media(max-width:900px){.menu-toggle{display:grid}}

/* Top bar */
@media(min-width:901px){.app-topbar{background:rgba(255,255,255,.92)!important;-webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px)}}
/* Mobile/tablet header keeps the original dark-navy gradient */
@media(max-width:900px){.app-topbar{background:radial-gradient(circle at 78% 20%,rgba(22,139,255,.22),transparent 30%),linear-gradient(135deg,#062e5b 0%,#031f43 52%,#063a70 100%)!important;-webkit-backdrop-filter:none;backdrop-filter:none;border-bottom:1px solid rgba(255,255,255,.12)!important}}
.page-heading h1{font-size:clamp(22px,3vw,30px)!important;letter-spacing:-.01em}
.page-heading p{font-size:14px!important}

/* Cards: hover lift, smoother feel */
.product-card,.category-card,.stat-card,.list-card{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background-color .18s ease}
.product-card:hover,.category-card:hover{transform:translateY(-3px);box-shadow:0 16px 34px rgba(6,57,107,.14);border-color:var(--epa-yellow)!important}
.product-card:active,.category-card:active{transform:translateY(-1px)}
.list-card:hover{background:#f6faff}
.product-image img,.list-thumb img{object-fit:contain}
.stat-card small{font-size:12.5px!important}
.stat-note{display:inline-block;margin-left:4px;padding:2px 6px;border-radius:999px;background:#eef4fb;color:#70829a;font-size:9.5px;font-weight:600;vertical-align:middle}

/* Readable text sizes (old CSS used 8–10px in several places) */
.product-card-body p,.list-main p{font-size:12px!important}
.product-meta{font-size:12.5px!important}
.mini-category,.brand-line{font-size:10.5px!important;letter-spacing:.02em}
.activity-row{font-size:13px!important}
.activity-row span,.activity-row time{font-size:11.5px!important}
.history-table th{font-size:11px!important}
.history-table td{font-size:12.5px!important}
.history-table tbody tr:nth-child(even){background:#f8fbfe}
.history-table tbody tr:hover{background:#eef6ff}

/* Stock pills: real, readable badges with three states */
.stock-pill{display:inline-flex!important;align-items:center!important;gap:6px;padding:5px 10px!important;border-radius:999px!important;font-size:11px!important;font-weight:700!important;line-height:1!important;background:#e8f8ef!important;color:#0a7c43!important;border:0!important;white-space:nowrap}
.stock-pill:before{content:"";width:7px;height:7px;border-radius:50%;background:#16aa5b;margin:0!important;display:inline-block}
.stock-pill.low{background:#fff4d6!important;color:#8a5a00!important}
.stock-pill.low:before{background:#f2a100!important}
.stock-pill.out{background:#ffe9e9!important;color:#b42525!important}
.stock-pill.out:before{background:#dc3c3c!important}

/* Alerts */
.alert{font-size:13.5px!important;border-radius:14px!important;border-left-width:4px!important;line-height:1.45}
.alert a{font-weight:700;color:inherit}
.alert.warning{background:#fff8e1;color:#7a5300;border:1px solid #f4dc95;border-left:4px solid #f2a100}
.alert.error{border-left:4px solid #dc3c3c!important}
.alert.success{border-left:4px solid #0da45b!important}
.alert.fade-out{opacity:0;transform:translateY(-6px);transition:.4s}

/* Forms & buttons */
input:disabled,select:disabled,textarea:disabled{background:#f1f5f9!important;color:#8a9ab0!important;cursor:not-allowed}
input::placeholder,textarea::placeholder{color:#9db0c4}
button:disabled{opacity:.55;cursor:not-allowed;filter:grayscale(.2)}
button.is-loading{position:relative;color:transparent!important;pointer-events:none}
button.is-loading:after{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;border:2.5px solid rgba(255,255,255,.4);border-top-color:#fff;animation:epaSpin .7s linear infinite}
.small-save.is-loading:after,.primary-button.is-loading:after{border-color:rgba(6,57,107,.25);border-top-color:#06396b}
@keyframes epaSpin{to{transform:rotate(360deg)}}
.sold-button:disabled{background:#cfd8e3!important;color:#6b7c92!important;box-shadow:none!important}

/* Images that fail to load */
img.img-broken{opacity:0}
.product-image:has(.img-broken),.list-thumb:has(.img-broken){position:relative}
.product-image:has(.img-broken):after,.list-thumb:has(.img-broken):after{content:"No image";position:absolute;inset:0;display:grid;place-items:center;color:#9db0c4;font-size:12px;font-weight:600}

.empty-state{padding:36px 16px!important;text-align:center;color:#70829a;font-size:14px}

/* Touch targets + no iOS zoom on inputs */
.qty-control button{min-width:44px;min-height:44px}
@media(max-width:700px){
  .content input,.content select,.content textarea{font-size:16px!important}
  .stock-pill{font-size:10.5px!important}
  .product-card:hover,.category-card:hover{transform:none}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* =========================================================
   EPA V13 — SOLD INVENTORY
   SOLD status is independent from WooCommerce stock quantity.
========================================================= */
.sold-page-heading{margin-bottom:16px}
.sold-explainer{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 18px}
.sold-explainer>div{background:linear-gradient(180deg,#fff,#f7fbff);border:1px solid #dbe7f2;border-radius:15px;padding:14px 16px;box-shadow:0 6px 18px rgba(4,48,92,.06)}
.sold-explainer strong{display:block;color:#06396b;font-size:12px;font-weight:800;letter-spacing:.03em;margin-bottom:3px}
.sold-explainer span{display:block;color:#6b7f93;font-size:11px;line-height:1.45}
.sold-search-bar form{width:100%}
.sold-panel{padding:0!important;overflow:hidden}
.sold-product-list{display:flex;flex-direction:column}
.sold-product-card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border-bottom:1px solid #e9eff5;background:#fff}
.sold-product-card:last-child{border-bottom:0}
.sold-product-card.is-sold{background:linear-gradient(90deg,#fff7f7 0,#fff 42%)}
.sold-product-main{display:flex;align-items:center;gap:14px;min-width:0;flex:1}
.sold-product-photo{width:82px;height:82px;border-radius:14px;border:1px solid #dfe8f1;background:#f8fbfe;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;flex:0 0 82px}
.sold-product-photo img{width:100%;height:100%;object-fit:contain;background:#fff}
.sold-product-photo>span{font-size:10px;color:#8ca0b4}
.mini-sold-stamp{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-12deg);border:3px solid #e21d2f;color:#e21d2f;background:rgba(255,255,255,.82);padding:3px 7px;border-radius:5px;font-size:15px;font-weight:900;letter-spacing:.05em;line-height:1}
.sold-product-copy{min-width:0}
.sold-product-copy h2{font-size:14px;line-height:1.35;margin:5px 0 4px;color:#123b63;font-weight:700}
.sold-product-copy p{margin:0;color:#77899a;font-size:10.5px;line-height:1.4}
.sold-status-row{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.sold-status,.sold-stock{display:inline-flex;align-items:center;min-height:23px;padding:4px 8px;border-radius:999px;font-size:9px;font-weight:800;letter-spacing:.035em}
.sold-status.available{background:#eaf8ef;color:#14743c;border:1px solid #c9edd6}
.sold-status.sold{background:#fff0f1;color:#c2182b;border:1px solid #ffc9cf}
.sold-stock{background:#edf4fb;color:#315b81;border:1px solid #d7e5f1}
.sold-stock.untracked{background:#f5f5f5;color:#777;border-color:#e6e6e6}
.sold-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;flex:0 0 auto}
.sold-actions form{margin:0}
.sold-btn{height:38px;border-radius:10px;border:1px solid #cddbe8;background:#fff;color:#06396b;font-family:Poppins,sans-serif;font-size:10.5px;font-weight:800;padding:0 13px;cursor:pointer;white-space:nowrap;box-shadow:0 3px 8px rgba(4,48,92,.05)}
.sold-btn:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(4,48,92,.10)}
.sold-btn.qty-down{border-color:#f1c7cb;color:#b51d2c;background:#fffafb}
.sold-btn.qty-up{border-color:#c9dfd1;color:#16703b;background:#fbfffc}
.sold-btn.mark-sold{background:#d7192d;border-color:#d7192d;color:#fff;min-width:126px}
.sold-btn.remove-sold{background:#06396b;border-color:#06396b;color:#fff;min-width:126px}
.sold-btn:disabled{opacity:.38;cursor:not-allowed;transform:none;box-shadow:none}
@media(max-width:900px){
 .sold-explainer{grid-template-columns:1fr}
 .sold-product-card{align-items:flex-start;flex-direction:column}
 .sold-actions{width:100%;justify-content:flex-start;padding-left:96px}
}
@media(max-width:620px){
 .sold-product-card{padding:14px}
 .sold-product-photo{width:70px;height:70px;flex-basis:70px}
 .sold-actions{padding-left:0;display:grid;grid-template-columns:1fr 1fr;width:100%}
 .sold-actions form{width:100%}
 .sold-actions form:last-child{grid-column:1/-1}
 .sold-btn{width:100%;height:42px}
 .sold-product-copy h2{font-size:13px}
}
