/* Shared stylesheet for the supplier portal and the admin console (P1-021).
   No external assets: system font stack only, no images, no icon fonts. */
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", sans-serif;
  background: #f6f7f3;
  color: #20251f;
  --ink: #20251f;
  --muted: #697568;
  --line: #d9dfd5;
  --panel: #ffffff;
  --brand: #315f4b;
  --brand-ink: #ffffff;
  --warn-bg: #fff8dd;
  --warn-ink: #5e4a10;
  --deny-bg: #fff0f0;
  --deny-ink: #8d2828;
  --ok-bg: #eaf5ee;
  --ok-ink: #1f5b3a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 16px; }
h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
button, select, input, textarea { font: inherit; color: inherit; }
button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  cursor: pointer;
}
button.secondary { background: var(--panel); color: var(--brand); }
button.danger { border-color: var(--deny-ink); background: var(--panel); color: var(--deny-ink); }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #f2b21b;
  outline-offset: 2px;
}
input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #c5ccbf;
  border-radius: 6px;
  background: var(--panel);
}
textarea { min-height: 64px; resize: vertical; }
input[type="checkbox"] { width: auto; min-height: 0; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
label > span { font-weight: 700; }
label.check { grid-template-columns: auto 1fr; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; min-width: 0; }
fieldset[disabled] { display: none; }
legend { font-weight: 700; font-size: 12px; color: var(--muted); padding: 0 4px; }
.shell { max-width: 1440px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.topbar .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: 12px;
  font-weight: 700;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.deny { background: var(--deny-bg); color: var(--deny-ink); }
.gate {
  border: 1px solid #c9c2a4;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 8px;
  padding: 14px;
  font-weight: 700;
}
.gate a { color: inherit; }
.workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.panel.wide { grid-column: 1 / -1; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
.grid-2 > .span, .grid-3 > .span { grid-column: 1 / -1; }
.form { display: grid; gap: 10px; }
.field-list { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 12px; }
.field-list dt { color: var(--muted); }
.field-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.rows { display: grid; gap: 6px; }
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  font-size: 12px;
}
.row.selectable { cursor: pointer; }
.row.selectable:hover, .row.selected { border-color: var(--brand); background: var(--ok-bg); }
.row span { overflow-wrap: anywhere; }
.row .k { color: var(--muted); }
.row.empty { color: var(--muted); font-style: italic; }
.line-editor { display: grid; gap: 8px; }
.line-editor .line { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.notice {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #b9d8c4; }
.notice.deny { background: var(--deny-bg); color: var(--deny-ink); border-color: #d9b7b7; }
.notice:empty { display: none; }
.validation { margin: 0; padding: 0 0 0 18px; color: var(--deny-ink); font-size: 12px; }
.validation:empty { display: none; }
.muted { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[dir="rtl"] .validation { padding: 0 18px 0 0; }
[dir="rtl"] .field-list dt { text-align: right; }
@media (max-width: 1024px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel.wide { grid-column: auto; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { padding: 10px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .line-editor .line { grid-template-columns: minmax(0, 1fr); }
  .field-list { grid-template-columns: minmax(0, 1fr); }
  .field-list dd { margin-bottom: 4px; }
  .topbar .actions { width: 100%; }
  .topbar .actions button { flex: 1 1 auto; }
}
