@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182144;
  background: #f7f8fd;
  --dark: #121944;
  --line: #dce1ee;
  --muted: #53607c;
  --stokly-blue: #294ae9;
  --stokly-blue-dark: #2037bb;
  --stokly-ink: #101944;
  --stokly-surface: #fff;
  --stokly-radius: 12px;
}

:focus-visible {
  outline: 3px solid #5270f2;
  outline-offset: 3px;
}

.button.primary { background: var(--stokly-blue); border-color: var(--stokly-blue); color: #fff; }
.button.primary:hover { background: var(--stokly-blue-dark); border-color: var(--stokly-blue-dark); }
.ui-icon { width: 22px; height: 22px; flex: 0 0 auto; fill: currentColor; vertical-align: middle; }

.stokly-shell {
  grid-template-columns: clamp(188px, 16.4vw, 238px) minmax(0, 1fr);
  font-size: 15px;
}

.stokly-shell .sidebar {
  padding: 24px 14px 20px;
  background: #eef0ff;
  min-height: min(580px, 100vh);
}

.sidebar .stokly-brand { margin: 0 11px 58px; }
.stokly-brand { gap: 4px; color: var(--stokly-ink); }
.stokly-brand img { width: 51px; height: 51px; }
.stokly-brand > span { font-size: 34px; font-weight: 700; letter-spacing: -1.5px; }
.auth-story .stokly-brand { color: #fff; align-self: flex-start; }
.auth-story .eyebrow, .auth-story p, .auth-story em { color: #cbd6ff; }

.stokly-shell .sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: none;
  overflow: auto;
}

.stokly-shell .nav-item {
  min-height: 55px;
  margin: 0;
  padding: 9px 13px;
  gap: 13px;
  color: var(--stokly-ink);
  font-size: 18px;
  font-weight: 550;
  border-radius: 9px;
}

.stokly-shell .nav-item .ui-icon { width: 25px; height: 25px; }
.stokly-shell .nav-item:hover { background: #e4e8fd; }
.stokly-shell .nav-item.selected { color: #243bcc; background: #dce1ff; font-weight: 700; }

.stokly-site {
  border-top: 1px solid #d7ddef;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 12px 4px;
  color: #2039ce;
  text-decoration: none;
  font-weight: 600;
}

.stokly-site:hover { text-decoration: underline; }

.stokly-shell .topbar {
  min-height: 93px;
  padding: 12px clamp(18px, 2.15vw, 32px);
  gap: clamp(10px, 1.8vw, 25px);
  background: #fbfbff;
  border-color: #dce1f2;
}

.stokly-shell .search-box {
  margin: 0 auto 0 0;
  flex: 1;
  max-width: 625px;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid #cbd3ea;
  border-radius: 9px;
  background: #f5f6fd;
  gap: 10px;
  color: #44516d;
}

.stokly-shell .search-box:focus-within { outline: 2px solid #5270f2; outline-offset: 2px; }
.stokly-shell .search-box input {
  padding: 10px 0;
  min-height: 42px;
  min-width: 0;
  width: 100%;
  font-size: 14px;
  outline: none;
}
.stokly-shell .search-box input::placeholder { color: #58647e; opacity: 1; }

.workspace-control {
  position: relative;
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  width: clamp(158px, 19vw, 280px);
  color: var(--stokly-ink);
  background: #f8f9ff;
  border: 1px solid #ccd4eb;
  border-radius: 9px;
}

.workspace-control select {
  position: relative;
  z-index: 1;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 10px 23px 10px 46px;
  margin: 0 -13px 0 -44px;
  min-width: 0;
  flex: 1;
  text-overflow: ellipsis;
  font-weight: 600;
}

.workspace-control .control-caret { position: absolute; right: 11px; width: 17px; pointer-events: none; }
.workspace-control.workspace-name { width: auto; max-width: 265px; font-weight: 600; }
.topbar-icon {
  position: relative;
  display: inline-grid;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  color: #243051;
}
.topbar-icon:hover { background: #e8ecff; }
.topbar-icon.has-attention::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  right: 7px;
  top: 6px;
  border: 2px solid #fbfbff;
  border-radius: 50%;
  background: #ffa324;
}

.account-menu { position: relative; flex: 0 0 auto; z-index: 4; }
.account-menu summary {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  list-style: none;
  color: #251974;
  background: #e2ddff;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { background: #d9d2ff; }
.account-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 238px;
  padding: 9px;
  background: #fff;
  border: 1px solid #d8def0;
  border-radius: 11px;
  box-shadow: 0 12px 35px #111c4820;
}
.account-identity { padding: 9px; border-bottom: 1px solid var(--line); }
.account-identity strong, .account-identity small { display: block; overflow-wrap: anywhere; }
.account-identity small { color: #53607c; margin-top: 4px; }
.account-panel .field { padding: 8px; margin: 0; }
.account-link {
  width: 100%;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  color: var(--stokly-ink);
  background: none;
  text-align: left;
}
.account-link:hover { background: #eff1ff; }
.account-link .ui-icon { width: 18px; height: 18px; }

.module-nav {
  display: flex;
  gap: 18px;
  padding: 0 clamp(18px, 2.15vw, 32px);
  border-bottom: 1px solid var(--line);
  background: #fbfbff;
  overflow: auto;
}
.module-tab {
  padding: 13px 4px 11px;
  color: #4e5a75;
  background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 600;
}
.module-tab:hover, .module-tab.selected { color: var(--stokly-blue-dark); }
.module-tab.selected { border-bottom-color: var(--stokly-blue); }

#content.overview-content { padding: 23px clamp(18px, 2.15vw, 32px) 28px; max-width: 1680px; }
.overview { display: grid; gap: 24px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 7px 4px; }
.overview-heading h1 {
  margin: 0 0 4px;
  color: var(--stokly-ink);
  font-size: clamp(29px, 3.25vw, 48px);
  letter-spacing: -.043em;
  line-height: 1.1;
}
.overview-heading p { margin: 0; color: #485470; font-size: 17px; }
.overview-main-action { display: inline-flex; align-items: center; gap: 13px; padding: 13px 19px; border-radius: 9px; white-space: nowrap; font-size: 17px; }
.overview-main-action .ui-icon { width: 15px; height: 15px; }

.overview-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.overview-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 108px;
  padding: 15px;
  color: var(--stokly-ink);
  background: var(--stokly-surface);
  border: 1px solid #dbe0f0;
  border-radius: var(--stokly-radius);
  text-align: left;
}
.overview-metric:hover, .overview-metric[aria-pressed="true"] { border-color: #9cacff; background: #f4f6ff; }
.overview-metric-icon { width: 52px; height: 52px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; }
.overview-metric-icon .ui-icon { width: 31px; height: 31px; }
.overview-metric-icon.blue { background: #e0e7ff; color: #2449e7; }
.overview-metric-icon.violet { background: #eee3ff; color: #6732bf; }
.overview-metric-icon.amber { background: #fff0d8; color: #9a5200; }
.overview-metric-icon.green { background: #e4f3e3; color: #216a37; }
.overview-metric-label { display: block; font-weight: 650; line-height: 1.22; }
.overview-metric strong { display: block; font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.04em; }

.overview-middle { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 18px; }
.overview-panel { min-width: 0; border: 1px solid #dbe0f0; border-radius: var(--stokly-radius); background: var(--stokly-surface); padding: 16px 17px; }
.overview-panel h2 { margin: 0 0 14px; color: var(--stokly-ink); font-size: 26px; letter-spacing: -.032em; line-height: 1.16; }
.overview-activity canvas { display: block; width: 100%; height: 207px; }
.overview-alerts { display: grid; gap: 7px; }
.overview-alert {
  width: 100%;
  background: #f2edff;
  color: #171c48;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  text-align: left;
  min-height: 48px;
}
.overview-alert.amber { background: #fff5e7; }
.overview-alert > .ui-icon:first-child { color: #7134be; }
.overview-alert.amber > .ui-icon:first-child { color: #a05000; }
.overview-alert > .ui-icon:last-child { margin-left: auto; width: 15px; height: 15px; }
.overview-alert:hover { outline: 1px solid #b7abec; }

.overview-queue { padding: 12px 17px 16px; }
.overview-queue:focus, .overview-attention:focus { outline-offset: 3px; }
.overview-queue-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.overview-queue th {
  background: #edf0fa;
  color: var(--stokly-ink);
  font-weight: 650;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  padding: 9px 12px;
}
.overview-queue th:first-child { border-radius: 7px 0 0 7px; }
.overview-queue th:last-child { border-radius: 0 7px 7px 0; }
.overview-queue th:last-child { width: 26%; }
.overview-queue td { padding: 10px 12px; color: #141d43; font-size: 15px; }
.overview-order-link { font-size: inherit; font-weight: 700; color: #263ec7; padding: 3px 0; background: transparent; white-space: nowrap; }
.overview-order-link:hover { text-decoration: underline; }
.overview-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  color: #59369a;
  background: #f0e9ff;
}
.overview-status.warning { color: #8a4500; background: #fff0d9; }
.overview-status.success { color: #1c6431; background: #e5f4e8; }
.overview-row-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 119px;
  background: #fff;
  border: 1px solid #b7c4f0;
  border-radius: 7px;
  padding: 7px 10px;
  color: #263ec7;
  font-weight: 700;
  white-space: nowrap;
}
.overview-row-action .ui-icon { width: 13px; height: 13px; }
.overview-row-action:hover { background: #eef1ff; }
.overview-row-action.pick-action { color: #fff; background: var(--stokly-blue); border-color: var(--stokly-blue); }
.overview-row-action.pick-action:hover { background: var(--stokly-blue-dark); }
.overview-empty { margin: 0; padding: 12px 0; color: #53607c; }

@media(max-width: 1100px) {
  .stokly-shell .topbar { gap: 12px; }
  .overview-metrics { gap: 10px; }
  .overview-metric { padding: 11px 9px; gap: 8px; }
  .overview-metric-icon { width: 40px; height: 40px; }
  .overview-metric-icon .ui-icon { width: 25px; height: 25px; }
  .overview-metric strong { font-size: 31px; }
}

@media(max-width: 800px) {
  .stokly-shell { grid-template-columns: minmax(0, 1fr); }
  .stokly-shell .sidebar { position: static; height: auto; min-height: 0; padding: 9px 14px 6px; }
  .sidebar .stokly-brand { margin: 0 0 6px; align-self: flex-start; }
  .stokly-shell .sidebar nav { flex: 0 1 auto; flex-flow: row nowrap; gap: 5px; max-height: none; }
  .stokly-shell .nav-item { flex: 0 0 auto; min-height: 42px; padding: 7px 9px; font-size: 14px; gap: 6px; }
  .stokly-shell .nav-item .ui-icon { width: 19px; height: 19px; }
  .stokly-site { position: absolute; right: 18px; top: 20px; margin: 0; padding: 0; border: 0; font-size: 13px; }
  .stokly-site .ui-icon { width: 16px; height: 16px; }
  .overview-heading { padding: 0; }
}
@media(max-width: 610px) {
  .stokly-shell .sidebar nav { flex-wrap: wrap; overflow: visible; }
  .stokly-shell .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; padding-block: 9px; }
  .stokly-shell .search-box { grid-column: 1 / -1; grid-row: 2; max-width: none; width: 100%; }
  .workspace-control { grid-column: 1; width: min(100%, 280px); }
  .account-menu { grid-column: 3; }
  .overview-heading { flex-wrap: wrap; gap: 11px; }
  .overview-heading h1 { font-size: 32px; }
  .overview-heading p { font-size: 15px; }
  .overview-main-action { padding: 9px 12px; }
  .overview-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-metric { min-height: 75px; }
  .overview-middle { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .overview { gap: 14px; }
  .overview-panel { padding: 13px; }
  .overview-queue .table-scroll { overflow-x: auto; }
}
