/* Aethyr Technology — app styles (login, staff admin, customer portal).
   Plain CSS, no build step. Tokens match the marketing page. */
:root {
  --navy: #141a3c;
  --accent: #1f4fa8;
  --accent-dark: #14306b;
  --accent-soft: #e6edfa;
  --bg-grey: #f4f6f9;
  --text: #1c2333;
  --text-muted: #4a5568;
  --border: #e0e5ed;
  --input-border: #c4ccd9;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #146c43;
  --success-soft: #e7f5ee;
  --radius-card: 14px;
  --radius: 8px;
  --font-body: Inter, system-ui, sans-serif;
  --font-head: 'Space Grotesk', Inter, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg-grey); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; font-weight: 600; }
h2 { font-size: 20px; font-weight: 600; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.brand:hover { color: #fff; }
.brand img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.brand small { font-family: var(--font-body); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #9fb6e6; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { color: #c9d3e6; text-decoration: none; padding: 8px 12px; border-radius: var(--radius); font-weight: 500; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.user-menu { display: flex; align-items: center; gap: 12px; color: #c9d3e6; font-size: 14px; }
.user-menu a { color: #c9d3e6; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: #c9d3e6; text-decoration: underline; cursor: pointer; }

/* Layout */
.page { max-width: 1200px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-family: var(--font-head); font-size: 34px; color: var(--navy); line-height: 1.1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent; background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--input-border); }
.btn-secondary:hover { background: var(--bg-grey); color: var(--navy); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1b8b2; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: #2d3648; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=search], .field select, .field textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: var(--radius); font: inherit; background: #fff; color: var(--text); width: 100%;
}
.field textarea { padding: 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field .hint { font-size: 13px; color: var(--text-muted); }
.field .error { font-size: 13px; color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { flex: 1 1 200px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid; }
.alert-success { background: var(--success-soft); border-color: #b5dfc9; color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: #f1b8b2; color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-grey); color: var(--text-muted); white-space: nowrap; }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.unread td { font-weight: 600; }

/* Product cards (portal) */
.product { display: flex; flex-direction: column; gap: 8px; }
.product .price { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--navy); margin-top: auto; }

/* Auth screens */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--navy); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: var(--radius-card); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-card .brand { color: var(--navy); }
.auth-card .brand:hover { color: var(--navy); }

/* Stock */
.subnav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.subnav a { padding: 10px 14px; color: var(--text-muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--navy); }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.subnav .count { font-weight: 500; font-size: 13px; color: var(--text-muted); }
.line-block { border-top: 1px solid var(--border); padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.line-block:first-of-type { border-top: 0; padding-top: 0; }
.line-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.serials { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.serials li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; background: #fff; }
.serials li form { display: inline; }
.serials .x { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.serials .x:hover { color: var(--danger); }
.serial-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.pick-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.progress { font-size: 14px; font-weight: 600; }
.progress.done { color: var(--success); }
.progress.todo { color: var(--accent); }
.inline-form { display: inline; }
