:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --surface: #ffffff;
  --surface-soft: #eef5ef;
  --ink: #17211d;
  --muted: #627067;
  --line: #dbe4dc;
  --green: #174d3c;
  --green-2: #216b50;
  --teal: #0d7f83;
  --amber: #b97805;
  --red: #b23b3b;
  --blue: #276b99;
  --slate: #778893;
  --shadow: 0 18px 50px rgba(30, 55, 44, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 77, 60, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(13, 127, 131, 0.1), transparent 32%),
    var(--bg);
  font-family: Verdana, Geneva, sans-serif;
}

body,
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

img,
.protected-logo {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  pointer-events: none;
  user-select: none;
}

input,
textarea {
  user-select: text;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.95) 0 18%, rgba(244, 248, 252, 0) 42%),
    linear-gradient(180deg, #f5f8fb 0%, #eef5f3 100%);
  font-weight: 700;
}

.app-loader[hidden] {
  display: none;
}

.loader-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(420px, calc(100vw - 32px));
}

.loader-card p {
  margin: 0;
  text-align: center;
}

.loader-logo-card {
  display: grid;
  place-items: center;
  width: min(240px, 64vw);
  min-height: 120px;
  padding: 16px 26px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(20, 108, 99, 0.13);
}

.loader-logo-card img {
  display: block;
  width: 168px;
  max-width: 100%;
  height: auto;
}

.tile-loader {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  gap: 8px;
  align-items: end;
  justify-content: center;
  min-height: 74px;
  perspective: 520px;
}

.tile-loader span {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 2px solid var(--tile-color);
  border-radius: 7px;
  color: var(--tile-color);
  background: #ffffff;
  box-shadow: 0 13px 24px rgba(22, 34, 44, 0.16);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transform-origin: 50% 100%;
  animation: tile-loader-bounce 1.28s cubic-bezier(0.22, 0.68, 0.24, 1) infinite;
  animation-delay: var(--delay);
}

.tile-loader span::after {
  content: "";
  position: absolute;
  inset: -18%;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.15) 42%, rgba(255, 255, 255, 0.92) 50%, rgba(255, 255, 255, 0.15) 58%, transparent 80%);
  transform: translateX(-120%) rotate(10deg);
  animation: tile-loader-glint 1.9s ease-in-out infinite;
  animation-delay: calc(var(--delay) + 180ms);
}

.loader-product {
  margin-top: -6px;
  color: #24313d;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loader-tagline {
  position: relative;
  z-index: 0;
  display: inline-block;
  overflow: hidden;
  padding: 2px 8px;
  color: #24313d;
  font-size: 17px;
  font-weight: 800;
  text-shadow:
    0 0 8px rgba(15, 118, 110, 0.2),
    0 0 18px rgba(185, 120, 5, 0.14);
  animation: tagline-glow 2.6s ease-in-out infinite;
}

.loader-tagline::before {
  content: "";
  position: absolute;
  inset: -30% auto -30% -38%;
  z-index: 1;
  width: 30%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-22deg);
  opacity: 0;
  pointer-events: none;
  animation: loader-shine 3.2s ease-in-out infinite;
}

.loader-tagline::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(232, 243, 241, 0.58) 100%);
  box-shadow: 0 8px 22px rgba(20, 108, 99, 0.08);
}

.loader-watermark {
  position: absolute;
  left: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 30px);
  display: grid;
  gap: 3px;
  max-width: min(260px, calc(100vw - 28px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  color: rgba(36, 49, 61, 0.86);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 14px 30px rgba(22, 34, 44, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.loader-watermark span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 7px rgba(255, 255, 255, 0.8);
}

.loader-watermark strong {
  color: rgba(24, 32, 39, 0.92);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.82);
}

@keyframes tile-loader-bounce {
  0%,
  100% {
    transform: translateY(0) rotateX(0deg);
  }
  34% {
    transform: translateY(-18px) rotateX(11deg);
  }
  58% {
    transform: translateY(2px) rotateX(-7deg);
  }
}

@keyframes tile-loader-glint {
  0%,
  44% {
    transform: translateX(-120%) rotate(10deg);
  }
  72%,
  100% {
    transform: translateX(145%) rotate(10deg);
  }
}

@keyframes tagline-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes loader-shine {
  0%,
  45% {
    opacity: 0;
    left: -38%;
  }
  58% {
    opacity: 1;
  }
  82%,
  100% {
    opacity: 0;
    left: 112%;
  }
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(219, 228, 220, 0.95);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.9)),
    rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.login-brand img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(23, 77, 60, 0.12);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(98, 112, 103, 0.26);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-size: 14px;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(23, 77, 60, 0.62);
  box-shadow: 0 0 0 3px rgba(23, 77, 60, 0.1);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.icon-action {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(98, 112, 103, 0.2);
  border-radius: 8px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.86);
}

.icon-action svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  border-color: transparent;
  background: transparent;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(82px, auto) 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.captcha-code {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(23, 77, 60, 0.18);
  border-radius: 8px;
  color: var(--green);
  background:
    repeating-linear-gradient(135deg, rgba(23, 77, 60, 0.08) 0 5px, rgba(13, 127, 131, 0.08) 5px 10px),
    #ffffff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.login-message,
.install-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.login-submit,
.install-action {
  width: 100%;
}

.login-submit.is-loading {
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.button-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.link-action {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(98, 112, 103, 0.2);
  border-radius: 8px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 900;
}

.install-message {
  margin-top: 12px;
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 14px max(20px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  color: rgba(36, 49, 61, 0.88);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(238, 248, 246, 0.46)),
    linear-gradient(90deg, rgba(23, 77, 60, 0.1), rgba(13, 127, 131, 0.12));
  box-shadow:
    0 16px 38px rgba(23, 77, 60, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.topbar-brand,
.topbar-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-timer {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 42px;
  min-width: 152px;
  padding: 6px 12px;
  border: 1px solid rgba(185, 120, 5, 0.26);
  border-radius: 8px;
  color: #5b430f;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
  font-weight: 900;
  outline: none;
}

.session-timer span {
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.session-timer strong {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}

.session-timer::after {
  content: attr(title);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(260px, 78vw);
  padding: 10px 12px;
  border: 1px solid rgba(23, 77, 60, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(23, 33, 29, 0.16);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.session-timer:hover::after,
.session-timer:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.sensitive-notice {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 80;
  width: min(620px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(178, 59, 59, 0.3);
  border-radius: 8px;
  color: #321f1f;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(23, 33, 29, 0.22);
  transform: translate(-50%, -50%);
}

.sensitive-notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--red);
}

.sensitive-notice-bar strong {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.sensitive-notice-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.notice-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.sensitive-notice p {
  display: grid;
  gap: 8px;
  margin: 0 auto;
  max-width: 540px;
  padding: 22px 24px 24px;
  color: #321f1f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

.sensitive-notice p span {
  display: block;
}

.sensitive-notice.minimized {
  width: min(340px, calc(100vw - 28px));
}

.sensitive-notice.minimized p {
  display: none;
}

.sensitive-notice.expanded {
  inset: 50% auto auto 50%;
  width: min(760px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
}

.sensitive-notice.expanded p {
  padding: 24px;
  font-size: 18px;
}

.brand-mark {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(23, 77, 60, 0.12);
}

.eyebrow,
.section-label {
  margin: 0 0 5px;
  color: var(--green-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.25;
}

.primary-action,
.secondary-action,
.ghost-action {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 900;
}

.primary-action {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(23, 77, 60, 0.18);
}

.secondary-action {
  color: var(--green);
  background: #ffffff;
  border-color: rgba(23, 77, 60, 0.24);
}

.ghost-action {
  color: var(--ink);
  background: rgba(238, 245, 239, 0.75);
  border-color: rgba(98, 112, 103, 0.2);
}

.small-action {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.workspace {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 46px;
}

.upload-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.upload-tools {
  display: grid;
  gap: 10px;
}

.history-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 77, 60, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 245, 239, 0.78)),
    rgba(23, 77, 60, 0.05);
  box-shadow:
    0 10px 22px rgba(30, 55, 44, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.history-status span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-status strong {
  max-width: 240px;
  min-width: 148px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--green);
  background: rgba(23, 77, 60, 0.1);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.upload-progress {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 77, 60, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.upload-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eee8;
}

.upload-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
  transition: width 160ms ease;
}

.upload-progress strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.source-message {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.error-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(178, 59, 59, 0.34);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  color: #5b1f1f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 247, 0.88)),
    rgba(178, 59, 59, 0.08);
  box-shadow: 0 12px 28px rgba(178, 59, 59, 0.1);
}

.error-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
}

.error-panel p {
  margin: 0;
  color: #6e3030;
  font-size: 13px;
  line-height: 1.45;
}

.error-panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.error-panel li {
  margin: 4px 0;
  color: #6e3030;
  font-size: 12px;
  line-height: 1.4;
}

.file-drop {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 22px;
  place-items: center;
  border: 2px dashed rgba(13, 127, 131, 0.38);
  border-radius: 8px;
  color: var(--green);
  background: linear-gradient(180deg, #ffffff, #f1f8f7);
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.file-drop.dragging {
  border-color: var(--teal);
  box-shadow: 0 18px 36px rgba(13, 127, 131, 0.14);
  transform: translateY(-1px);
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop span {
  font-size: 17px;
  font-weight: 900;
}

.file-drop strong {
  color: var(--muted);
  font-size: 12px;
}

.file-drop em {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--amber);
  background: rgba(185, 120, 5, 0.1);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.source-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metrics-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.source-card,
.metric,
.insight,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(30, 55, 44, 0.08);
}

.source-card {
  display: grid;
  gap: 8px;
  min-height: 102px;
  padding: 14px;
}

.source-card span,
.metric span,
.stat-label,
.bar-meta span,
.table-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-card strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-pill {
  justify-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(23, 77, 60, 0.1);
  font-size: 11px;
  font-weight: 900;
}

.status-pill.missing {
  color: var(--amber);
  background: rgba(185, 120, 5, 0.12);
}

.metric {
  min-height: 104px;
  padding: 16px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 23px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tab-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tab-result-grid:empty {
  display: none;
}

.result-card {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(219, 228, 220, 0.95);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 247, 0.82)),
    linear-gradient(135deg, rgba(23, 77, 60, 0.07), rgba(13, 127, 131, 0.05));
  box-shadow: 0 10px 24px rgba(30, 55, 44, 0.07);
}

.result-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-card strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.result-card em {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.leave-note,
.data-note {
  margin: -4px 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(185, 120, 5, 0.22);
  border-radius: 8px;
  color: #71511a;
  background: rgba(185, 120, 5, 0.08);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.status-text {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(23, 77, 60, 0.1);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.status-text.leave {
  color: var(--amber);
  background: rgba(185, 120, 5, 0.12);
}

.insight {
  min-height: 118px;
  padding: 15px;
}

.insight strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.insight span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tabbar {
  display: flex;
  gap: 8px;
  margin: 22px 0 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
}

.tab-button.active {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.panel-date-line {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.mix-card {
  display: grid;
  gap: 16px;
}

.stacked-bar {
  display: flex;
  width: 100%;
  height: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf2ee;
}

.stacked-bar span {
  display: block;
  min-width: 2px;
}

.stacked-bar .productive {
  background: var(--green);
}

.stacked-bar .neutral {
  background: var(--blue);
}

.stacked-bar .unproductive {
  background: var(--red);
}

.stacked-bar .idle {
  background: var(--amber);
}

.stacked-bar .break {
  background: #6d7880;
}

.stacked-bar .other {
  background: #9aa5a9;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3ef;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #ffffff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e9eee9;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}

th {
  color: #ffffff;
  background: var(--slate);
  font-weight: 900;
}

tbody tr:nth-child(even) {
  background: #f3f3f3;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.numeric,
th.numeric {
  text-align: right;
  white-space: nowrap;
}

.history-table table {
  min-width: 980px;
}

.period-report-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.period-download {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, auto);
  gap: 14px 20px;
  align-items: start;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(23, 77, 60, 0.14);
  border-radius: 8px;
  background: #fbfdfb;
}

.period-download h3,
.period-download .data-note,
.period-download .source-message {
  margin-bottom: 0;
}

.period-download .data-note {
  display: inline-block;
  max-width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(185, 120, 5, 0.22);
  border-radius: 8px;
  color: #6c4a0d;
  background: #fff8e9;
  line-height: 1.35;
}

.period-download .source-message {
  grid-column: 1 / -1;
  min-height: 0;
  padding-top: 8px;
}

.period-download-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(150px, auto);
  gap: 12px;
  align-items: end;
}

.period-download-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.period-download-controls input {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(98, 112, 103, 0.26);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.period-report-block {
  display: grid;
  gap: 12px;
}

.period-report-heading h3 {
  margin-bottom: 0;
}

.table-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(23, 77, 60, 0.22);
  border-radius: 8px;
  color: var(--green);
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.table-action.danger {
  color: var(--red);
  border-color: rgba(178, 59, 59, 0.24);
  background: rgba(178, 59, 59, 0.07);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px dashed rgba(98, 112, 103, 0.34);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfb;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.paper {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 34px;
  border: 1px solid #d5dadd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(23, 33, 29, 0.16);
}

.paper-header {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.paper-header img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.paper-title h2 {
  margin: 0 0 7px;
  font-size: 24px;
}

.paper-title p,
.report-note {
  margin: 0;
  color: #5d666b;
  font-size: 12px;
  line-height: 1.45;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0;
  border: 1px solid #d6dddf;
  border-radius: 8px;
  overflow: hidden;
}

.report-stat {
  padding: 12px;
  border-right: 1px solid #d6dddf;
  background: #f7f9f8;
}

.report-stat:last-child {
  border-right: 0;
}

.report-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.report-section {
  margin-top: 20px;
}

.report-section h3 {
  margin: 0 0 8px;
  color: #293237;
}

.report-section table {
  min-width: 0;
}

.report-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #d6dddf;
}

.site-footer {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
  margin: 12px 0 0;
  min-height: 56px;
  padding: 12px clamp(18px, 5.8vw, 98px);
  border-top: 1px solid rgba(255, 255, 255, 0.74);
  color: #2f3d44;
  background:
    linear-gradient(90deg, rgba(210, 233, 233, 0.92), rgba(227, 236, 215, 0.92)),
    #ddeade;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.site-footer span {
  position: relative;
  z-index: 1;
  line-height: 1.25;
  min-width: min(100%, 180px);
  white-space: normal;
}

.site-footer strong {
  color: var(--green);
  font-weight: 900;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--amber));
  opacity: 0.16;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -28%;
  width: 24%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  transform: skewX(-22deg);
  animation: footer-shine 4.8s ease-in-out infinite;
}

@keyframes footer-shine {
  0%,
  46% {
    left: -28%;
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  86%,
  100% {
    left: 112%;
    opacity: 0;
  }
}

@media (max-width: 1060px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .source-grid,
  .insight-strip,
  .tab-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar,
  .topbar-brand,
  .topbar-actions {
    align-items: stretch;
  }

  .topbar {
    position: static;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .session-timer {
    min-width: 0;
  }

  .session-timer::after {
    right: auto;
    left: 0;
  }

  .sensitive-notice {
    inset: 50% auto auto 50%;
    width: min(520px, calc(100vw - 28px));
  }

  .sensitive-notice.expanded {
    inset: 50% auto auto 50%;
    width: min(560px, calc(100vw - 28px));
    transform: translate(-50%, -50%);
  }

  .sensitive-notice p {
    padding: 18px;
    font-size: 14px;
  }

  .topbar-actions button {
    padding: 0 9px;
  }

  .upload-band,
  .history-status,
  .period-download,
  .login-brand,
  .login-links,
  .captcha-row,
  .dashboard-grid,
  .paper-header {
    grid-template-columns: 1fr;
  }

  .captcha-row .icon-action {
    width: 100%;
  }

  .metrics-grid,
  .source-grid,
  .insight-strip,
  .tab-result-grid,
  .period-download-controls,
  .legend-grid,
  .report-stats {
    grid-template-columns: 1fr;
  }

  .paper {
    padding: 18px;
  }

  .site-footer {
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    min-height: auto;
    padding: 14px 18px;
    text-align: center;
  }

}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #ffffff;
  }

  .topbar,
  .upload-band,
  .source-grid,
  .error-panel,
  .metrics-grid,
  .insight-strip,
  .tabbar,
  .site-footer,
  .tab-panel:not(#report-panel) {
    display: none !important;
  }

  .app-shell,
  .workspace,
  #report-panel {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .paper {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .report-section {
    break-inside: avoid;
  }

  th {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
