/* Clean, compact layout with per-row column control + typography utilities */
/* Grid utilities */
:root{
  --gap:16px;
  --radius:12px;
  --field-radius:5px;
  --border:#d0d7de;
  --text:#000000;
  --muted:#57606a;
  --bg:#f6f8fa;
  --accent:#0969da;
  --success:#1f9d55;
  --danger:#d64545;
  --surface:#ffffff;
  --shadow:0 8px 24px rgba(140,149,159,0.2);
  --shadow-soft:0 2px 8px rgba(140,149,159,0.15);
  --input-h:40px;
  --thumb:64px;

  /* Typography controls */
  --label-weight:900;      /* field labels boldness */
  --label-size:15px;       /* field label size */
  --input-size:14px;       /* inputs/selects font-size */
  --body-size:14px;        /* general body text */
  --h2-size:16px;          /* section headings in cards */

  /* Attribute selector controls (you can override via .attrs-*) */
  --attr-min-w:150px;
  --attr-font-size:14px;
  --attr-font-weight:500;
  --attr-control-h:40px;

  /* Purpose (checkbox list) controls (override via .purpose-*) */
  --purpose-font-size:14px;
  --purpose-font-weight:400;
  --checkbox-scale:1.0;        /* visual scale of checkboxes */

  /* Switch-line checkboxes (Available, Quantity Predefined, Active) */
  --switch-font-size:14px;
  --switch-font-weight:400;
  --switch-checkbox-scale:1.1;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;color:var(--text);background:var(--bg);font-size:var(--body-size)}

/* Header */
.topbar{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;background:var(--surface);box-shadow:var(--shadow-soft);position:sticky;top:0;z-index:10}
.topbar h1{margin:0;font-size:18px}
.status{display:flex;gap:10px;align-items:center}
#online-indicator{padding:4px 8px;border-radius:999px;font-size:12px;background:#f2f4f7;color:#666}
#online-indicator.online{background:#e6f4ff;color:#095aba}
#online-indicator.offline{background:#fff1f0;color:#a61b1b}

/* Card/form container */
.form-wrap{max-width:1200px;margin:24px auto;padding:12px}
.product-grid{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px}

/* Grid rows and spans */
.grid-row{display:grid;gap:var(--gap);align-items:start;margin-bottom:var(--gap)}
.cols-1{--cols:1}.cols-2{--cols:2}.cols-3{--cols:3}.cols-4{--cols:4}
.grid-row{grid-template-columns:repeat(var(--cols,4), minmax(0,1fr))}
.field{display:flex;flex-direction:column;gap:8px}
.span-1{grid-column:span 1}.span-2{grid-column:span 2}.span-3{grid-column:span 3}.span-4{grid-column:span 4}

/* Field label typography (bold) */
label.field{font-weight:var(--label-weight);font-size:var(--label-size);line-height:1.2}
label.field .small-note,
label.field .hint{font-weight:400}

/* Inputs/selects/textarea visuals and typography (regular) */
label.field>input,
label.field>select,
label.field>textarea{
  height:var(--input-h);
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:var(--field-radius);
  font-size:var(--input-size);
  font-weight:400;
  outline:none;
  background:#fff
}
label.field>textarea{height:auto;min-height:96px;resize:vertical}
label.field>select{
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2357606a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:16px
}

/* Helpers */
.small-note,.hint{font-size:12px;color:var(--muted)}
.switch-line{display:flex;align-items:center;gap:10px;margin-top:6px}

/* Buttons */
.btn{appearance:none;border:1px solid var(--border);background:#fff;color:var(--text);padding:8px 12px;border-radius:8px;cursor:pointer;font-size:14px}
.btn:hover{box-shadow:var(--shadow-soft)}
.btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn.small{padding:6px 10px;font-size:13px}
.btn:disabled,.btn.btn-disabled{opacity:.6;cursor:not-allowed}
.filelike{position:relative;overflow:hidden}
.filelike input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}

/* Outlet picker */
.outlets-picker{display:flex;flex-wrap:wrap;gap:8px}
.outlet-pill{border:1px solid var(--border);background:#fff;color:var(--text);padding:6px 10px;border-radius:999px;cursor:pointer;font-size:13px}
.outlet-pill.selected{background:var(--accent);color:#fff;border-color:var(--accent)}
.outlet-pill:focus{outline:2px solid #0969da33}

/* Opening stock: compact and scrollable when many outlets */
.stores-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.scroll-box{max-height:200px;overflow:auto;border:1px dashed var(--border);border-radius:10px;padding:10px;background:#fafbfc}

/* Image field: inline, compact thumbnail; no big empty box */
.image-inline{display:flex;align-items:center;gap:10px}
.image-inline input[type=file]{height:var(--input-h)}
.image-thumb{display:none;width:var(--thumb);height:var(--thumb);border:1px solid var(--border);border-radius:8px;overflow:hidden;background:#fff}
.image-thumb img{width:100%;height:100%;object-fit:cover}
.image-thumb.show{display:block}

/* Attributes: adjustable size */
.attr-controls{display:flex;gap:8px;align-items:center}
#attribute-select,#attribute-value-select{
  min-width:var(--attr-min-w);
  height:var(--attr-control-h);
  font-size:var(--attr-font-size);
  font-weight:var(--attr-font-weight);
}
.attr-controls .btn{
  height:var(--attr-control-h);
  font-size:var(--attr-font-size);
}

/* Purpose: adjustable font and checkbox size */
.purpose-checks{--purpose-font-size:var(--purpose-font-size);--purpose-font-weight:var(--purpose-font-weight)}
.purpose-checks label{
  font-size:var(--purpose-font-size);
  font-weight:var(--purpose-font-weight);
}
.purpose-checks input[type=checkbox]{
  transform:scale(var(--checkbox-scale));
  transform-origin:left center;
  margin-right:8px;
  accent-color:var(--accent);
}
/* compact grid variant */
.purpose-checks.compact{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px}
.purpose-checks.compact label{white-space:nowrap}

/* Switch-line (Available, Quantity Predefined, Active): adjustable font and checkbox size */
.switch-line label{
  font-size:var(--switch-font-size);
  font-weight:var(--switch-font-weight);
}
.switch-line input[type=checkbox]{
  transform:scale(var(--switch-checkbox-scale));
  transform-origin:left center;
  margin-right:10px;
  accent-color:var(--accent);
}

/* Pending list */
.pending{background:#fafbfc;border:1px solid var(--border);border-radius:10px;padding:12px}
.pending h2{margin:0 0 8px 0;font-size:var(--h2-size)}
#pending-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
#pending-list li{display:flex;justify-content:space-between;align-items:center;padding:8px;border:1px solid var(--border);border-radius:8px;background:#fff}

/* Actions/toolbelt */
.form-actions{display:flex;gap:8px;flex-wrap:wrap}
.toolbelt{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* Typography utility classes (optional) */
.text-xs{font-size:12px}
.text-sm{font-size:13px}
.text-md{font-size:14px}
.text-lg{font-size:16px}
.text-xl{font-size:18px}
.font-regular{font-weight:400}
.font-medium{font-weight:500}
.font-semibold{font-weight:600}
.font-bold{font-weight:700}

/* Size utility classes for quick tuning (apply to the field wrapper) */
/* Attributes */
.attrs-sm{ --attr-min-w:180px; --attr-control-h:36px; --attr-font-size:13px; --attr-font-weight:500; }
.attrs-md{ --attr-min-w:220px; --attr-control-h:40px; --attr-font-size:14px; --attr-font-weight:500; }
.attrs-lg{ --attr-min-w:280px; --attr-control-h:44px; --attr-font-size:16px; --attr-font-weight:600; }
.attrs-xl{ --attr-min-w:340px; --attr-control-h:48px; --attr-font-size:18px; --attr-font-weight:700; }

/* Purpose checkboxes */
.purpose-sm{ --purpose-font-size:13px; --purpose-font-weight:500; --checkbox-scale:0.95; }
.purpose-md{ --purpose-font-size:14px; --purpose-font-weight:500; --checkbox-scale:1.0; }
.purpose-lg{ --purpose-font-size:16px; --purpose-font-weight:600; --checkbox-scale:1.1; }
.purpose-xl{ --purpose-font-size:18px; --purpose-font-weight:700; --checkbox-scale:1.2; }

/* Switch-line checkboxes (Available/Active/etc.) */
.switch-sm{ --switch-font-size:13px; --switch-font-weight:500; --switch-checkbox-scale:1.0; }
.switch-md{ --switch-font-size:14px; --switch-font-weight:600; --switch-checkbox-scale:1.1; }
.switch-lg{ --switch-font-size:16px; --switch-font-weight:700; --switch-checkbox-scale:1.2; }
.switch-xl{ --switch-font-size:18px; --switch-font-weight:800; --switch-checkbox-scale:1.3; }