:root {
  --ink: #132327;
  --ink-soft: #304247;
  --paper: #f4f2eb;
  --paper-deep: #ebe8de;
  --surface: #fffefa;
  --surface-alt: #f8f7f2;
  --line: #dcddd5;
  --line-strong: #c7cac2;
  --accent: #b8de5a;
  --accent-deep: #587d16;
  --teal: #1f7264;
  --teal-soft: #def1eb;
  --blue: #426f9d;
  --blue-soft: #e6eef7;
  --orange: #d47a32;
  --orange-soft: #fbebdc;
  --red: #bc4e49;
  --red-soft: #f8e5e3;
  --purple: #76609e;
  --purple-soft: #eee9f6;
  --muted: #566568;
  --shadow: 0 16px 42px rgba(20, 35, 39, 0.08);
  --shadow-soft: 0 8px 24px rgba(20, 35, 39, 0.06);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 254px;
  --font-sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-display: "STSong", "Songti SC", "Noto Serif SC", serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% 8%, rgba(184, 222, 90, 0.12), transparent 24rem),
    var(--paper);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 38px;
  border-radius: 8px 17px 8px 17px;
  color: var(--ink);
  background: var(--accent);
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface-alt);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
}

.button:hover {
  border-color: var(--ink-soft);
  background: var(--surface-alt);
}

.button:focus-visible,
.icon-button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search-field input:focus-visible,
.function-tab:focus-visible,
.nav-module:focus-visible,
.text-button:focus-visible,
.page-button:focus-visible,
button:focus-visible {
  outline: 3px solid #064f45;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 254, 250, 0.95);
}

.button-primary {
  border-color: var(--ink);
  color: var(--surface);
  background: var(--ink);
}

.button-primary:hover {
  border-color: var(--teal);
  background: var(--teal);
}

.button-accent {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent);
}

.button-accent:hover {
  border-color: #a7cc4c;
  background: #c4e872;
}

.button-danger {
  border-color: #e6c3bf;
  color: #7f2f2a;
  background: var(--red-soft);
}

.button-small {
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
}

.text-button:hover {
  color: var(--accent-deep);
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.field > label {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.field:has([required]) > span::after {
  margin-left: 3px;
  color: var(--red);
  content: "*";
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #667476;
}

.field-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #8e302b;
  background: var(--red-soft);
  font-size: 14px;
  font-weight: 700;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(410px, 0.78fr);
  min-height: 100vh;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow: hidden;
  padding: 44px clamp(36px, 6vw, 88px);
  color: #f6f5ee;
  background:
    linear-gradient(125deg, rgba(19, 35, 39, 0.96), rgba(20, 50, 53, 0.88)),
    repeating-linear-gradient(90deg, transparent 0 74px, rgba(255, 255, 255, 0.04) 75px 76px),
    repeating-linear-gradient(0deg, transparent 0 74px, rgba(255, 255, 255, 0.04) 75px 76px);
}

.login-visual::before {
  position: absolute;
  right: -13rem;
  bottom: -12rem;
  width: 40rem;
  height: 40rem;
  border: 1px solid rgba(184, 222, 90, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 80px rgba(184, 222, 90, 0.025),
    0 0 0 160px rgba(184, 222, 90, 0.018);
  content: "";
}

.login-visual::after {
  position: absolute;
  top: 16%;
  right: 10%;
  width: 200px;
  height: 280px;
  background:
    linear-gradient(135deg, rgba(184, 222, 90, 0.18), transparent 60%);
  clip-path: polygon(48% 0, 100% 34%, 83% 100%, 0 76%, 14% 22%);
  content: "";
  opacity: 0.6;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: 60px 0;
}

.login-copy .eyebrow {
  color: var(--accent);
}

.login-copy h1 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(44px, 5.4vw, 82px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.16;
}

.login-scope {
  display: grid;
  gap: 7px;
  max-width: 560px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}

.login-scope > span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.login-scope > p {
  max-width: 560px;
  margin: 0;
  color: rgba(246, 245, 238, 0.72);
  font-size: 14px;
  line-height: 1.8;
}

.login-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  min-height: 100vh;
  padding: 44px;
  background:
    radial-gradient(circle at 10% 90%, rgba(44, 138, 121, 0.1), transparent 18rem),
    var(--paper);
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(207, 209, 199, 0.72);
  border-radius: var(--radius-lg);
  background: rgba(255, 254, 250, 0.92);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
}

.login-card > .muted,
.login-card .page-meta.compact {
  margin: 0 0 28px;
}

.login-card .field + .field {
  margin-top: 17px;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
}

.login-card .form-error {
  margin-top: 14px;
}

.captcha-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.captcha-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.captcha-scene {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
  aspect-ratio: 320 / 140;
}

.captcha-scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.captcha-piece {
  position: absolute;
  top: 34.3%;
  left: 0;
  width: 16.25%;
  aspect-ratio: 1;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), #d8f093);
  box-shadow: 0 4px 12px rgba(19, 35, 39, 0.28);
  transition: left 40ms linear;
}

.captcha-slider-label {
  color: var(--muted);
  font-size: 14px;
}

.captcha-slider {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--teal);
}

.captcha-track {
  display: none;
}

@media (min-width: 901px) and (max-height: 820px) {
  .login-panel {
    align-content: start;
    padding: 22px 44px;
  }

  .login-card {
    padding: 24px 32px;
  }

  .login-card .page-meta.compact {
    margin-bottom: 16px;
  }

  .login-card .field + .field {
    margin-top: 12px;
  }

  .captcha-panel {
    gap: 7px;
    margin-top: 12px;
  }

  .captcha-slider {
    min-height: 38px;
  }

  .login-submit {
    margin-top: 14px;
  }
}

.login-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.05em;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  color: #f1f1eb;
  background:
    linear-gradient(180deg, rgba(19, 35, 39, 0.98), rgba(14, 30, 33, 1)),
    var(--ink);
}

.sidebar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 48%;
  background:
    radial-gradient(circle at 100% 100%, rgba(184, 222, 90, 0.1), transparent 60%);
  content: "";
  pointer-events: none;
}

.sidebar-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 23px 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand div {
  display: grid;
  gap: 3px;
}

.sidebar-brand strong {
  font-size: 15px;
  letter-spacing: 0.05em;
}

.sidebar-brand div span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.sidebar-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 24px;
}

.domain-nav {
  display: grid;
  gap: 19px;
}

.domain-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 8px 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.domain-label span:last-child {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.domain-modules {
  display: grid;
  gap: 3px;
}

.nav-module {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.nav-module:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-module.active {
  color: var(--ink);
  background: var(--accent);
  font-weight: 800;
}

.nav-module-index {
  width: 23px;
  color: rgba(255, 255, 255, 0.66);
  font-family: var(--font-num);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.nav-module.active .nav-module-index {
  color: var(--ink);
}

.sidebar-user {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-user > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sidebar-user strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user div span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.sidebar-user .icon-button {
  width: 34px;
  height: 34px;
  color: rgba(255, 255, 255, 0.78);
}

.sidebar-user .icon-button:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-footer {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: start;
  gap: 2px;
  padding: 10px 16px 14px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.sidebar-footer .text-button {
  min-height: 44px;
  justify-self: start;
  color: rgba(255, 255, 255, 0.86);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
  padding: 0 clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgba(209, 210, 201, 0.75);
  background: rgba(244, 242, 235, 0.9);
  backdrop-filter: blur(16px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-separator {
  color: var(--line-strong);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
}

.connection-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64a84a;
  box-shadow: 0 0 0 4px rgba(100, 168, 74, 0.12);
}

.connection-status[data-state="pending"] i,
.connection-status[data-state="saving"] i {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(212, 122, 50, 0.12);
}

.connection-status[data-state="failed"] {
  color: var(--red);
}

.connection-status[data-state="failed"] i {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(188, 78, 73, 0.12);
}

.mobile-menu-button {
  display: none;
}

.main-view {
  padding: clamp(26px, 4vw, 48px) clamp(20px, 3.8vw, 54px) 64px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.page-title-group {
  max-width: 800px;
}

.page-title-group h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.3vw, 48px);
  font-weight: 500;
  line-height: 1.2;
}

.page-title-group > p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-meta div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.74);
}

.page-meta dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.page-meta dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.page-meta.compact {
  display: grid;
  justify-content: stretch;
}

.page-meta.compact div {
  width: 100%;
}

.workbench-meta {
  justify-content: flex-start;
  margin-top: 12px;
}

.workbench-meta div {
  background: transparent;
}

.overview-meta {
  justify-content: flex-start;
  margin: 16px 0 0;
}

.business-rules {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.74);
}

.business-rules summary {
  min-height: 32px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.business-rules ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.module-count {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 254, 250, 0.74);
  font-family: var(--font-num);
  font-size: 14px;
}

.function-nav {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 254, 250, 0.64);
  scrollbar-width: thin;
}

.function-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.function-tab:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.function-tab.active {
  color: var(--surface);
  background: var(--ink);
}

.function-layout {
  display: grid;
  gap: 16px;
}

.workbench {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(214, 215, 207, 0.84);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.workbench:has(.overview-hero) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workbench-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.workbench-heading {
  max-width: 790px;
}

.workbench-heading h2 {
  margin: 0 0 7px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
}

.workbench-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.workbench-actions,
.toolbar-actions,
.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.spec-details {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.spec-details summary {
  padding: 11px 14px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  list-style: none;
}

.spec-details summary::-webkit-details-marker {
  display: none;
}

.spec-details summary::before {
  display: inline-block;
  margin-right: 8px;
  color: var(--teal);
  content: "＋";
}

.spec-details[open] summary::before {
  content: "－";
}

.spec-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 32px 15px 38px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.kpi-card::after {
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 76px;
  height: 76px;
  border: 15px solid var(--teal-soft);
  border-radius: 50%;
  content: "";
}

.kpi-card.alert::after {
  border-color: var(--orange-soft);
}

.kpi-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.kpi-value {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-family: var(--font-num);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.kpi-value em {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
}

.kpi-foot {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
}

.kpi-alert-tag {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #8e3c37;
  background: var(--red-soft);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.overview-hero {
  position: relative;
  margin-bottom: 16px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  border-radius: var(--radius);
  color: #f7f6ef;
  background:
    linear-gradient(110deg, rgba(19, 35, 39, 0.98), rgba(31, 69, 70, 0.92)),
    var(--ink);
}

.overview-hero::before {
  position: absolute;
  right: -80px;
  bottom: -150px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(184, 222, 90, 0.3);
  border-radius: 50%;
  box-shadow:
    0 0 0 44px rgba(184, 222, 90, 0.025),
    0 0 0 88px rgba(184, 222, 90, 0.017);
  content: "";
}

.overview-hero h2 {
  position: relative;
  margin: 0 0 9px;
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 500;
}

.overview-hero p {
  position: relative;
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
}

.overview-stamp {
  position: absolute;
  top: 26px;
  right: 28px;
  display: grid;
  gap: 4px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  text-align: right;
}

.overview-stamp strong {
  color: var(--accent);
  font-family: var(--font-num);
}

.overview-count-link {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 800;
}

.overview-count-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.filter-bar .field {
  min-width: 130px;
}

.filter-bar .field select,
.filter-bar .field input {
  min-height: 35px;
  padding: 6px 9px;
  border-color: var(--line);
  font-size: 14px;
}

.search-field {
  position: relative;
  flex: 1 1 210px;
  max-width: 340px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  min-height: 35px;
  padding: 7px 10px 7px 33px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.filter-spacer {
  flex: 1;
}

.filter-summary {
  color: var(--muted);
  font-size: 14px;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  margin-top: 14px;
}

.overview-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 14px;
}

.overview-side {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.overview-matrix .matrix-cell {
  aspect-ratio: auto;
  min-height: 44px;
  height: 44px;
}

.panel {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.panel.flat {
  padding: 0;
  border: 0;
  background: transparent;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--line-strong);
}

.legend-dot.free { background: #dce5d8; }
.legend-dot.normal { background: #a9d3bf; }
.legend-dot.full { background: #f0c06e; }
.legend-dot.low { background: #d7cce9; }
.legend-dot.abnormal { background: #8f2f2a; }

.matrix-grid {
  display: grid;
  gap: 6px;
}

.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: 150px repeat(6, minmax(28px, 1fr));
  gap: 6px;
}

.matrix-head span {
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 14px;
  text-align: center;
}

.matrix-row-label {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.matrix-cell {
  position: relative;
  aspect-ratio: 1.55;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #dce5d8;
}

.matrix-cell:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.matrix-cell.normal { background: #a9d3bf; }
.matrix-cell.full { background: #f0c06e; }
.matrix-cell.low { background: #d7cce9; }
.matrix-cell.abnormal { background: #8f2f2a; }

.matrix-cell span {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  gap: 0;
  place-items: center;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.matrix-cell.abnormal span {
  color: #fff;
}

.matrix-cell small {
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
}

.trend-chart {
  position: relative;
  min-height: 260px;
  overflow-x: auto;
  overflow-y: hidden;
}

.trend-chart svg {
  width: 100%;
  min-width: 470px;
  height: auto;
  min-height: 250px;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-text {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
}

.chart-area {
  fill: url("#trendArea");
}

.chart-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--teal);
  stroke-width: 2;
  cursor: pointer;
}

.chart-bar {
  fill: var(--accent);
}

.chart-anomaly {
  fill: var(--orange);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-point:focus,
.chart-anomaly:focus,
.chart-bar:focus,
.trend-chart g:focus {
  outline: none;
  filter: drop-shadow(0 0 3px #064f45);
  stroke: #064f45;
  stroke-width: 4;
}

.chart-legend {
  margin-top: 10px;
}

.chart-data-table {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
}

.chart-data-table summary {
  min-height: 36px;
  color: var(--teal);
  font-weight: 800;
  cursor: pointer;
}

.chart-data-table table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 14px;
}

.chart-data-table th,
.chart-data-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}

.task-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
}

.priority-mark {
  width: 4px;
  height: 30px;
  border-radius: 99px;
  background: var(--line-strong);
}

.priority-mark.urgent { background: var(--red); }
.priority-mark.attention { background: var(--orange); }
.priority-mark.normal { background: var(--teal); }

.task-priority-label {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.task-main {
  min-width: 0;
}

.task-main strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.task-time {
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 14px;
  white-space: nowrap;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 11px;
  border-bottom: 1px solid #ecece5;
  color: var(--ink-soft);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: #fbfaf5;
}

.data-table td strong {
  color: var(--ink);
}

.data-table .numeric,
.data-table .num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table .actions-cell {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.data-table tbody tr[data-row-detail-action] {
  cursor: pointer;
}

.data-table tbody tr[data-row-detail-action]:focus-visible {
  outline: 3px solid #064f45;
  outline-offset: -3px;
  background: var(--surface-alt);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.65;
}

.badge.ok,
.badge.completed,
.badge.normal,
.badge.enabled,
.badge.pass,
.badge.closed {
  color: #225d3c;
  background: #e3f1e7;
}

.badge.warning,
.badge.pending,
.badge.partial,
.badge.attention,
.badge.observing {
  color: #9b5a1b;
  background: var(--orange-soft);
}

.badge.danger,
.badge.abnormal,
.badge.frozen,
.badge.rejected,
.badge.overdue {
  color: #983b36;
  background: var(--red-soft);
}

.badge.info,
.badge.processing,
.badge.review,
.badge.shipping {
  color: #35638b;
  background: var(--blue-soft);
}

.badge.purple {
  color: #67508e;
  background: var(--purple-soft);
}

.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
}

.progress-track {
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.progress span {
  width: 27px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 14px;
  text-align: right;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
}

.table-range {
  color: var(--muted);
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-button {
  min-width: 36px;
  min-height: 36px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
}

.page-button:hover {
  border-color: var(--line-strong);
}

.page-button.active {
  border-color: var(--ink);
  color: var(--surface);
  background: var(--ink);
}

.page-button[disabled] {
  opacity: 0.4;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.empty-symbol {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--teal);
  font-family: var(--font-num);
  font-size: 16px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.mini-stat {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-alt);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.mini-stat strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-num);
  font-size: 21px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.kanban-column {
  min-height: 310px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-alt);
}

.kanban-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.kanban-title span {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 99px;
  background: var(--paper-deep);
  font-family: var(--font-num);
  font-size: 14px;
}

.kanban-card {
  width: 100%;
  margin-bottom: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
}

.kanban-card:hover {
  border-color: var(--teal);
}

.kanban-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.kanban-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.kanban-card footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  padding: 4px 0;
}

.timeline::before {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 10px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  padding: 10px 0;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin: 4px 0 0 6px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.timeline-main strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.timeline-main span,
.timeline-time {
  color: var(--muted);
  font-size: 14px;
}

.mini-bars {
  display: grid;
  gap: 12px;
}

.mini-bar-row {
  display: grid;
  grid-template-columns: 92px minmax(100px, 1fr) 45px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.mini-bar-label {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.mini-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.mini-bar-value {
  color: var(--muted);
  font-family: var(--font-num);
  text-align: right;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(30px, 1fr));
  gap: 5px;
}

.heatmap-cell {
  position: relative;
  aspect-ratio: 1.25;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--teal) 18%, var(--surface));
}

.heatmap-cell[data-level="1"] { background: color-mix(in srgb, var(--teal) 14%, var(--surface)); }
.heatmap-cell[data-level="2"] { background: color-mix(in srgb, var(--teal) 28%, var(--surface)); }
.heatmap-cell[data-level="3"] { background: color-mix(in srgb, var(--teal) 42%, var(--surface)); }
.heatmap-cell[data-level="4"] { background: #3f7f72; }
.heatmap-cell[data-level="5"] { background: #1f5f54; }

.heatmap-cell:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.heatmap-cell span {
  display: grid;
  gap: 2px;
  place-items: center;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 800;
}

.heatmap-cell small {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
}

.heatmap-cell[data-level="4"],
.heatmap-cell[data-level="5"] {
  color: #fff;
}

.config-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.list-nav {
  display: grid;
  gap: 5px;
}

.list-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: left;
}

.list-nav button:hover,
.list-nav button.active {
  background: var(--surface-alt);
  color: var(--ink);
}

.list-nav button.active {
  font-weight: 800;
}

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

.detail-item {
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-alt);
}

.detail-item.wide {
  grid-column: 1 / -1;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
}

.detail-item strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.5;
}

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

.panel-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.attachment-list,
.activity-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-list li,
.activity-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.side-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(520px, 100vw);
  padding: 24px;
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(19, 35, 39, 0.16);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.side-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 22, 25, 0.36);
  backdrop-filter: blur(2px);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(10, 22, 25, 0.4);
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f5f5ef;
  background: rgba(19, 35, 39, 0.96);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.6;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: rgba(119, 44, 40, 0.97);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.locked-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 15px;
  padding: 11px 13px;
  border: 1px solid #e6d3b8;
  border-radius: 9px;
  color: #81531d;
  background: #fbf2e4;
  font-size: 14px;
  line-height: 1.6;
}

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

.form-grid .field-full {
  grid-column: 1 / -1;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat-strip .mini-stat {
  padding: 11px;
}

.stat-strip .mini-stat strong {
  font-size: 18px;
}

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

.role-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-alt);
}

.role-card strong {
  display: block;
  margin-bottom: 5px;
}

.role-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.subtle-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .overview-content-grid {
    grid-template-columns: 1fr;
  }

  .mini-stats,
  .stat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kanban {
    grid-template-columns: repeat(4, 210px);
  }
}

@media (max-width: 900px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .text-button,
  .page-button,
  .button-small,
  .overview-count-link,
  .matrix-cell,
  .connection-status {
    min-height: 44px;
  }

  .topbar {
    height: 62px;
  }

  .topbar-meta #systemDate {
    display: none;
  }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .list-nav {
    display: flex;
    overflow-x: auto;
  }

  .list-nav button {
    flex: 0 0 auto;
  }
}

@media (max-width: 680px) {
  .main-view {
    padding: 23px 14px 50px;
  }

  .text-button,
  .page-button,
  .button-small,
  .overview-count-link,
  .matrix-cell,
  .connection-status {
    min-height: 44px;
  }

  .topbar {
    padding: 0 14px;
  }

  .connection-status {
    display: inline-flex;
    justify-content: center;
    min-width: 44px;
  }

  .connection-status span {
    display: inline;
  }

  .page-header {
    display: grid;
    gap: 14px;
  }

  .workbench-header {
    display: grid;
    gap: 14px;
  }

  .workbench-actions {
    justify-content: flex-start;
  }

  .page-meta {
    justify-content: flex-start;
  }

  .kpi-grid,
  .mini-stats,
  .stat-strip,
  .form-grid,
  .detail-grid,
  .role-cards {
    grid-template-columns: 1fr;
  }

  .detail-item.wide,
  .form-grid .field-full {
    grid-column: auto;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-bar .field,
  .search-field {
    flex: 1 1 100%;
    max-width: none;
  }

  .overview-stamp {
    position: relative;
    top: auto;
    right: auto;
    width: fit-content;
    margin-top: 18px;
    text-align: left;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .side-panel {
    padding: 18px;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
  }

  .matrix-head,
  .matrix-row {
    grid-template-columns: 92px repeat(6, minmax(36px, 1fr));
    gap: 4px;
  }

  .overview-matrix .matrix-head,
  .overview-matrix .matrix-row {
    grid-template-columns: 92px repeat(2, minmax(30px, 1fr)) !important;
  }

  .overview-matrix .matrix-cell {
    min-height: 44px;
    height: 44px;
  }

  .heatmap {
    gap: 4px;
  }

  .trend-chart svg {
    min-width: 100%;
  }

  .chart-axis-text {
    font-size: 34px;
  }

  .chart-x-label[data-label-index="0"],
  .chart-x-label[data-label-index="2"],
  .chart-x-label[data-label-index="4"],
  .chart-x-label[data-label-index="6"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 16mm;
  }

  body {
    background: #fff;
    color: #111;
  }

  .sidebar,
  .topbar,
  .sidebar-backdrop,
  .drawer-backdrop,
  .toast-region,
  .workbench-actions,
  .function-nav,
  .filter-bar,
  .table-footer,
  .actions-cell,
  .chart-data-table,
  .side-panel .icon-button,
  .panel-footer {
    display: none !important;
  }

  .workspace {
    margin: 0;
  }

  .main-view {
    padding: 0;
  }

  .workbench,
  .panel,
  .data-table-wrap {
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .data-table {
    min-width: 0;
    width: 100%;
  }

  body:has(.side-panel.open) .workspace {
    display: none !important;
  }

  body:not(:has(.side-panel.open)) .side-panel {
    display: none !important;
  }

  .side-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    box-shadow: none;
    transform: none;
  }

  .panel-body {
    overflow: visible;
  }

  .detail-item {
    break-inside: avoid;
  }
}
