/* =========================================================================
   Dashboards (workshop owner + admin)
   ========================================================================= */
.validation-summary-valid { display: none; }
.dash { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; width: min(100% - 32px, 1320px); margin: 28px auto 64px; align-items: start; }
.dash-side { position: sticky; top: 92px; }
.dash-main { min-width: 0; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--sh-sm); }
.side-ws { display: flex; gap: 12px; align-items: center; padding: 6px 6px 16px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.side-ws > div { display: grid; gap: 4px; min-width: 0; }
.side-ws b { line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.side-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, var(--brand-2), var(--brand-700)); color: #fff; font-weight: 800; flex-shrink: 0; font-size: 1.3rem; }
.side-avatar.admin { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #2b1a00; }
.side-avatar.big { width: 84px; height: 84px; border-radius: 26px; font-size: 2.2rem; }
.side-avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 700; color: var(--ink-2); transition: background .2s, color .2s; }
.side-nav a:hover { background: var(--bg); }
.side-nav a.active { background: var(--brand-50); color: var(--brand-700); }
.side-nav a .ms { color: var(--muted-2); }
.side-nav a.active .ms { color: var(--brand); }
.count { margin-inline-start: auto; font-style: normal; min-width: 24px; text-align: center; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #2b1a00; font-size: .78rem; font-weight: 800; }
.count.danger { background: var(--danger); color: #fff; }

.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dash-head h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: .9rem; }
.mb-16 { margin-bottom: 16px; }
.mt-6 { margin-top: 6px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sc { display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 22px; transition: transform .25s var(--ease), box-shadow .25s; }
a.sc:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.sc > .ms { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 26px; }
.sc div { display: grid; line-height: 1.3; }
.sc b { font-size: 1.8rem; font-weight: 800; font-family: 'Plus Jakarta Sans', var(--font); }
.sc small { color: var(--muted); font-weight: 600; }
.sc-accent { background: linear-gradient(135deg, #fff8e6, #fff); border-color: #fde4a8; }
.sc-accent > .ms { background: var(--accent); color: #2b1a00; }
.sc-danger > .ms { background: var(--danger-50); color: var(--danger); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--sh-sm); margin-bottom: 22px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 1.15rem; font-weight: 800; }
.form-panel { max-width: 860px; padding: 28px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.onboarding { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; background: linear-gradient(135deg, var(--brand-50), #fff); border-color: #bfe9de; }
.onboarding > .ms { font-size: 40px; color: var(--brand); }
.onboarding div { flex: 1; min-width: 220px; }
.onboarding p { color: var(--muted); }

.mini-list { display: grid; }
.mini-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--bg); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li > .ms { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.mini-list li > div { flex: 1; min-width: 0; display: grid; }
.mini-list small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list em { font-style: normal; color: var(--muted-2); font-size: .85rem; }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th { text-align: start; padding: 14px 16px; font-size: .8rem; color: var(--muted); font-weight: 800; background: var(--bg); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-top: 1px solid var(--bg); vertical-align: middle; }
.tbl td small { display: block; color: var(--muted); font-size: .8rem; }
.tbl td small.err { color: var(--danger); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr:hover td { background: #fcfbf8; }
.tbl td:first-child { min-width: 230px; }
.tbl tr.dim td { opacity: .55; }
.tbl td.nowrap { white-space: nowrap; }
.tbl code { background: var(--bg); padding: 2px 8px; border-radius: 6px; font-size: .85rem; }
.tbl .ms { font-size: 1.1em; }
.cell-prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-prod > div { display: grid; }
.cell-prod a:hover { color: var(--brand); }
.thumb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; flex-shrink: 0; }
.thumb.plain { background: var(--brand-50); color: var(--brand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.row-actions form { display: flex; align-items: center; gap: 6px; margin: 0; }
.row-actions.wrap { flex-wrap: wrap; }
.btn.icon { padding: 8px 10px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-50); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn.on { background: #fff3cd; color: #8a5a00; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }

.toggle { position: relative; width: 46px; height: 26px; border-radius: 999px; border: 0; background: #cfd5d9; cursor: pointer; transition: background .25s; padding: 0; }
.toggle i { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: inset-inline-start .25s var(--ease); }
.toggle.on { background: var(--ok); }
.toggle.on i { inset-inline-start: 23px; }

/* status tags */
.st { display: inline-flex; align-items: center; gap: 5px; width: fit-content; white-space: nowrap; padding: 2px 11px; border-radius: 999px; font-size: .78rem; font-weight: 800; line-height: 1.7; }
.st .ms { font-size: 1.05em; }
.st-new, .st-pending { background: #fff3cd; color: #8a5a00; }
.st-contacted { background: #dbeafe; color: #1e40af; }
.st-closed { background: #e5e7eb; color: #4b5563; }
.st-approved, .st-email-sent { background: var(--ok-50); color: #166534; }
.st-suspended, .st-email-failed { background: var(--danger-50); color: #991b1b; }
.st-email-pending { background: #fff3cd; color: #8a5a00; }
.st-broadcast { background: #ede9fe; color: #5b21b6; }

/* request cards */
.rq-list { display: grid; gap: 16px; }
.rq { display: grid; gap: 14px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 24px; transition: box-shadow .25s; }
.rq:hover { box-shadow: var(--sh-sm); }
.rq.new { border-color: #f5c451; box-shadow: 0 0 0 4px rgba(245,158,11,.1); }
.rq header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.rq-who { display: flex; align-items: center; gap: 12px; }
.rq-who div { display: grid; line-height: 1.35; }
.rq-who small { color: var(--muted); }
.rq-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-50); color: var(--brand-700); font-weight: 800; }
.rq-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rq-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.rq-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.rq-meta a { color: var(--brand-700); }
.rq-meta a:hover { text-decoration: underline; }
.rq-msg { padding: 14px 16px; background: var(--accent-50); border-inline-start: 4px solid var(--accent); border-radius: 12px; white-space: pre-wrap; line-height: 1.8; }
.rq footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.rq-contact, .rq-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pref { color: var(--muted); font-size: .85rem; }

.price-input { display: flex; align-items: center; gap: 8px; }
.price-input span { font-weight: 800; color: var(--muted); }
.logo-edit { display: flex; align-items: center; gap: 16px; }
.inline-search { min-width: 260px; }
.inline-search .sfield { background: #fff; border-color: var(--line); }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding: 4px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick label > span { display: grid; place-items: center; height: 52px; border: 2px solid var(--line); border-radius: 14px; background: #fff; transition: all .2s; }
.icon-pick .ms { font-size: 26px; color: var(--muted); }
.icon-pick label:hover > span { border-color: var(--brand); }
.icon-pick input:checked + span { background: var(--brand); border-color: var(--brand); }
.icon-pick input:checked + span .ms { color: #fff; }
.img-item input { position: absolute; opacity: 0; pointer-events: none; }
.img-item input:checked ~ label { background: var(--danger); }

/* =========================================================================
   Admin overview
   ========================================================================= */
.sc div em { font-style: normal; font-size: .78rem; color: var(--muted-2); font-weight: 600; }
.sc b.sm { font-size: 1.15rem; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-head h2 .ms { color: var(--accent-600); }
.panel-head small { display: block; margin-top: 2px; }
.panel-head.pad { padding: 20px 22px 6px; margin: 0; }
.panel-head.sub { margin-top: 22px; }
.count-badge { font-style: normal; display: inline-grid; place-items: center; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .76rem; font-weight: 800; }
.tab.active .count-badge { background: rgba(255,255,255,.2); color: #fff; }
.tabs.sub { background: transparent; box-shadow: none; border-color: transparent; padding: 0; }
.tabs.sub .tab { padding: 6px 14px; font-size: .88rem; border: 1px solid var(--line); background: #fff; }
.tabs.sub .tab.active { background: var(--brand); border-color: var(--brand); }

.attention { border-color: #f5d9a0; background: linear-gradient(135deg, #fffaf0, #fff); }
.attention.ok { border-color: #bfe9de; background: linear-gradient(135deg, var(--brand-50), #fff); }
.attention.ok .empty { background: transparent; border: 0; padding: 10px; grid-auto-flow: column; justify-content: center; gap: 12px; }
.attention.ok .empty > .ms { font-size: 30px; color: var(--brand); }
.att-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.att-list a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; font-weight: 600; color: var(--ink-2); transition: transform .2s var(--ease), box-shadow .2s; }
.att-list a:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.att-list a > .ms:first-child { color: var(--accent-600); }
.att-list b { font-family: 'Plus Jakarta Sans', var(--font); font-size: 1.15rem; color: var(--ink); }
.att-list .go { margin-inline-start: auto; color: var(--muted-2); }
.att-list .bad a > .ms:first-child { color: var(--danger); }
.att-list .bad a { border-color: #f6c9c9; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dash-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid > .panel { margin-bottom: 22px; }

.mini-kpis { display: flex; gap: 22px; }
.mini-kpis span { display: grid; text-align: center; line-height: 1.3; }
.mini-kpis b { font-size: 1.35rem; font-weight: 800; font-family: 'Plus Jakarta Sans', var(--font); }
.mini-kpis small { color: var(--muted); font-weight: 600; font-size: .78rem; display: flex; align-items: center; gap: 6px; justify-content: center; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-weight: 800; font-size: .76rem; padding: 1px 6px; border-radius: 999px; }
.trend .ms { font-size: 1rem; }
.trend.up { background: var(--ok-50); color: #166534; }
.trend.down { background: var(--danger-50); color: #991b1b; }
.trend.flat { background: var(--bg); color: var(--muted); }

.chart-wrap { margin-top: 10px; }
.bars { width: 100%; height: 180px; display: block; overflow: visible; }
.bars rect { fill: var(--brand-2); opacity: .9; transition: opacity .2s, fill .2s; }
.bars rect:hover { opacity: 1; fill: var(--brand); }
.bars rect.today { fill: var(--accent); }
.bars rect.zero { fill: var(--line); opacity: 1; }
.bars .axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bars .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 6; vector-effect: non-scaling-stroke; opacity: .8; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted-2); font-size: .8rem; font-weight: 600; direction: ltr; }

.stack { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.stack i { display: block; min-width: 0; transition: flex .5s var(--ease); }
.stack i:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.stack i:last-child { border-start-end-radius: 999px; border-end-end-radius: 999px; }
.s-new { background: #f59e0b; } .s-contacted { background: #3b82f6; } .s-closed { background: #9ca3af; }
.s-sent { background: #16a34a; } .s-pending { background: #fbbf24; } .s-failed { background: var(--danger); } .s-empty { background: var(--bg); }
.legend { display: grid; gap: 8px; margin-top: 14px; }
.legend li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; }
.legend li i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend li b { margin-inline-start: auto; font-family: 'Plus Jakarta Sans', var(--font); }
.legend li em { font-style: normal; color: var(--muted-2); font-size: .82rem; min-width: 38px; text-align: end; }
.note { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: .88rem; }
.note .ms { color: var(--brand); font-size: 1.2rem; }

.track { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.track i { display: block; height: 100%; width: var(--v, 0%); min-width: 3px; border-radius: 999px; background: var(--brand-2); transition: width .8s var(--ease); }
.craft-stats { display: grid; gap: 18px; }
.craft-stat { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, var(--cs), #fff 60%); }
.craft-stat header { margin-bottom: 2px; }
.craft-stat .track i { background: var(--c1); }
.bar-row { display: grid; grid-template-columns: 88px 1fr 34px; gap: 12px; align-items: center; font-size: .88rem; color: var(--muted); font-weight: 600; }
.bar-row b { text-align: end; color: var(--ink); font-family: 'Plus Jakarta Sans', var(--font); }

.rank-list { display: grid; gap: 4px; }
.rank-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li > .ms { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.rank-list li > div:nth-child(2) { flex: 1; display: grid; gap: 8px; min-width: 0; }
.rank-num { display: grid; text-align: end; line-height: 1.25; }
.rank-num b { font-size: 1.1rem; font-family: 'Plus Jakarta Sans', var(--font); }
.rank-num small { color: var(--muted-2); font-size: .76rem; }

.geo-tbl { min-width: 560px; }
.geo-tbl td { padding-block: 11px; }
.geo-tbl .wide { width: 38%; min-width: 180px; }
.geo-tbl td .st { margin-inline-start: 10px; }
.dual { display: grid; gap: 4px; }
.dual .track { height: 6px; }
.track.supply i { background: var(--brand-2); }
.track.demand i { background: var(--accent); }
.legend-line { display: flex; align-items: center; gap: 8px; padding: 12px 22px 16px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.legend-line .dot { width: 10px; height: 10px; border-radius: 3px; margin-inline-start: 10px; }
.legend-line .dot:first-child { margin-inline-start: 0; }
.dot.supply { background: var(--brand-2); } .dot.demand { background: var(--accent); }

.num-pair { display: grid; justify-items: center; line-height: 1.25; min-width: 46px; flex-shrink: 0; }
.num-pair b { font-size: 1.05rem; font-family: 'Plus Jakarta Sans', var(--font); }
.num-pair small { color: var(--muted-2); font-size: .72rem; display: inline-flex; }
.num-pair small .ms { font-size: 1.05rem; }
.mini-list li > .num-pair { flex: 0 0 auto; }

/* public workshop / piece code (K7M2QX9D) */
.code-chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 2px 10px; border-radius: 8px; background: var(--bg); color: var(--ink-2); font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-weight: 700; font-size: .82rem; letter-spacing: .08em; user-select: all; }
.code-chip .ms { font-size: 1.05rem; color: var(--muted-2); }
.code-chip.sm { padding: 0 6px; font-size: .74rem; border-radius: 6px; display: inline; }
.mini-list a:hover b { color: var(--brand); }
.mini-list.roomy li { align-items: flex-start; }
.mini-list.roomy small { white-space: normal; }
.mini-list .msg { color: var(--ink-2); margin-top: 4px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* admin workshop details */
.ws-title { display: flex; align-items: center; gap: 16px; }
.ws-title h1 { line-height: 1.25; }
.ws-title .side-avatar b { font-weight: 800; }
.desc { color: var(--ink-2); line-height: 1.9; margin-bottom: 14px; }
.kv { display: grid; gap: 2px; }
.kv > div { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.kv dt .ms { font-size: 1.15rem; color: var(--muted-2); }
.kv dd { margin: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.kv dd a { color: var(--brand-700); }
.kv dd a:hover { text-decoration: underline; }
.sub-h { margin: 20px 0 10px; font-size: .95rem; font-weight: 800; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-weight: 700; font-size: .85rem; }
.tag .ms { font-size: 1.05rem; color: var(--brand); }
.rq-error { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--danger-50); color: #991b1b; font-size: .88rem; font-weight: 600; }
.rq-error .ms { font-size: 1.1rem; }

@media (max-width: 1100px) {
  .dash-grid, .dash-grid.even { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mini-kpis { gap: 14px; }
  .kv > div { grid-template-columns: 1fr; gap: 4px; }
  .bar-row { grid-template-columns: 74px 1fr 30px; }
  .ws-title { align-items: flex-start; }
}

@media (max-width: 1020px) {
  .dash { grid-template-columns: 1fr; margin-top: 16px; }
  .dash-side { position: static; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .side-ws { display: none; }
  .side-card { padding: 8px; }
  .form-panel { padding: 20px; }
}

/* Urdu (Nastaliq): tall glyphs need more line height than the default 1.3 used for compact dashboard text */
html[lang="ur"] .sc div { line-height: 1.9; }
html[lang="ur"] .sc b { line-height: 1.3; }
html[lang="ur"] .sc small, html[lang="ur"] .sc em { line-height: 2.1; }
html[lang="ur"] .panel-head small, html[lang="ur"] .mini-kpis small, html[lang="ur"] .legend li, html[lang="ur"] .rank-num small,
html[lang="ur"] .bar-row, html[lang="ur"] .mini-list small, html[lang="ur"] .rq-who small, html[lang="ur"] .rq-meta,
html[lang="ur"] .att-list a, html[lang="ur"] .kv dt, html[lang="ur"] .tag, html[lang="ur"] .num-pair small { line-height: 2.1; }
html[lang="ur"] .rq-msg, html[lang="ur"] .side-nav a, html[lang="ur"] .tbl td, html[lang="ur"] .tbl th { line-height: 2.2; }
html[lang="ur"] .panel-head h2, html[lang="ur"] .dash-head h1 { line-height: 1.9; }
html[lang="ur"] .mini-list li > div > b, html[lang="ur"] .mini-list li > div > a b, html[lang="ur"] .rq-who b, html[lang="ur"] .rank-list li b,
html[lang="ur"] .cell-prod b, html[lang="ur"] .kv dd { line-height: 2; }
