﻿:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #d8dee8;
  --primary: #2454e8;
  --primary-dark: #183fb8;
  --accent: #d97706;
  --ok: #16803c;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.login-screen {
  position: relative;
  overflow: auto;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background: #eef3f5;
}

.login-screen::before,
.login-screen::after {
  display: none;
}

.login-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 430px);
  gap: 0;
  width: min(960px, 100%);
  min-height: 560px;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid #d6e0e5;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(15, 46, 58, 0.12);
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 48px;
  color: #f5fbfc;
  background: #123f4e;
  border-radius: 13px 0 0 13px;
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand-lockup strong,
.login-brand-lockup span {
  display: block;
}

.login-brand-lockup strong {
  font-size: 18px;
  line-height: 1.2;
}

.login-brand-lockup span {
  margin-top: 5px;
  color: #b9d9e0;
  font-size: 12px;
}

.login-brand-body {
  max-width: 390px;
  margin: auto 0;
}

.login-brand-body .eyebrow {
  color: #f5d88f;
}

.login-brand-body h1 {
  margin: 14px 0 18px;
  color: #fff;
  font-size: 38px;
  line-height: 1.25;
}

.login-brand-body p:last-child {
  margin: 0;
  color: #c4e0e5;
  line-height: 1.8;
}

.login-brand-footer {
  color: #b9d9e0;
  font-size: 12px;
}

.login-story {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  min-height: 480px;
  padding: 36px;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(5, 28, 36, 0.88), rgba(15, 74, 89, 0.72)),
    rgba(9, 32, 40, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.login-story > * {
  position: relative;
  z-index: 1;
}

.login-story-top {
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-story h1 {
  margin: 0;
  font-size: 38px;
}

.login-story p {
  margin: 8px 0 0;
  color: #d8edf3;
}

.login-network {
  position: relative;
  height: 160px;
  margin: 28px 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(96, 191, 205, 0.12), transparent 60%);
  background-size:
    56px 56px,
    56px 56px,
    cover;
}

.network-node,
.truck-mark,
.data-pulse,
.route-line {
  position: absolute;
  display: block;
}

.network-node {
  width: 16px;
  height: 16px;
  border: 3px solid #f5d88f;
  border-radius: 50%;
  background: #113742;
  box-shadow: 0 0 0 8px rgba(245, 216, 143, 0.12);
}

.node-company { left: 8%; top: 62%; }
.node-hub { left: 36%; top: 34%; }
.node-carrier { right: 28%; top: 56%; }
.node-sign { right: 8%; top: 22%; }

.route-line {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245, 216, 143, 0.95), rgba(96, 191, 205, 0.9));
  transform-origin: left center;
}

.route-main { left: 9%; top: 70%; width: 28%; transform: rotate(-24deg); }
.route-alt { left: 38%; top: 42%; width: 34%; transform: rotate(18deg); }
.route-sync { right: 9%; top: 33%; width: 22%; transform: rotate(134deg); }

.truck-mark {
  width: 38px;
  height: 18px;
  border-radius: 4px 7px 4px 4px;
  background: #f5d88f;
  box-shadow:
    0 10px 0 -7px #0b2730,
    7px 15px 0 -11px #fff,
    28px 15px 0 -11px #fff;
}

.truck-mark::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 6px;
  content: "";
  background: #17366f;
  border-radius: 2px;
}

.truck-one { left: 25%; top: 45%; transform: rotate(-24deg); }
.truck-two { right: 18%; top: 42%; transform: rotate(22deg); }

.data-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6be3f2;
  box-shadow: 0 0 18px rgba(107, 227, 242, 0.88);
}

.pulse-one { left: 48%; top: 48%; }
.pulse-two { right: 13%; top: 29%; }

.flow-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.flow-node {
  min-height: 112px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.flow-node span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 28px;
  color: #17366f;
  background: #f5d88f;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.flow-node strong {
  display: block;
  margin-top: 12px;
  font-size: 17px;
}

.flow-node p {
  margin: 6px 0 0;
  color: #cfe4ea;
  line-height: 1.5;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.login-stats div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.login-stats strong,
.login-stats span {
  display: block;
}

.login-stats strong {
  font-size: 22px;
}

.login-stats span {
  margin-top: 4px;
  color: #cfe4ea;
  font-size: 12px;
}

.login-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
  padding: 52px 46px;
  background: #fff;
  border: 0;
  border-radius: 0 13px 13px 0;
  box-shadow: none;
  align-content: center;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-form-title h2 {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-form-title span {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.app-shell {
  --sidebar-width: 232px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: 54px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 72px;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 18px 10px;
  color: #eaf0ff;
  background: #172a55;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  z-index: 10;
}

.sidebar > .nav {
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
}

.sidebar-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 36px;
  margin-top: 10px;
  padding: 10px 8px 0;
  color: rgba(234, 240, 255, 0.68);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar-version-value {
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 600;
}

.app-shell.sidebar-collapsed .sidebar-version {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .sidebar-version-label {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-version-value {
  font-size: 10px;
}

.global-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding: 0 18px;
  color: #fff;
  background: #2454e8;
  box-shadow: 0 2px 8px rgba(20, 50, 120, 0.16);
  z-index: 20;
}

.global-brand,
.global-actions,
.global-context {
  display: flex;
  align-items: center;
}

.global-brand {
  gap: 10px;
  flex: 0 0 auto;
}

.global-brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #2454e8;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.global-brand-copy {
  display: grid;
  gap: 1px;
  white-space: nowrap;
}

.global-brand-copy strong {
  font-size: 16px;
}

.global-brand-copy span,
.global-context {
  font-size: 12px;
}

.global-context {
  gap: 10px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.92);
}

.global-context span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-actions {
  gap: 8px;
  margin-left: auto;
}

.global-action-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  color: #fff;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
}

.global-action-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.global-text-action {
  font-size: 12px;
}

.global-user {
  max-width: 210px;
  overflow: hidden;
  padding: 7px 10px;
  color: #17398f;
  background: #e7efff;
  border-radius: 6px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 46px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: #17366f;
  background: #f5d88f;
  border-radius: 8px;
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
}

.brand p {
  margin: 4px 0 0;
  color: #bdd1d8;
  font-size: 12px;
  white-space: nowrap;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: #eaf0ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.app-shell.sidebar-collapsed .sidebar-header {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding-bottom: 6px;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  width: 100%;
}

.app-shell.sidebar-collapsed .brand-copy {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  width: 42px;
  height: 42px;
  color: #17366f;
  background: #f5d88f;
  border-color: #f5d88f;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-group-toggle,
.nav-subitems button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: #dbe6ff;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  overflow: hidden;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.nav-group-toggle {
  color: #a9bce8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-group-toggle.current {
  color: #f5d88f;
}

.nav-group-toggle .nav-icon {
  color: currentColor;
  font-size: 16px;
}

.nav-chevron {
  margin-left: auto;
  color: #8fa8dc;
  font-size: 16px;
  transition: transform 0.16s ease;
}

.nav-group.expanded .nav-chevron {
  transform: rotate(180deg);
}

.nav-subitems {
  display: grid;
  gap: 2px;
  max-height: 400px;
  overflow: hidden;
  transition: max-height 0.18s ease, opacity 0.18s ease;
}

.nav-group.collapsed .nav-subitems {
  max-height: 0;
  opacity: 0;
}

.nav-subitems button {
  min-height: 38px;
  padding-left: 48px;
  color: #dbe6ff;
  font-size: 13px;
}

.nav-submarker {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #7894d0;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  font-size: 17px;
  font-weight: 800;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
}

.app-shell.sidebar-collapsed .nav button {
  justify-content: center;
  min-height: 46px;
  padding: 0;
}

.app-shell.sidebar-collapsed .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.app-shell.sidebar-collapsed .nav-label {
  display: none;
}

.app-shell.sidebar-collapsed .nav-group {
  gap: 0;
}

.app-shell.sidebar-collapsed .nav-group-toggle {
  min-height: 46px;
  padding: 0;
}

.app-shell.sidebar-collapsed .nav-group-toggle .nav-chevron,
.app-shell.sidebar-collapsed .nav-subitems {
  display: none;
}

.app-shell.sidebar-collapsed .nav-subitems button {
  padding: 0;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-subitems button.active {
  color: #17366f;
  background: #f5d88f;
  font-weight: 700;
}

.nav-subitems button.active .nav-submarker {
  background: #17366f;
}

.main {
  grid-column: 2;
  grid-row: 2;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 8px 16px 6px;
  overflow: hidden;
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 34px;
  margin: -2px 0 4px;
  padding: 0 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  max-width: 180px;
  min-height: 30px;
  padding: 0 10px;
  color: #52647e;
  background: #eaf0fb;
  border: 1px solid #d5dff2;
  border-radius: 5px 5px 0 0;
  font-size: 12px;
}

.page-tab:hover,
.page-tab.active {
  color: #17366f;
  background: #fff;
  border-color: #c6d3ee;
}

.page-tab.active {
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--primary);
}

.page-tab > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-tab-close {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #7b8aa5;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}

.page-tab-close:hover {
  color: #b42318;
  background: #f1d9d6;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.top-actions,
.toolbar,
.toolbar-left,
.dialog-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  min-height: 36px;
  padding: 8px 10px;
  color: #174151;
  background: #e3f3f7;
  border: 1px solid #c5e5ee;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.notification-wrap {
  position: relative;
}

.notification-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  color: #fff;
  background: #d85b4d;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf2f5;
  text-align: left;
}

.notification-item:hover,
.notification-item.unread {
  background: #f3fafc;
}

.notification-item-title {
  font-weight: 700;
}

.notification-item-message,
.notification-item-meta,
.notification-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-toast-stack {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 60;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.notification-toast-card {
  position: relative;
  overflow: hidden;
  display: flex;
  background: #fff;
  border: 1px solid #cfe2e8;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
  animation: notification-toast-in 0.22s ease-out;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.notification-toast-card.closing {
  opacity: 0;
  transform: translateX(18px);
}

.notification-toast-body {
  display: flex;
  flex: 1;
  gap: 10px;
  min-width: 0;
  padding: 13px 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

.notification-toast-icon {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.notification-toast-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notification-toast-copy strong,
.notification-toast-copy span,
.notification-toast-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-toast-copy span,
.notification-toast-copy small {
  color: var(--muted);
  font-size: 12px;
}

.notification-toast-close {
  position: absolute;
  top: 7px;
  right: 8px;
  z-index: 1;
  width: 22px;
  height: 22px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
}

@keyframes notification-toast-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

.notification-empty {
  margin: 0;
  padding: 24px 14px;
  text-align: center;
}

.toolbar {
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 4px;
}

#view-users > .user-admin-toolbar {
  min-height: 0;
  margin-bottom: 2px;
  padding: 0;
}

#view-users > .user-admin-toolbar .toolbar-left {
  display: none;
}

#view-users > .user-admin-tabs {
  margin-top: 0;
  margin-bottom: 4px;
}

.role-editor-page,
.user-editor-page {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.role-editor-page.hidden,
.user-editor-page.hidden {
  display: none;
}

.role-editor-page-header,
.user-editor-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.role-editor-page-header h3,
.user-editor-page-header h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

#roleEditorForm,
#userEditorForm {
  display: grid;
  gap: 14px;
}

.role-editor-basic-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) minmax(320px, 1fr);
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.role-editor-basic-grid label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.role-editor-basic-grid input {
  width: 100%;
  min-width: 0;
}

.user-editor-basic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.user-editor-basic-grid label {
  display: grid;
  grid-template-columns: minmax(64px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.user-editor-basic-grid input,
.user-editor-basic-grid select {
  width: 100%;
  min-width: 0;
}

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

.user-editor-scope-card {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.user-editor-scope-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.user-editor-scope-title strong {
  font-size: 15px;
}

.user-editor-scope-title span {
  color: var(--muted);
  font-size: 12px;
}

.user-editor-compact-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-editor-compact-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}

.user-editor-compact-option input {
  flex: 0 0 auto;
  width: auto;
  min-height: auto;
}

.user-editor-compact-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-editor-actions,
.user-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.section-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.section-tab {
  min-height: 34px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-weight: 700;
}

.section-tab:hover,
.section-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.role-admin-layout {
  display: block;
}

.toolbar > .toolbar-left {
  min-width: 0;
  flex: 1 1 auto;
}

.toolbar > .primary-button,
.toolbar > .ghost-button,
.toolbar > .top-actions {
  flex: 0 0 auto;
}

.toolbar .primary-button,
.toolbar .ghost-button,
.picking-toolbar .ghost-button {
  min-height: 32px;
}

/* ERP command-bar style for page-level actions. Row-level actions keep the button style below. */
.toolbar > .primary-button,
.toolbar > .ghost-button,
.toolbar .panel-actions > .primary-button,
.toolbar .panel-actions > .ghost-button,
.picking-toolbar > .ghost-button,
.picking-toolbar-actions > .ghost-button,
.task-filter-export-menu summary,
.task-filter-batch-button {
  min-height: 32px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
}

.toolbar > .primary-button:hover,
.toolbar > .ghost-button:hover,
.toolbar .panel-actions > .primary-button:hover,
.toolbar .panel-actions > .ghost-button:hover,
.picking-toolbar > .ghost-button:hover,
.picking-toolbar-actions > .ghost-button:hover,
.task-filter-export-menu summary:hover,
.task-filter-batch-button:hover:not(:disabled) {
  color: var(--primary-dark);
  background: #eef4ff;
}

.toolbar > .primary-button:not(:last-child),
.toolbar > .ghost-button:not(:last-child),
.picking-toolbar-actions > .ghost-button:not(:last-child) {
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.task-filter-batch-button:disabled {
  color: #94a3b8;
  background: transparent;
  border-color: transparent;
  opacity: 0.75;
}

.task-filter-batch-button {
  right: 86px;
}

.export-menu {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
}

.export-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  line-height: 1;
}

.export-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  opacity: 0.7;
}

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

.export-menu-items {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  gap: 5px;
  min-width: 150px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.export-menu-items .ghost-button {
  width: 100%;
  text-align: left;
}

.picking-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.export-fields-dialog {
  width: min(520px, calc(100vw - 32px));
}

.export-fields-body {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
}

.export-fields-actions {
  display: flex;
  gap: 8px;
}

.export-field-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  padding: 10px;
  overflow-y: auto;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.export-field-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}

.export-field-option input {
  flex: 0 0 auto;
}

.task-filter-panel {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.task-filter-export-menu {
  position: relative;
  flex: 0 0 auto;
}

.task-filter-batch-button {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
}

.task-filter-command-group {
  position: static;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 28px;
  gap: 0;
  margin-left: 2px;
}

.task-filter-export-menu summary {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
}

.task-filter-command-group ~ .task-filter-body {
  flex: 0 0 100%;
  width: 100%;
  padding-right: 10px;
}

.task-filter-summary {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 10px;
  width: auto;
  max-width: calc(100% - 230px);
  min-height: 28px;
  padding: 0 12px;
  overflow: hidden;
}

.task-filter-summary > span {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 800;
}

.task-filter-summary > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-filter-expand-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 12px;
}

.task-filter-expand-button:hover {
  background: #eef4ff;
}

.task-filter-metrics {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
  justify-self: end;
  margin: 0;
}

.task-filter-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 110px;
  min-height: 32px;
  padding: 3px 10px;
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.task-filter-metrics em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.task-filter-metrics b {
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
}

.task-filter-body {
  padding: 0 10px 8px;
}

.task-filter-body .toolbar {
  margin-bottom: 0;
}

.task-filter-panel.collapsed .task-filter-body {
  display: none;
}

.task-filter-panel + .task-tabbar {
  margin-top: 0;
}

.toolbar-left {
  flex-wrap: wrap;
}

.inline-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.inline-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inline-fields input {
  width: 140px;
}

.kingdee-pull-fields {
  width: 100%;
}

.toolbar-note {
  margin: 0;
  color: var(--muted);
}

/* Keep maintenance pages focused on filters and actions instead of a second framed header. */
.view:not(#view-tasks):not(#view-dashboard):not(#view-logs):not(#view-picking):not(#view-picking-history) > .toolbar {
  padding: 4px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.view:not(#view-tasks):not(#view-dashboard):not(#view-logs):not(#view-picking):not(#view-picking-history) > .toolbar .toolbar-note {
  display: none;
}

#view-picking > .panel > .panel-header,
#view-picking-history > .panel > .panel-header,
#view-picking-staff > .panel > .panel-header {
  display: none;
}

.primary-button,
.ghost-button,
.small-button,
.icon-button,
.link-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

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

.ghost-button,
.small-button,
.icon-button,
.link-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.small-button,
.link-button {
  min-height: 30px;
  padding: 0 10px;
}

#taskFilterPanel .task-filter-batch-button,
#taskFilterPanel .task-filter-export-menu summary {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
}

#taskFilterPanel .task-filter-export-menu summary {
  gap: 5px;
  font-size: 12px;
}

.link-button {
  color: var(--primary);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

input,
select,
textarea {
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #89b8c8;
  outline: 0;
}

input[type="search"] {
  width: min(460px, 42vw);
}

#taskProvinceFilter,
#taskCityFilter,
#taskDistrictFilter {
  width: 120px;
}

textarea {
  width: 100%;
  padding: 10px;
  line-height: 1.5;
  resize: vertical;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#appShell.task-detail-page .view {
  display: none;
}

#appShell.task-detail-page #taskDrawer.task-page-host {
  display: block;
  visibility: visible;
}

#taskDrawer[aria-hidden="true"] {
  display: none !important;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.metric-card {
  padding: 16px;
  text-align: left;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-card-button {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.summary-card-button:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(36, 84, 232, 0.12);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
}

.summary-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.platform-license-panel {
  max-width: 1080px;
}

.authorization-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 18px 20px;
  gap: 0 24px;
}

.authorization-detail {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.authorization-detail dt {
  color: var(--muted);
  font-size: 13px;
}

.authorization-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.log-filter-bar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.log-interface-filter {
  min-width: 220px;
}

.log-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.log-table-wrap table {
  min-width: 760px;
}

.log-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.log-error-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.table-pagination > span {
  flex: 1 1 160px;
}

.table-pagination label,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pagination select {
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
}

.sync-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 20px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.sync-status-strip span {
  white-space: nowrap;
}

.task-summary-panel {
  margin-bottom: 0;
}

.task-tabbar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 0 0 6px;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-self: start;
  margin: 0;
  padding: 0;
  background: transparent;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.dashboard-latest-panel {
  min-width: 0;
}

.dashboard-latest-panel .table-wrap {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.dashboard-latest-panel thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.view:not(#view-tasks):not(#view-dashboard):not(#view-logs):not(#view-picking):not(#view-picking-history) > .panel {
  min-width: 0;
}

.task-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.task-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: var(--primary);
  background: #e3f3f7;
  border: 1px solid #c5e5ee;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.task-tab.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(23, 107, 135, 0.18);
}

.task-tab.active .task-tab-count {
  color: var(--primary-dark);
  background: #f5d88f;
  border-color: #f5d88f;
}

.task-tab-pane {
  display: none;
}

.task-tab-pane.active {
  display: block;
}

.master-tabbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.master-tab {
  min-height: 34px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.master-tab:hover {
  color: var(--primary-dark);
  background: #fff;
}

.master-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.master-pane {
  display: block;
}

@media (min-width: 801px) {
  .app-shell {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .main {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .view.active {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  #view-tasks.view.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #view-tasks > .task-filter-panel,
  #view-tasks > .task-tabbar {
    flex: 0 0 auto;
  }

  #view-tasks > .task-tab-pane.active {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  #view-tasks > .task-tab-pane.active > .panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  #view-tasks > .task-tab-pane.active .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  #view-tasks > .task-tab-pane.active .panel-header,
  #view-tasks > .task-tab-pane.active .batch-bar,
  #view-tasks > .task-tab-pane.active .table-pagination {
    flex: 0 0 auto;
  }

  #view-picking.view.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #view-picking-history.view.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #view-tasks .task-filter-panel,
  #view-tasks .task-tabbar {
    flex: 0 0 auto;
  }

  #view-picking .picking-toolbar,
  #view-picking .picking-filter-panel,
  #view-picking .panel-header {
    flex: 0 0 auto;
  }

  #view-picking-history .picking-toolbar,
  #view-picking-history .picking-filter-panel,
  #view-picking-history .panel-header {
    flex: 0 0 auto;
  }

  #view-picking > .panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  #view-picking .picking-toolbar,
  #view-picking-history .picking-toolbar {
    min-height: 36px;
    margin-bottom: 6px;
  }

  #view-picking .picking-filter-panel,
  #view-picking-history .picking-filter-panel {
    margin-bottom: 6px;
    padding: 8px;
  }

  #view-picking-history > .panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  #view-tasks .task-tab-pane.active {
    flex: 1 1 auto;
    min-height: 0;
  }

  #view-tasks .task-tab-pane > .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  #view-tasks .batch-bar,
  #view-tasks .panel-header {
    flex: 0 0 auto;
  }

  #view-tasks .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  #view-picking .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  #view-picking-history .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  #view-picking-history .table-pagination {
    flex: 0 0 auto;
  }

  #view-logs.view.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #view-logs > .panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  #view-logs .panel-header,
  #view-logs .log-filter-bar,
  #view-logs .log-pagination {
    flex: 0 0 auto;
  }

  #view-tasks thead th {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  #view-picking thead th {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  #view-picking-history thead th {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}

@media (max-width: 1280px) {
  .task-tabbar {
    grid-template-columns: auto 1fr;
  }

  .task-filter-metrics {
    justify-content: center;
  }
}

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}

.batch-bar > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.batch-bar strong,
.batch-bar span {
  display: inline;
}

.batch-bar span {
  margin-left: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-col input {
  min-height: auto;
  width: 16px;
  height: 16px;
  padding: 0;
}

.history-mode .select-col {
  display: none;
}

.batch-dialog-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}

.batch-dialog-summary .summary-card {
  box-shadow: none;
}

.picking-toolbar {
  justify-content: space-between;
}

.picking-filter-panel {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.picking-filter-panel.collapsed {
  display: none;
}

.filter-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.compact-filter {
  min-width: 112px;
}

.multi-field {
  display: grid;
  gap: 6px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
}

.multi-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.multi-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}

.multi-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.danger-button {
  color: #b42318;
}

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

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

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

.picking-table {
  table-layout: fixed;
  min-width: 1080px;
}

.picking-history-table {
  min-width: 1220px;
}

.picking-record-col-index { width: 4%; }
.picking-record-col-bill { width: 10%; }
.picking-record-col-date { width: 7%; }
.picking-record-col-completed { width: 11%; }
.picking-record-col-completed-by { width: 8%; }
.picking-record-col-customer { width: 16%; }
.picking-record-col-destination { width: 13%; }
.picking-record-col-number { width: 5%; }
.picking-record-col-weight { width: 6%; }
.picking-record-col-marker { width: 8%; }
.picking-record-col-picker { width: 7%; }
.picking-record-col-type { width: 5%; }

.picking-col-index { width: 4%; }
.picking-col-bill { width: 10%; }
.picking-col-date { width: 8%; }
.picking-col-customer { width: 18%; }
.picking-col-destination { width: 14%; }
.picking-col-number { width: 5%; }
.picking-col-weight { width: 6%; }
.picking-col-marker { width: 9%; }
.picking-col-picker { width: 11%; }
.picking-col-action { width: 15%; }

.compact-table {
  min-width: 620px;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
}

th {
  color: #475569;
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 700;
}

td {
  color: #253142;
}

.number-cell,
.flag-cell {
  text-align: center;
}

.picking-bill-cell {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: nowrap;
}

.picking-customer-cell,
.picking-destination-cell {
  max-width: 220px;
  line-height: 1.45;
  word-break: break-word;
}

.picking-bill-cell,
.picking-customer-cell,
.picking-destination-cell {
  overflow-wrap: anywhere;
}

#view-tasks table,
.dashboard-latest-panel table {
  min-width: 0;
}

#view-tasks th,
#view-tasks td,
.dashboard-latest-panel th,
.dashboard-latest-panel td {
  padding-inline: 8px;
}

#view-tasks th:nth-child(2),
#view-tasks td:nth-child(2) {
  width: 112px;
}

#view-tasks th:nth-child(3),
#view-tasks td:nth-child(3) {
  width: 130px;
}

#view-tasks th:nth-child(5),
#view-tasks td:nth-child(5) {
  max-width: 190px;
}

.picking-picker-cell,
.picking-result-cell,
.picking-action-cell,
.picking-marker-cell {
  line-height: 1.45;
}

.picking-picker-cell strong,
.picking-picker-cell span,
.picking-result-cell span {
  display: block;
}

.picking-action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.marker-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 4px 4px 0;
  padding: 0 7px;
  color: #7c3d08;
  background: #fff4dc;
  border: 1px solid #f3d391;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

tr:hover td {
  background: #f8fbfc;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #174151;
  background: #dff1f6;
  border: 1px solid #c2e3ed;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.warn {
  color: #7c3d08;
  background: #fff4dc;
  border-color: #f3d391;
}

.status-pill.danger {
  color: #8b1c13;
  background: #ffe7e4;
  border-color: #ffc5be;
}

.status-pill.ok {
  color: #0f5f2e;
  background: #e4f7eb;
  border-color: #bfe8ce;
}

.status-list {
  display: grid;
  gap: 0;
}

.status-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.status-item:last-child {
  border-bottom: 0;
}

.status-item span {
  color: var(--muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.38);
}

.drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  z-index: 21;
  width: min(1440px, calc(100vw - 64px));
  height: min(92vh, 920px);
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #c9d3e0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  overflow-y: auto;
}

.drawer.is-dragging {
  opacity: 0.97;
  user-select: none;
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  cursor: move;
  user-select: none;
}

.drawer-menu-bar {
  position: sticky;
  top: 68px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.drawer-header-actions {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.drawer-menu-section {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-right: 9px;
  border-right: 1px solid var(--line);
  flex: 0 0 auto;
}

.drawer-menu-section > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.drawer-menu-section:last-child {
  border-right: 0;
}

.drawer-menu-more {
  position: relative;
  flex: 0 0 auto;
}

.drawer-menu-more summary {
  padding: 7px 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  list-style: none;
}

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

.drawer-menu-more-items {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  gap: 5px;
  min-width: 110px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.drawer-menu-button {
  min-height: 32px;
  padding: 6px 11px;
  white-space: nowrap;
  font-size: 13px;
}

.drawer-header h3 {
  margin: 3px 0 0;
  font-size: 19px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-content {
  padding: 20px 24px 32px;
}

.task-page-host {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0;
  width: auto;
  height: calc(100vh - 100px);
  max-height: none;
  transform: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-y: auto;
}

#appShell.task-detail-page .main {
  overflow: hidden;
}

.task-page-host .drawer-header {
  position: sticky;
  top: 0;
  min-height: 48px;
  justify-content: flex-end;
  padding: 5px 16px;
  cursor: default;
  user-select: text;
}

.task-page-host .drawer-menu-bar {
  position: sticky;
  top: 47px;
}

.task-document {
  max-width: none;
  margin: 0 auto;
  padding: 2px 0 18px;
}

.task-actions-section {
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.task-basic-info {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.task-basic-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.task-basic-info-grid .detail-item {
  display: grid;
  grid-template-columns: minmax(86px, 112px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 9px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

#taskDrawer .drawer-content {
  min-width: 0;
}

#taskDrawer .task-document,
#taskDrawer .task-basic-info,
#taskDrawer .task-basic-info-grid,
#taskDrawer .drawer-section,
#taskDrawer .inline-form {
  min-width: 0;
  max-width: 100%;
}

#taskDrawer .task-basic-info-grid .detail-item {
  min-width: 0;
}

.task-basic-info-grid .detail-item:nth-child(even) {
  border-right: 1px solid var(--line);
}

.task-basic-info-grid .detail-item:nth-child(4n) {
  border-right: 0;
}

.task-basic-info-grid .detail-item-wide {
  grid-column: span 2;
}

.task-basic-info-grid .detail-item-full {
  grid-column: 1 / -1;
}

.task-fields-form {
  grid-template-columns: 110px 210px 170px 150px max-content;
  align-items: end;
  justify-content: start;
}

.task-fields-form button {
  white-space: nowrap;
}

.task-form-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: max-content;
}

.task-form-actions button {
  min-height: 38px;
}

.task-flow-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line-strong, #b8c4d4);
}

.task-flow-tab {
  min-height: 36px;
  padding: 8px 14px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  font-size: 13px;
}

.task-flow-tab.active {
  color: var(--accent, #2457e6);
  background: #fff;
  border-color: var(--line-strong, #b8c4d4);
  font-weight: 700;
}

.task-flow-panel {
  display: none;
  margin-top: 14px;
}

.task-flow-panel.active {
  display: block;
}

.detail-item {
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.task-basic-info-grid .detail-item strong {
  margin-top: 0;
}

.drawer-section {
  margin-top: 18px;
}

.drawer-section h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inline-form label,
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

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

.inline-form button {
  justify-self: start;
}

#taskFieldsForm.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  align-items: end;
  justify-content: start;
}

#taskFieldsForm.inline-form label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  white-space: nowrap;
}

#taskFieldsForm.inline-form label input,
#taskFieldsForm.inline-form label select {
  flex: 0 0 auto;
}

#taskFieldsForm.inline-form label:nth-child(1) input {
  width: 110px;
}

#taskFieldsForm.inline-form label:nth-child(2) input {
  width: 210px;
}

#taskFieldsForm.inline-form label:nth-child(3) input {
  width: 170px;
}

#taskFieldsForm.inline-form label:nth-child(4) select {
  width: 150px;
}

#vehiclePlanForm.inline-form label {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

#vehiclePlanForm.inline-form {
  grid-template-columns: 300px 300px 300px 300px;
  align-items: end;
  justify-content: start;
}

#vehiclePlanForm .full {
  grid-column: 1 / -1;
  width: 100%;
}

dialog {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  cursor: move;
  user-select: none;
}

.dialog-header button,
.dialog-header input,
.dialog-header select,
.dialog-header textarea {
  cursor: pointer;
}

dialog.is-dragging {
  opacity: 0.96;
}

.dialog-header h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

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

.permission-manager {
  grid-column: 1 / -1;
  display: grid;
  gap: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.permission-manager-toolbar,
.permission-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.permission-manager-toolbar {
  min-height: 44px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
}

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

.permission-manager-actions input[type="search"] {
  width: 240px;
}

.permission-manager-toolbar strong {
  display: inline-block;
  margin: 0;
  font-size: 15px;
}

.permission-table-wrap {
  max-height: none;
  background: #fff;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.permission-catalog-wrap {
  max-height: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}

.permission-table {
  min-width: 900px;
}

.permission-table th,
.permission-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.permission-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.permission-table th:nth-child(1) { width: 110px; }
.permission-table th:nth-child(2) { width: 150px; }
.permission-table th:nth-child(3) { width: 180px; }
.permission-table th:nth-child(5) { width: 80px; }
.permission-table th:nth-child(6) { width: 76px; }

.permission-table code {
  color: #294a82;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.permission-risk {
  display: inline-flex;
  padding: 2px 7px;
  color: var(--muted);
  background: #eef2f7;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.permission-risk-high {
  color: #9a3412;
  background: #ffedd5;
}

.permission-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.permission-picker.hidden {
  display: none;
}

.permission-picker-toolbar {
  justify-content: flex-start;
}

.permission-picker-toolbar input[type="search"] {
  width: min(420px, 45vw);
}

.permission-picker-toolbar select {
  width: 160px;
}

.dialog-actions {
  justify-content: flex-end;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

#importDialog textarea {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-height: 320px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 420px;
  padding: 12px 14px;
  color: #fff;
  background: #1f2937;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

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

.hidden {
  display: none !important;
}

/* Responsive login layout. */
.login-screen {
  overflow: auto;
  min-height: 100vh;
  padding: 32px;
  background: #eef3f5;
}

.login-screen::before,
.login-screen::after {
  display: none;
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 430px);
  justify-content: stretch;
  width: min(960px, 100%);
  min-height: 560px;
  gap: 0;
  background: var(--surface);
  border: 1px solid #d6e0e5;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(15, 46, 58, 0.12);
}

.login-card {
  min-height: auto;
  padding: 52px 46px;
  background: #fff;
  border: 0;
  border-radius: 0 13px 13px 0;
  box-shadow: none;
}

.login-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-title-row > div:last-child {
  min-width: 0;
}

.login-title-row .brand-mark {
  flex: 0 0 42px;
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px;
  }

  .login-form-title h2 {
    font-size: 25px;
  }
}

.login-story,
.login-network,
.flow-board,
.login-stats {
  display: none;
}

@media (min-width: 801px) and (max-width: 1120px) {
  .login-hero {
    grid-template-columns: minmax(360px, 1fr) minmax(340px, 400px);
    width: min(900px, 100%);
  }

  .login-brand-panel {
    padding: 40px 34px;
  }

  .login-card {
    padding: 44px 34px;
  }
}

@media (max-width: 1120px) {
  .user-editor-basic-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .user-editor-scope-grid {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 320px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .authorization-details {
    grid-template-columns: 1fr;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .task-tabbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-filter-metrics {
    justify-content: flex-start;
    justify-self: start;
  }
}

@media (max-width: 800px) {
  .task-filter-summary {
    max-width: calc(100% - 16px);
  }

  .task-filter-command-group {
    flex: 0 0 100%;
    margin-left: 0;
    border-top: 1px solid var(--line);
  }

  .task-filter-command-group > * {
    flex: 1 1 auto;
  }

  .picking-toolbar-actions {
    margin-left: 0;
  }

  .export-field-options {
    grid-template-columns: 1fr;
  }

  .role-editor-page-header,
  .user-editor-page-header,
  .permission-manager-toolbar,
  .permission-picker-toolbar,
  .permission-manager-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .role-editor-basic-grid {
    grid-template-columns: 1fr;
  }

  .user-editor-basic-grid,
  .user-editor-scope-grid,
  .user-editor-compact-options {
    grid-template-columns: 1fr;
  }

  .role-editor-basic-grid label {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .user-editor-basic-grid label {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .permission-manager-actions input[type="search"],
  .permission-picker-toolbar input[type="search"],
  .permission-picker-toolbar select {
    width: 100%;
  }

  .permission-catalog-wrap {
    max-height: 260px;
  }

  .app-shell {
    --sidebar-width: auto;
    grid-template-columns: 1fr;
    grid-template-rows: 54px auto minmax(0, 1fr);
    min-height: 0;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: static;
    width: auto;
    height: auto;
  }

  .main {
    grid-column: 1;
    grid-row: 3;
    height: auto;
    min-height: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .global-topbar {
    gap: 10px;
    padding: 0 10px;
  }

  .global-brand-copy span,
  .global-context {
    display: none;
  }

  .global-brand-copy strong {
    font-size: 14px;
  }

  .global-actions {
    gap: 2px;
  }

  .global-text-action {
    padding-inline: 6px;
  }

  .global-user {
    max-width: 112px;
  }

  .sidebar-header {
    align-items: center;
  }

  .app-shell.sidebar-collapsed .brand {
    display: flex;
  }

  .app-shell.sidebar-collapsed .brand-copy {
    display: block;
  }

  .app-shell.sidebar-collapsed .sidebar-header {
    justify-content: space-between;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    width: 34px;
    height: 34px;
    color: #e7f6fa;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
  }

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

  .app-shell.sidebar-collapsed .nav-label {
    display: inline;
  }

  .app-shell.sidebar-collapsed .nav-group-toggle .nav-label {
    display: inline;
  }

  .app-shell.sidebar-collapsed .nav-group-toggle {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .app-shell.sidebar-collapsed .nav-subitems {
    display: grid;
  }

  .login-screen {
    padding: 16px;
  }

  .login-hero {
    display: block;
    width: min(430px, 100%);
    min-height: 0;
  }

  .login-brand-panel {
    display: none;
  }

  .login-card {
    padding: 36px 28px;
    border-radius: 13px;
  }

  .login-story {
    min-height: 0;
    padding: 22px;
  }

  .flow-board,
  .login-stats {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 6px 10px 12px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-left {
    width: 100%;
  }

  .notification-wrap {
    width: 100%;
  }

  .notification-button {
    width: 100%;
    justify-content: center;
  }

  .notification-panel {
    right: auto;
    left: 0;
    width: 100%;
  }

  .notification-toast-stack {
    top: calc(62px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    width: auto;
  }

  input[type="search"],
  select,
  .top-actions button,
  .toolbar button {
    width: 100%;
  }

  .global-topbar {
    padding-top: env(safe-area-inset-top);
    min-height: calc(54px + env(safe-area-inset-top));
  }

  .global-action-button,
  .sidebar-toggle,
  .small-button,
  .primary-button,
  .ghost-button {
    min-height: 40px;
  }

  .global-action-button {
    min-width: 40px;
  }

  .task-tab {
    min-height: 38px;
  }

  .metric-grid,
  .summary-grid,
  .batch-dialog-summary,
  .detail-grid,
  .inline-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  #taskDrawer .drawer-header {
    min-height: 48px;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 5px 12px;
    cursor: default;
  }

  #taskDrawer.task-page-host .drawer-header {
    cursor: move;
    user-select: none;
  }

  #taskDrawer.drawer {
    top: 0;
    left: auto;
    right: 0;
    width: 100vw;
    height: 100vh;
    transform: none;
    border: 0;
    border-radius: 0;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
  }

  #taskDrawer.task-page-host {
    position: fixed;
    top: 0;
    left: auto;
    right: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    transform: none;
    border: 0;
    border-radius: 0;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
  }

  #taskDrawer .drawer-header-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  #taskDrawer .drawer-menu-bar {
    top: 47px;
    padding-inline: 12px;
  }

  #taskDrawer.task-page-host .drawer-menu-bar {
    top: 47px;
  }

  #taskDrawer .drawer-menu-button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  #taskDrawer #closeDrawerButton {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
  }

  #taskDrawer .task-basic-info {
    padding: 8px;
  }

  #taskDrawer .task-basic-info-grid {
    grid-template-columns: 1fr;
  }

  #taskDrawer .task-basic-info-grid .detail-item-wide {
    grid-column: auto;
  }

  #taskDrawer .task-basic-info-grid .detail-item-full {
    grid-column: auto;
  }

  #taskDrawer #taskFieldsForm.inline-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }

  #taskDrawer #taskFieldsForm.inline-form label,
  #taskDrawer #taskFieldsForm.inline-form label:nth-child(1),
  #taskDrawer #taskFieldsForm.inline-form label:nth-child(2),
  #taskDrawer #taskFieldsForm.inline-form label:nth-child(3),
  #taskDrawer #taskFieldsForm.inline-form label:nth-child(4) {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    width: auto;
  }

  #taskDrawer #taskFieldsForm.inline-form input,
  #taskDrawer #taskFieldsForm.inline-form select,
  #taskDrawer #vehiclePlanForm.inline-form input,
  #taskDrawer #vehiclePlanForm.inline-form select {
    width: 100%;
    min-width: 0;
  }

  #taskDrawer #vehiclePlanForm.inline-form {
    grid-template-columns: 1fr;
  }

  #taskDrawer #taskFieldsForm.inline-form label,
  #taskDrawer #vehiclePlanForm.inline-form label {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  #taskDrawer .task-form-actions {
    justify-content: flex-start;
  }

  #taskDrawer .task-basic-info-grid .detail-item,
  #taskDrawer .task-basic-info-grid .detail-item:nth-child(even) {
    border-right: 0;
  }

  #taskDrawer .task-basic-info-grid .detail-item {
    grid-template-columns: minmax(86px, 112px) minmax(0, 1fr);
  }

  #taskDrawer .task-flow-tabs {
    overflow-x: auto;
    margin-inline: -12px;
    padding-inline: 12px;
  }

  #taskDrawer .task-flow-tab {
    flex: 0 0 auto;
    padding-inline: 11px;
    font-size: 12px;
  }
}

@media print {
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  #taskDrawer,
  #taskDrawer * {
    visibility: visible;
  }

  #taskDrawer {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    box-shadow: none;
  }

  #taskDrawer .drawer-header {
    position: static;
    padding: 0 0 12px;
    border-bottom: 0;
  }

  #taskDrawer .drawer-header > div:first-child,
  #taskDrawer .drawer-header-actions,
  #taskDrawer #closeDrawerButton,
  #taskDrawer .drawer-print-exclude,
  #taskDrawer .task-actions-section {
    display: none !important;
  }

  #taskDrawer .drawer-content {
    padding: 0;
  }

  #taskDrawer .task-document {
    max-width: none;
    padding: 0;
  }

  #taskDrawer .detail-item {
    background: #fff;
    border-color: #bbb;
  }

  #taskDrawer .drawer-section {
    break-inside: avoid;
  }

  #taskDrawer .task-flow-panel {
    display: block !important;
  }

  #taskDrawer .task-flow-tabs {
    display: none !important;
  }

  #taskDrawer .table-wrap {
    overflow: visible;
  }

  #taskDrawer table {
    width: 100%;
  }

  @page {
    size: A4;
    margin: 14mm;
  }
}
