:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --panel-soft: #eef5ef;
  --ink: #1e2528;
  --muted: #617071;
  --line: #d8dfda;
  --accent: #0b6b5d;
  --accent-strong: #094d43;
  --warn: #b55d13;
  --danger: #b3261e;
  --blue: #22577a;
  --shadow: 0 18px 50px rgba(24, 37, 34, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

@keyframes loading-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.mobile-appbar {
  display: none;
}

.to-top-button {
  display: none;
}

.is-auth-start .nav,
.is-auth-start .tenant-box,
.is-auth-start .topbar-actions {
  display: none;
}

.sidebar {
  background: #1f302e;
  color: #f8fbf8;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #d8ead5;
  color: #19312b;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span:not(.brand-mark) {
  color: #c5d2cc;
  font-size: 0.88rem;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  text-align: left;
  color: #dbe5df;
  background: transparent;
}

.nav-item:hover,
.nav-item.is-active {
  background: #314743;
  color: #ffffff;
}

.tenant-box {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  min-width: 0;
}

.language-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.language-box span {
  color: #b8c7c0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.language-switch button {
  min-height: 36px;
  border: 1px solid #49625d;
  border-radius: 8px;
  background: transparent;
  color: #dbe5df;
  font-weight: 800;
}

.language-switch button.is-active,
.language-switch button:hover {
  background: #d8ead5;
  color: #19312b;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tenant-box label {
  color: #b8c7c0;
}

.tenant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 8px;
  min-width: 0;
}

.tenant-meta {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  color: #b8c7c0;
  font-size: 0.78rem;
}

.tenant-meta strong {
  color: #ffffff;
  font-size: 0.82rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.workspace {
  position: relative;
  min-width: 0;
  padding: 24px;
}

.view {
  position: relative;
}

.is-loading .workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(246, 247, 243, 0.92), rgba(238, 245, 239, 0.88), rgba(255, 255, 255, 0.82)),
    linear-gradient(90deg, rgba(11, 107, 93, 0.08), rgba(34, 87, 122, 0.08), rgba(11, 107, 93, 0.08));
  background-size: 100% 100%, 240% 100%;
  animation: loading-shimmer 1.3s ease-in-out infinite alternate;
}

.is-loading .view {
  min-height: 260px;
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(110deg, rgba(216, 223, 218, 0.7), rgba(238, 245, 239, 0.7)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.is-loading .view::before,
.is-loading .view::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  z-index: 3;
  border-radius: 8px;
  background: linear-gradient(90deg, #e4ebe5, #f7faf6, #e4ebe5);
  background-size: 220% 100%;
  animation: loading-shimmer 1.1s ease-in-out infinite alternate;
}

.is-loading .view::before {
  top: 128px;
  height: 92px;
}

.is-loading .view::after {
  top: 240px;
  height: 38px;
  right: 46%;
}

@media (prefers-reduced-motion: reduce) {
  .is-loading .workspace::before,
  .is-loading .view::before,
  .is-loading .view::after {
    animation: none;
  }
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0;
}

h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.topbar-actions,
.row-actions,
.dialog-actions,
.toolbar-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  position: relative;
  display: block;
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.user-menu summary::before,
.user-menu summary::after {
  content: "";
  position: absolute;
  left: 50%;
  background: currentColor;
  transform: translateX(-50%);
}

.user-menu summary::before {
  top: 10px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.user-menu summary::after {
  bottom: 9px;
  width: 20px;
  height: 10px;
  border-radius: 999px 999px 4px 4px;
}

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

.user-menu[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(11, 107, 93, 0.12);
}

.user-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(280px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.tenant-user-menu .user-card {
  left: auto;
  right: 0;
  top: calc(100% + 8px);
  width: min(260px, calc(100vw - 28px));
}

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

.user-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.user-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.user-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.user-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.user-card dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.logout-button {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}

.primary-button,
.ghost-button,
.icon-button,
.danger-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

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

.danger-button {
  background: #fff4f2;
  border-color: #f0c5c0;
  color: var(--danger);
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
  font-size: 1.05rem;
}

.sidebar .icon-button {
  background: #314743;
  border-color: #49625d;
  color: #ffffff;
}

.message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  background: #e9f3f0;
  color: var(--accent-strong);
  border: 1px solid #bddbd4;
}

.message-close {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.message.is-error {
  background: #fff2ef;
  color: var(--danger);
  border-color: #f0c5c0;
}

.auth-start {
  max-width: 840px;
  display: grid;
  gap: 24px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 107, 93, 0.08), rgba(34, 87, 122, 0.07)),
    #ffffff;
  box-shadow: var(--shadow);
}

.auth-start-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #1f302e;
  color: #ffffff;
  font-weight: 900;
}

.auth-start h2 {
  max-width: 680px;
  font-size: 2rem;
}

.auth-start p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-start-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-start-steps div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.auth-start-steps span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-start-steps strong {
  display: block;
  margin-bottom: 6px;
}

.auth-start-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.auth-request-form {
  min-width: min(100%, 420px);
}

.auth-request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.auth-request-row .primary-button {
  white-space: nowrap;
}

.auth-request-result {
  padding: 16px;
  border: 1px solid #bddbd4;
  border-radius: 8px;
  background: rgba(233, 243, 240, 0.92);
}

.auth-request-result dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.auth-request-result dl div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
}

.auth-request-result dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-request-result dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-close {
  flex: 0 0 auto;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.toolbar input {
  max-width: 360px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.sort-control select {
  width: auto;
  min-width: 150px;
}

.segmented {
  display: flex;
  background: #e9eee9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  max-width: 100%;
  overflow-x: auto;
}

.segmented button {
  border: 0;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

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

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

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  background: #f9faf8;
}

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

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-row.is-selected {
  background: #f0f6f2;
}

.clickable-row:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.8rem;
  font-weight: 800;
  background: #eef1ee;
  color: var(--muted);
}

.pill.available,
.pill.returned {
  background: #dff1df;
  color: #285c29;
}

.pill.rented,
.pill.active {
  background: #e1edf7;
  color: var(--blue);
}

.pill.paused {
  background: #fff7d8;
  color: #72570d;
}

.pill.archived {
  background: #eeeeee;
  color: #555555;
}

.pill.disabled {
  background: #eeeeee;
  color: #555555;
}

.pill.overdue {
  background: #fff0da;
  color: var(--warn);
}

.pill.role-none,
.pill.profile-basic {
  background: #eeeeee;
  color: #555555;
}

.pill.role-reader,
.pill.profile-full {
  background: #e1edf7;
  color: var(--blue);
}

.pill.role-operator,
.pill.role-admin {
  background: #dff1df;
  color: #285c29;
}

.pill.role-platform_admin {
  background: #ffe9d7;
  color: #8a4612;
}

.pill.service-ok {
  background: #e1edf7;
  color: var(--blue);
}

.pill.service-due_soon {
  background: #fff7d8;
  color: #72570d;
}

.pill.service-overdue {
  background: #fff0da;
  color: var(--warn);
}

.pill.condition-good {
  background: #dff1df;
  color: #285c29;
}

.pill.condition-watch {
  background: #fff7d8;
  color: #72570d;
}

.pill.condition-needs_service,
.pill.condition-in_service {
  background: #fff0da;
  color: var(--warn);
}

.pill.condition-retired {
  background: #eeeeee;
  color: #555555;
}

.history-service {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.attention-stack {
  display: grid;
  gap: 12px;
}

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

.attention-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.attention-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  align-items: start;
}

.detail-panel {
  position: sticky;
  top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.detail-list div {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 4px 0 0;
}

.journey {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
}

.journey::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.journey-stop {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
}

.journey-stop.is-selected > div:last-child {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, #ffffff);
}

.journey-marker {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--line);
}

.journey-stop.condition-watch .journey-marker,
.journey-stop.overdue .journey-marker,
.journey-stop.reader .journey-marker {
  background: var(--warn);
}

.journey-stop.condition-needs_service .journey-marker,
.journey-stop.condition-in_service .journey-marker,
.journey-stop.operator .journey-marker,
.journey-stop.admin .journey-marker {
  background: var(--danger);
}

.journey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.journey-stop p {
  margin: 6px 0 0;
}

.empty.compact {
  min-height: 72px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.record-dialog {
  width: min(720px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.record-dialog::backdrop {
  background: rgba(22, 30, 31, 0.45);
}

.record-dialog form {
  padding: 18px;
}

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

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

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

.tenant-role-field {
  display: grid;
  gap: 10px;
}

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

.tenant-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) 42px;
  gap: 8px;
  align-items: center;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 16px;
    gap: 14px;
  }

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

  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    text-align: center;
    white-space: nowrap;
  }

  .tenant-box {
    margin-top: 0;
  }

  .stats-grid,
  .content-grid,
  .split-view,
  .auth-start-steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .mobile-appbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 7px 10px;
    background: #1f302e;
    color: #f8fbf8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: inherit;
    font-weight: 800;
    text-decoration: none;
  }

  .mobile-brand .brand-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }

  .mobile-brand span:not(.brand-mark) {
    overflow: hidden;
    color: #dbe5df;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid #49625d;
    border-radius: 8px;
    color: #f8fbf8;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
  }

  .mobile-appbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .mobile-user-menu {
    display: block;
  }

  .mobile-user-menu summary {
    width: 34px;
    min-height: 34px;
    border-color: #49625d;
    background: transparent;
    color: #f8fbf8;
  }

  .mobile-user-menu summary::before {
    top: 8px;
    width: 9px;
    height: 9px;
  }

  .mobile-user-menu summary::after {
    bottom: 8px;
    width: 18px;
    height: 9px;
  }

  .mobile-user-menu .user-card {
    right: 0;
    left: auto;
    color: var(--ink);
  }

  .sidebar {
    position: static;
    padding: 12px;
    gap: 8px;
  }

  .tenant-user-menu {
    display: none;
  }

  .sidebar > .brand {
    display: none;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 0.9rem;
  }

  .brand span:not(.brand-mark) {
    display: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-item {
    width: 100%;
    min-height: 32px;
    padding: 0 6px;
    font-size: 0.82rem;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
  }

  .tenant-box {
    padding-top: 8px;
  }

  .language-box {
    gap: 4px;
  }

  .language-box > span {
    display: none;
  }

  .language-switch button {
    min-height: 30px;
    font-size: 0.82rem;
  }

  .workspace {
    padding: 14px 12px 24px;
  }

  .topbar,
  .panel-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 10px;
    margin-bottom: 12px;
  }

  h1 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .topbar-actions,
  .row-actions,
  .dialog-actions,
  .toolbar-actions {
    width: 100%;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(5, 36px);
    justify-content: end;
    gap: 6px;
    width: auto;
  }

  .topbar-actions .utility-action {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    font-size: 0;
  }

  .topbar-actions .utility-action::before {
    content: attr(data-icon);
    font-size: 1rem;
    line-height: 1;
  }

  .topbar-actions > .primary-button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 38px;
    font-size: 0.95rem;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    flex: 1;
    width: 100%;
  }

  .icon-button {
    min-width: 42px;
    width: 42px;
    flex: 0 0 42px;
  }

  .to-top-button {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 25;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(24, 37, 34, 0.24);
  }

  .toolbar {
    gap: 10px;
  }

  .toolbar input,
  .toolbar select,
  .sort-control,
  .sort-control select {
    width: 100%;
    max-width: none;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 0 0 auto;
  }

  .panel {
    padding: 12px;
  }

  .panel-actions {
    justify-content: stretch;
    width: 100%;
  }

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

  .language-switch {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid,
  .content-grid,
  .split-view,
  .auth-start-steps,
  .tenant-role-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-start {
    padding: 22px;
  }

  .auth-request-row {
    grid-template-columns: 1fr;
  }

  .auth-request-row .primary-button {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 42px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

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

  td:empty {
    display: none;
  }

  td .row-actions {
    justify-content: stretch;
  }

  .detail-panel {
    position: static;
  }

  .record-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    margin: 0;
  }

  .record-dialog form {
    min-height: 100dvh;
    padding: 14px;
    overflow-y: auto;
  }

  .field.full {
    grid-column: auto;
  }
}
