:root {
  --red: #e01f4d;
  --red-dark: #b91438;
  --orange: #ee8f1f;
  --gold: #f5c400;
  --green: #4f8f11;
  --ink: #1f1e1c;
  --muted: #62605b;
  --soft: #8f8a82;
  --line: #eae8e4;
  --paper: #ffffff;
  --surface: #ffffff;
  --app: #fbfbfa;
  --danger-bg: #fff3f5;
  --warn-bg: #fff8df;
  --ok-bg: #f1f8ec;
  --shadow: 0 20px 50px rgba(31, 30, 28, 0.06);
  --font-display: "Barlow Semi Condensed", "DIN Next", "DIN Pro", Arial, sans-serif;
  --font-body: "Barlow", "DIN Next", "DIN Pro", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 1120px;
  background: var(--app);
  color: var(--ink);
  font-family: var(--font-body);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 251, 250, 0.96)),
    var(--app);
}

.login-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 24px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.login-form .primary-button {
  width: 100%;
}

.login-error {
  margin: 0;
  border: 1px solid #ffd1db;
  border-radius: 7px;
  background: var(--danger-bg);
  color: var(--red);
  padding: 11px 13px;
  font-weight: 700;
}

.demo-credentials {
  display: grid;
  gap: 5px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fff9db;
  color: #7a6100;
  padding: 12px 13px;
  font-size: 0.94rem;
}

.demo-credentials strong {
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 12px 20px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px 34px;
}

.brand-mark {
  width: 68px;
  height: 60px;
  object-fit: cover;
  object-position: left center;
}

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

.nav-spacer {
  flex: 1;
}

.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 8px;
  text-align: left;
  font-weight: 500;
  position: relative;
}

.nav button svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.nav button:hover {
  background: #fafafa;
}

.nav button.active {
  background: #f8f8f7;
  color: var(--red);
  font-weight: 600;
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 999px;
  background: var(--red);
}

.main {
  min-width: 0;
}

.topbar {
  height: 96px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 46px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.search {
  width: min(780px, 58vw);
  height: 58px;
  border: 1px solid #d8d5cf;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.search svg {
  width: 24px;
  height: 24px;
  color: var(--ink);
}

.search input {
  border: 0;
  outline: 0;
  width: 100%;
  color: var(--ink);
  font-size: 1.02rem;
}

.search input::placeholder {
  color: #8b8b96;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  position: relative;
}

.icon-button:hover {
  background: #f5f5f4;
}

.badge {
  position: absolute;
  top: -3px;
  right: -2px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.profile {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 6px 8px;
}

.profile:hover {
  background: #f5f5f4;
}

.avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edeae5;
  font-weight: 700;
}

.profile-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.content {
  padding: 38px 36px 48px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--soft);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: 2.05rem;
}

h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
}

h3 {
  font-size: 1.08rem;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border-radius: 7px;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  background: var(--red);
  color: #fff;
  box-shadow: 0 18px 30px rgba(224, 31, 77, 0.16);
}

.primary-button:hover {
  background: var(--red-dark);
}

.primary-button svg,
.secondary-button svg,
.ghost-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex: 0 0 auto;
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #cfcac2;
}

.ghost-button {
  background: transparent;
  color: var(--red);
}

.danger-button {
  background: var(--danger-bg);
  border-color: #ffd1db;
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 24px;
}

.overview-hero {
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 32px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(224, 31, 77, 0.08), rgba(245, 196, 0, 0.08)),
    #fff;
  box-shadow: var(--shadow);
}

.overview-hero h2 {
  font-size: 2.7rem;
  text-transform: none;
}

.overview-hero .subtitle {
  max-width: 650px;
  line-height: 1.5;
}

.hero-meter {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

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

.kpi-card {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.kpi-icon.danger {
  background: var(--danger-bg);
  color: var(--red);
}

.kpi-icon.warn {
  background: var(--warn-bg);
  color: #b46b00;
}

.kpi-icon.ok {
  background: var(--ok-bg);
  color: var(--green);
}

.kpi-icon.neutral {
  background: #f3f1ed;
  color: var(--ink);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-label {
  color: var(--muted);
  font-weight: 600;
}

.readiness {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
}

.readiness-item {
  min-height: 124px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}

.readiness-item:last-child {
  border-right: 0;
}

.module-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  text-align: left;
  align-self: start;
  width: 100%;
}

.module-label svg {
  width: 20px;
  height: 20px;
}

.ring {
  --pct: 50;
  --tone: var(--orange);
  width: 62px;
  height: 62px;
  border-radius: 999px;
  background: conic-gradient(var(--tone) calc(var(--pct) * 1%), #e8e5de 0);
  display: grid;
  place-items: center;
}

.ring.large {
  width: 116px;
  height: 116px;
}

.ring::before {
  content: attr(data-value);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
}

.ring.large::before {
  width: 94px;
  height: 94px;
  font-size: 1.72rem;
  font-weight: 700;
}

.status-text {
  color: var(--tone);
  font-weight: 600;
  font-size: 0.9rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.compact-panel {
  align-self: start;
  height: auto;
  max-height: none;
}

.compact-list .row {
  min-height: 48px;
  padding: 9px 14px;
  gap: 12px;
}

.important-list .row {
  min-height: 46px;
}

.critical-list .row {
  grid-template-columns: 32px minmax(0, 1fr) 18px;
}

.compact-list .round-icon {
  width: 32px;
  height: 32px;
}

.compact-list .mini-icon {
  width: 22px;
  height: 22px;
}

.compact-list .round-icon svg,
.compact-list .mini-icon svg {
  width: 17px;
  height: 17px;
}

.compact-list .row-sub {
  font-size: 0.86rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.list {
  overflow: hidden;
}

.row {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.row:first-child {
  border-top: 0;
}

.row.clickable:hover {
  background: #fbfbfa;
}

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

.row-title {
  font-weight: 600;
}

.row-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
  display: block;
}

.round-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #f4f3f1;
}

.round-icon svg,
.mini-icon svg,
.checkmark svg,
.ok-dot svg,
.side-head svg,
.icon-button svg,
.profile svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.round-icon.danger {
  background: var(--red);
  color: #fff;
}

.round-icon.warn {
  background: #f5a400;
  color: #fff;
}

.mini-icon {
  width: 25px;
  height: 25px;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
}

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

.progress-row {
  display: grid;
  grid-template-columns: auto 1fr 145px 42px;
}

.bar {
  height: 5px;
  border-radius: 999px;
  background: #ece9e4;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--pct);
  border-radius: inherit;
  background: var(--tone);
}

.module-track-list {
  display: grid;
  gap: 10px;
}

.module-track {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(140px, 240px) 48px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 14px 32px rgba(31, 30, 28, 0.04);
}

.module-track:hover {
  border-color: #d4d0c9;
  transform: translateY(-1px);
}

.module-track-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 14%, white);
  color: var(--tone);
}

.module-track-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.module-track-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.module-track-main strong {
  font-size: 1rem;
}

.module-track-main span {
  color: var(--muted);
  font-weight: 600;
}

.module-track > strong {
  justify-self: end;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.side-panel {
  padding: 24px 24px 20px;
}

.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.health {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.checkmark {
  width: 52px;
  height: 52px;
  border: 3px solid var(--green);
  color: var(--green);
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.side-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.side-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 700;
}

.person {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 15px;
}

.initials {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #edeae5;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.ok-dot {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
}

.link-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 104px;
  padding: 22px;
}

.folder {
  color: #edae00;
}

.folder svg {
  width: 54px;
  height: 54px;
  stroke-width: 1.7;
}

.side-link {
  min-height: 70px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.side-link:first-child {
  border-top: 0;
}

.side-link button {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: contents;
}

.footer-line {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  padding: 6px 10px 0;
}

.footer-line strong {
  color: var(--green);
  font-size: 1.12rem;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 26px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
}

.section-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
  color: var(--ink);
  text-align: left;
}

.section-card:hover {
  border-color: #d4d0c9;
  transform: translateY(-1px);
}

.section-card strong {
  display: block;
  font-size: 1.08rem;
}

.section-icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f7f7f6;
  color: var(--ink);
  flex: 0 0 auto;
}

.section-icon.small {
  width: 38px;
  height: 38px;
}

.section-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.section-meta {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(0, 1.08fr);
  gap: 26px;
  align-items: start;
}

.entry-form-panel {
  position: sticky;
  top: 120px;
}

.back-button {
  min-height: 34px;
  padding: 0;
  margin-bottom: 10px;
  color: var(--muted);
}

.back-button svg {
  transform: rotate(180deg);
}

.checkbox-line {
  align-items: center;
}

.entry-list {
  display: grid;
  gap: 14px;
}

.record-card {
  padding: 18px;
}

.record-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.record-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 16px 0;
}

.record-details div {
  min-width: 0;
}

.record-details dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.record-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.record-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.empty-state {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.module-menu {
  padding: 10px;
}

.module-menu button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  text-align: left;
}

.module-menu button.active {
  background: #f8f8f7;
  color: var(--red);
  font-weight: 700;
}

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

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

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

.field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.field input,
.field select,
.field textarea,
.file-input {
  width: 100%;
  border: 1px solid #d8d5cf;
  background: #fff;
  border-radius: 7px;
  padding: 12px 13px;
  color: var(--ink);
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus,
.file-input:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224, 31, 77, 0.1);
}

.file-input {
  min-height: 74px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.file-input input {
  display: none;
}

.file-input .round-icon {
  width: 36px;
  height: 36px;
}

.file-input strong {
  display: block;
  line-height: 1.12;
}

.file-input .secondary-button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 38px;
  margin-top: 2px;
}

.file-name {
  color: var(--muted);
  font-size: 0.9rem;
  display: block;
  margin-top: 3px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.chip.red {
  color: var(--red);
  border-color: #ffd1db;
  background: var(--danger-bg);
}

.chip.gold {
  color: #9a7b00;
  border-color: #fde68a;
  background: #fff9db;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 16px;
}

.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.doc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.doc-card small {
  color: var(--muted);
}

.security-note {
  border-left: 3px solid var(--red);
  background: #fff;
  padding: 15px 17px;
  border-radius: 6px;
  color: var(--muted);
}

.emergency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 26px;
}

.approval-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.flow-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  background: #fff;
  min-height: 132px;
}

.flow-step strong {
  display: block;
  margin: 10px 0 5px;
}

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

.approval-person {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.approval-person:last-child {
  border-bottom: 0;
}

.approval-person button {
  min-height: 36px;
  padding: 0 12px;
}

.vault {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.vault.locked {
  background: #fafafa;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.audit {
  max-height: 340px;
  overflow: auto;
}

.audit-event {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.audit-event:last-child {
  border-bottom: 0;
}

.audit-event time {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 3px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(31, 30, 28, 0.22);
  z-index: 20;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1250px) {
  body {
    min-width: 1000px;
  }

  .app-shell {
    grid-template-columns: 250px 1fr;
  }

  .dashboard-grid,
  .emergency-layout {
    grid-template-columns: 1fr;
  }

  .right-stack {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    padding-bottom: 82px;
  }

  .login-shell {
    min-height: 100svh;
    padding: 18px;
  }

  .login-panel {
    padding: 24px;
  }

  .app-shell {
    display: block;
    min-height: 100svh;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    height: auto;
    min-height: 74px;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    gap: 8px;
    box-shadow: 0 -12px 30px rgba(31, 30, 28, 0.08);
  }

  .brand,
  .nav-spacer {
    display: none;
  }

  .nav {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
  }

  .nav button {
    min-width: 88px;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    font-size: 0.72rem;
    line-height: 1.05;
    text-align: center;
  }

  .nav button svg {
    width: 20px;
    height: 20px;
  }

  .nav button.active::before {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 2px;
    width: auto;
    height: 3px;
  }

  .topbar {
    position: sticky;
    height: auto;
    min-height: 74px;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .search {
    width: 100%;
    height: 48px;
    padding: 0 12px;
  }

  .search svg {
    width: 20px;
    height: 20px;
  }

  .search input {
    font-size: 0.94rem;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .icon-button[title="Hilfe"] {
    display: none;
  }

  .profile {
    width: 44px;
    height: 48px;
    justify-content: center;
    padding: 0;
  }

  .profile-name,
  .profile svg {
    display: none;
  }

  .avatar {
    width: 38px;
    height: 38px;
  }

  .content {
    padding: 24px 14px 30px;
  }

  .page-head {
    display: grid;
    gap: 16px;
    align-items: start;
  }

  .page-head .primary-button,
  .page-head .secondary-button,
  .page-head .danger-button {
    width: 100%;
  }

  h1 {
    font-size: 1.72rem;
  }

  h2 {
    font-size: 1.06rem;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .dashboard-grid,
  .emergency-layout,
  .workspace,
  .entry-layout,
  .two-col,
  .right-stack {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .overview-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px;
  }

  .overview-hero h2 {
    font-size: 2.2rem;
  }

  .hero-meter {
    justify-items: start;
  }

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

  .kpi-card {
    min-height: 118px;
    padding: 16px;
  }

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

  .section-card {
    min-height: 108px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 16px;
  }

  .entry-form-panel {
    position: static;
  }

  .form-grid,
  .record-details {
    grid-template-columns: 1fr;
  }

  .module-track {
    min-height: 88px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .module-track .bar {
    grid-column: 2 / -1;
    width: 100%;
  }

  .module-track > strong {
    align-self: start;
  }

  .approval-flow {
    grid-template-columns: 1fr;
  }

  .approval-person {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .approval-person button,
  .approval-person .chip,
  .approval-person .ok-dot {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }

  .side-panel,
  .panel.pad {
    padding: 18px;
  }

  .link-card {
    min-height: 86px;
    padding: 18px;
  }

  .doc-card .secondary-button,
  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 46px;
  }

  .toast {
    right: 14px;
    left: 14px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (max-width: 520px) {
  .content {
    padding-inline: 12px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .top-actions {
    flex: 0 0 auto;
  }

  .kpi-grid {
    gap: 10px;
  }

  .kpi-card {
    min-height: 112px;
    padding: 14px;
  }

  .kpi-value {
    font-size: 1.7rem;
  }

  .row {
    min-height: 58px;
    padding: 12px 13px;
    gap: 11px;
  }

  .compact-list .row {
    grid-template-columns: 32px minmax(0, 1fr) 18px;
  }

  .important-list .row {
    grid-template-columns: 24px minmax(0, 1fr) 18px;
  }

  .section-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .section-card .section-meta {
    grid-column: 2;
    justify-self: start;
  }

  .toolbar {
    align-items: flex-start;
  }

  .chips {
    gap: 6px;
  }

  .chip {
    padding: 6px 9px;
    font-size: 0.82rem;
  }
}
