:root, html[data-theme="light"] {
  --primary: var(--accent); --secondary: var(--surface-3); --primary-fg: var(--accent-on);
  --body-fg: var(--text); --body-bg: var(--surface-0); --body-quiet-color: var(--text-2); --body-loud-color: var(--text);
  --header-color: var(--text); --header-branding-color: var(--text); --header-bg: var(--surface-1); --header-link-color: var(--text-2);
  --breadcrumbs-fg: var(--text-2); --breadcrumbs-link-fg: var(--text); --breadcrumbs-bg: var(--surface-1);
  --link-fg: var(--accent); --link-hover-color: var(--accent-hover); --link-selected-fg: var(--accent);
  --hairline-color: var(--border); --border-color: var(--border); --error-fg: var(--crit);
  --message-success-bg: var(--ok-quiet); --message-warning-bg: var(--warn-quiet); --message-error-bg: var(--crit-quiet);
  --darkened-bg: var(--surface-3); --selected-bg: var(--accent-quiet); --selected-row: var(--surface-3);
  --button-fg: var(--accent-on); --button-bg: var(--accent); --button-hover-bg: var(--accent-hover);
  --default-button-bg: var(--accent); --default-button-hover-bg: var(--accent-hover);
  --close-button-bg: var(--surface-4); --close-button-hover-bg: var(--border-strong);
  --delete-button-bg: var(--crit); --delete-button-hover-bg: var(--crit);
  --object-tools-fg: var(--accent-on); --object-tools-bg: var(--accent); --object-tools-hover-bg: var(--accent-hover);
}
.admin-shell { background: var(--surface-0); color: var(--text); font-family: var(--font); }
.admin-shell .app-main { min-width: 0; }
.admin-shell .page { width: min(calc(100% - (2 * var(--sp-6))), var(--content-max)); }
.admin-shell.dashboard .admin-page { width: min(calc(100% - (2 * var(--sp-6))), var(--content-max)); max-width: none; }
.admin-content { box-sizing: border-box; min-width: 0; padding: var(--sp-5); }
.admin-content > h1 { font-size: 23px; line-height: 1.15; letter-spacing: -.025em; }
.admin-content-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
.admin-shell.dashboard #content.admin-content { width: 100%; }
.admin-shell.dashboard .admin-content-layout:has(> #content-related) { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); align-items: start; }
.admin-shell #content-main { min-width: 0; }
.admin-shell.dashboard #content-main { float: none; width: auto; }
.admin-shell #nav-sidebar { display: none; }
.admin-shell a:focus-visible, .admin-shell button:focus-visible, .admin-shell input:focus-visible, .admin-shell select:focus-visible, .admin-shell textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.admin-shell .module, .admin-shell .inline-group, .admin-shell #changelist-filter, .admin-shell .submit-row, .admin-shell .selector { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: var(--shadow-1); }
.admin-shell .module h2, .admin-shell .module caption, .admin-shell .inline-group h2 { padding: var(--sp-3) var(--sp-4); color: var(--text); background: var(--surface-3); font-weight: 700; }
.admin-shell .module table th, .admin-shell .module table td { padding: var(--sp-2) var(--sp-3); }
.admin-shell .module table tbody tr:hover { background: var(--accent-quiet); }
.admin-shell .button, .admin-shell input[type="submit"], .admin-shell input[type="button"], .admin-shell .submit-row input, .admin-shell a.button { border-radius: var(--r-sm); font-weight: 700; }
.admin-shell input, .admin-shell textarea, .admin-shell select, .admin-shell .vTextField { border-color: var(--border) !important; border-radius: var(--r-sm) !important; color: var(--text); background: var(--surface-1); }
.admin-shell .submit-row { padding: var(--sp-4); }
.admin-shell .object-tools { margin-top: calc(-1 * var(--sp-6)); }
.admin-shell .paginator, .admin-shell .actions { color: var(--text-2); background: var(--surface-2); }
.admin-home { display: grid; gap: var(--sp-5); }
.admin-home-header { display: flex; align-items: end; justify-content: space-between; gap: var(--sp-5); }
.admin-home-header h1 { margin: 0; color: var(--text); font-size: 23px; line-height: 1.15; letter-spacing: -.025em; }
.admin-home-header p:last-child { margin: var(--sp-2) 0 0; color: var(--text-2); }
.admin-model-filter { display: grid; max-width: 760px; gap: var(--sp-2); }
.admin-model-filter label { color: var(--text-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.admin-model-filter__control { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.admin-model-filter__control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-quiet); }
.admin-model-filter__control svg { width: 20px; fill: none; stroke: var(--text-2); stroke-width: 2; }
.admin-model-filter__control input { width: 100%; padding: var(--sp-3) 0; border: 0 !important; outline: 0; background: transparent; }
.admin-model-filter__result { min-height: 1.2em; margin: 0; color: var(--text-2); font-size: .82rem; }
.admin-app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; gap: var(--sp-4); }
.admin-app-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: var(--shadow-1); }
.admin-app-card__header { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--border); }
.admin-app-card__icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-md); color: var(--accent); background: var(--accent-quiet); font-family: var(--mono); font-size: .68rem; font-weight: 800; }
.admin-app-card__header h2 { margin: 0; color: var(--text); font-size: 1.05rem; }
.admin-app-card__label { margin: 0 0 2px; color: var(--text-3); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.admin-app-card__count { margin-left: auto; color: var(--text-2); font: 700 .78rem var(--mono); }
.admin-model-section { padding: var(--sp-3); }
.admin-model-section + .admin-model-section { border-top: 1px solid var(--border); }
.admin-model-section h3 { margin: 0 0 var(--sp-2); color: var(--text-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
.admin-model-section h3 span { margin-left: var(--sp-2); color: var(--text-3); font-size: .68rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.admin-model-section--system { background: var(--surface-1); }
.admin-model-grid { display: grid; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); }
.admin-model-row { display: flex; min-width: 0; min-height: 38px; }
.admin-model-row + .admin-model-row { border-top: 1px solid var(--border); }
.admin-model-row:hover { background: var(--accent-quiet); }
.admin-model-row.is-system-written { background: var(--surface-2); }
.admin-model-row.is-system-written:hover { background: var(--accent-quiet); }
.admin-model-row__main { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); color: var(--text) !important; text-decoration: none; }
.admin-model-row__name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.admin-model-row__hint { flex: 0 0 auto; color: var(--text-2); font-size: .72rem; }
.admin-model-row__add { display: grid; width: 38px; place-items: center; border-left: 1px solid var(--border); color: var(--accent) !important; background: var(--accent-quiet); font-size: 1.1rem; text-decoration: none; }
.admin-model-row__add:hover { color: var(--accent-on) !important; background: var(--accent); }
.admin-empty-state { padding: var(--sp-6); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-2); text-align: center; }
.admin-content-layout > #content-related.admin-recent-actions { position: static; float: none; width: auto; margin: 0; align-self: start; padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: var(--shadow-1); }
.admin-recent-actions h2 { margin: 0; color: var(--text); font-size: 1rem; }
.admin-recent-actions h3 { margin: var(--sp-1) 0 var(--sp-3); color: var(--text-2); font-size: .78rem; }
.admin-recent-actions .actionlist { margin: 0; padding: 0; }
.admin-recent-actions .actionlist li { padding: var(--sp-2) 0 var(--sp-2) 22px; border-bottom: 1px solid var(--border); }
.admin-recent-actions .actionlist li:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .admin-shell.dashboard .admin-content-layout:has(> #content-related) { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .admin-shell .page, .admin-shell.dashboard .admin-page { width: min(calc(100% - (2 * var(--sp-3))), var(--content-max)); } .admin-content { padding: var(--sp-4) var(--sp-3); } .admin-home-header { display: block; } .admin-app-grid { grid-template-columns: 1fr; } .admin-shell .object-tools { margin-top: 0; } }
