@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --color-primary: #069802;
  --color-primary-deep: #047a01;
  --color-ink: #171717;
  --color-ink-secondary: #212121;
  --color-ink-muted: #707070;
  --color-ink-faint: #b2b2b2;
  --color-canvas: #ffffff;
  --color-canvas-soft: #fafafa;
  --color-canvas-night: #1c1c1c;
  --color-chrome: #171717;
  --color-chrome-soft: #222222;
  --color-chrome-hover: #343434;
  --color-chrome-text: #f5f5f5;
  --color-chrome-muted: #b8b8b8;
  --color-chrome-border: rgba(255, 255, 255, 0.1);
  --color-chrome-badge-text: #d8ffd6;
  --color-control: #eeeeee;
  --color-control-hover: #e5e5e5;
  --color-table-head: #f3f3f3;
  --color-table-stripe: #fcfcfc;
  --color-table-hover: #f8f8f8;
  --color-table-line: #eeeeee;
  --color-input-border: #d7d7d7;
  --color-drop-border: #bdbdbd;
  --color-hairline: #dfdfdf;
  --color-hairline-strong: #c7c7c7;
  --color-hairline-cool: #ededed;
  --color-danger: #ee3021;
  --color-danger-hover: #cf2619;
  --color-danger-soft: #fff0ee;
  --color-disabled: #d7d7d7;
  --color-disabled-text: #777777;
  --color-success: #147a3f;
  --color-success-soft: #eefbf5;
  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-size-body: 14px;
  --font-size-caption: 13px;
  --font-size-micro: 12px;
  --font-size-button: 14px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --radius-nav: 3px;
  --radius-tab: 3px;
  --radius-table: var(--radius-sm);
  --radius-drop: var(--radius-sm);
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.16);
  --focus-ring: 0 0 0 3px rgba(6, 152, 2, 0.22);
  --bg: var(--color-canvas-soft);
  --panel: var(--color-canvas);
  --line: var(--color-hairline);
  --text: var(--color-ink);
  --muted: var(--color-ink-muted);
  --primary: var(--color-primary);
  --primary-dark: var(--color-primary-deep);
  --danger: var(--color-danger);
  --success: var(--color-success);
  --login-primary: var(--color-canvas-night);
  --login-primary-hover: var(--color-ink-secondary);
  --login-text: var(--color-ink);
  --login-muted: var(--color-ink-muted);
  --login-border: var(--color-hairline-cool);
  --login-shadow: none;
  --header-height: 46px;
  --header-height-mobile: 46px;
  --header-padding-x: var(--space-xl);
  --header-user-gap: 10px;
  --sidebar-width: 188px;
  --nav-gap: 6px;
  --nav-padding-block: 14px;
  --nav-padding-inline: 10px;
  --nav-item-height: 38px;
  --nav-item-padding-x: var(--space-md);
  --nav-active-border-width: 3px;
  --nav-active-border-inset: 9px;
  --tab-gap: 6px;
  --tab-height: 40px;
  --tab-padding-x: var(--space-lg);
  --tab-line-width: 1px;
  --tab-active-border-width: 1px;
  --color-tab-line: var(--color-table-line);
  --drop-min-height: 176px;
  --drop-padding: var(--space-xl);
  --drop-border-width: 2px;
  --drop-file-button-height: 34px;
  --drop-file-status-min-height: 20px;
  --drop-file-status-max-width: 560px;
  --titlebar-gap: var(--space-lg);
  --title-search-width: 340px;
  --table-headline-gap: var(--space-md);
  --table-headline-min-height: 34px;
  --sort-indicator-height: 20px;
  --sort-icon-size: 16px;
  --select-arrow-size: 12px;
  --select-arrow-offset: 16px;
  --select-padding-right: 42px;
  --modal-transition-duration: 180ms;
  --modal-transition-distance: 4px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  line-height: 1.6;
}

a {
  color: var(--primary);
}

.l-header {
  background: var(--color-chrome);
  position: sticky;
  top: 0;
  z-index: 100;
}

.l-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  width: 100%;
  min-height: var(--header-height);
  padding: 0 var(--header-padding-x);
}

.l-header__brand {
  color: var(--color-chrome-text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.l-header__user {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--header-user-gap);
  color: var(--color-chrome-muted);
  font-size: var(--font-size-caption);
}

.l-header__user > span:not(.badge) {
  color: var(--color-chrome-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(6, 152, 2, 0.28);
  color: var(--color-chrome-badge-text);
  font-size: var(--font-size-micro);
}

.l-admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  min-height: calc(100vh - var(--header-height));
}

.l-sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  min-height: calc(100vh - var(--header-height));
  background: var(--color-chrome);
}

.l-nav {
  display: grid;
  gap: var(--nav-gap);
  padding: var(--nav-padding-block) var(--nav-padding-inline);
}

.l-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--nav-item-height);
  padding: 0 var(--nav-item-padding-x);
  border-radius: var(--radius-nav);
  color: var(--color-chrome-muted);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.l-nav a:hover {
  background: var(--color-chrome-hover);
  color: var(--color-chrome-text);
}

.l-nav a.is-active {
  background: var(--color-chrome-hover);
  color: var(--color-chrome-text);
}

.l-nav a.is-active::before {
  position: absolute;
  top: var(--nav-active-border-inset);
  bottom: var(--nav-active-border-inset);
  left: 0;
  width: var(--nav-active-border-width);
  border-radius: var(--radius-full);
  background: var(--primary);
  content: "";
}

.l-nav__divider {
  margin: var(--space-xs) var(--space-sm);
  border: 0;
  border-top: 1px solid var(--color-chrome-border);
}

.l-main {
  min-width: 0;
  padding: 28px 28px 64px;
}

h1 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  letter-spacing: 0;
}

.page-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--titlebar-gap);
  margin: 0 0 18px;
}

.page-titlebar h1 {
  min-width: 0;
  margin: 0;
}

.page-titlebar__actions {
  display: flex;
  flex: 0 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: var(--font-weight-medium);
}

.panel {
  margin: 0 0 18px;
  padding: 20px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
}

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

.field-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.field-grid + .help,
.panel > .help {
  margin: -6px 0 14px;
}

.drop-field {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-md);
  min-height: var(--drop-min-height);
  padding: var(--drop-padding);
  border: var(--drop-border-width) dashed var(--color-drop-border);
  border-radius: var(--radius-drop);
  background: var(--color-canvas);
  box-shadow: none;
  text-align: center;
  transition: border-color 0.16s ease;
}

.drop-field.is-dragover {
  border-color: var(--primary);
}

.drop-field__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: 0;
  color: var(--color-ink-secondary);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.drop-field__label svg {
  width: 20px;
  height: 20px;
  color: var(--primary-dark);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.drop-field__picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--drop-file-button-height);
  padding: 0 var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-control);
  color: var(--color-ink);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  pointer-events: none;
}

.drop-field__status {
  display: block;
  min-height: var(--drop-file-status-min-height);
  max-width: min(100%, var(--drop-file-status-max-width));
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-align: center;
}

.drop-field__status.is-selected {
  color: var(--primary-dark);
  font-weight: var(--font-weight-bold);
}

.drop-field__status.is-file-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  pointer-events: auto;
}

.file-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  overflow: hidden;
  border: 1px solid rgba(6, 152, 2, 0.24);
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--primary-dark);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.file-tag__name {
  min-width: 0;
  overflow: hidden;
  padding: 4px var(--space-xs) 4px var(--space-md);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-left: 1px solid rgba(6, 152, 2, 0.18);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  line-height: 1;
}

.file-tag__remove:hover,
.file-tag__remove:focus-visible {
  background: rgba(6, 152, 2, 0.1);
  outline: none;
}

input[type="file"] {
  width: 100%;
  color: var(--muted);
  font: inherit;
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: var(--space-md);
  padding: 0 var(--space-md);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-control);
  color: var(--color-ink);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.drop-field input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  max-width: none;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-field--managed input[type="file"] {
  inset: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input[type="file"]::file-selector-button:hover {
  background: var(--color-control-hover);
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  min-height: 40px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-canvas);
  color: var(--text);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

select {
  appearance: none;
  padding-right: var(--select-padding-right);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%23707070' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--select-arrow-offset) center;
  background-size: var(--select-arrow-size) auto;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: var(--color-input-border);
  box-shadow: none;
  outline: none;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

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

.field-label span {
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px);
  gap: 14px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.help.upload-sample-link {
  display: block;
  margin: 16px 0 0;
  font-size: var(--font-size-micro);
}

.title-search {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin: 0;
}

.title-search__group {
  display: flex;
  flex: 0 1 var(--title-search-width);
  align-items: stretch;
  min-width: 0;
}

.title-search__group input[type="text"] {
  width: var(--title-search-width);
  min-width: 0;
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.button.title-search__submit {
  min-height: 40px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.admin-tabs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--tab-gap);
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  border-bottom: var(--tab-line-width) solid var(--color-tab-line);
}

.admin-tabs-status {
  margin-bottom: 16px;
}

.admin-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tab-height);
  margin: 0;
  padding: 0 var(--tab-padding-x);
  border: var(--tab-active-border-width) solid transparent;
  border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  background: var(--color-control);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.admin-tab:hover {
  background: var(--color-control-hover);
  color: var(--color-ink);
}

.admin-tab.is-active {
  z-index: 1;
  margin-bottom: calc(-1 * var(--tab-line-width));
  border-color: var(--color-tab-line);
  border-bottom: 0;
  background: var(--color-canvas);
  color: var(--color-ink);
}

.admin-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: calc(-1 * (var(--tab-line-width) + var(--tab-active-border-width)));
  left: 0;
  height: calc(var(--tab-line-width) + var(--tab-active-border-width));
  background: var(--color-canvas);
  content: "";
}

.upload-panel[hidden] {
  display: none;
}

.upload-tabs .admin-tab {
  transition: none;
}

.status-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: rgba(23, 23, 23, 0.08);
  color: var(--muted);
  font-size: var(--font-size-micro);
}

.status-tab .status-tab__count.has-count {
  background: var(--color-success-soft);
  color: var(--success);
}

.status-tab.is-active span {
  background: var(--primary);
  color: var(--color-canvas);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 38px;
  padding: 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-control);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--font-size-button);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.button[hidden] {
  display: none !important;
}

.button svg,
.btn svg,
.icon-button svg,
.drag-handle svg {
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.button:hover {
  background: var(--color-control-hover);
}

.button:focus-visible,
.icon-button:focus-visible,
.btn:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

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

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

.button-danger {
  background: var(--danger);
  color: var(--color-canvas);
}

.button-danger:hover {
  background: var(--color-danger-hover);
}

.button-secondary {
  background: var(--color-control);
  color: var(--color-ink);
}

.l-header .button-secondary {
  background: var(--color-chrome-soft);
  color: var(--color-chrome-text);
}

.l-header .button-secondary:hover {
  background: var(--color-chrome-hover);
}

.button-compact {
  min-height: 34px;
  padding: 0 var(--space-md);
}

.l-header .button-secondary.button-compact {
  align-self: stretch;
  height: 100%;
  min-height: var(--header-height);
  padding: 0 var(--space-lg);
  border-left: 1px solid var(--color-chrome-border);
  border-radius: 0;
}

.button:disabled {
  background: var(--color-disabled);
  color: var(--color-disabled-text);
  cursor: not-allowed;
  opacity: 1;
}

.button:disabled:hover {
  background: var(--color-disabled);
  color: var(--color-disabled-text);
}

.button-wide {
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: var(--font-size-button);
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--login-primary);
  color: var(--color-canvas);
}

.btn-primary:not(:disabled):hover {
  background-color: var(--login-primary-hover);
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-control);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.icon-button-danger {
  color: var(--danger);
}

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

.icon-button:hover {
  background: var(--color-control-hover);
}

.icon-button-danger:hover {
  background: var(--color-danger-soft);
}

.icon-button-primary:hover {
  background: var(--color-success-soft);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-left: 0;
  border-radius: var(--radius-md);
  background: var(--color-canvas-soft);
  box-shadow: none;
  white-space: pre-line;
}

.notice-error {
  background: var(--color-danger-soft);
  color: var(--danger);
}

.notice-success {
  background: var(--color-success-soft);
  color: var(--success);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-table-line);
  border-radius: var(--radius-table);
  background: var(--panel);
  box-shadow: none;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
}

th,
td {
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--color-table-line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--color-table-head);
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

td {
  color: var(--text);
}

tbody tr:nth-child(even) td {
  background: var(--color-table-stripe);
}

tbody tr:hover td {
  background: var(--color-table-hover);
}

tbody tr.is-selected td {
  background: var(--color-success-soft);
}

tbody tr.is-dragging td {
  border-bottom-color: transparent;
  background: var(--color-success-soft);
}

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

.thumb {
  display: block;
  width: 96px;
  height: 64px;
  object-fit: cover;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-canvas-soft);
}

.empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.table-summary {
  margin: 0 0 8px;
  color: var(--muted);
}

.table-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--table-headline-gap);
  min-height: var(--table-headline-min-height);
  margin: 0 0 var(--space-sm);
}

.table-headline .table-summary {
  margin: 0;
}

.table-headline__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.table-summary__filter {
  display: inline-flex;
  margin-left: var(--space-sm);
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

.table-summary__note {
  display: inline-flex;
  margin-left: var(--space-sm);
  color: var(--muted);
}

.bulk-action-form {
  margin: 0;
}

.asset-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin: 0 0 var(--space-sm);
}

.asset-bulk-form,
.selection-bulk-form,
.asset-order-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
}

.selection-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: var(--font-size-micro);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--muted);
  text-decoration: none;
}

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

.sort-link.is-active {
  color: var(--text);
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sort-indicator-height);
  padding: 0;
  color: var(--muted);
}

.sort-indicator__icon {
  width: var(--sort-icon-size);
  height: var(--sort-icon-size);
  color: currentColor;
}

.cell-note {
  color: var(--muted);
  font-size: var(--font-size-micro);
}

.status-dot-cell {
  width: 34px;
  min-width: 34px;
  text-align: center;
}

.selection-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.drag-cell {
  width: 72px;
  min-width: 72px;
  text-align: center;
}

.drag-cell .sort-link {
  justify-content: center;
}

.drag-handle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.drag-handle:hover {
  background: var(--color-control-hover);
  color: var(--text);
}

.drag-handle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle.is-dragging,
body.is-table-row-dragging {
  cursor: grabbing;
}

.drag-handle.is-dragging {
  background: var(--color-success-soft);
  color: var(--primary);
}

body.is-table-row-dragging {
  user-select: none;
}

.drag-ghost-table {
  position: fixed;
  z-index: 1000;
  width: auto;
  max-width: none;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  background: transparent;
  opacity: 0.78;
  pointer-events: none;
  table-layout: fixed;
}

.drag-ghost-table td {
  border-bottom: 0;
  background: var(--color-success-soft);
}

.drag-drop-placeholder {
  pointer-events: none;
}

.drag-drop-placeholder td {
  border-bottom-color: transparent;
  background: var(--color-success-soft);
  opacity: 0.58;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  vertical-align: middle;
}

.status-dot-ok {
  background: var(--success);
}

.status-dot-error {
  background: var(--danger);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--success);
  font-size: var(--font-size-micro);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.status-badge + .status-badge {
  margin-left: var(--space-xs);
}

.status-badge-warning {
  background: #fff7d6;
  color: #735500;
}

.status-badge-danger {
  background: var(--color-danger-soft);
  color: var(--danger);
}

.p-users__invite-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: var(--space-md);
}

.p-users__section {
  margin: 0 0 18px;
}

.p-users__table {
  min-width: 900px;
}

.p-users__table-wrap {
  margin-bottom: var(--space-lg);
}

.p-users__badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.p-users__badge {
  color: var(--text);
}

.p-users__badge-env {
  background: var(--color-danger-soft);
  color: var(--danger);
}

.p-users__badge-db {
  background: var(--color-success-soft);
  color: var(--success);
}

.p-users__badge-pending,
.p-users__badge-current {
  background: var(--color-canvas-soft);
  color: var(--muted);
}

.action-cell {
  width: 96px;
  white-space: nowrap;
}

.action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.is-modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 23, 23, 0.46);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 460px);
  border: 0;
  border-radius: var(--radius-xl, 16px);
  background: var(--color-canvas);
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  width: min(100%, 640px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  padding: 16px 18px;
}

.modal-body p {
  margin: 0 0 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 42px;
  margin-bottom: var(--space-md);
  color: var(--muted);
  font-weight: var(--font-weight-medium);
  opacity: 0;
  transform: translateY(var(--modal-transition-distance));
  transition: opacity var(--modal-transition-duration) ease, transform var(--modal-transition-duration) ease;
}

.loading-state[hidden] {
  display: none;
}

.loading-state.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-hairline-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.check-result {
  display: grid;
  gap: var(--space-md);
  opacity: 0;
  transform: translateY(var(--modal-transition-distance));
  transition: opacity var(--modal-transition-duration) ease, transform var(--modal-transition-duration) ease;
}

.check-result:empty {
  display: none;
}

.check-result.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.check-result__message {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  white-space: pre-wrap;
}

.check-result__message-success {
  background: var(--color-success-soft);
  color: var(--success);
}

.check-result__message-error {
  background: var(--color-danger-soft);
  color: var(--danger);
}

.check-result__message-warning {
  background: #fff7d6;
  color: #735500;
}

.check-list {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.check-list dt,
.check-list dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.check-list dt {
  background: var(--color-table-head);
  color: var(--muted);
  font-weight: var(--font-weight-medium);
}

.check-list dd {
  background: var(--color-canvas);
}

.check-list dt:last-of-type,
.check-list dd:last-of-type {
  border-bottom: 0;
}

.check-sections {
  display: grid;
  gap: var(--space-lg);
}

.check-sections section + section {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-table-line);
}

.check-sections h3 {
  margin: 0 0 var(--space-sm);
  color: var(--text);
  font-size: var(--font-size-body);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

code {
  font-family: var(--font-mono);
  font-size: var(--font-size-micro);
}

.p-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 56px);
  background: var(--color-canvas-soft);
  color: var(--login-text);
}

.p-login__panel {
  width: min(100%, 440px);
  padding: 40px 36px 34px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-canvas);
  box-shadow: var(--login-shadow);
}

.p-login__brand {
  display: flex;
  justify-content: center;
  margin: 0 0 10px;
}

.p-login__logo {
  display: block;
  width: min(48%, 180px);
  height: auto;
}

.p-login__app {
  margin: 0 0 20px;
  color: var(--login-text);
  font-size: var(--font-size-button);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  text-align: center;
}

.p-login .error,
.p-login .success {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: var(--font-size-caption);
}

.p-login .error {
  border: 0;
  background: var(--color-danger-soft);
  color: var(--danger);
}

.p-login .success {
  border: 0;
  background: var(--color-success-soft);
  color: var(--success);
}

.p-login__note {
  margin: 0 0 24px;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.p-login__actions {
  display: grid;
  gap: 12px;
}

.p-login__google {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.p-login__google-mark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-canvas);
  color: var(--login-text);
  font-weight: 700;
  line-height: 1;
}

.p-login__meta {
  margin: 14px 0 0;
  color: var(--login-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 900px) {
  :root {
    --header-height: var(--header-height-mobile);
  }

  .l-admin-shell {
    display: block;
  }

  .l-sidebar {
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    min-height: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .l-nav {
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    overflow-x: auto;
  }

  .l-nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
  }

  .l-main {
    padding: 22px 16px 48px;
  }
}

@media (max-width: 760px) {
  .l-header {
    position: static;
  }

  .l-sidebar {
    position: static;
  }

  .l-header__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .l-header__user {
    justify-content: flex-start;
  }

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

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

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

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

  .page-titlebar,
  .table-headline {
    align-items: stretch;
    flex-direction: column;
  }

  .asset-table-actions,
  .asset-bulk-form,
  .selection-bulk-form,
  .table-headline__actions,
  .asset-order-form {
    align-items: stretch;
    flex-direction: column;
  }

  .page-titlebar__actions,
  .title-search {
    justify-content: flex-start;
  }

  .page-titlebar__actions,
  .title-search,
  .title-search__group,
  .title-search__group input[type="text"] {
    width: 100%;
  }

  .p-login {
    padding: 20px;
  }

  .p-login__panel {
    padding: 30px 22px 28px;
  }
}
