/* WHAT THIS FILE IS FOR
   The look of the Datum preview, in Alpha Tek's colors: charcoal bars, light work area, safety-orange main buttons,
   Barlow fonts (served from this site, no outside font service). Phone, tablet and desktop sizes are handled at the
   bottom of the file. */

/* Fonts, loaded from demo/fonts (Barlow and Barlow Condensed, free under the SIL Open Font License). */
@font-face { font-family: Barlow; font-weight: 400; src: url(fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 500; src: url(fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 600; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 700; src: url(fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: BarlowC; font-weight: 600; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: BarlowC; font-weight: 700; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

/* The company's colors. A different company would only change these few lines. */
:root {
  --ink: #191B1D; --ink2: #24272A; --ink3: #2C3034; --paper: #F5F6F7; --card: #fff; --line: #E0E4E6; --muted: #596168;
  --acc: #FF5020; --acct: #B6330E; --ok: #2E7D32; --okbg: #E7F3E8; --warn: #9A5B00; --warnbg: #FFF2DC;
  --bad: #B3261E; --badbg: #FDE8E6; --grey: #EEF0F2;
}

/* Page basics. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: Barlow, system-ui, sans-serif; color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.4; }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }

/* The thin orange strip at the very top that says this is a preview. */
.preview { background: var(--acc); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 5px 10px; }

/* Top bar: logo, search, "viewing as" role picker. */
.top { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.top .logo { height: 34px; display: block; }
.search { flex: 1; max-width: 560px; background: var(--ink2); border: 1px solid #3a3e42; border-radius: 6px; padding: 9px 14px; color: #aab1b7; }
.roles { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #cfd4d8; font-size: 13px; }
.roles select { background: var(--ink2); border: 1px solid #3a3e42; border-radius: 6px; padding: 8px 10px; color: #fff; font-weight: 600; }

/* Main layout: side menu plus work area. */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 86px); }
.side { background: var(--ink); color: #c9ced2; padding: 12px 10px; }
.side .h { font-family: BarlowC; font-size: 11px; letter-spacing: .16em; color: #7d858c; padding: 12px 12px 6px; text-transform: uppercase; }
.side a { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 6px; font-weight: 500; text-decoration: none; cursor: pointer; }
.side a:hover { background: var(--ink2); }
.side a.on { background: var(--ink3); color: #fff; box-shadow: inset 3px 0 0 var(--acc); }
.side a i { font-style: normal; background: var(--acc); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.side .by { font-size: 11px; color: #6d757c; padding: 18px 12px 4px; }
.main { padding: 22px 26px 40px; min-width: 0; }

/* Headings, cards, buttons, tags and tables used on every screen. */
h1 { font-family: BarlowC; font-weight: 700; font-size: 28px; letter-spacing: .02em; text-transform: uppercase; }
.sub { color: var(--muted); margin-top: 2px; }
.head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: 1.3fr 1fr 280px; } .g5 { grid-template-columns: repeat(5, 1fr); }
.gside { grid-template-columns: 1fr 330px; } .ghelp { grid-template-columns: 270px 1fr 300px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.card.hot { border: 2px solid var(--acc); }
.card h3 { font-family: BarlowC; font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.card.hot h3 { color: var(--acct); }
.btn { display: inline-block; border-radius: 6px; padding: 10px 16px; font-weight: 600; border: 1px solid var(--line); background: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #c4cacd; }
.btn.p { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.p:hover { background: #ec4515; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.big { font-size: 17px; padding: 14px 20px; }
.btn.wide { width: 100%; text-align: center; }
.btn[disabled] { opacity: .45; cursor: default; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 2px 8px; }
.ok { background: var(--okbg); color: var(--ok); } .warn { background: var(--warnbg); color: var(--warn); }
.bad { background: var(--badbg); color: var(--bad); } .grey { background: var(--grey); color: var(--muted); }
.k { color: var(--muted); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.big-n { font-size: 34px; font-weight: 700; margin: 2px 0; }
.label { font-family: BarlowC; font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.red { color: var(--bad); font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { font-family: BarlowC; font-size: 12px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FAFBFB; }
.right { text-align: right; }
.bar { height: 8px; background: var(--grey); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar b { display: block; height: 100%; background: var(--acc); width: 0; transition: width .3s; }
.bar.tall { height: 12px; }
.photo { background: repeating-linear-gradient(45deg, #E9ECEE 0 10px, #F1F3F4 10px 20px); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 13px; min-height: 90px; }
.photo.tallp { min-height: 170px; }
/* Real part photos (square, cropped from Kevin's photos): small in lists, large on the part page. */
.pimg { display: block; object-fit: cover; border-radius: 6px; background: var(--grey); }
.thumb { width: 44px; height: 44px; min-height: 0; flex: none; border-radius: 6px; }
.thumb.big { width: 64px; height: 64px; }
.pimg.tallp { width: 100%; aspect-ratio: 1; max-height: 420px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item { padding: 8px 0; border-bottom: 1px solid var(--line); } .item:last-child { border-bottom: 0; }
.machine { border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.machine.on { border: 2px solid var(--acc); }
ol.steps { padding-left: 18px; line-height: 1.6; font-size: 14px; }

/* Forms (order entry, receiving). */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field input, .field select { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; }
input.qty { width: 70px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
input.track { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 200px; }
.totals td { border: 0; padding: 4px 6px; } .totals tr.sum td { font-weight: 700; font-size: 18px; border-top: 2px solid var(--ink); }

/* Tabs (shipping and receiving). */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 9px 16px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-weight: 600; cursor: pointer; text-decoration: none; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Big-button rows for the build bench (tablet). */
.step { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 10px; }
.step .what { flex: 1; } .step .name { font-size: 19px; font-weight: 600; }

/* The pop-up message after an action ("Order created", etc.). */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; }
.toast.show { opacity: 1; }
.toast b { color: var(--acc); }

/* Welcome panel shown first, to pick whose screen to look at. */
.welcome { max-width: 900px; margin: 30px auto; }
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.who a { display: block; text-decoration: none; cursor: pointer; }
.who a .card:hover { border-color: var(--acc); }
.who .t { font-weight: 700; font-size: 18px; margin-bottom: 4px; }

/* Bottom menu, used instead of the side menu on phones. */
.bottom { display: none; }

/* Tablet and smaller: stack the multi-column screens. */
@media (max-width: 1100px) {
  .g3, .ghelp, .gside { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(3, 1fr); }
}
/* Phone: no side menu (bottom menu instead), smaller header, one column. */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side, .search { display: none; }
  .top { padding: 10px 14px; gap: 10px; } .top .logo { height: 26px; }
  .roles span { display: none; }
  .main { padding: 16px 14px 90px; }
  .g2, .g5, .who { grid-template-columns: 1fr 1fr; }
  .who { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 5; }
  .bottom a { flex: 1; text-align: center; padding: 10px 2px 14px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer; }
  .bottom a.on { color: var(--acct); }
  .hide-phone { display: none; }
  input.track { width: 100%; }
}
