:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Zen Hei", system-ui, sans-serif;
  color: #152338;
  background: #f3f6fb;
  --muted: #51617a;
  --line: #e3eaf3;
  --blue: #1558ba;
  --panel: #fff;
  --radius: 16px;
  --shadow: 0 6px 18px #1b3a6410;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #5896fb; outline-offset: 3px; }
[id] { scroll-margin-top: 20px; }
.numeric { font-variant-numeric: tabular-nums; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-inner, .page {
  width: min(1184px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 34px;
  min-height: 75px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #152338;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: #2168d9;
}

.brand-mark::before {
  content: "";
  width: 19px;
  height: 17px;
  background: #fff;
  clip-path: polygon(0 48%, 100% 0, 80% 100%, 52% 70%, 39% 86%, 40% 62%, 79% 22%, 30% 56%);
}

nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 24px;
  font-size: 13px;
}

nav a { color: var(--muted); white-space: nowrap; }
nav a:hover { color: var(--blue); }
.logout-form { margin-inline-start: auto; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #198451;
  box-shadow: 0 0 0 3px #e0f4e9;
}

.connection-dot.inactive {
  background: #78869b;
  box-shadow: 0 0 0 3px #e9edf3;
}

.page { padding-block: 38px 48px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 36px); line-height: 1.25; letter-spacing: -.025em; }
.intro p, .timezone { color: var(--muted); font-size: 13px; }
.intro p { margin-top: 7px; }
.timezone { white-space: nowrap; padding-bottom: 3px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric, .panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric { padding: 19px 22px; }

.metric-checkin {
  color: #fff;
  border-color: #1e5fc6;
  background: linear-gradient(117deg, #1b57bd, #2569d4);
}

.metric-label { font-size: 13px; font-weight: 650; }
.metric-value { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; font-size: 31px; font-weight: 780; line-height: 1.2; }
.metric-unit { align-self: end; margin-bottom: 3px; color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-detail { min-height: 19px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.metric-checkin .metric-detail, .metric-checkin .metric-label { color: #e7efff; }

.check-mark {
  display: grid;
  width: 23px;
  height: 23px;
  place-content: center;
  border-radius: 50%;
  background: #ffffff29;
  font-size: 15px;
}

.workspace, .activity { display: grid; gap: 18px; align-items: stretch; }
.workspace { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.activity { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.panel { padding: 21px 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.panel-heading h2 { font-size: 19px; line-height: 1.35; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding-inline: 13px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .15s ease, border-color .15s ease;
}

.button-secondary { color: var(--blue); border-color: #d6e3f8; background: #f5f8fe; }
.button-secondary:hover:not(:disabled) { background: #e9f1ff; }
.refresh-icon { font-size: 17px; line-height: 1; }
.button-primary { color: #fff; border-color: #1c60cc; background: #2063cc; }
.button-primary:hover:not(:disabled) { background: #184eaa; }
.button-primary span { font-size: 19px; font-weight: 500; line-height: 1; }
.shop-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.shop-settings label { margin: 0; white-space: nowrap; }
.shop-settings input[name="shop_minutes"] { width: 64px; }
.shop-settings > span, .shop-settings small { color: var(--muted); font-size: 12px; }

.shop-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.shop-table thead { color: #445671; background: #f4f7fc; font-size: 12px; white-space: nowrap; }
.shop-table th, .shop-table td { padding: 12px 10px; }
.shop-table thead th:first-child { border-radius: 8px 0 0 8px; }
.shop-table thead th:last-child { border-radius: 0 8px 8px 0; }
.shop-table tbody th, .shop-table td { border-bottom: 1px solid #edf1f7; }
.shop-table tbody tr:last-child > * { border-bottom: 0; }
.shop-table tbody th { width: 100%; font-weight: 650; }
.shop-table td:last-child { text-align: right; }
.product-name { overflow-wrap: anywhere; }
.shop-table small, .activity-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 450; line-height: 1.4; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pill-neutral { color: #4b5e79; background: #eef2f7; }
.pill-green { color: #156443; background: #e7f7ee; }
.pill-blue { color: #174b9d; background: #e8f0ff; }
.pill-amber { color: #7a520b; background: #fff2d7; }
.pill-red { color: #983840; background: #fcecee; }

.text-button {
  min-height: 31px;
  border: 0;
  border-radius: 7px;
  padding: 5px 7px;
  color: var(--blue);
  background: transparent;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover { background: #ebf3ff; }
.cancel { color: #943b44; }
.cancel:hover { background: #fcedef; }

.schedule form { display: grid; gap: 8px; }
label { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 13px; font-weight: 700; }
label span { color: var(--muted); font-size: 11px; font-weight: 450; }

input:not([type="hidden"], [type="checkbox"]), select {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  border: 1px solid #d5deed;
  border-radius: 8px;
  padding: 7px 10px;
  color: #152338;
  background: #fff;
  font-size: 14px;
}

.priority { align-items: center; gap: 7px; width: fit-content; color: var(--muted); font-weight: 550; }
.priority input { margin: 0; width: 16px; height: 16px; accent-color: var(--blue); }
.schedule .button-primary { margin-top: 6px; }
.form-note { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }

.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 12px 1px; }
.activity-list li:last-child { padding-bottom: 2px; }
.activity-info { min-width: 0; overflow-wrap: anywhere; }
.activity-list strong { font-size: 14px; }
.purchase-actions { display: flex; align-items: center; gap: 4px; }
.empty { border-radius: 9px; padding: 13px 14px; color: var(--muted); background: #f5f7fb; font-size: 13px; line-height: 1.5; }
.empty a { white-space: nowrap; }
.notice { margin-bottom: 16px; border: 1px solid #d7e3f6; border-radius: 9px; padding: 10px 13px; background: #eaf1ff; color: #234a80; font-size: 13px; line-height: 1.5; }
.notice-error { border-color: #f3d7dc; background: #fff1f3; color: #843641; }
.notice-success { border-color: #d2ebdc; background: #eaf8ef; color: #205e42; }

.login-page { display: grid; min-height: 100vh; min-height: 100svh; place-items: center; padding: 24px 16px; }
.login-panel { width: min(100%, 400px); padding: 28px; }
.login-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-heading h1 { font-size: 23px; }
.login-panel form { display: grid; gap: 8px; }
.login-panel .button-primary { margin-top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 880px) {
  .topbar-inner, .page { width: calc(100% - 40px); }
  .topbar-inner { gap: 20px; }
  nav { gap: 14px; }
  .workspace { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .panel, .metric { padding-inline: 16px; }
  .shop-table th, .shop-table td { padding-inline: 6px; }
}

@media (max-width: 660px) {
  .topbar-inner, .page { width: calc(100% - 28px); }
  .topbar-inner { flex-wrap: wrap; justify-content: space-between; gap: 0 8px; padding: 11px 0 9px; }
  nav { flex-basis: 100%; order: 1; gap: 20px; padding-top: 11px; }
  .connection { font-size: 12px; }
  .page { padding-top: 24px; }
  .intro { margin-bottom: 17px; }
  .metrics { gap: 7px; margin-bottom: 13px; }
  .metric { padding: 12px 8px; border-radius: 11px; }
  .metric-label, .metric-detail { font-size: 11px; }
  .metric-detail { overflow-wrap: anywhere; }
  .metric-value { gap: 3px; margin-block: 7px 5px; font-size: clamp(17px, 4.7vw, 25px); }
  .metric-unit { margin-bottom: 1px; font-size: 11px; }
  .check-mark { width: 15px; height: 15px; font-size: 11px; }
  .workspace, .activity { grid-template-columns: 1fr; gap: 12px; }
  .activity { margin-top: 12px; }
  .panel { border-radius: 13px; padding: 15px 13px; }
  .shop-table tbody th { font-size: 13px; }
  .shop-table th, .shop-table td { padding: 10px 4px; }
  input:not([type="hidden"], [type="checkbox"]), select { font-size: 16px; }
}
