/*
 * Workbench bridge: WeUI primitives tuned for the dense desktop dashboard.
 * The business cards and maps keep their existing language; these rules only
 * provide shared controls, status, list, and dialog behavior.
 */
:root{
 --dsh-brand:#b78300;
 --dsh-brand-soft:#fff7df;
 --dsh-control:#f7f8f9;
 --dsh-control-border:#dfe2e5;
 --dsh-focus:rgba(10,132,255,.14);
}

body.dsh-ui-enhanced{--weui-BTN-HEIGHT:38px;--weui-BTN-HEIGHT-MEDIUM:34px;--weui-BTN-HEIGHT-SMALL:28px}
body.dsh-ui-enhanced *{scrollbar-color:#c9cdd1 transparent}

/* WeUI buttons are intentionally compact for repeated operational actions. */
body.dsh-ui-enhanced .weui-btn{min-width:0;height:36px;padding:0 14px;border-radius:6px;font-family:inherit;font-size:12px;font-weight:650;line-height:36px;letter-spacing:0;box-shadow:none;transition:background-color .16s,border-color .16s,color .16s,transform .16s}
body.dsh-ui-enhanced .weui-btn:active{transform:translateY(1px)}
body.dsh-ui-enhanced .weui-btn_primary{background:#1d1d1f;color:#fff}
body.dsh-ui-enhanced .weui-btn_primary:not(.weui-btn_disabled):hover{background:#353537}
body.dsh-ui-enhanced .weui-btn_default{border:1px solid var(--dsh-control-border);background:#fff;color:#3b3b3e}
body.dsh-ui-enhanced .weui-btn_default:not(.weui-btn_disabled):hover{border-color:#b7bcc1;background:#fafafa}
body.dsh-ui-enhanced .weui-btn_warn{background:#c9362b;color:#fff}
body.dsh-ui-enhanced .weui-btn_mini{height:28px;padding:0 9px;font-size:11px;line-height:28px}
body.dsh-ui-enhanced .weui-btn_reset:focus-visible,
body.dsh-ui-enhanced button:focus-visible,
body.dsh-ui-enhanced input:focus-visible,
body.dsh-ui-enhanced select:focus-visible{outline:2px solid rgba(10,132,255,.65);outline-offset:2px}

/* Search and select controls use the same WeUI form vocabulary. */
body.dsh-ui-enhanced .dsh-weui-search-box{display:flex;align-items:center;gap:7px;min-width:0;border:1px solid var(--dsh-control-border);border-radius:7px;background:#fff;padding:0 10px;transition:border-color .16s,box-shadow .16s}
body.dsh-ui-enhanced .dsh-weui-search-box:focus-within{border-color:#0a84ff;box-shadow:0 0 0 3px var(--dsh-focus)}
body.dsh-ui-enhanced .dsh-weui-search-box::before{content:'⌕';flex:none;color:#85888c;font-size:19px;line-height:1;transform:translateY(-1px)}
body.dsh-ui-enhanced .dsh-weui-search-input{height:38px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;font-size:13px!important}
body.dsh-ui-enhanced .weui-select{height:38px;border:1px solid var(--dsh-control-border);border-radius:7px;background:#fff;color:#303033;padding:0 30px 0 10px;font:inherit;font-size:12px;outline:0}
body.dsh-ui-enhanced .dsh-weui-label{color:#75787c;font-size:10px;font-weight:650;letter-spacing:.02em}
body.dsh-ui-enhanced .dsh-weui-form-row{border:1px solid var(--dsh-control-border);border-radius:8px;background:var(--dsh-control);padding:5px}

/* Cells make dynamic search results and store lists scan like a WeUI list. */
body.dsh-ui-enhanced .dsh-weui-cell{position:relative;display:flex;align-items:center;gap:10px;min-height:42px;padding:8px 10px;border-bottom:1px solid #eceeef;background:#fff;transition:background-color .16s}
body.dsh-ui-enhanced .dsh-weui-cell:first-child{border-top-left-radius:7px;border-top-right-radius:7px}
body.dsh-ui-enhanced .dsh-weui-cell:last-child{border-bottom:0;border-bottom-left-radius:7px;border-bottom-right-radius:7px}
body.dsh-ui-enhanced .dsh-weui-cell:hover,
body.dsh-ui-enhanced .dsh-weui-cell:focus-visible{background:#f7faff}
body.dsh-ui-enhanced .dsh-weui-list{overflow:hidden;border:1px solid #e2e5e7;border-radius:8px;background:#fff}
body.dsh-ui-enhanced .dsh-weui-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:7px;color:#777b80;font-size:10px;font-weight:650}
body.dsh-ui-enhanced .dsh-weui-list-head b{color:#2b2d30;font-size:12px}

/* Small status markers deliberately use WeUI badges only where status is the point. */
body.dsh-ui-enhanced .dsh-weui-badge{display:inline-flex;align-items:center;min-height:20px;padding:0 6px;border-radius:4px;background:var(--dsh-brand-soft);color:#8a6100;font-size:10px;font-weight:700;line-height:20px;white-space:nowrap}
body.dsh-ui-enhanced .dsh-weui-badge.good{background:#edf8f1;color:#177245}
body.dsh-ui-enhanced .dsh-weui-badge.warn{background:#fff4e5;color:#a75b00}
body.dsh-ui-enhanced .dsh-weui-badge.bad{background:#fff1ef;color:#b52f27}

/* Preserve the dashboard's custom dialog geometry while borrowing WeUI semantics. */
body.dsh-ui-enhanced .dsh-weui-dialog{border-radius:9px!important;border:1px solid rgba(20,25,28,.12);box-shadow:0 22px 60px rgba(22,27,31,.2);background:#fff}
body.dsh-ui-enhanced .dsh-weui-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
body.dsh-ui-enhanced .dsh-weui-dialog-close{display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:6px;background:#f1f2f3;color:#63676b;font-size:18px;line-height:1;cursor:pointer}
body.dsh-ui-enhanced .dsh-weui-dialog-close:hover{background:#e7e9eb;color:#25272a}

/* Stable screenshots for the email workflow. */
body[data-snapshot-mode="1"] *,
body[data-snapshot-mode="1"] *::before,
body[data-snapshot-mode="1"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
body[data-snapshot-mode="1"] .dsh-motion-target{opacity:1!important;transform:none!important}
body[data-snapshot-mode="1"] [data-dsh-snapshot-loading="1"]{visibility:hidden}

/* A quiet readiness marker for local screenshot tooling. */
body[data-snapshot-ready="1"]::after{content:'';position:fixed;left:-9999px;top:-9999px;width:1px;height:1px}

@media(max-width:820px){
 body.dsh-ui-enhanced .department-nav{min-width:0;width:100vw!important;max-width:100vw!important}
 body.dsh-ui-enhanced .department-nav-list{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:calc(100vw - 16px)!important;min-width:0;overflow:hidden}
 body.dsh-ui-enhanced .department-nav .department-nav-item{min-width:0;width:100%!important;max-width:100%;overflow:hidden}
 body.dsh-ui-enhanced .dsh-weui-search-box{width:100%}
 body.dsh-ui-enhanced .weui-btn{height:34px;line-height:34px}
}
