/* Deci dashboard — Brand Book §05 palette, §06 typography.
   Cream carries the layout; red is reserved for prices and actions.

   طراحی عمداً «درشت و کم‌گزینه» است: ادمین دسی تا حالا با داشبورد کار نکرده، پس
   هر کارت یک کار دارد، هر دکمه با فعل نوشته شده، و هر عدد کنارش توضیح دارد. */

@font-face { font-family:'Vazirmatn'; font-weight:400; font-display:swap;
  src:url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family:'Vazirmatn'; font-weight:500; font-display:swap;
  src:url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family:'Vazirmatn'; font-weight:700; font-display:swap;
  src:url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2'); }
@font-face { font-family:'Poppins'; font-weight:600; font-display:swap;
  src:url('/assets/fonts/Poppins-SemiBold.woff2') format('woff2'); }

:root{
  --red:#D80621;
  --yellow:#F4C300;
  --amber:#E09E00;
  --charcoal:#2B2723;
  --cream:#FAF6EE;
  --cream-deep:#EEE8DC;
  --cream-edge:#E8E3D8;
  --grey:#9A9484;
  --body:#4A453E;
  --green:#1E8E3E;
  --radius:16px;
  --shadow:0 6px 22px rgba(43,39,35,.08);
}

*{box-sizing:border-box;margin:0;padding:0;}
/* any display: rule below would otherwise beat the browser's own [hidden] handling */
[hidden]{display:none !important;}
body{
  font-family:'Vazirmatn',Tahoma,sans-serif;
  background:var(--cream);
  color:var(--charcoal);
  font-size:15px;
  line-height:1.7;
}
button,input,select,textarea{font:inherit;color:inherit;}
a{color:var(--red);}
h3{font-size:14px;color:var(--grey);margin:12px 0 8px;font-weight:700;}

/* ---------- top bar ---------- */
.topbar{
  display:flex;align-items:center;gap:18px;flex-wrap:wrap;
  padding:10px 22px;background:#fff;border-bottom:1px solid var(--cream-edge);
  position:sticky;top:0;z-index:20;
}
/* لاک‌آپ برند بوک، دست‌نخورده — فقط ارتفاعش تنظیم می‌شود. */
.brand{display:flex;align-items:center;gap:12px;}
.brand img{height:40px;width:auto;display:block;}
.brand span{font-size:12px;color:var(--grey);border-inline-start:1px solid var(--cream-edge);padding-inline-start:12px;}

.mainnav{display:flex;gap:4px;flex:1;flex-wrap:wrap;}
.mainnav button{
  background:transparent;border-radius:11px;padding:9px 14px;font-weight:500;
  font-size:14.5px;color:var(--body);position:relative;
}
.mainnav button:hover{background:var(--cream);}
.mainnav button.on{background:var(--charcoal);color:#fff;font-weight:700;}
.badge{
  background:var(--red);color:#fff;border-radius:999px;padding:0 7px;font-size:11.5px;
  margin-inline-start:4px;
}

.topRight{display:flex;align-items:center;gap:8px;}
.rate{background:var(--cream);border-radius:11px;padding:4px 12px;text-align:center;min-width:96px;}
.rate .lbl{display:block;font-size:11px;color:var(--grey);line-height:1.3;}
.rate b{font-size:14px;}

/* ---------- buttons ---------- */
button{cursor:pointer;border:none;border-radius:12px;padding:10px 18px;font-weight:500;transition:.15s;}
button:disabled{opacity:.5;cursor:not-allowed;}
.primary{background:var(--red);color:#fff;font-weight:700;box-shadow:0 6px 16px rgba(216,6,33,.22);}
.primary:hover:not(:disabled){filter:brightness(1.06);}
button.ok{background:var(--green);color:#fff;font-weight:700;box-shadow:0 6px 16px rgba(30,142,62,.22);}
button.ok:hover:not(:disabled){filter:brightness(1.06);}
.danger{background:#fff;color:var(--red);border:1.5px solid var(--red);font-weight:700;}
.ghost{background:var(--cream-deep);color:var(--charcoal);}
.ghost:hover:not(:disabled){background:var(--cream-edge);}
.tiny{padding:6px 12px;font-size:13px;border-radius:10px;}
.btnlike{text-decoration:none;display:inline-block;}

/* ---------- layout ---------- */
.view{padding:20px;max-width:1400px;margin:0 auto;}
.loading{padding:60px;text-align:center;color:var(--grey);}
.board{display:flex;flex-direction:column;gap:16px;}

.card{
  background:#fff;border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);
  margin-bottom:16px;
}
.card h2{font-size:17px;margin-bottom:6px;}
.card > .hint:first-of-type{margin-bottom:14px;}
.hint{font-size:12.5px;color:var(--grey);line-height:1.8;}
.warn{color:var(--amber);font-weight:700;}
span.ok,.check.ok{color:var(--green);}
.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:14px;}

.layout{display:grid;grid-template-columns:300px 1fr;gap:20px;align-items:start;}
@media (max-width:1000px){ .layout{grid-template-columns:1fr;} }
.sidebar label{display:block;margin-bottom:12px;font-size:13px;color:var(--body);}
.sidebar select,.sidebar input{
  width:100%;margin-top:5px;padding:9px 11px;border:1.5px solid var(--cream-edge);
  border-radius:10px;background:var(--cream);
}
.sidebar .primary{width:100%;}

.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:14px;}
.filters input,.filters select{
  padding:9px 12px;border:1.5px solid var(--cream-edge);border-radius:10px;background:var(--cream);
}
.filters input[type=search]{min-width:260px;flex:1;}

.formGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;}
.formGrid label{display:flex;flex-direction:column;gap:4px;font-size:12.5px;color:var(--body);}
.formGrid label.full{grid-column:1/-1;}
.formGrid input,.formGrid select,.formGrid textarea{
  padding:9px 11px;border:1.5px solid var(--cream-edge);border-radius:10px;background:var(--cream);
  font-size:14px;
}

/* ---------- tables ---------- */
.rows{width:100%;border-collapse:collapse;font-size:13.5px;}
.rows th{
  text-align:right;font-size:11.5px;color:var(--grey);font-weight:500;
  padding:6px;border-bottom:1.5px solid var(--cream-edge);
}
.rows td{padding:9px 6px;border-top:1px solid var(--cream-edge);vertical-align:top;}
.rows tr.clickable,.rows td.clickable{cursor:pointer;}
.rows tr.clickable:hover{background:var(--cream);}
/* لوگوی برند — کوچک، هم‌تراز متن، بدون بریدن (لوگوها نسبت‌های مختلفی دارند) */
.brandLogo{
  object-fit:contain;vertical-align:middle;border-radius:5px;background:#fff;
  padding:1px;box-shadow:0 1px 3px rgba(43,39,35,.12);
}
.pill{background:var(--cream-deep);border-radius:999px;padding:3px 11px;font-size:12px;color:var(--body);}
.pill.red{background:var(--red);color:#fff;}
.pill.yellow{background:var(--yellow);color:var(--charcoal);}
.chip{background:var(--cream-deep);border-radius:999px;padding:5px 13px;font-size:12.5px;}
.statRow{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px;}

.status{border-radius:999px;padding:3px 11px;font-size:12px;white-space:nowrap;}
.s-awaiting_review{background:var(--yellow);color:var(--charcoal);font-weight:700;}
.s-awaiting_payment{background:var(--cream-deep);}
.s-approved{background:#DFF3E5;color:var(--green);font-weight:700;}
.s-purchased{background:#E4EEFB;color:#20558A;}
.s-shipped{background:#E9E2FA;color:#5B3FA8;}
.s-delivered{background:var(--green);color:#fff;}
.s-rejected,.s-cancelled{background:#FBE3E6;color:var(--red);}
.s-draft{background:var(--cream-deep);color:var(--grey);}

/* ---------- home: batches ---------- */
.brandBatch,.batchBox{
  border:1.5px solid var(--cream-edge);border-radius:14px;padding:14px;margin-bottom:12px;
}
.bbHead{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;}
.bbHead b{font-size:15.5px;margin-inline-end:8px;}
.bbMoney{font-weight:700;color:var(--red);}
.ship{margin:12px 0;background:var(--cream);border-radius:12px;padding:12px 14px;}
.ship .row{display:flex;justify-content:space-between;font-size:13px;gap:10px;}
.track{height:12px;background:var(--cream-edge);border-radius:99px;overflow:hidden;margin-top:8px;}
.fill{height:100%;background:linear-gradient(90deg,var(--yellow),var(--red));border-radius:99px;transition:width .4s;}
.pick{display:flex;align-items:center;gap:6px;cursor:pointer;}

.linkRow{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0;}
.linkRow input{
  flex:1;min-width:240px;padding:9px 12px;border:1.5px solid var(--cream-edge);
  border-radius:10px;background:var(--cream);direction:ltr;text-align:left;font-size:12.5px;
}
.doneRow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px;}
.fileBtn{
  background:var(--cream-deep);border-radius:12px;padding:10px 18px;cursor:pointer;font-weight:500;
}
.fileBtn:hover{background:var(--cream-edge);}
.fileName{font-size:12.5px;}

/* ---------- home: calendar slots ---------- */
.slots{display:flex;flex-direction:column;gap:8px;margin:12px 0;}
.slot{
  display:flex;gap:12px;align-items:flex-start;background:var(--cream);border-radius:12px;
  padding:12px 14px;cursor:pointer;
}
.slot.done{opacity:.55;}
.slot.done b{text-decoration:line-through;}
.slot input{margin-top:4px;width:18px;height:18px;}
.slot b{display:block;font-size:14px;}
.slot small{color:var(--grey);font-size:12px;line-height:1.6;}

.checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px;margin-top:12px;}
/* scoped to .checks so it doesn't collide with the .check checkbox rows in the settings dialog */
.checks .check{display:flex;gap:9px;align-items:flex-start;background:var(--cream);border-radius:11px;padding:10px 12px;}
.checks .check.bad{background:#FFF6E5;}
.checks .check b{display:block;font-size:13px;}
.checks .check small{color:var(--grey);font-size:11.5px;line-height:1.6;}

.numbers{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;}
.num{background:var(--cream);border-radius:12px;padding:14px;text-align:center;}
.num b{display:block;font-size:22px;color:var(--red);}
.num span{font-size:12px;color:var(--grey);}

/* ---------- orders detail ---------- */
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:18px;}
.cols .row{display:flex;flex-direction:column;gap:4px;margin-bottom:8px;font-size:12.5px;}
.cols .row.full{grid-column:1/-1;}
.cols input,.cols textarea{
  padding:8px 10px;border:1.5px solid var(--cream-edge);border-radius:9px;background:var(--cream);
}
.flowRow{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:16px 0 4px;}
.flowRow input{padding:9px 12px;border:1.5px solid var(--cream-edge);border-radius:10px;background:var(--cream);}
.msgRow{display:flex;gap:8px;margin-top:14px;}
.msgRow input{flex:1;padding:10px 12px;border:1.5px solid var(--cream-edge);border-radius:10px;background:var(--cream);}
.history{list-style:none;font-size:12.5px;color:var(--body);}
.history li{padding:3px 0;border-bottom:1px dashed var(--cream-edge);}
details summary{cursor:pointer;font-size:13px;color:var(--grey);margin-top:12px;}

.freightRow{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}

/* ---------- باربری ---------- */
/* گام بین «خریده شد» و «ارسال شد». عمداً کادر خودش را دارد تا با دکمه‌های وضعیت
   قاطی نشود: این یکی پول تازه‌ای از مشتری می‌گیرد. */
.freightBox{
  background:var(--cream);border:1.5px solid var(--cream-edge);border-radius:14px;
  padding:14px 16px;margin-top:16px;
}
.freightBox.waiting{border-color:var(--yellow);background:#FFFBEB;}
.freightBox.done{opacity:.85;}
.freightBox h3{font-size:14.5px;margin-bottom:6px;}
.freightGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin:12px 0;}
.freightGrid label{display:flex;flex-direction:column;gap:4px;font-size:12.5px;color:var(--grey);}
.freightGrid label.full{grid-column:1/-1;}
.freightGrid input{
  padding:9px 11px;border:1.5px solid var(--cream-edge);border-radius:10px;background:#fff;
  font-size:14px;color:var(--charcoal);
}

.bulkBar{
  display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:var(--yellow);
  border-radius:12px;padding:10px 14px;margin-bottom:12px;
}
.bulkBar input{flex:1;min-width:220px;padding:8px 11px;border:none;border-radius:9px;}

/* ---------- inventory ---------- */
.invGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;}
.invCard{background:var(--cream);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;}
.invCard.empty{opacity:.55;}
.invCard .thumb{position:relative;aspect-ratio:3/4;background:var(--cream-deep);}
.invCard .thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.invCard .noimg{
  display:flex;align-items:center;justify-content:center;height:100%;color:var(--grey);font-size:12px;
}
.invCard .qty{
  position:absolute;top:8px;inset-inline-start:8px;background:var(--green);color:#fff;
  border-radius:999px;padding:3px 11px;font-size:12px;font-weight:700;
}
.invCard .qty.low{background:var(--red);}
.invCard .body{padding:10px;display:flex;flex-direction:column;gap:5px;flex:1;}
.invCard .price{color:var(--red);font-weight:700;}
.invCard .foot{display:flex;gap:5px;margin-top:auto;}
.variantRow{display:flex;gap:8px;margin-bottom:6px;align-items:center;}
.variantRow input[type=text]{flex:1;padding:8px 10px;border:1.5px solid var(--cream-edge);border-radius:9px;background:var(--cream);}
.variantRow input[type=number]{width:90px;padding:8px 10px;border:1.5px solid var(--cream-edge);border-radius:9px;background:var(--cream);}
.imgStrip{display:flex;gap:8px;margin-top:10px;}
.imgStrip img{width:70px;height:90px;object-fit:cover;border-radius:9px;}

/* ---------- تقویم محتوا ---------- */
.calHead{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;}
.calNav{display:flex;align-items:center;gap:8px;flex:none;}
.calNav b{font-size:14px;min-width:110px;text-align:center;}

.calGrid{
  display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-top:16px;
}
.calDow{
  font-size:11.5px;color:var(--grey);text-align:center;padding:4px 0 2px;font-weight:500;
}
.calDay{
  min-height:88px;background:var(--cream);border:1.5px solid transparent;border-radius:12px;
  padding:7px 8px;display:flex;flex-direction:column;gap:4px;align-items:stretch;text-align:right;
  font:inherit;color:inherit;cursor:pointer;
}
.calDay:hover{border-color:var(--cream-edge);}
.calDay.out{opacity:.35;}
.calDay.today{border-color:var(--red);}
.calDay.open{background:#fff;border-color:var(--charcoal);box-shadow:var(--shadow);}
.calDay .n{font-family:'Poppins',sans-serif;font-size:13px;color:var(--grey);}
.calDay.has .n{color:var(--charcoal);font-weight:600;}
.calDay .focus{
  font-size:11.5px;font-weight:600;color:var(--charcoal);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.calDay .soon{font-size:11px;color:var(--grey);}
.calDay .dots{display:flex;gap:4px;align-items:center;margin-top:auto;flex-wrap:wrap;}

.dot{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:16px;height:16px;border-radius:8px;font-size:10.5px;font-style:normal;
  font-family:'Poppins',sans-serif;padding:0 4px;
}
.dot.story{background:var(--charcoal);color:var(--cream);}
.dot.post{background:var(--red);width:8px;min-width:8px;height:8px;border-radius:50%;}
.dot.pending{background:var(--yellow);width:8px;min-width:8px;height:8px;border-radius:50%;}
.dot.done{background:var(--green);width:8px;min-width:8px;height:8px;border-radius:50%;}

.calLegend{display:flex;gap:16px;margin-top:12px;font-size:11.5px;color:var(--grey);flex-wrap:wrap;}
.calLegend span{display:flex;align-items:center;gap:5px;}

/* یک روز، باز شده */
.slotBox{background:var(--cream);border-radius:14px;padding:12px 14px;margin-bottom:10px;}
.slotBox.done{opacity:.6;}
.slotBox.post{background:#FFFBEB;}
.slotHead{display:flex;gap:10px;align-items:flex-start;cursor:pointer;}
.slotHead b{display:block;font-size:14px;}
.slotHead small{display:block;font-size:12px;color:var(--grey);margin-top:2px;}
.slotItems{list-style:none;margin:10px 0 0;display:flex;flex-direction:column;gap:5px;}
.slotItems li{
  display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  background:#fff;border-radius:10px;padding:7px 10px;font-size:12.5px;
}
.slotItems .code{
  font-family:'Poppins',sans-serif;font-weight:700;background:var(--yellow);
  border-radius:7px;padding:1px 8px;font-size:12px;
}
.slotItems .nm{flex:1;min-width:120px;}
.tagx{font-size:11px;color:var(--grey);background:var(--cream);border-radius:7px;padding:2px 8px;}
.tagx.off{background:var(--red);color:#fff;}
.tagx.pending{background:var(--yellow);color:var(--charcoal);}
.caption{
  white-space:pre-wrap;background:#fff;border-radius:12px;padding:12px 14px;margin-top:10px;
  font-size:12.5px;line-height:1.9;max-height:260px;overflow:auto;
}

/* ---------- posts ---------- */
.postList{display:flex;flex-direction:column;gap:8px;}
.postRow{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  background:var(--cream);border-radius:12px;padding:12px 14px;
}
.slideRow{
  display:flex;gap:10px;align-items:center;background:var(--cream);border-radius:12px;
  padding:9px 12px;margin-bottom:7px;
}
.slideRow .n{
  width:26px;height:26px;border-radius:50%;background:var(--charcoal);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:12px;flex:none;
}
.slideRow img{width:44px;height:56px;object-fit:cover;border-radius:8px;}
.slideRow .noimg{width:44px;height:56px;border-radius:8px;background:var(--cream-edge);}
.slideRow .grow{flex:1;display:flex;flex-direction:column;gap:4px;}
.slideRow input{padding:7px 10px;border:1.5px solid var(--cream-edge);border-radius:9px;background:#fff;font-size:13px;}

.candGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px;}
.cand{display:flex;gap:10px;background:var(--cream);border-radius:12px;padding:10px;}
.cand img{width:64px;height:80px;object-fit:cover;border-radius:9px;}
.cand .noimg{width:64px;height:80px;border-radius:9px;background:var(--cream-edge);}
.cand div{display:flex;flex-direction:column;gap:3px;flex:1;}
.cand small{line-height:1.5;}

/* ---------- automations ---------- */
.webhookBox{background:var(--cream);border-radius:12px;padding:14px;margin-bottom:14px;}
.preview{
  background:var(--charcoal);color:#E8E3D8;border-radius:12px;padding:14px;font-size:12.5px;
  white-space:pre-wrap;line-height:1.9;font-family:'Vazirmatn',monospace;margin-top:12px;
  max-height:340px;overflow:auto;
}

/* ---------- runs / product grid (stories view) ---------- */
.empty{
  background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);
  padding:70px 20px;text-align:center;color:var(--grey);
}
.empty img{opacity:.5;margin-bottom:14px;}
.runs{display:flex;flex-direction:column;gap:8px;max-height:340px;overflow:auto;}
.runItem{text-align:right;background:var(--cream);border-radius:12px;padding:10px 12px;border:2px solid transparent;width:100%;}
.runItem.active{border-color:var(--red);background:#fff;}
.runItem b{display:block;font-size:13.5px;}
.runItem small{color:var(--grey);font-size:11.5px;}
.runHead{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;margin-bottom:16px;}
.runHead .line1{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.runHead h1{font-size:19px;}
.focus{display:flex;gap:10px;align-items:flex-end;margin-top:14px;}
.focus label{flex:1;font-size:12.5px;color:var(--body);}
.focus input{width:100%;margin-top:5px;padding:8px 11px;border:1.5px solid var(--cream-edge);border-radius:10px;background:var(--cream);}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(255px,1fr));gap:14px;}
.product{
  background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;
  border:2.5px solid transparent;display:flex;flex-direction:column;
}
.product.approved{border-color:var(--green);}
.product .thumb{position:relative;aspect-ratio:3/4;background:var(--cream-deep);}
.product .thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.product .off{
  position:absolute;top:8px;inset-inline-start:8px;background:var(--red);color:#fff;
  border-radius:999px;padding:3px 10px;font-size:12px;font-weight:700;
}
.product .body{padding:12px;display:flex;flex-direction:column;gap:8px;flex:1;}
.product .en{
  font-family:'Poppins',sans-serif;font-size:11.5px;color:var(--grey);direction:ltr;text-align:left;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.product input[type=text],.product input[type=number]{
  width:100%;padding:7px 9px;border:1.5px solid var(--cream-edge);border-radius:9px;background:var(--cream);
}
.product .nameFa{font-weight:700;font-size:14px;}
.codeField{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--grey);}
.codeField input{width:80px !important;text-align:center;}
.priceBox{background:var(--cream);border-radius:11px;padding:9px 11px;}
.priceBox .base{display:flex;justify-content:space-between;font-size:12.5px;color:var(--grey);}
.priceBox .base input{width:88px;text-align:center;padding:4px 6px;font-size:13px;}
.priceBox .toman{display:flex;justify-content:space-between;align-items:baseline;margin-top:6px;}
.priceBox .toman b{font-size:18px;color:var(--red);}
.sizes{display:flex;gap:5px;flex-wrap:wrap;}
.sizes .sz{background:var(--cream-deep);border-radius:8px;padding:2px 9px;font-size:12px;font-family:'Poppins',sans-serif;}
.sizes .sz.out{opacity:.45;text-decoration:line-through;}
.product .foot{display:flex;gap:8px;align-items:center;margin-top:auto;padding-top:4px;}
.product .foot a{font-size:12px;text-decoration:none;}
.approveBtn{flex:1;background:var(--cream-deep);}
.approveBtn.on{background:var(--green);color:#fff;font-weight:700;}

/* ---------- stories gallery ---------- */
.stories{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:14px;margin-top:12px;}
.stories figure{background:var(--cream);border-radius:14px;overflow:hidden;}
.stories img{width:100%;display:block;}
.stories figcaption{padding:7px 10px 4px;font-size:12px;font-weight:700;}
.fb{padding:0 10px 11px;display:flex;flex-direction:column;gap:7px;}
.fb textarea{
  width:100%;padding:7px 9px;border:1.5px solid var(--cream-edge);border-radius:9px;
  background:#fff;resize:vertical;font-size:12.5px;
}
.fixRow{display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:11.5px;}
.fixRow select{padding:4px 7px;border:1.5px solid var(--cream-edge);border-radius:8px;background:#fff;font-size:11.5px;}
.fixRow label{display:flex;align-items:center;gap:4px;color:var(--body);}
.tagRow{display:flex;gap:4px;flex-wrap:wrap;}
.tag{display:flex;align-items:center;gap:3px;background:var(--cream-deep);border-radius:7px;padding:2px 7px;font-size:11px;cursor:pointer;}
.tag:has(input:checked){background:var(--yellow);}
.fbStatus{font-size:11.5px;color:var(--green);}

/* ---------- job log + toasts ---------- */
.joblog{
  position:fixed;inset-inline-end:20px;bottom:20px;width:min(460px,92vw);
  background:var(--charcoal);color:#fff;border-radius:14px;box-shadow:0 18px 40px rgba(0,0,0,.3);
  z-index:50;overflow:hidden;
}
.joblog-head{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;}
.joblog-head .ghost{background:rgba(255,255,255,.14);color:#fff;}
.joblog pre{
  margin:0;padding:0 14px 14px;max-height:210px;overflow:auto;font-size:12px;line-height:1.85;
  white-space:pre-wrap;font-family:'Vazirmatn',monospace;color:#E8E3D8;
}

.toasts{position:fixed;top:70px;inset-inline-end:20px;z-index:60;display:flex;flex-direction:column;gap:8px;}
.toast{
  background:var(--green);color:#fff;border-radius:12px;padding:11px 18px;font-weight:500;
  box-shadow:0 10px 26px rgba(0,0,0,.18);transition:.5s;
}
.toast.bad{background:var(--red);}
.toast.out{opacity:0;transform:translateY(-8px);}

/* ---------- dialogs ---------- */
dialog{
  border:none;border-radius:18px;padding:0;max-width:560px;width:92vw;
  box-shadow:0 30px 70px rgba(0,0,0,.28);background:#fff;color:var(--charcoal);
}
dialog::backdrop{background:rgba(43,39,35,.5);}
.settings{padding:22px;display:flex;flex-direction:column;gap:16px;max-height:86vh;overflow:auto;}
.settings h2{font-size:18px;}
fieldset{border:1.5px solid var(--cream-edge);border-radius:12px;padding:14px;}
legend{padding:0 8px;font-size:13px;font-weight:700;color:var(--red);}
.row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px;font-size:13.5px;}
.row input,.row select{width:190px;padding:7px 10px;border:1.5px solid var(--cream-edge);border-radius:9px;background:var(--cream);}
.check{display:flex;align-items:center;gap:8px;font-size:13.5px;margin:8px 0;}
menu{display:flex;justify-content:flex-start;gap:10px;padding:0;}
code{background:var(--cream-deep);padding:1px 6px;border-radius:5px;font-size:12px;direction:ltr;display:inline-block;}

.confirm{max-width:480px;padding:22px;}
.confirm h3{font-size:17px;color:var(--charcoal);margin-bottom:10px;}
.confirm p{font-size:14px;line-height:1.9;margin-bottom:16px;color:var(--body);}
.confirm menu{justify-content:flex-start;}

/* ---------- login ---------- */
.loginPage{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px;}
.loginBox{
  background:#fff;border-radius:20px;padding:32px;width:min(420px,100%);
  box-shadow:0 20px 50px rgba(43,39,35,.12);text-align:center;
}
.loginBox h1{font-size:19px;margin:12px 0 20px;}
.loginBox h2{font-size:16px;margin-bottom:8px;}
.loginBox form{display:flex;flex-direction:column;gap:12px;text-align:right;}
.loginBox label{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--body);}
.loginBox input{padding:11px 13px;border:1.5px solid var(--cream-edge);border-radius:11px;background:var(--cream);font-size:15px;}
.loginBox .err{color:var(--red);font-size:13px;min-height:18px;}
.qr{margin:16px auto;display:flex;justify-content:center;}
.qr svg{border-radius:10px;}
.secretRow{display:flex;gap:8px;align-items:center;justify-content:center;margin-bottom:16px;}
.secretRow code{direction:ltr;font-size:13px;letter-spacing:1px;}
.recovery{text-align:right;margin-top:16px;}
.recovery ul{list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px 0 16px;}
.recovery code{display:block;text-align:center;padding:6px;font-size:14px;}

/* ---------- محصول‌های امروز، قبل از ساخت ---------- */
.card.sub { background: var(--sunk, #F3EDE1); box-shadow: none; margin: 18px 0; }
.cands { display: grid; gap: 10px; margin: 12px 0; }
.cand {
  display: grid;
  grid-template-columns: auto 64px 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}
.cand.off { opacity: .45; }
.cand img, .cand .noimg { width: 64px; height: 76px; object-fit: cover; border-radius: 8px; background: #EEE8DC; }
.cand .meta { min-width: 0; }
.cand .meta b { display: block; font-size: 14px; }
.cand .meta small { color: #9A9484; font-size: 11px; display: block; }
.cand .row { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.cand .price { font-weight: 700; color: #D80621; font-size: 13px; }
.cand .acts { display: flex; gap: 6px; align-items: center; }
.addRow input { flex: 1; min-width: 0; direction: ltr; text-align: left; }
.joblog {
  background: #2B2723; color: #EEE8DC; border-radius: 10px; padding: 12px;
  font-size: 11px; line-height: 1.7; max-height: 190px; overflow: auto; direction: ltr; text-align: left;
}
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.frames img { width: 100%; border-radius: 8px; display: block; }

/* ---------- تب‌های داخلِ یک صفحه ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tab {
  border: 1.5px solid var(--cream-edge); background: var(--cream); color: var(--body);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.tab:hover { background: var(--cream-deep); }
.tab.on { background: var(--charcoal); color: var(--cream); border-color: var(--charcoal); }

/* ---------- برندهای اضافهٔ یک روز ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 10px; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.chips .chip button {
  border: 0; background: transparent; cursor: pointer; color: var(--red);
  font-size: 15px; line-height: 1; padding: 0 2px; font-family: inherit;
}

/* متن روی اسلاید، داخل کارت محصولِ پست */
.cand .meta input[data-caption] {
  margin-top: 5px; width: 100%; padding: 6px 9px; font-size: 12px;
  border: 1.5px solid var(--cream-edge); border-radius: 8px; background: #fff; font-family: inherit;
}

/* ردیفِ بازشدهٔ تاریخچه */
.rows tr.detail > td { background: var(--cream); padding: 12px; }

/* ---------- انتخاب عکسِ هر اسلایدِ پست ---------- */
/* با .cand شروع می‌شود چون قاعدهٔ قدیمیِ `.cand div` وگرنه ستونی‌اش می‌کند. */
.cand .shots { display: flex; flex-direction: row; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
/* ردیفِ رنگ و برشِ کاندید — همان دلیل، همان درمان. */
.cand .candFix { flex-direction: row; margin-top: 7px; }
.shots .shot {
  position: relative; border: 2px solid transparent; border-radius: 8px; padding: 0;
  background: var(--cream-deep); cursor: pointer; overflow: hidden; line-height: 0;
  font-family: inherit; flex: none;
}
.shots .shot img { width: 40px; height: 50px; object-fit: cover; display: block; }
.shots .shot span {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; line-height: 1.5;
  background: rgba(43,39,35,.72); color: var(--cream); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 2px;
}
.shots .shot.auto {
  width: auto; height: 50px; padding: 0 10px; font-size: 11px; color: var(--body);
  line-height: 46px; border-color: var(--cream-edge);
}
.shots .shot:hover { border-color: var(--grey); }
.shots .shot.on { border-color: var(--red); }
.shots select {
  padding: 5px 8px; font-size: 11px; border: 1.5px solid var(--cream-edge);
  border-radius: 8px; background: #fff; font-family: inherit; align-self: stretch;
}
.tagx.sold { background: var(--green, #2F7A4F); color: #fff; }
.tagx.site { background: var(--charcoal); color: var(--cream); }

/* ---------- برندهای بدون کرال: لینک، اسکرین‌شات، خواندن با هوش ---------- */
.manualBrand .tabs{display:flex;gap:6px;margin:12px 0;}
.manualBrand .tabs button{background:var(--cream);border-radius:11px;padding:9px 16px;font-size:13.5px;}
.manualBrand .tabs button.on{background:var(--charcoal);color:#fff;font-weight:700;}
.manualBrand .tabs button:disabled{opacity:.45;cursor:not-allowed;}

.linkRow{display:flex;gap:8px;margin-bottom:7px;}
.linkRow input{
  flex:1;padding:9px 12px;border:1.5px solid var(--cream-edge);border-radius:10px;
  background:var(--cream);direction:ltr;text-align:left;font-size:13px;
}

/* جای رها کردن اسکرین‌شات — کلیک، کشیدن، یا چسباندن از کلیپ‌بورد */
.dropZone{
  display:flex;align-items:center;justify-content:center;min-height:150px;margin:14px 0;
  border:2.5px dashed var(--cream-edge);border-radius:16px;background:var(--cream);
  cursor:pointer;text-align:center;color:var(--grey);font-size:13.5px;overflow:hidden;
}
.dropZone.over{border-color:var(--red);background:#fff;}
.dropZone img{max-width:100%;max-height:340px;object-fit:contain;display:block;}

.mResults{margin-top:16px;}
.mCard{
  display:flex;gap:12px;align-items:flex-start;background:var(--cream);
  border-radius:14px;padding:12px;margin-bottom:9px;
}
/* موردی که هنوز کامل نیست، زرد است تا در فهرست گم نشود */
.mCard.needs{background:#FFF6E5;}
.mCard img{width:88px;height:110px;object-fit:cover;border-radius:10px;flex:none;}
.mCard .noimg{
  width:88px;height:110px;border-radius:10px;background:var(--cream-edge);flex:none;
  display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--grey);
}
.mCard .grow{flex:1;display:flex;flex-direction:column;gap:6px;}
.mCard label{display:flex;flex-direction:column;gap:3px;font-size:11.5px;color:var(--grey);}
.mCard input{
  padding:7px 10px;border:1.5px solid var(--cream-edge);border-radius:9px;
  background:#fff;font-size:13px;
}
.mCard .triple{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;}
