/* GRG Warehouse portal — "Ink & Ivory" palette.
   To try another palette, swap the values in the two :root blocks below. */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #161a22;
  --muted: #5f6470;
  --line: #e3e0d8;
  --accent: #1f2c4a;
  --accent-soft: #e9ecf3;
  --focus: #2f6fdf;
  --ok: #2f7a4a;      --ok-soft: #e6f2ea;
  --draft: #8a6a12;   --draft-soft: #f7efd9;
  --tag-ns: #2d5d8a;  --tag-ns-soft: #e5eef7;
  --tag-rf: #7a3e5c;  --tag-rf-soft: #f5e7ee;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131a;
    --surface: #181c25;
    --ink: #eef0f4;
    --muted: #9aa1ae;
    --line: #2a303c;
    --accent: #b9c6e4;
    --accent-soft: #212a3b;
    --ok: #7cc49a;      --ok-soft: #1d2a22;
    --draft: #e0c27a;   --draft-soft: #2c2718;
    --tag-ns: #9cc3ea;  --tag-ns-soft: #1c2733;
    --tag-rf: #e3a6c4;  --tag-rf-soft: #2e1f27;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ── Header: logo only ── */
header.top { border-bottom: 1px solid var(--line); background: var(--surface); }
header.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: 11px; }
.brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mark {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--accent); color: var(--surface);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: .5px;
}
.userbar { display: flex; align-items: center; gap: 8px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-right: 4px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.userbar .btn {
  font: inherit; font-size: 14px; font-weight: 500; min-height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
}
.userbar .btn:hover { border-color: var(--accent); }
.userbar .btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── Page ── */
main.wrap { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; }
.hello { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 6px; }
.hello h1 { margin: 0; }
.clock { color: var(--muted); font-size: 14px; }
.sub { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 30px 0 12px; font-weight: 600;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Tool tiles ── */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; min-height: 178px; color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.tile:has(.main-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile .main-link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.tile .main-link:focus { outline: none; }
.tile.feature { grid-column: span 2; flex-direction: row; gap: 18px; align-items: flex-start; }
.tile.feature .body { display: flex; flex-direction: column; gap: 8px; flex: 1; align-self: stretch; }
.tile .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ic {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
}
.ic svg { width: 24px; height: 24px; }
.feature .ic { width: 56px; height: 56px; border-radius: 14px; }
.feature .ic svg { width: 28px; height: 28px; }
.tile h3 { margin: 4px 0 0; font-size: 17px; line-height: 1.25; }
.feature h3 { margin: 0; font-size: 20px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile p.use { color: var(--ink); font-size: 13.5px; }
.tile p.use b { font-weight: 600; }
.foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; font-size: 13px; }
.howto { white-space: nowrap; position: relative; z-index: 1; color: var(--accent); text-decoration: none; font-weight: 500; padding: 6px 0; }
.howto:hover { text-decoration: underline; }
.howto:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.foot .ext { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tag { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.tag.netsuite { background: var(--tag-ns-soft); color: var(--tag-ns); }
.tag.rfsmart  { background: var(--tag-rf-soft); color: var(--tag-rf); }
.tag.portal   { background: var(--accent-soft); color: var(--accent); }
.tag.external { background: var(--line); color: var(--muted); }
.tile .last { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 6px 10px; }
.tile .last[hidden] { display: none; }
.tile .last .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tile .last b { font-weight: 600; }

/* ── Procedures ── */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 60px;
}
.row:first-child { border-top: 0; }
a.row:hover { background: var(--accent-soft); }
a.row:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.row b { display: block; font-size: 15px; }
.row span.d, .row > div > span { display: block; font-size: 13px; color: var(--muted); }
.row .r { display: flex; align-items: center; gap: 10px; flex: none; }
.row .go { color: var(--accent); font-size: 14px; }
.pill { white-space: nowrap; flex: none; font-size: 11px; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill.draft { background: var(--draft-soft); color: var(--draft); }
.pill.soon { background: var(--line); color: var(--muted); }
details.later { border-top: 1px solid var(--line); }
details.later summary { cursor: pointer; padding: 12px 18px; font-size: 13px; color: var(--muted); list-style: none; }
details.later summary::-webkit-details-marker { display: none; }
details.later summary::before { content: "▸ "; }
details.later[open] summary::before { content: "▾ "; }
details.later .row { opacity: .75; }

footer.wrap { color: var(--muted); font-size: 12px; padding-top: 0; padding-bottom: 28px; }

/* ── SOP article pages ── */
article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
article h1 { margin-bottom: 8px; }
article ol { padding-left: 22px; }
article li { margin: 0 0 12px; }
article .meta { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.back { display: inline-block; margin: 0 0 16px; color: var(--accent); text-decoration: none; font-size: 14px; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 16px 0; }

/* ── Tablet ── */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tile { min-height: 190px; }
}
/* ── Phone ── */
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .grid { grid-template-columns: 1fr; }
  .tile.feature { grid-column: auto; flex-direction: column; gap: 8px; }
  .tile { min-height: 0; }
  .who span { display: none; }
  .userbar .btn.admin { display: none; }
  h1, .hello h1 { font-size: 21px; }
  .clock { display: none; }
  .row { flex-wrap: wrap; }
}
@media print {
  header.top, .back, footer { display: none; }
  body { background: #fff; color: #000; }
  article { border: 0; padding: 0; }
}
