/* SFIVA Studio — the five tools (studio.php). The landing page, packages and
   bar are in eco.css (.sd-hero, .sd-pkg, .sd-bar…); this file is the tools. */
.sd { --sd-line: rgba(138,106,44,.18); --sd-soft: #faf6ec; --sd-ink: #1b1a17; --sd-mute: #5d6a63; --sd-em: var(--em-800, #0d2218); --sd-gold: var(--gold-600, #8a6a2c); background: #f7f3ea; }
.sd .pos { color: #1e6b34; } .sd .neg { color: #a3281b; } .sd .muted { color: var(--sd-mute); } .sd .nw { white-space: nowrap; } .sd .r { text-align: right; }

/* ---------------------------------------------------------- landing */
.sd-ts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(1.4rem, 4vw, 3.4rem); align-items: center; }
.sd-tool-show.alt .sd-ts-copy { order: 2; }
.sd-tool-show.alt { background: #fff; padding-top: clamp(2.6rem, 6vw, 4.4rem) !important; border-block: 1px solid var(--sd-line); }
.sd-eyebrow.dark { color: var(--sd-gold); }
.sd-ts-copy h2 { font: 500 clamp(1.7rem, 3.2vw, 2.5rem)/1.12 var(--display); color: var(--sd-em); margin: 0 0 .8rem; }
.sd-ts-pitch { color: var(--ink-700, #2a3830); line-height: 1.65; margin: 0 0 1rem; }
.sd-ts-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.sd-ts-list li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: .95rem; line-height: 1.5; }
.sd-ts-list i { color: var(--gold-500, #b08b42); margin-top: .25em; }
.sd-ts-beats { margin: 0 0 .6rem; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, #fbf4e1, #f3e3b8); border: 1px solid rgba(176,139,66,.3); font-size: .92rem; line-height: 1.55; color: #3d3016; }
.sd-ts-beats i { color: var(--sd-gold); margin-right: 4px; }
.sd-ts-for { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sd-mute); margin: 0 0 1rem; }
.sd-ts-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sd-ts-cta .sd-link { margin: 0; padding: 0; }
.sd-ts-shot { margin: 0; border-radius: 18px; overflow: hidden; background: var(--sd-em); box-shadow: 0 30px 60px -28px rgba(13,34,24,.45), 0 0 0 1px rgba(217,185,108,.25); aspect-ratio: 16 / 10; }
.sd-ts-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.sd-ts-ph { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(80% 80% at 70% 20%, rgba(217,185,108,.25), transparent 60%), linear-gradient(160deg, #0d2218, #07140e); color: var(--gold-300, #d9b96c); font-size: 4rem; }
.sd-h3 { font: 600 1.2rem var(--display); color: var(--sd-em); margin: 2rem 0 1rem; }
.sd-pkg-grid.singles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.sd-pkg-grid.singles .sd-pkg { padding: 20px 18px 18px; }
.sd-pkg-grid.singles .sd-price b { font-size: 1.6rem; }

/* ---------------------------------------------------------- workspace */
.sd-app { padding: 18px 0 64px; min-height: 60vh; }
.sd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; padding: 10px; border-radius: 16px; background: #fff; border: 1px solid var(--sd-line); box-shadow: 0 8px 24px -18px rgba(13,34,24,.35); position: sticky; top: calc(var(--header-h, 70px) + 6px); z-index: 20; }
.sd-tb-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.sd-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.sd-tabs::-webkit-scrollbar { display: none; }
.sd-tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font: 600 .86rem var(--sans); color: var(--sd-mute); cursor: pointer; white-space: nowrap; }
.sd-tabs button:hover { background: var(--sd-soft); color: var(--sd-em); }
.sd-tabs button.on { background: var(--sd-em); color: #fbf4e1; }
.sd-tabs button.on i { color: var(--gold-300, #d9b96c); }
.sd-tabs button em { font-style: normal; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #b83a2b; color: #fff; font-size: .7rem; }
.sd-tabs button em:empty { display: none; }
.sd-tabs.sm { margin-bottom: 12px; border-bottom: 1px solid var(--sd-line); padding-bottom: 8px; }
.sd-tabs.sm button { min-height: 34px; padding: 0 10px; font-size: .8rem; }
.sd-tabs.sm button em { background: var(--sd-gold); }
.sd-scen { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 260px; min-width: 0; scrollbar-width: thin; }
.sd-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--sd-line); background: var(--sd-soft); font: 600 .84rem var(--sans); color: var(--sd-em); cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-chip.on { background: var(--sd-em); border-color: var(--sd-em); color: #fbf4e1; }
.sd-chip i { opacity: .6; font-size: .75rem; } .sd-chip i:hover { opacity: 1; }
.sd-btn.sm { min-height: 36px; padding: 0 14px; font-size: .82rem; }
.sd-btn.wa { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.sd-btn.danger { color: #a3281b; border-color: rgba(163,40,27,.4); }
.sd-btn:disabled { opacity: .5; cursor: default; transform: none; }
.sd-btn.ghost.light:hover { background: rgba(255,255,255,.08); }
.sd-status { font-size: .78rem; color: var(--sd-mute); min-width: 70px; text-align: right; }
.sd-status.busy { color: var(--sd-gold); } .sd-status.ok { color: #1e6b34; } .sd-status.err { color: #a3281b; font-weight: 700; }
.sd-card { background: #fff; border: 1px solid var(--sd-line); border-radius: 16px; padding: 16px 18px; margin: 0 0 14px; min-width: 0; }
fieldset.sd-card { display: block; }
.sd-card h3, .sd-card legend { font: 600 1.08rem var(--display); color: var(--sd-em); margin: 0 0 10px; }
.sd-card legend { padding: 0 6px; font: 700 .7rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--sd-gold); }
.sd-card h4, .bi-h4 { font: 700 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--sd-gold); margin: 16px 0 8px; }
.sd-app .sd-hint { font-size: .8rem; color: var(--sd-mute); line-height: 1.5; margin: 0 0 10px; }
.sd-app .sd-link, .sd-empty .sd-link { margin: 0; padding: 0; border: 0; background: none; font: 600 .86rem var(--sans); color: var(--sd-gold); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sd-app .sd-cta { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sd-app .sd-chips button em { font-style: normal; opacity: .65; margin-left: 2px; }
.sd-empty { text-align: center; padding: clamp(2rem, 6vw, 4rem) 1rem; border: 1px dashed rgba(138,106,44,.35); border-radius: 18px; background: #fffdf8; }
.sd-empty > i { font-size: 2.2rem; color: var(--gold-400, #c9a45a); }
.sd-empty h3 { font: 500 1.6rem var(--display); color: var(--sd-em); margin: .6rem 0; }
.sd-empty p { max-width: 560px; margin: 0 auto; color: var(--sd-mute); line-height: 1.6; }
.sd-empty .sd-cta { justify-content: center; }
.sd-empty.sm { padding: 1.4rem; }
.sd-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 9999; max-width: min(92vw, 560px); padding: 12px 18px; border-radius: 12px; background: var(--sd-em, #0d2218); color: #fbf4e1; font-size: .9rem; box-shadow: 0 18px 40px rgba(0,0,0,.25); transition: transform .3s; pointer-events: none; }
.sd-toast.on { transform: translate(-50%, 0); }
.sd-toast.err { background: #8a2116; }
.sd-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--sd-mute); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sd-x:hover { background: #f6ece9; color: #a3281b; }
.sd-dialog { border: 0; padding: 0; border-radius: 18px; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.sd-dialog::backdrop { background: rgba(7,20,14,.55); backdrop-filter: blur(2px); }
.sd-dlg { padding: 18px 20px; }
.sd-dlg header, .sd-dlg footer { display: flex; align-items: center; gap: 10px; }
.sd-dlg header { justify-content: space-between; margin-bottom: 12px; }
.sd-dlg header h3 { margin: 0; font: 600 1.25rem var(--display); color: var(--sd-em); }
.sd-dlg footer { margin-top: 16px; } .sd-dlg footer span { flex: 1; }
.sd-bc { display: block; }

/* forms used across the tools */
.od-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.od-form.one { grid-template-columns: 1fr; }
.od-form label, .od-map label, .bi-num label { display: grid; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--ink-700, #2a3830); min-width: 0; }
.od-form label.wide { grid-column: 1 / -1; }
.od-form label small { font-weight: 400; color: var(--sd-mute); }
.od-form label i { color: #a3281b; font-style: normal; }
.sd-app input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .sd-app select, .sd-app textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #ddd3bf; border-radius: 10px; background: #fffdf8; font: 400 .92rem var(--sans); color: var(--sd-ink); box-sizing: border-box; }
.sd-app textarea { resize: vertical; line-height: 1.45; }
.sd-app input:focus, .sd-app select:focus, .sd-app textarea:focus { outline: 2px solid var(--gold-400, #c9a45a); outline-offset: 1px; border-color: transparent; }
.sd-app input[type=color] { width: 100%; height: 40px; border: 1px solid #ddd3bf; border-radius: 10px; padding: 3px; background: #fff; }
.od-chk { display: flex !important; align-items: center; gap: 8px; font-size: .86rem; font-weight: 500 !important; margin: 8px 0 0; cursor: pointer; }
.od-chk input, .od-radio input { width: 18px; height: 18px; accent-color: var(--sd-em); flex: 0 0 auto; }
.od-radio { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--sd-line); border-radius: 12px; margin: 0 0 8px; font-size: .9rem; cursor: pointer; }
.od-radio b { margin-left: auto; font-size: 1.05rem; color: var(--sd-em); }
.od-radio:has(input:disabled) { opacity: .5; }
.od-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.od-two > .sd-card { margin: 0 0 14px; }
.od-tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------------ Profit Planner */
.pp-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pp-in { display: grid; gap: 12px; position: sticky; top: calc(var(--header-h, 70px) + 80px); max-height: calc(100vh - var(--header-h, 70px) - 100px); overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.pp-in .sd-card { margin: 0; }
.pp-presets { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.pp-presets label { display: grid; gap: 4px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sd-gold); }
.pp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-f { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--ink-700, #2a3830); align-content: start; }
.pp-f.wide { grid-column: 1 / -1; }
.pp-f small { font-weight: 400; font-size: .72rem; color: var(--sd-mute); line-height: 1.35; }
.pp-inp { position: relative; display: flex; align-items: center; }
.pp-inp em { position: absolute; left: 10px; font-style: normal; font-size: .76rem; color: var(--sd-mute); pointer-events: none; }
.pp-inp em.r { left: auto; right: 10px; }
.sd-app .pp-inp em + input { padding-left: 40px !important; }
.sd-app .pp-inp input:has(+ em.r) { padding-right: 28px !important; }
.pp-out { display: grid; gap: 14px; min-width: 0; }
.pp-out .sd-card { margin: 0; }
.pp-hero { padding: 20px 22px; border-radius: 18px; background: linear-gradient(135deg, #0f3a26, #0b2a1c); color: #f6eedb; display: grid; gap: 4px; }
.pp-hero.down { background: linear-gradient(135deg, #5a1d14, #3a120c); }
.pp-hero small { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-300, #d9b96c); font-weight: 700; }
.pp-hero b { font: 600 clamp(2rem, 5vw, 2.9rem)/1.05 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pp-hero span { font-size: .92rem; opacity: .85; }
.pp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.pp-out .pp-kpis { margin: 0; }
.pp-k { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--sd-line); min-width: 0; }
.pp-k small { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sd-mute); font-weight: 700; }
.pp-k b { font-size: 1.28rem; color: var(--sd-em); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pp-k span { font-size: .75rem; color: var(--sd-mute); line-height: 1.35; }
.pp-k.ok { border-color: rgba(30,107,52,.35); background: #f3f9f4; } .pp-k.ok b { color: #1e6b34; }
.pp-k.bad { border-color: rgba(163,40,27,.35); background: #fdf3f1; } .pp-k.bad b { color: #a3281b; }
.pp-stack { display: flex; height: 20px; border-radius: 10px; overflow: hidden; background: #eee; }
.pp-stack span { min-width: 2px; }
.pp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .8rem; color: var(--sd-mute); }
.pp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pp-legend b { color: var(--sd-ink); }
.pp-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.pp-fn { padding: 10px; border-radius: 12px; background: var(--sd-soft); text-align: center; }
.pp-fn b { display: block; font-size: 1.3rem; color: var(--sd-em); font-variant-numeric: tabular-nums; }
.pp-fn span { font-size: .74rem; color: var(--sd-mute); text-transform: uppercase; letter-spacing: .08em; }
.pp-fn.ok b { color: #1e6b34; } .pp-fn.bad b { color: #a3281b; }
.pp-pl, .pp-cmp, .pp-sens { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.pp-pl td { padding: 7px 4px; border-bottom: 1px solid #f0e8d8; }
.pp-pl td:nth-child(2), .pp-pl td:nth-child(3) { text-align: right; white-space: nowrap; }
.pp-pl td:nth-child(3) { color: var(--sd-mute); font-size: .78rem; width: 60px; }
.pp-pl tr.st td { font-weight: 700; color: var(--sd-em); background: #fcf9f1; }
.pp-pl tr.net td { font-size: 1.02rem; border-top: 2px solid var(--sd-em); }
.pp-tips { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.pp-tips li b { display: block; color: var(--sd-em); }
.pp-tips li span { display: block; font-size: .8rem; color: var(--sd-gold); font-weight: 600; }
.pp-tips li small { display: block; font-size: .84rem; color: var(--ink-700, #2a3830); line-height: 1.5; margin-top: 2px; }
.pp-sens-wrap { overflow-x: auto; }
.pp-sens th, .pp-sens td, .pp-cmp th, .pp-cmp td { padding: 7px 8px; border: 1px solid #f0e8d8; text-align: right; white-space: nowrap; }
.pp-sens th:first-child, .pp-cmp th:first-child { text-align: left; background: #fcf9f1; }
.pp-sens thead th, .pp-cmp thead th { background: #fcf9f1; font-size: .74rem; color: var(--sd-mute); }
.pp-sens tr.here { outline: 2px solid var(--sd-em); outline-offset: -2px; }
.pp-cmp b.pos { color: #1e6b34; } .pp-cmp b.neg { color: #a3281b; }
.pp-compare { margin-top: 14px; }

/* ------------------------------------------------------ COD Order Desk */
.od-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.od-filters .sd-chips { flex: 1 1 520px; }
.od-tools { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 420px; justify-content: flex-end; }
.od-tools select { width: auto !important; min-width: 130px; }
.od-search { position: relative; flex: 1 1 240px; display: block; }
.od-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--sd-mute); font-size: .85rem; }
.sd-app .od-search input { padding-left: 34px; }
.od-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin: 0 0 10px; border-radius: 12px; background: #fff; border: 1px solid var(--sd-line); }
.od-bulk.on { background: #fbf4e1; border-color: rgba(176,139,66,.45); }
.od-all { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; margin-right: 6px; cursor: pointer; }
.od-all input, .od-ck input { width: 18px; height: 18px; accent-color: var(--sd-em); }
.od-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.od-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--sd-line); border-left: 4px solid #c8d7cc; }
.od-row.lvl-medium { border-left-color: #d9a227; } .od-row.lvl-high { border-left-color: #b83a2b; background: #fffaf8; }
.od-ck { padding-top: 2px; }
.od-main { min-width: 0; display: grid; gap: 5px; }
.od-l1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.od-name { font-size: 1rem; color: var(--sd-em); }
.od-ref { font-size: .76rem; color: var(--sd-mute); }
.od-l2, .od-l3 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--ink-700, #2a3830); }
.od-l2 i, .od-l3 i { color: var(--sd-gold); margin-right: 3px; font-size: .78rem; }
.od-ph { color: inherit; text-decoration: none; font-weight: 600; white-space: nowrap; }
.od-ph.bad { color: #a3281b; text-decoration: line-through; }
.od-amt { font-weight: 700; color: var(--sd-em); font-variant-numeric: tabular-nums; }
.od-amt em { font-style: normal; font-size: .72rem; padding: 1px 6px; border-radius: 6px; background: #e6f1e8; color: #1e6b34; }
.od-items { color: var(--sd-mute); }
.od-trk, .od-wa { font-size: .78rem; color: var(--sd-mute); }
.od-why { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.od-why li { font-size: .74rem; padding: 2px 8px; border-radius: 99px; background: #f4f1ea; color: #5d5a50; }
.od-why li.bad { background: #fbe9e6; color: #8a2116; } .od-why li.warn { background: #fdf3dc; color: #7a5810; } .od-why li.good { background: #e6f1e8; color: #1e5a2f; }
.od-acts { display: grid; gap: 6px; align-content: start; justify-items: end; min-width: 150px; }
.od-acts select { min-height: 34px !important; padding: 4px 8px !important; font-size: .8rem !important; }
.od-mini { display: flex; gap: 4px; }
.od-mini button, .bi-acts button { width: 32px; height: 32px; border: 1px solid var(--sd-line); border-radius: 8px; background: #fff; color: var(--sd-mute); cursor: pointer; font-size: .82rem; }
.od-mini button:hover, .bi-acts button:hover { background: var(--sd-em); color: #fbf4e1; border-color: var(--sd-em); }
.od-st, .bi-st { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.od-st.gold { background: #fbf0d4; color: #7a5810; } .od-st.amber { background: #fde7d2; color: #8a4510; } .od-st.green { background: #e1f1e4; color: #1e6b34; } .od-st.blue { background: #e2ecf8; color: #1d4f8a; }
.od-st.deep { background: #0f3a26; color: #e8cf8e; } .od-st.red { background: #fbe1dc; color: #8a2116; } .od-st.grey { background: #eee; color: #555; }
.od-risk { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.od-risk.low { background: #e6f1e8; color: #1e5a2f; } .od-risk.medium { background: #fdf0d2; color: #7a5810; } .od-risk.high { background: #b83a2b; color: #fff; }
.od-more { text-align: center; margin: 14px 0 0; }
.od-drop { display: grid; justify-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed rgba(138,106,44,.4); border-radius: 16px; background: #fffdf8; cursor: pointer; text-align: center; transition: background .2s, border-color .2s; }
.od-drop.over, .od-drop:hover { background: #fbf4e1; border-color: var(--gold-500, #b08b42); }
.od-drop i { font-size: 1.8rem; color: var(--gold-500, #b08b42); }
.od-drop span { font-size: .82rem; color: var(--sd-mute); }
.od-pastebox { margin: 12px 0 0; }
.od-pastebox summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--sd-gold); }
.od-pastebox textarea { margin: 8px 0; }
.od-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 10px; margin: 0 0 12px; }
.od-prev { overflow-x: auto; border: 1px solid var(--sd-line); border-radius: 12px; }
.od-prev table, .od-bt, .bi-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.od-prev th, .od-prev td, .od-bt th, .od-bt td, .bi-table th, .bi-table td { padding: 8px 10px; border-bottom: 1px solid #f0e8d8; text-align: left; vertical-align: top; }
.od-prev th, .od-bt th, .bi-table thead th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sd-gold); background: #fcf9f1; white-space: nowrap; }
.bi-table td small { display: block; color: var(--sd-mute); font-size: .76rem; }
.bi-table .r, .od-bt .r { text-align: right; font-variant-numeric: tabular-nums; }
.bi-table td.st { font-weight: 700; }
.bi-table tbody tr:hover { background: #fcfaf4; }
.bi-table tfoot th { border-top: 2px solid var(--sd-em); padding: 8px 10px; }
.od-impsum { font-size: .88rem; margin: 10px 0 0; }
.od-two .od-form + .sd-cta, .od-form + .od-risk-live { margin-top: 12px; }
.od-risk-live { margin: 12px 0 0; display: grid; gap: 6px; justify-items: start; }
.od-hist ul { list-style: none; padding: 0; margin: 8px 0 0; font-size: .8rem; display: grid; gap: 4px; }
.od-hist time { color: var(--sd-mute); margin-right: 6px; }
.od-fieldrow { margin: 10px 0 0; }
.od-fieldrow label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; }
.od-cols { list-style: none; counter-reset: c; margin: 0; padding: 0; display: grid; gap: 6px; }
.od-cols li { display: grid; grid-template-columns: 22px 1fr 1fr 30px 30px; gap: 6px; align-items: center; counter-increment: c; }
.od-cols li::before { content: counter(c); font-size: .74rem; color: var(--sd-mute); text-align: center; }
.od-cols button { height: 36px; border: 1px solid var(--sd-line); border-radius: 8px; background: #fff; cursor: pointer; }
.od-tpl { border: 1px solid var(--sd-line); border-radius: 14px; padding: 10px 12px 12px; margin: 0 0 12px; }
.od-tpl legend { font: 700 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--sd-gold); padding: 0 6px; }
.od-tpl3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.od-tpl3 label { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; }
.od-tpl3 textarea[dir=rtl] { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", Tahoma, sans-serif; line-height: 1.9; }
.od-suggest { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fbf4e1; font-size: .86rem; }
.od-suggest i { color: var(--sd-gold); }
.od-period { margin: 0 0 12px; }
.od-bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 6px; border-bottom: 1px solid var(--sd-line); }
.od-bars span { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(#c9a45a, #a3823d); position: relative; display: flex; align-items: flex-end; }
.od-bars span i { display: block; width: 100%; background: #1e6b34; border-radius: 3px 3px 0 0; }
.od-lvl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.od-lvl th { text-align: left; padding: 8px 6px; width: 90px; }
.od-lvl td { padding: 8px 6px; }
.od-meter { display: block; height: 10px; border-radius: 99px; background: #eee; overflow: hidden; min-width: 120px; }
.od-meter i { display: block; height: 100%; background: linear-gradient(90deg, #1e6b34, #3f9a57); border-radius: 99px; }

/* ------------------------------------------------- Books & Invoices Pro */
.bi-new { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.bi-new span { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sd-mute); margin-right: 4px; }
.bi-st.draft { background: #eee; color: #555; } .bi-st.sent { background: #e2ecf8; color: #1d4f8a; } .bi-st.part { background: #fdf0d2; color: #7a5810; } .bi-st.paid, .bi-st.ok { background: #e1f1e4; color: #1e6b34; }
.bi-st.late { background: #fbe1dc; color: #8a2116; } .bi-st.void { background: #f1eeee; color: #8a7f7f; text-decoration: line-through; }
.bi-acts { display: flex; gap: 4px; justify-content: flex-end; }
.bi-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 46%); gap: 18px; align-items: start; }
.bi-form .sd-card { margin: 0 0 12px; }
.bi-pick { margin: 0 0 10px; }
.bi-lines { display: grid; gap: 6px; }
.bi-lh, .bi-line { display: grid; grid-template-columns: minmax(0, 2.4fr) 62px 96px 62px 62px 96px 32px; gap: 6px; align-items: start; }
.bi-lines.ch .bi-lh, .bi-lines.ch .bi-line { grid-template-columns: minmax(0, 3fr) 80px 90px 32px; }
.bi-lh span { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sd-mute); }
.bi-lh .r, .bi-line output { text-align: right; }
.bi-item { display: grid; gap: 4px; }
.sd-app .bi-item input + input { min-height: 32px; font-size: .8rem; color: var(--sd-mute); }
.bi-line output { padding-top: 10px; font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--sd-em); }
.bi-line .sd-x { margin-top: 4px; }
.bi-totrow { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sd-line); }
.bi-totrow label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; }
.bi-totals p { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.bi-totals p.g { font-size: 1.15rem; border-top: 2px solid var(--sd-em); padding-top: 6px; margin-top: 6px; color: var(--sd-em); }
.bi-totals small { display: block; font-size: .76rem; font-style: italic; color: var(--sd-mute); }
.bi-side { position: sticky; top: calc(var(--header-h, 70px) + 80px); display: grid; gap: 10px; min-width: 0; }
.bi-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-actions .sd-btn { min-height: 38px; padding: 0 14px; font-size: .82rem; }
.bi-paper { position: relative; width: 100%; overflow: hidden; border-radius: 6px; background: #fff; box-shadow: 0 18px 44px -16px rgba(13,34,24,.35), 0 0 0 1px rgba(138,106,44,.15); }
.bi-paper iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.bi-logo { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; flex-wrap: wrap; }
.bi-logo-box { width: 96px; height: 64px; display: grid; place-items: center; border: 1px dashed var(--sd-line); border-radius: 10px; background: repeating-conic-gradient(#f4efe3 0 25%, #fff 0 50%) 0 0 / 12px 12px; overflow: hidden; }
.bi-logo-box img { max-width: 90%; max-height: 90%; object-fit: contain; }
.bi-logo-box span { font-size: .72rem; color: var(--sd-mute); }
.bi-logo label.sd-btn { cursor: pointer; }
.bi-num { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bi-numrow { display: grid; grid-template-columns: 1fr 70px; gap: 4px; }
.bi-age td.neg { font-weight: 700; }
body.bk-printing .sd-toolbar, body.bk-printing .bi-pane:not([data-pane="ledger"]) { display: none !important; }

/* ---------------------------------------------------- Catalogue Studio */
.ct-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ct-side { background: #fff; border: 1px solid var(--sd-line); border-radius: 16px; padding: 12px 14px 16px; position: sticky; top: calc(var(--header-h, 70px) + 80px); max-height: calc(100vh - var(--header-h, 70px) - 96px); overflow: auto; scrollbar-width: thin; }
.ct-stage { min-width: 0; }
.ct-pagebar { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: .84rem; font-weight: 600; color: var(--sd-em); }
.ct-pagebar .sd-hint { margin: 0; }
.ct-paper { background: #cfc8b8; border-radius: 12px; max-width: 640px; margin: 0 auto; }
.ct-paper iframe { height: auto; }
.ct-swatch { display: flex; gap: 8px; }
.ct-swatch button { width: 46px; height: 46px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.ct-swatch button span { position: absolute; right: 6px; bottom: 6px; width: 10px; height: 10px; border-radius: 50%; }
.ct-swatch button.on { border-color: var(--gold-400, #c9a45a); }
.ct-sel { margin: 0 0 12px; }
.ct-sel h4 { margin-top: 0; }
.ct-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.ct-order li { display: grid; grid-template-columns: 34px 1fr 26px 26px 26px; gap: 6px; align-items: center; font-size: .8rem; padding: 3px; border-radius: 8px; background: var(--sd-soft); }
.ct-order img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; background: #fff; }
.ct-order span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-order button { height: 26px; border: 0; border-radius: 6px; background: #fff; cursor: pointer; color: var(--sd-mute); }
.ct-find { display: grid; grid-template-columns: 1fr 130px; gap: 6px; margin: 0 0 10px; }
.ct-side .sd-picks { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.sd-pick.mine i { display: grid; place-items: center; aspect-ratio: 1; background: var(--sd-soft); border-radius: 8px; color: var(--sd-gold); font-size: 1.4rem; }
.ct-prices { margin: 12px 0 0; }
.ct-prow { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f3ede0; font-size: .8rem; }
.ct-prow span small { display: block; color: var(--sd-mute); font-size: .72rem; }
.ct-prow input[data-inote] { grid-column: 1 / -1; min-height: 32px !important; font-size: .78rem !important; }
.ct-mine { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ct-mine li { display: grid; grid-template-columns: 40px 1fr 32px; gap: 8px; align-items: center; font-size: .84rem; }
.ct-mine img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.ct-mine small { display: block; color: var(--sd-mute); }
.ct-cards { margin-top: 18px; }
.ct-cardbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.ct-cardbar h3 { margin: 0 auto 0 0; }
.ct-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ct-cardgrid figure { margin: 0; display: grid; gap: 6px; }
.ct-cardgrid img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.35); }
.ct-cardgrid figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .78rem; }

/* ------------------------------------------------------------ Shop Link */
.sl-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 22px; border-radius: 18px; margin: 0 0 14px; background: linear-gradient(135deg, #0f3a26, #07140e); color: #f6eedb; }
.sl-hero.off { background: linear-gradient(135deg, #3a332a, #1d1915); }
.sl-hero small { display: block; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-300, #d9b96c); font-weight: 700; }
.sl-hero b { display: block; font: 500 clamp(1.3rem, 3vw, 1.9rem)/1.2 var(--display); margin: 4px 0; overflow-wrap: anywhere; }
.sl-hero span { font-size: .86rem; opacity: .82; max-width: 640px; display: block; }
.sl-hero .sd-cta { margin: 0; }
.sl-bars span { background: linear-gradient(#e3c77f, #b08b42); }
.sl-ptop { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; margin: 0 0 12px; }
.sl-ptop h3 { font: 600 1.2rem var(--display); color: var(--sd-em); margin: 0 0 4px; }
.sl-ptop .sd-hint { max-width: 620px; margin: 0; }
.sl-bulk { display: flex; flex-wrap: wrap; gap: 6px; }
.sl-bulk input, .sl-bulk select { width: auto !important; min-width: 170px; }
.sl-plist { display: grid; gap: 8px; }
.sl-prod { display: grid; grid-template-columns: minmax(220px, 1fr) 70px minmax(0, 2fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--sd-line); opacity: .78; }
.sl-prod.on { opacity: 1; border-color: rgba(176,139,66,.55); box-shadow: 0 6px 18px -12px rgba(138,106,44,.5); }
.sl-pick { display: grid; grid-template-columns: 20px 56px 1fr; gap: 10px; align-items: center; cursor: pointer; }
.sl-pick input { width: 18px; height: 18px; accent-color: var(--sd-em); }
.sl-pick img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--sd-soft); }
.sl-pick b { display: block; font-size: .9rem; color: var(--sd-em); line-height: 1.25; }
.sl-pick small { color: var(--sd-mute); font-size: .74rem; }
.sl-feat { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--sd-mute); }
.sl-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sl-pk { display: grid; gap: 3px; font-size: .76rem; }
.sl-pk > em { font-style: normal; font-weight: 700; color: var(--sd-em); }
.sl-pk small { color: var(--sd-mute); font-size: .7rem; }
.sl-pk > i { font-style: normal; font-size: .74rem; font-weight: 700; }
.sl-pk > i.pos { color: #1e6b34; } .sl-pk > i.neg { color: #a3281b; }
.sl-handle { display: flex; align-items: stretch; border: 1px solid #ddd3bf; border-radius: 10px; overflow: hidden; background: #fffdf8; }
.sl-handle em { font-style: normal; display: flex; align-items: center; padding: 0 4px 0 11px; font-size: .82rem; color: var(--sd-mute); white-space: nowrap; background: #f6f0e2; }
.sd-app .sl-handle input { border: 0 !important; border-radius: 0 !important; min-width: 0; }
small.pos { color: #1e6b34 !important; font-weight: 700 !important; } small.neg { color: #a3281b !important; font-weight: 700 !important; }
.sl-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.sl-theme { display: grid; gap: 6px; justify-items: center; padding: 10px; border: 2px solid var(--sd-line); border-radius: 14px; cursor: pointer; font-size: .8rem; }
.sl-theme.on { border-color: var(--gold-400, #c9a45a); background: #fffaf0; }
.sl-theme input { position: absolute; opacity: 0; pointer-events: none; }
.sl-theme .sw { display: flex; width: 100%; height: 38px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sl-theme .sw i { flex: 1; }
.t-ivory .sw i:nth-child(1) { background: #f7f2e8; } .t-ivory .sw i:nth-child(2) { background: #fff; } .t-ivory .sw i:nth-child(3) { background: #8a6a2c; }
.t-emerald .sw i:nth-child(1) { background: #0d2218; } .t-emerald .sw i:nth-child(2) { background: #f6eedb; } .t-emerald .sw i:nth-child(3) { background: #d9b96c; }
.t-noir .sw i:nth-child(1) { background: #0c0b0a; } .t-noir .sw i:nth-child(2) { background: #1f1c17; } .t-noir .sw i:nth-child(3) { background: #d9b96c; }
.sl-link { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 0 0 8px; }
.sl-qrbox { display: grid; place-items: center; min-height: 240px; background: #fff; border-radius: 12px; }
.sl-qrbox svg { width: min(240px, 100%); height: auto; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1099px) {
  .bi-ed { grid-template-columns: 1fr; }
  .bi-side { position: static; order: -1; }
  .bi-paper { max-width: 560px; }
}
@media (max-width: 899px) {
  .sd-ts { grid-template-columns: 1fr; }
  .sd-tool-show.alt .sd-ts-copy { order: 0; }
  .sd-toolbar { position: static; }
  .sd-tb-acts { margin-left: 0; width: 100%; }
  .pp-grid, .ct-grid, .od-two { grid-template-columns: 1fr; }
  .pp-in, .ct-side { position: static; max-height: none; overflow: visible; }
  .od-tpl3 { grid-template-columns: 1fr; }
  .sl-prod { grid-template-columns: 1fr; }
  .sl-feat { justify-self: start; }
}
@media (max-width: 640px) {
  .sd-app { padding-top: 10px; }
  .od-form, .pp-fields { grid-template-columns: 1fr; }
  .od-row { grid-template-columns: 24px minmax(0, 1fr); }
  .od-acts { grid-column: 1 / -1; justify-items: stretch; grid-template-columns: 1fr 1fr; min-width: 0; }
  .od-acts .od-mini { grid-column: 1 / -1; justify-content: flex-end; }
  .pp-funnel { grid-template-columns: repeat(2, 1fr); }
  .bi-lh { display: none; }
  .bi-line, .bi-lines.ch .bi-line { grid-template-columns: repeat(4, minmax(0, 1fr)) 32px; padding: 8px 0; border-bottom: 1px solid var(--sd-line); }
  .bi-line .bi-item { grid-column: 1 / -1; }
  .bi-line output { grid-column: 1 / 5; text-align: left; padding-top: 2px; }
  .bi-totrow { grid-template-columns: 1fr; }
  .sl-themes { grid-template-columns: 1fr 1fr 1fr; }
  .ct-find { grid-template-columns: 1fr; }
}
