:root {
  --color-primary: #0082c9;
  --color-primary-hover: #00679e;
  --color-primary-soft: #eaf4fb;
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-surface-alt: #f9fafb;
  --color-border: #d8dee6;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-text-inverse: #ffffff;
  --color-danger: #dc2626;
  --color-danger-soft: #fdecec;
  --color-shadow: rgba(17, 24, 39, 0.08);
  --color-sidebar-bg: #0082c9;
  --color-topbar-bg: #0082c9;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px var(--color-shadow);
  --shadow-md: 0 4px 14px var(--color-shadow);
  --topbar-height: 72px;
  --sidebar-width: 260px;
  --font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--color-bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

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

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--color-primary);
}

.login-card {
  width: min(450px, 100%);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.login-logo {
  display: block;
  width: auto;
  max-width: 225px;
  height: auto;
  margin: 0 auto var(--space-4);
}

.login-card h1 {
  margin-bottom: var(--space-5);
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.login-form label {
  font-weight: 600;
}

.form-error {
  margin-bottom: var(--space-1);
  padding: var(--space-3);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--radius-md);
  color: #b91c1c;
  background: var(--color-danger-soft);
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: #fff;
}

.login-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 130, 201, 0.14);
}

.login-form button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-2);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-inverse);
  background: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--color-primary-hover);
}

.copyright {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  background: var(--color-bg);
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--color-text-inverse);
  background: var(--color-topbar-bg);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text-inverse);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}

.brand img {
  width: 120px;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.language-menu {
  position: relative;
}

.language-menu summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: var(--color-text-inverse);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

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

.language-menu summary::after {
  content: "";
  display: inline-block;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.language-menu[open] summary::after {
  transform: rotate(180deg);
}

.language-dropdown {
  min-width: 104px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1010;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.language-dropdown button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: transparent;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.language-dropdown button:hover,
.language-dropdown button:focus {
  outline: none;
  background: var(--color-surface-alt);
}

.notification-pill {
  min-width: 40px;
  min-height: 40px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: var(--color-text-inverse);
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.notification-pill strong {
  min-width: 20px;
  height: 20px;
  position: absolute;
  top: -4px;
  right: -5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--color-danger);
  font-size: 12px;
  line-height: 1;
}

.user-menu {
  min-width: 180px;
  position: relative;
}

.user-menu summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: var(--color-surface);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-sm);
}

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

.user-menu summary::after {
  content: "";
  display: inline-block;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.user-menu[open] summary::after {
  transform: rotate(180deg);
}

.user-dropdown {
  min-width: 200px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1010;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.user-dropdown a,
.user-dropdown button {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.user-dropdown a:hover,
.user-dropdown a:focus,
.user-dropdown button:hover,
.user-dropdown button:focus {
  outline: none;
  background: var(--color-surface-alt);
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-6) var(--space-4);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--color-sidebar-bg);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 100%;
}

.sidebar a,
.nav-group summary {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 600;
}

.sidebar a:hover,
.sidebar a.active,
.nav-group summary:hover,
.nav-group summary.active {
  color: var(--color-text-inverse);
  background: rgba(255, 255, 255, 0.16);
}

.nav-group summary {
  cursor: pointer;
  list-style: none;
  font-family: inherit;
  font-size: inherit;
  border: 0;
  background: transparent;
}

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

.nav-group summary::after {
  content: ">";
  float: right;
  font-size: 0.78rem;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.nav-group[open] summary::after {
  transform: rotate(-90deg);
}

.nav-group__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-1);
  padding-left: var(--space-3);
}

.nav-group__items a {
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-spacer {
  flex: 1;
  min-height: var(--space-8);
}

.dashboard-main {
  min-width: 0;
  margin-top: var(--topbar-height);
  margin-left: var(--sidebar-width);
  padding: var(--space-6);
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dashboard-head h1 {
  margin-bottom: var(--space-2);
}

.dashboard-head p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.workspace {
  min-height: calc(100vh - var(--topbar-height) - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.workspace-content {
  width: min(100%, 620px);
  text-align: center;
}

.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
  align-self: stretch;
}

.dashboard-process-grid {
  width: min(100%, 900px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: var(--space-6);
}

.dashboard-process-card {
  position: relative;
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px var(--space-8) var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-process-card__title {
  position: absolute;
  top: var(--space-5);
  left: var(--space-5);
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.dashboard-process-card__body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  width: 100%;
}

.dashboard-process-card:hover,
.dashboard-process-card:focus-visible {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  outline: none;
}

.dashboard-process-card img {
  width: 138px;
  height: 138px;
  object-fit: contain;
  flex: 0 0 auto;
}

.dashboard-process-card strong {
  min-width: 86px;
  color: var(--color-primary);
  font-size: 70px;
  line-height: 1;
  text-align: right;
  font-weight: 800;
}

.dashboard-process-card strong span {
  color: var(--color-success);
  font-size: .58em;
}

.data-panel {
  width: 100%;
  align-self: stretch;
}

.data-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.data-panel__header h2,
.data-panel__header p {
  margin-bottom: 0;
}

.data-panel__header p {
  color: var(--color-text-muted);
  font-weight: 600;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.btn,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn--primary,
.button-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn--primary:hover,
.btn--primary:focus,
.button-primary:hover,
.button-primary:focus {
  background: var(--color-primary-hover);
}

.btn:disabled,
.button-primary:disabled,
.button-secondary:disabled {
  background: #edf1f5;
  border-color: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.btn:disabled:hover,
.btn:disabled:focus,
.button-primary:disabled:hover,
.button-primary:disabled:focus,
.button-secondary:disabled:hover,
.button-secondary:disabled:focus {
  background: #edf1f5;
  color: var(--color-text-muted);
}

.btn--secondary,
.button-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
}

.btn--danger {
  background: var(--color-danger);
  color: var(--color-text-inverse);
}

.btn--small {
  min-height: 32px;
  padding: 0 var(--space-3);
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.icon-button {
  min-width: 40px;
  min-height: 40px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-inverse);
  cursor: pointer;
}

.icon-button--light {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.flash-message {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 700;
}

.flash-message--success {
  border-color: rgba(22, 163, 74, 0.28);
  color: #166534;
  background: #ecfdf3;
}

.flash-message--error {
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
  background: var(--color-danger-soft);
}

.flash-message--warning {
  border-color: rgba(217, 119, 6, 0.28);
  color: #92400e;
  background: #fff7ed;
}

.credential-copy-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.credential-copy-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  max-width: 560px;
}

.credential-copy-row span {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}

.credential-copy-row code {
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-copy-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 4px;
  background: #ffffff;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.credential-copy-button:hover,
.credential-copy-button:focus-visible {
  border-color: rgba(22, 163, 74, 0.5);
  background: #f8fffb;
  outline: 0;
}

.detail-grid__full {
  grid-column: 1 / -1;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.data-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.data-table th {
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.data-table tbody tr.data-table__row--warning td {
  background: #fff4e6;
}

.data-table tbody tr.data-table__row--info td {
  background: #eaf4ff;
}

.data-table tbody tr.data-table__row--warning.data-table__row--info td {
  background: #fff4e6;
}

.data-table tbody tr.data-table__row--leadership-risk td {
  border-top: 2px solid #dc2626;
  border-bottom: 2px solid #dc2626;
}

.data-table tbody tr.data-table__row--leadership-risk td:first-child {
  border-left: 2px solid #dc2626;
}

.data-table tbody tr.data-table__row--leadership-risk td:last-child {
  border-right: 2px solid #dc2626;
}

.data-table tbody tr.data-table__row--success td {
  background: #ecfdf3;
}

.data-table tbody tr.data-table__row--danger td {
  background: #fdecec;
}

.notification-inbox__layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: stretch;
}

.notification-inbox__list-panel,
.notification-inbox__detail {
  min-height: 520px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.notification-inbox__list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notification-inbox__list {
  overflow: auto;
  flex: 1;
}

.notification-list-item {
  display: block;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.notification-list-item:hover,
.notification-list-item:focus,
.notification-list-item.active {
  background: var(--color-primary-soft);
}

.notification-list-item strong,
.notification-list-item span {
  display: block;
}

.notification-list-item strong {
  margin-bottom: var(--space-2);
}

.notification-list-item span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.notification-list-item--unread strong::before {
  content: "";
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: var(--space-2);
  border-radius: 999px;
  background: var(--color-danger);
  vertical-align: middle;
}

.notification-inbox__detail {
  padding: var(--space-6);
}

.notification-inbox__detail header {
  margin-bottom: var(--space-5);
}

.notification-inbox__detail header p {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-weight: 700;
}

.notification-inbox__detail h3 {
  margin-bottom: 0;
}

.notification-body p {
  margin-bottom: var(--space-3);
}

.notification-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 700;
}

.notification-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  text-decoration: none;
  background: var(--color-surface);
}

.notification-pagination__button:hover,
.notification-pagination__button:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.notification-pagination__button.disabled {
  pointer-events: none;
  opacity: 0.35;
}

.sort-link {
  color: inherit;
  text-decoration: none;
}

.sort-link:hover,
.sort-link:focus {
  color: var(--color-primary);
}

.table-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
  gap: var(--space-3);
  align-items: end;
  margin: 0 0 var(--space-4);
}

.table-filter label {
  display: grid;
  gap: var(--space-1);
  font-weight: 700;
}

.table-filter label span {
  color: var(--color-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.table-filter input,
.table-filter select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  padding: 0 var(--space-3);
}

.table-filter input:focus,
.table-filter select:focus {
  outline: 2px solid rgba(0, 130, 201, 0.22);
  border-color: var(--color-primary);
}

.table-link {
  color: inherit;
  text-decoration: none;
}

.table-link:hover,
.table-link:focus {
  color: var(--color-primary);
}

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

.data-table td strong,
.data-table td span {
  display: block;
}

.data-table td span {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.data-table--compact {
  min-width: 760px;
}

.audit-log-table {
  min-width: 1120px;
}

.audit-log-table__metadata {
  max-width: 420px;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  color: var(--color-text);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.table-scroll--checklist {
  overflow-x: visible;
}

.data-table--checklist {
  min-width: 0;
  table-layout: fixed;
}

.data-table--checklist th:first-child,
.data-table--checklist td:first-child {
  width: 52px;
}

.data-table--checklist th:nth-child(2),
.data-table--checklist td:nth-child(2) {
  width: 30%;
}

.data-table--checklist th:nth-child(3),
.data-table--checklist td:nth-child(3) {
  width: 16%;
}

.data-table--checklist th:nth-child(4),
.data-table--checklist td:nth-child(4) {
  width: 28%;
}

.data-table--checklist th:nth-child(5),
.data-table--checklist td:nth-child(5) {
  width: 22%;
}

.checklist-station-row {
  cursor: pointer;
}

.checklist-download-actions {
  margin-top: var(--space-4);
}

.checklist-download-button--disabled,
.checklist-download-button--disabled:hover,
.checklist-download-button--disabled:focus {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.checklist-station-row:focus-visible td {
  outline: 2px solid rgba(0, 130, 201, 0.28);
  outline-offset: -2px;
}

.row-toggle {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 800;
  line-height: 1;
}

.checklist-station-detail td {
  background: var(--color-surface) !important;
}

.checklist-station-detail__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
  margin: 0;
}

.checklist-station-detail__grid div {
  display: grid;
  gap: 3px;
}

.checklist-station-detail__grid dt {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.checklist-station-detail__grid dd {
  margin: 0;
  white-space: pre-wrap;
}

.checklist-station-assets {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.checklist-station-assets h4 {
  margin: 0 0 var(--space-2);
  font-size: 15px;
}

.checklist-station-assets ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-station-assets li {
  display: grid;
  gap: 2px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
}

.swap-summary {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
}

.swap-summary p {
  margin: 0;
}

.case-detail {
  display: grid;
  gap: var(--space-5);
}

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

.detail-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}

.detail-section[id] {
  scroll-margin-top: calc(var(--topbar-height) + var(--space-4));
}

#case-stations,
#case-checkpoints,
#case-assets {
  scroll-margin-top: calc(var(--topbar-height) + var(--space-8));
}

.detail-section h3 {
  margin-bottom: var(--space-3);
  font-size: 18px;
}

.asset-station-block {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.asset-station-block:first-of-type {
  margin-top: 0;
}

.asset-station-block h4 {
  margin: 0;
  font-size: 15px;
}

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

.detail-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
  gap: var(--space-3);
}

.detail-list dt {
  color: var(--color-text-muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

.choice-list {
  display: grid;
  gap: var(--space-2);
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}

.choice-list__item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.choice-list__item:hover,
.choice-list__item:focus-visible,
.choice-list__item.is-selected {
  border-color: var(--color-primary);
  background: var(--color-surface-alt);
}

.choice-list__item strong,
.choice-list__item span {
  display: block;
}

.choice-list__item span,
.choice-list__empty {
  margin: 2px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.organization-panel {
  display: grid;
  gap: var(--space-4);
}

.org-accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.org-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 58px;
  padding: 0 var(--space-4);
  cursor: pointer;
  list-style: none;
}

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

.org-accordion summary::after {
  content: "v";
  color: var(--color-text-muted);
  font-weight: 700;
  transform: rotate(-90deg);
  transition: transform .15s ease;
}

.org-accordion[open] > summary::after {
  transform: rotate(0);
}

.org-accordion summary span,
.role-summary span {
  display: block;
}

.org-accordion summary small {
  display: block;
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.org-accordion--nested {
  box-shadow: none;
}

.role-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

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

.role-summary div {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
}

.role-summary span {
  margin-bottom: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.role-summary strong {
  overflow-wrap: anywhere;
}

.nested-accordion-list {
  display: grid;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

.org-accordion .table-scroll {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

td .table-actions,
.data-table td .table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: auto;
  min-width: 184px;
  max-width: max-content;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.table-actions .action-icon-button,
.data-table td .table-actions .action-icon-button {
  display: inline-flex;
  flex: 0 0 56px;
  align-items: center;
  justify-content: center;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  margin: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.table-actions .action-icon-button:hover,
.table-actions .action-icon-button:focus-visible {
  border-color: var(--color-border);
  background: var(--color-surface-alt);
  outline: 0;
}

.table-actions .action-icon-button:disabled,
.table-actions .action-icon-button[disabled] {
  cursor: not-allowed;
  opacity: .42;
}

.table-actions .action-icon-button:disabled:hover,
.table-actions .action-icon-button[disabled]:hover {
  border-color: transparent;
  background: transparent;
}

.table-actions .action-icon-button img,
.data-table td .table-actions .action-icon-button img {
  display: block;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  object-fit: contain;
}

.reset-password-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.reset-password-button:hover,
.reset-password-button:focus-visible {
  border-color: var(--color-border);
  background: var(--color-surface-alt);
  outline: 0;
}

.reset-password-button img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.case-detail .asset-station-block .table-actions {
  min-width: 360px;
}

.case-detail .asset-station-block .table-actions .action-icon-button,
.case-detail .asset-station-block .data-table td .table-actions .action-icon-button {
  flex-basis: 112px;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  height: 112px;
  min-height: 112px;
  max-height: 112px;
  padding: 8px;
}

.case-detail .asset-station-block .table-actions .action-icon-button img,
.case-detail .asset-station-block .data-table td .table-actions .action-icon-button img {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  height: 96px;
  min-height: 96px;
  max-height: 96px;
}

.case-detail .asset-station-block .checkpoint-actions {
  min-width: 120px;
}

.case-detail .asset-station-block .checkpoint-actions .action-icon-button,
.case-detail .asset-station-block .data-table td .checkpoint-actions .action-icon-button {
  flex-basis: 40px;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 4px;
}

.case-detail .asset-station-block .checkpoint-actions .action-icon-button img,
.case-detail .asset-station-block .data-table td .checkpoint-actions .action-icon-button img {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
}

.case-detail .station-case-actions {
  min-width: 248px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.btn--icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn--icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.modal-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.modal-card__header h2 {
  margin-bottom: 0;
}

.modal-step {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-5);
}

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

.checkbox-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.checkbox-line input {
  width: auto;
}

.flash-message ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
}

.form-grid label,
.form-grid span {
  display: block;
}

.form-grid span {
  margin-bottom: var(--space-2);
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: #fff;
}

.form-grid textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

.form-grid input[readonly] {
  background: var(--color-surface-alt);
}

.modal-body-copy {
  margin: 0;
  padding: var(--space-5);
  color: var(--color-text);
}

.comment-thread {
  display: grid;
  gap: var(--space-2);
  max-height: 260px;
  overflow: auto;
  padding: 0 var(--space-5) var(--space-5);
}

.comment-thread__item,
.comment-thread__empty {
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  white-space: pre-wrap;
}

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

.form-grid__wide {
  grid-column: 1 / -1;
}

.form-grid fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.form-grid legend {
  margin-bottom: var(--space-3);
  font-weight: 800;
}

.form-grid .radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.form-grid .radio-option input {
  width: auto;
  min-height: 0;
}

.form-grid .radio-option span {
  margin-bottom: 0;
}

.form-section-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 700;
}

.station-template-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.station-template-list p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-text-muted);
}

.station-template-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 42px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.station-template-item input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}

.station-template-item span {
  margin: 0;
  font-weight: 700;
}

.station-template-item em {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.station-template-item--mandatory {
  border-color: rgba(0, 130, 201, 0.35);
  background: var(--color-primary-soft);
}

.station-template-item--mandatory em {
  color: var(--color-primary);
  background: #fff;
}

.template-editor {
  align-items: stretch;
}

.template-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(240px, max-content);
  align-items: end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.template-toolbar label,
.template-toolbar span,
.process-switch legend {
  display: block;
}

.template-toolbar span,
.process-switch legend {
  margin-bottom: var(--space-2);
  font-weight: 700;
}

.template-toolbar select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: #fff;
}

.process-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: var(--space-2);
  padding: 0;
  border: 0;
}

.process-switch legend {
  grid-column: 1 / -1;
}

.process-switch label {
  position: relative;
}

.process-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.process-switch label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.process-switch input:checked + span {
  border-color: rgba(0, 130, 201, 0.45);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.template-table {
  min-width: 720px;
}

.template-table th:nth-child(2),
.template-table th:nth-child(3),
.template-table th:nth-child(4),
.template-table td:nth-child(2),
.template-table td:nth-child(3),
.template-table td:nth-child(4) {
  width: 132px;
  text-align: center;
  vertical-align: middle;
}

.template-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto;
}

.template-radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.template-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.template-actions__save {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
}

.filter-tab--active {
  border-color: rgba(21, 94, 117, 0.28);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.template-save-message {
  color: #166534;
  font-weight: 800;
}

.template-empty {
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  font-weight: 600;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.workspace-content h2 {
  margin-bottom: var(--space-3);
}

.workspace-content p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

@media (max-width: 1100px) {
  .sidebar {
    display: none;
  }

  .dashboard-main {
    margin-left: 0;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 var(--space-4);
  }

  .brand span {
    display: none;
  }

  .topbar-actions {
    gap: var(--space-2);
  }

  .language-menu summary {
    min-width: 44px;
    padding: 0 var(--space-2);
  }

  .user-menu {
    min-width: 44px;
  }

  .user-menu summary {
    min-width: 44px;
    padding: 0 var(--space-3);
  }

  .user-name {
    width: 0;
    overflow: hidden;
  }

  .user-dropdown {
    min-width: 190px;
  }

  .dashboard-main {
    padding: var(--space-4);
  }

  .dashboard-head {
    flex-direction: column;
    margin-bottom: var(--space-4);
  }

  .workspace {
    min-height: 58vh;
    padding: var(--space-4);
  }

  .dashboard-process-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-process-card {
    min-height: 156px;
    padding: 48px var(--space-5) var(--space-5);
  }

  .dashboard-process-card__title {
    top: var(--space-4);
    left: var(--space-4);
  }

  .dashboard-process-card__body {
    gap: var(--space-5);
  }

  .dashboard-process-card img {
    width: 92px;
    height: 92px;
  }

  .dashboard-process-card strong {
    min-width: 66px;
    font-size: 50px;
  }

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

  .detail-grid,
  .detail-list div {
    grid-template-columns: 1fr;
  }

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

  .modal-actions {
    flex-direction: column-reverse;
  }

  .template-toolbar,
  .process-switch,
  .table-filter {
    grid-template-columns: 1fr;
  }

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

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

.detail-grid.checklist-summary-grid {
  grid-template-columns: minmax(0, min(100%, 360px));
  justify-content: center;
}
