@font-face {
  font-family: "Ioskeley Mono";
  src: url("/wavecrate/assets/IoskeleyMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111313;
  --surface: #171919;
  --surface-2: #1d1f1f;
  --line: #3e403e;
  --line-soft: #2a2c2b;
  --text: #e5e0d9;
  --muted: #9d9a94;
  --accent: #c94f40;
  --accent-bright: #e15847;
  --ivory: #eee9e1;
  --green: #7d9c6b;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Ioskeley Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }

.admin-header {
  min-height: 64px;
  padding: 0 38px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
}

.admin-brand { justify-self: start; text-decoration: none; }
.admin-brand span,
.admin-status,
.eyebrow,
.panel-kicker { color: var(--accent-bright); }
.admin-brand:hover { color: var(--accent-bright); }
.admin-status { justify-self: center; }

.admin-header-actions { justify-self: end; display: flex; gap: 8px; }

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .06em;
  text-align: center;
}

.admin-button:hover,
.admin-button:focus-visible { border-color: var(--muted); background: var(--surface-2); outline: none; }
.admin-button-primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.admin-button-primary:hover,
.admin-button-primary:focus-visible { border-color: var(--accent-bright); background: var(--accent-bright); }
.admin-button-small { min-height: 30px; padding: 0 10px; color: var(--muted); font-size: 9px; }
.admin-button:disabled { cursor: not-allowed; opacity: .5; }

main { flex: 1; }

.login-view {
  width: min(920px, calc(100% - 96px));
  min-height: 460px;
  margin: clamp(48px, 10vh, 120px) auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: var(--surface);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-copy,
.login-form { padding: 54px; display: flex; flex-direction: column; justify-content: center; }
.login-copy { border-right: 1px solid var(--line); background: rgba(23, 25, 25, .94); }
.login-copy > p:last-child { max-width: 380px; margin: 24px 0 0; color: var(--muted); line-height: 1.65; }
.eyebrow,
.panel-kicker { margin: 0; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.lock-mark { width: 58px; height: 58px; margin: 42px 0 28px; display: grid; place-items: center; border: 1px solid var(--accent-bright); border-radius: 50%; color: var(--accent-bright); font-size: 28px; transform: rotate(45deg); }
.lock-mark::first-letter { transform: rotate(-45deg); }
h1,
h2,
p { margin-top: 0; }
h1 { margin-bottom: 0; color: var(--ivory); font-size: clamp(44px, 6vw, 78px); font-weight: 400; letter-spacing: -.06em; line-height: .92; }
.login-copy h1 { max-width: 420px; }
.login-form { background: rgba(17, 19, 19, .96); }
.login-form label { margin-bottom: 8px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.login-form input { min-height: 48px; margin-bottom: 18px; padding: 0 14px; border: 1px solid var(--line); color: var(--text); background: var(--bg); outline: none; }
.login-form input:focus { border-color: var(--accent-bright); box-shadow: inset 3px 0 var(--accent-bright); }
.login-form .admin-button { width: 100%; margin-top: 4px; }
.login-form small { margin-top: 18px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.form-message { min-height: 1.3em; margin: 0 0 10px; color: var(--accent-bright); font-size: 10px; }

.dashboard-view { width: min(1320px, calc(100% - 96px)); margin: 0 auto; padding: 48px 0 64px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding-bottom: 32px; }
.dashboard-heading h1 { margin: 12px 0 8px; }
.dashboard-heading > div > p:last-child { margin: 0; color: var(--muted); }
.dashboard-heading time { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); }
.metric { min-width: 0; min-height: 142px; padding: 18px; display: grid; align-content: end; border-right: 1px solid var(--line); background: var(--surface); }
.metric:last-child { border-right: 0; }
.metric-label { color: var(--muted); font-size: 9px; line-height: 1.35; text-transform: uppercase; }
.metric-value { margin: 8px 0 4px; color: var(--ivory); font-size: clamp(22px, 2.5vw, 34px); font-weight: 400; line-height: 1; }
.metric-note { color: var(--muted); font-size: 9px; }

.dashboard-grid { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 24px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.panel-heading { min-height: 42px; display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 6px 0 0; color: var(--text); font-size: 17px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.panel-heading > strong { color: var(--ivory); font-size: 26px; font-weight: 400; }
.panel-note { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.download-bars { height: 188px; margin-top: 24px; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 8px; border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px); background-size: 100% 25%; }
.download-bar { min-height: 2px; height: var(--bar-height); background: linear-gradient(to top, var(--accent), var(--accent-bright)); opacity: .82; }
.download-bar:hover { opacity: 1; }
.axis { padding-top: 9px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; text-transform: uppercase; }

.page-row { margin-top: 18px; display: grid; grid-template-columns: minmax(86px, 1fr) minmax(0, 1.5fr) 42px; gap: 10px; align-items: center; color: var(--muted); font-size: 9px; }
.page-row:first-child { margin-top: 24px; }
.page-row > div { height: 5px; background: var(--line-soft); }
.page-row > div i { display: block; height: 100%; min-width: 3px; background: var(--accent-bright); }
.page-row strong { color: var(--text); font-weight: 400; text-align: right; }

.products-panel,
.activity-panel { margin-top: 24px; }
.product-list { margin-top: 18px; border-top: 1px solid var(--line-soft); }
.product-row { min-height: 74px; padding: 12px 8px; display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(180px, 1.4fr) repeat(3, minmax(80px, .55fr)); gap: 16px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.product-name { display: grid; gap: 5px; }
.product-name strong { color: var(--ivory); font-size: 15px; font-weight: 400; }
.product-name small,
.product-release small,
.product-stat span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.product-release { display: grid; gap: 5px; }
.product-release strong { color: var(--text); font-size: 11px; font-weight: 400; }
.product-stat { display: grid; gap: 5px; }
.product-stat strong { color: var(--ivory); font-size: 18px; font-weight: 400; }

.activity-table { margin-top: 18px; overflow-x: auto; font-size: 10px; }
.activity-row { min-width: 640px; min-height: 38px; padding: 0 8px; display: grid; grid-template-columns: 1.25fr .75fr 1.4fr 1fr .55fr; gap: 12px; align-items: center; border-top: 1px solid var(--line-soft); }
.activity-head { min-height: 30px; color: var(--muted); border-top: 0; font-size: 8px; text-transform: uppercase; }
.activity-row strong { color: var(--green); font-weight: 400; }
.activity-row strong.is-zero { color: var(--muted); }
.activity-empty { display: block; min-width: 0; padding: 18px 8px; color: var(--muted); border-top: 1px solid var(--line-soft); }

footer { padding: 0 38px 28px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 1040px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(3n) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .product-row { grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) repeat(3, minmax(68px, .6fr)); gap: 10px; }
}

@media (max-width: 760px) {
  .admin-header { min-height: 58px; padding: 0 14px; grid-template-columns: 1fr auto; }
  .admin-status { display: none; }
  .admin-header-actions { gap: 5px; }
  .admin-button { min-height: 34px; padding-inline: 10px; font-size: 9px; }
  .login-view { width: calc(100% - 28px); min-height: 0; margin: 28px auto; grid-template-columns: 1fr; }
  .login-copy { padding: 34px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-form { padding: 28px; }
  .lock-mark { width: 42px; height: 42px; margin: 28px 0 20px; font-size: 20px; }
  .dashboard-view { width: calc(100% - 28px); padding: 28px 0 42px; }
  .dashboard-heading { align-items: start; flex-direction: column; padding-bottom: 24px; }
  .dashboard-heading h1 { font-size: 48px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .products-panel,
  .activity-panel { margin-top: 14px; }
  .panel { padding: 16px; }
  .download-bars { height: 150px; gap: 4px; }
  .product-list { overflow-x: auto; }
  .product-row { min-width: 720px; }
  footer { padding-inline: 14px; }
}
