/* TM TRADING admin console.
   Denser and more utilitarian than the public site, same brand colours. */

:root {
  --ink: #16211b;
  --ink-soft: #55645b;
  --ink-faint: #85938a;

  --green-900: #0f2a1c;
  --green-800: #16412a;
  --green-700: #1e5b3a;
  --lime: #a8c62f;

  --bg: #f4f2ec;
  --paper: #fff;
  --line: #e3ded2;
  --line-strong: #cdc5b2;

  --blue: #24608c;
  --amber: #a76c07;
  --amber-bg: #fdf3e0;
  --red: #a3312a;
  --red-bg: #fbecea;
  --ok: #2a7a4c;
  --ok-bg: #e8f3ec;

  --radius: 5px;
  --shadow: 0 1px 2px rgba(15, 42, 28, .07), 0 4px 14px rgba(15, 42, 28, .06);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 224px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--green-700); }
h1, h2, h3 { font-family: var(--serif); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--green-900);
  color: #b6cdbd;
  padding: 1.2rem 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1.1rem 1.2rem;
  text-decoration: none;
  color: #fff;
}
.sidebar-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: 2px solid var(--lime);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: .85rem;
  flex: none;
}
.sidebar-brand b { font-family: var(--serif); font-size: 1rem; letter-spacing: .04em; display: block; }
.sidebar-brand span { font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: #8fa998; }

.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a {
  color: #b6cdbd;
  text-decoration: none;
  padding: .6rem 1.1rem;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, .09); color: #fff; border-left-color: var(--lime); }
.sidebar nav .count {
  margin-left: auto;
  background: var(--lime);
  color: var(--green-900);
  font-size: .7rem;
  font-weight: 700;
  padding: 0 .4rem;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
}
.sidebar-foot { margin-top: auto; padding: 1rem 1.1rem 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; }
.sidebar-foot a { color: #8fa998; }

.main { padding: 1.6rem 2rem 4rem; min-width: 0; }

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.page-top p { margin: .1rem 0 0; color: var(--ink-soft); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.back-link { display: inline-block; font-size: .85rem; color: var(--ink-soft); text-decoration: none; margin-bottom: .5rem; }
.back-link:hover { color: var(--green-700); }

/* ---------- panels ---------- */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 1.1rem; }
.panel-foot { padding: .9rem 1.1rem; border-top: 1px solid var(--line); background: #fbfaf7; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: start; }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
}
.stat:hover { border-color: var(--line-strong); }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.stat span { font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }
.stat.warn b { color: var(--amber); }

/* ---------- forms ---------- */

.field { margin-bottom: .85rem; }
.field label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .3rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: .92rem;
  color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(30, 91, 58, .3);
  outline-offset: 1px;
  border-color: var(--green-700);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .8rem; }
.field-hint { font-size: .78rem; color: var(--ink-faint); margin: .25rem 0 0; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.checkbox input { width: auto; }

fieldset { border: none; margin: 0 0 .4rem; padding: 0; }
legend {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--green-700);
  padding: 0 0 .6rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--green-700); color: var(--green-700); }
.btn-danger { background: #fff; color: var(--red); border-color: #e0bdb9; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: .32rem .6rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: .95rem;
  padding: .2rem .35rem;
  border-radius: 3px;
}
.icon-btn:hover { color: var(--red); background: var(--red-bg); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data th, table.data td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: #fbfaf7;
  white-space: nowrap;
  font-weight: 700;
}
table.data tbody tr:hover { background: #fbfaf7; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data a { text-decoration: none; font-weight: 600; }
table.data a:hover { text-decoration: underline; }
table.data .thumb {
  width: 40px; height: 40px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px;
}
.cell-input {
  width: 90px;
  padding: .3rem .4rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font: inherit;
  font-size: .86rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cell-input.wide { width: 100%; text-align: left; }
select.cell-input { width: auto; text-align: left; background: #fff; cursor: pointer; }
/* "What each piece works out to" under a case price. */
.cell-sub { color: var(--ink-faint); font-size: .76rem; margin-top: .2rem; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .84rem; }
table.data td.mono { white-space: nowrap; }

/* ---------- status pipeline ---------- */

/* Odoo-style stepper: shows where the order stands and moves it on, instead
   of hiding the workflow inside a dropdown. */
.pipeline { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; }
.pipeline button {
  position: relative;
  border: 1px solid var(--line-strong);
  border-right: none;
  background: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: .42rem 1.1rem .42rem 1.5rem;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  margin-left: -10px;
}
.pipeline button:first-child { margin-left: 0; padding-left: 1.1rem; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.pipeline button:last-child { border-right: 1px solid var(--line-strong); }
.pipeline button:hover { color: var(--green-700); background: var(--bg); }
.pipeline button.done { background: #e8f0ea; color: var(--green-700); }
.pipeline button.current { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.pipeline button.cancelled { background: var(--red-bg); color: var(--red); }
.pipeline button[disabled] { cursor: default; opacity: 1; }

/* ---------- product picker (type-ahead) ---------- */

/* min-width:0 matters: inside a grid cell a wider minimum makes the input
   overflow and sit on top of the next field. */
.picker { position: relative; width: 100%; min-width: 0; }
.add-line .picker { flex: 1 1 min(320px, 100%); }
.picker > input {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: .92rem;
  background: #fff;
}
.picker > input:focus {
  outline: 2px solid rgba(30, 91, 58, .3);
  outline-offset: 1px;
  border-color: var(--green-700);
}
.picker-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 42, 28, .16);
  max-height: 330px;
  overflow-y: auto;
  padding: .25rem;
}
.picker-menu[hidden] { display: none; }
.picker-option {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem .5rem;
  border-radius: 3px;
  cursor: pointer;
}
.picker-option.active { background: #e8f0ea; }
.picker-option img {
  width: 46px; height: 46px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px;
  flex: none;
}
.picker-option .who { min-width: 0; flex: 1; }
.picker-option b { display: block; font-size: .92rem; font-weight: 600; }
.picker-option small { color: var(--ink-faint); font-size: .78rem; }
.picker-option mark { background: #f2e9a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.picker-price { text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; flex: none; }
.picker-price em { display: block; font-style: normal; font-size: .72rem; color: var(--amber); }
.picker-empty { padding: 1rem .7rem; color: var(--ink-faint); font-size: .88rem; text-align: center; }

/* "Create this one" sits at the bottom of the list, so an unknown company or
   product is never a dead end. */
.picker-create { border-top: 1px solid var(--line); color: var(--green-700); }
.picker-create b { font-weight: 600; }
.picker-plus {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  flex: none;
}

/* ---------- save state ---------- */

.save-state {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--ink-faint);
  padding-right: .3rem;
}
.save-state::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.save-state[data-state="dirty"] { color: var(--amber); }
.save-state[data-state="dirty"]::before { background: var(--amber); }
.save-state[data-state="saving"]::before { background: var(--blue); }

/* ---------- add a line ---------- */

.add-line-row td { background: #fbfaf7; border-bottom: none; }
.add-line-trigger {
  background: none;
  border: none;
  padding: .2rem 0;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--green-700);
  cursor: pointer;
}
.add-line-trigger::before { content: "+ "; }
.add-line-trigger:hover { text-decoration: underline; }
.pipeline .cancel-step {
  margin-left: 1rem;
  clip-path: none;
  border-right: 1px solid var(--line-strong);
}

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 3px;
  white-space: nowrap;
}
.badge-request { background: var(--amber-bg); color: var(--amber); }
.badge-quoted { background: #e9f0f6; color: var(--blue); }
.badge-confirmed { background: #ece9f7; color: #543f9e; }
.badge-invoiced { background: var(--ok-bg); color: var(--ok); }
.badge-paid { background: var(--green-700); color: #fff; }
.badge-cancelled { background: #eee; color: #666; }
.badge-archived { background: #eee; color: #666; }

/* ---------- misc ---------- */

.empty { padding: 2.6rem 1rem; text-align: center; color: var(--ink-faint); }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  padding: .45rem .6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: .88rem;
  background: #fff;
}
.toolbar input[type="search"] { min-width: 240px; }

/* ---------- order document ---------- */

/* The order page reads top to bottom like the document it becomes:
   who and when, then the lines, then the money. */
.doc { overflow: visible; }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem 1.6rem;
  padding: 1.3rem;
  background: #fbfaf7;
}
.doc-grid .field { margin: 0; min-width: 0; }
.doc-grid .field-hint { min-height: 1.1em; }

/* Every block inside the order document gets a labelled band, so it is
   obvious where the header ends and the invoice lines begin. */
.doc-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .7rem 1.3rem;
  background: var(--green-900);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.doc-band .doc-band-note {
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  color: #b6cdbd;
}

/* Sits inside the line-items table footer, Odoo-style. */
.add-line {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  padding: .2rem 0;
}
.add-line[hidden] { display: none; }
.add-line input[type="number"] { width: 84px; padding: .55rem .5rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; text-align: center; }
.add-line select { padding: .55rem .5rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; background: #fff; cursor: pointer; }

/* Charge inputs on the left, running totals on the right; they stack
   rather than squeeze once the panel gets narrow. */
.doc-foot {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(270px, 330px);
  gap: 1.4rem 2rem;
  align-items: start;
  padding: 1.2rem;
}
.charge-fields { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: .8rem; }
@media (max-width: 820px) {
  .doc-foot { grid-template-columns: 1fr; }
}

table.data.wide, table.data.lines-table { min-width: 880px; }
table.data.wide td:nth-child(3) { white-space: nowrap; }

/* The invoice lines are the point of the page - make them read that way. */
table.lines-table thead th {
  background: #eceadf;
  color: var(--ink);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  border-bottom: 2px solid var(--line-strong);
  padding-top: .55rem;
  padding-bottom: .55rem;
}
table.lines-table tbody tr { border-left: 3px solid transparent; }
table.lines-table tbody tr:nth-child(even) { background: #fcfbf8; }
table.lines-table tbody tr:hover { background: #f3f6f3; border-left-color: var(--green-700); }
table.lines-table tbody td { padding-top: .7rem; padding-bottom: .7rem; }
table.lines-table tbody td b { font-size: .95rem; }

/* Product photos big enough to actually recognise the item. */
.line-thumb {
  width: 64px; height: 64px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
}
.line-thumb.placeholder { display: grid; place-items: center; color: var(--ink-faint); font-size: .8rem; }

.totals { width: 100%; }
.totals .shipment-line {
  display: block;
  font-size: .82rem;
  color: var(--ink-faint);
  padding-bottom: .5rem;
  margin-bottom: .3rem;
  border-bottom: 1px solid var(--line);
}

/* Secondary sections stay folded away until wanted. */
.details-panel > summary {
  padding: .8rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .92rem;
  list-style: none;
}
.details-panel > summary::-webkit-details-marker { display: none; }
.details-panel > summary::before { content: "▸ "; color: var(--ink-faint); }
.details-panel[open] > summary { border-bottom: 1px solid var(--line); }
.details-panel[open] > summary::before { content: "▾ "; }
.totals div { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .92rem; }
.totals .grand {
  border-top: 2px solid var(--ink);
  margin-top: .4rem;
  padding-top: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--serif);
}
.totals b { font-variant-numeric: tabular-nums; }

.notice {
  padding: .7rem .9rem;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.notice-warn { background: var(--amber-bg); border-color: var(--amber); color: #6b4708; }
.notice-info { background: #eef4f8; border-color: var(--blue); color: #1d4a6d; }

#toast {
  position: fixed;
  bottom: 1.4rem; left: 50%;
  transform: translate(-50%, 200%);
  background: var(--green-900);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .25s ease;
  z-index: 90;
  max-width: 90vw;
}
#toast.show { transform: translate(-50%, 0); }
#toast.err { background: var(--red); }

/* ---------- login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--green-900), #1b4d31);
  padding: 2rem;
}
.login-card {
  background: var(--paper);
  border-radius: 8px;
  padding: 2.2rem;
  width: min(400px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.login-card .sidebar-mark { background: var(--green-800); color: #fff; margin-bottom: 1rem; }
.login-error {
  background: var(--red-bg);
  color: var(--red);
  padding: .6rem .8rem;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: .9rem;
  display: none;
}
.login-error.show { display: block; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: .6rem 1rem; gap: 1rem; overflow-x: auto; }
  .sidebar-brand { padding: 0; }
  .sidebar nav { flex-direction: row; }
  .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; padding: .5rem .7rem; white-space: nowrap; }
  .sidebar nav a.active { border-left-color: transparent; border-bottom-color: var(--lime); }
  .sidebar-foot { display: none; }
  .main { padding: 1.2rem 1rem 3rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- product editor drawer ---------- */

.editor-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(560px, 100%);
  background: var(--bg);
  box-shadow: 0 0 60px rgba(15, 42, 28, .3);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  z-index: 61;
  display: flex;
  flex-direction: column;
}
.editor-drawer.open { transform: none; }
.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--green-900);
  color: #fff;
}
.editor-head h2 { margin: 0; font-size: 1.1rem; color: #fff; }
.editor-body { flex: 1; overflow-y: auto; padding: 1.2rem; }
.editor-body fieldset { margin-bottom: 1.4rem; }
.editor-foot {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .9rem 1.2rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 28, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s;
  z-index: 60;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer-close {
  background: none; border: none; color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 .2rem;
}

/* ---------- photo manager ---------- */

.photo-drop {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  padding: .9rem 1rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfaf7;
  margin-bottom: .8rem;
}
.photo-drop.over { border-color: var(--green-700); background: #eef4ef; }
.photo-drop-hint { font-size: .85rem; color: var(--ink-faint); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .7rem;
}
.photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}
.photo-card.is-main { border-color: var(--green-700); box-shadow: 0 0 0 1px var(--green-700); }
.photo-card.broken { opacity: .45; }
.photo-card img {
  width: 100%;
  height: 116px;
  object-fit: contain;
  background: #fff;
  padding: .35rem;
}
.photo-card figcaption { border-top: 1px solid var(--line); padding: .4rem; }
.photo-card select {
  width: 100%;
  font: inherit;
  font-size: .76rem;
  padding: .2rem .25rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
}
.photo-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem;
  margin-top: .35rem;
}
.photo-actions button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .76rem;
  color: var(--green-700);
  cursor: pointer;
  text-decoration: underline;
}
.photo-actions button.danger { color: var(--red); }
.photo-main-tag {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-700);
}

table.data tr.row-hidden { opacity: .55; }
table.data tr[data-sku] { cursor: pointer; }

/* A product with no photography yet - visible at a glance in the list. */
.line-thumb.no-photo { border-style: dashed; opacity: .8; }

/* Evidence photos read as clearly separate from shopfront ones. */
.photo-card.is-internal { background: #faf8f3; }
.photo-card.is-internal img { opacity: .72; }
.photo-public {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .35rem;
  font-size: .72rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.photo-public input { width: auto; margin: 0; }
.photo-card.is-internal .photo-public span { color: var(--ink-faint); font-style: italic; }

/* .btn sets display, which would silently defeat the hidden attribute. */
[hidden] { display: none !important; }

/* Bulk pricing mode: the price column becomes a keyboard-first entry lane. */
.price-inline {
  width: 6.5rem;
  padding: .35rem .5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
.price-inline.unpriced {
  border-color: var(--amber);
  background: var(--amber-bg);
}
.price-inline:focus {
  outline: 2px solid var(--green-700);
  outline-offset: 1px;
  background: #fff;
}
