/* Generated from assets/admin/admin.css. Run composer assets-build. */
:root {
    color-scheme: light;
    --admin-font-sans: "IBM Plex Sans", "Manrope", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --admin-bg: #f0f4f7;
    --admin-bg-soft: #fbfbfb;
    --admin-surface: #ffffff;
    --admin-surface-strong: #fafbfb;
    --admin-surface-muted: #f8f9fa;
    --admin-border: #c7cbce;
    --admin-border-strong: #8e949b;
    --admin-text: #041120;
    --admin-text-strong: #000425;
    --admin-muted: #515e6d;
    --admin-primary: #2d92ee;
    --admin-primary-strong: #2880d1;
    --admin-primary-active: #2475be;
    --admin-primary-soft: #eaf5fe;
    --admin-on-primary: #ffffff;
    --admin-link: #2d92ee;
    --admin-success: #00bf6f;
    --admin-success-soft: #eef7f0;
    --admin-danger: #eb3b5a;
    --admin-danger-soft: #fff0f0;
    --admin-warning: #efa83a;
    --admin-warning-soft: #fff4d9;
    --admin-gradient: linear-gradient(89.82deg, rgba(255, 255, 255, 0.82) 38.43%, #b5d0eb 139.55%);
    --admin-gradient-deep: linear-gradient(189.17deg, #ddebf7 71.83%, rgba(228, 242, 255, 0) 143.33%);
    --admin-radius-xl: 16px;
    --admin-radius-lg: 12px;
    --admin-radius-md: 8px;
    --admin-radius-sm: 8px;
    --admin-sidebar-width: 274px;
    --admin-shadow-soft: 0 6px 8px rgba(45, 65, 71, 0.12), 0 4px 8px rgba(45, 65, 71, 0.10), 0 0 8px rgba(45, 65, 71, 0.10);
    --admin-shadow-surface: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.admin-body {
    margin: 0;
    min-height: 100vh;
    background: var(--admin-bg);
    background-image: linear-gradient(180deg, var(--admin-bg-soft) 0%, var(--admin-bg) 100%);
    color: var(--admin-text);
    font-family: var(--admin-font-sans);
    font-size: 14px;
    line-height: 1.5;
}

.admin-body a {
    color: var(--admin-link);
    text-decoration: none;
}

.admin-body a:hover,
.admin-body a:focus-visible {
    color: var(--admin-primary-strong);
    text-decoration: none;
}

.admin-body :focus-visible {
    outline: 2px solid color-mix(in srgb, var(--admin-primary) 55%, transparent);
    outline-offset: 2px;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
}

.sidebar {
    position: sticky;
    top: 14px;
    align-self: start;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-xl);
    background: var(--admin-gradient-deep);
    box-shadow: var(--admin-shadow-soft);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 64px;
    padding: 16px 16px 12px;
    color: var(--admin-text-strong);
    font-size: 17px;
    font-weight: 700;
}

.brand img {
    width: min(170px, 100%);
    height: auto;
    flex: 0 1 auto;
    object-fit: contain;
}

.nav {
    display: grid;
    flex: 1 1 auto;
    gap: 12px;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 10px 12px;
}

.nav-group {
    display: grid;
    gap: 2px;
    padding-bottom: 0;
    border-bottom: 0;
}

.nav-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 70%, transparent);
    border-radius: var(--admin-radius-md);
    padding: 8px 10px;
    background: color-mix(in srgb, var(--admin-surface) 48%, transparent);
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease;
}

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

.nav-group-label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.nav-group-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: color-mix(in srgb, var(--admin-muted) 84%, var(--admin-primary));
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.nav-group-title::after {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.16s ease;
}

.nav-group[open] > .nav-group-title {
    border-color: color-mix(in srgb, var(--admin-primary) 24%, var(--admin-border));
    background: color-mix(in srgb, var(--admin-primary) 8%, transparent);
    color: var(--admin-text-strong);
    margin-bottom: 4px;
}

.nav-group[open] > .nav-group-title .nav-group-icon {
    color: var(--admin-primary);
}

.nav-group[open] > .nav-group-title::after {
    transform: rotate(225deg);
}

.nav-group-title:hover,
.nav-group-title:focus-visible {
    border-color: color-mix(in srgb, var(--admin-primary) 24%, var(--admin-border));
    background: color-mix(in srgb, var(--admin-primary) 10%, transparent);
    color: var(--admin-text-strong);
    outline: 0;
}

.nav a {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--admin-radius-md);
    padding: 9px 11px;
    background: transparent;
    color: var(--admin-text);
    text-align: left;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.nav-group > a {
    width: calc(100% - 18px);
    min-height: 36px;
    margin-left: 18px;
    padding: 8px 10px;
}

.nav a:hover,
.nav a:focus-visible {
    border-color: var(--admin-border-strong);
    background: color-mix(in srgb, var(--admin-primary) 14%, transparent);
    color: var(--admin-text-strong);
    outline: 0;
}

.nav a.active,
.nav a[aria-current="page"],
.nav a.active:hover,
.nav a.active:focus-visible,
.nav a[aria-current="page"]:hover,
.nav a[aria-current="page"]:focus-visible {
    border-color: color-mix(in srgb, var(--admin-primary) 46%, var(--admin-border));
    background: var(--admin-primary);
    color: var(--admin-on-primary);
}

.nav form {
    margin: 0;
}

.sidebar-account {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    padding: 8px 10px 10px;
    border-top: 1px solid color-mix(in srgb, var(--admin-border) 70%, transparent);
    background: color-mix(in srgb, var(--admin-surface) 34%, transparent);
}

.admin-body a.sidebar-account-profile,
.sidebar-account-profile {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 36px;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 82%, transparent);
    border-radius: var(--admin-radius-md);
    padding: 4px 6px;
    background: color-mix(in srgb, var(--admin-surface) 76%, transparent);
    color: var(--admin-text);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.admin-body a.sidebar-account-profile:hover,
.admin-body a.sidebar-account-profile:focus-visible,
.admin-body a.sidebar-account-profile.active,
.admin-body a.sidebar-account-profile[aria-current="page"] {
    border-color: color-mix(in srgb, var(--admin-primary) 32%, var(--admin-border));
    background: color-mix(in srgb, var(--admin-primary) 8%, var(--admin-surface));
    color: var(--admin-text-strong);
    outline: 0;
}

.sidebar-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--admin-primary);
    color: var(--admin-on-primary);
}

.sidebar-account-avatar svg,
.sidebar-account-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.sidebar-account-text {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.sidebar-account-name {
    overflow: hidden;
    color: var(--admin-text-strong);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-role {
    overflow: hidden;
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-form {
    flex: 0 0 auto;
    margin: 0;
}

.sidebar-logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 82%, transparent);
    border-radius: var(--admin-radius-md);
    padding: 0;
    background: color-mix(in srgb, var(--admin-surface) 76%, transparent);
    color: var(--admin-danger);
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sidebar-logout-button:hover,
.sidebar-logout-button:focus-visible {
    border-color: color-mix(in srgb, var(--admin-danger) 28%, var(--admin-border));
    background: color-mix(in srgb, var(--admin-danger) 10%, var(--admin-surface));
    color: var(--admin-danger);
    outline: 0;
}

.main {
    min-width: 0;
    padding: 18px 18px 34px;
}

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

.topbar .button {
    white-space: nowrap;
}

.admin-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.admin-modal {
    width: min(520px, calc(100vw - 32px));
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--admin-text);
}

.admin-modal::backdrop {
    background: rgba(4, 17, 32, 0.42);
    backdrop-filter: blur(2px);
}

.admin-modal-surface {
    display: grid;
    gap: 18px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    padding: 18px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-surface);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.admin-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    color: var(--admin-muted);
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.admin-modal-close:hover,
.admin-modal-close:focus-visible {
    border-color: color-mix(in srgb, var(--admin-primary) 34%, var(--admin-border));
    background: var(--admin-primary-soft);
    color: var(--admin-primary-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 12%, transparent);
    outline: 0;
}

.admin-modal-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

h1,
h2 {
    color: var(--admin-text-strong);
}

h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.18;
    font-weight: 750;
}

h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

h3 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: 15px;
    line-height: 1.25;
    font-weight: 750;
}

p {
    margin: 0;
}

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

.panel {
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    background: color-mix(in srgb, var(--admin-surface) 88%, var(--admin-surface-muted));
    box-shadow: var(--admin-shadow-surface);
}

section.panel {
    margin-bottom: 14px;
    padding: 18px;
}

section.panel:has(> .filter-grid) {
    overflow: visible;
}

section.panel:has(> table) {
    overflow-x: auto;
    overflow-y: hidden;
}

section.panel > table {
    width: 100%;
    min-width: max-content;
}

.admin-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.admin-table-scroll > table {
    width: 100%;
    min-width: max-content;
}

section.panel:has(> .admin-table-scroll) {
    overflow: hidden;
}

section.panel:has(> .toolbar + table) th,
section.panel:has(> .toolbar + table) td,
section.panel:has(> .toolbar + .admin-table-scroll) th,
section.panel:has(> .toolbar + .admin-table-scroll) td {
    white-space: nowrap;
}

.panel + .panel {
    margin-top: 14px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.admin-body a.button,
.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 30px;
    padding: 8px 14px;
    background: var(--admin-primary);
    color: var(--admin-on-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.admin-body a.button:hover,
.admin-body a.button:focus-visible,
.button:hover,
.button:focus-visible,
button.button:hover,
button.button:focus-visible {
    border-color: transparent;
    background: var(--admin-primary-strong);
    color: var(--admin-on-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 14%, transparent);
    outline: 0;
}

.admin-body a.button.secondary,
.button.secondary {
    border-color: var(--admin-border);
    background: var(--admin-surface);
    color: var(--admin-primary);
}

.admin-body a.button.secondary:hover,
.admin-body a.button.secondary:focus-visible,
.button.secondary:hover,
.button.secondary:focus-visible {
    border-color: color-mix(in srgb, var(--admin-primary) 34%, var(--admin-border));
    background: var(--admin-primary-soft);
    color: var(--admin-primary-strong);
}

.admin-body a.button.danger,
.button.danger {
    border-color: color-mix(in srgb, var(--admin-danger) 22%, var(--admin-border));
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.admin-body a.button.danger:hover,
.admin-body a.button.danger:focus-visible,
.button.danger:hover,
.button.danger:focus-visible {
    border-color: color-mix(in srgb, var(--admin-danger) 40%, var(--admin-border));
    background: color-mix(in srgb, var(--admin-danger-soft) 74%, var(--admin-surface));
    color: var(--admin-danger);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: var(--admin-surface-strong);
}

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

tbody tr:last-child > th,
tbody tr:last-child > td,
tfoot tr:last-child > th,
tfoot tr:last-child > td {
    border-bottom: 0;
}

th {
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-body a.sort-header,
.sort-header {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    color: inherit;
    font: inherit;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.15;
    text-decoration: none;
    text-transform: uppercase;
    vertical-align: top;
}

.admin-body a.sort-header:hover,
.admin-body a.sort-header:focus-visible {
    color: var(--admin-primary-strong);
    text-decoration: none;
}

.sort-header__label {
    min-width: 0;
    overflow-wrap: normal;
}

.sort-header__icon {
    position: relative;
    width: 9px;
    height: 12px;
    flex: 0 0 9px;
    border: 0;
    border-radius: 0;
    margin-top: 1px;
    opacity: 0.68;
}

.sort-header__icon::before,
.sort-header__icon::after {
    content: "";
    position: absolute;
    left: 1px;
    width: 0;
    height: 0;
    border-right: 3.5px solid transparent;
    border-left: 3.5px solid transparent;
    opacity: 0.38;
}

.sort-header__icon::before {
    top: 1px;
    border-bottom: 4px solid currentColor;
}

.sort-header__icon::after {
    bottom: 1px;
    border-top: 4px solid currentColor;
}

.sort-header--active {
    color: var(--admin-primary);
}

.sort-header--active .sort-header__icon {
    opacity: 1;
}

.sort-header--active.sort-header--asc .sort-header__icon::before,
.sort-header--active.sort-header--desc .sort-header__icon::after {
    opacity: 1;
}

.sort-header--active.sort-header--asc .sort-header__icon::after,
.sort-header--active.sort-header--desc .sort-header__icon::before {
    opacity: 0.16;
}

.sort-header--static {
    cursor: default;
}

tbody tr:hover td {
    background: color-mix(in srgb, var(--admin-primary) 3%, transparent);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 86%, transparent);
    border-radius: 999px;
    padding: 3px 9px;
    background: var(--admin-surface-muted);
    color: var(--admin-text);
    font-size: 12px;
    font-weight: 650;
    margin: 0 4px 4px 0;
}

.badge.success {
    border-color: color-mix(in srgb, var(--admin-success) 20%, var(--admin-border));
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.badge.danger {
    border-color: color-mix(in srgb, var(--admin-danger) 20%, var(--admin-border));
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.badge.warning {
    border-color: color-mix(in srgb, var(--admin-warning) 24%, var(--admin-border));
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.form-grid {
    display: grid;
    gap: 16px;
    max-width: 720px;
}

.admin-reference-document-form {
    max-width: 1040px;
}

.admin-reference-document-view {
    display: grid;
    gap: 14px;
}

.admin-reference-document-summary-card th {
    width: 220px;
}

.admin-reference-document-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 72%, transparent);
}

.admin-reference-document-header h2 {
    margin: 0 0 3px;
    color: var(--admin-text-strong);
    font-size: 18px;
    line-height: 1.25;
}

.admin-account-form .toolbar {
    margin-bottom: 0;
}

.form-section {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--admin-border) 70%, transparent);
}

.admin-account-form .toolbar + .form-section {
    padding-top: 0;
    border-top: 0;
}

.field-hint {
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.form-actions .button {
    min-width: 128px;
}

.admin-text-preview {
    display: block;
    width: min(360px, 34vw);
    max-width: 360px;
    overflow: hidden;
    color: var(--admin-muted);
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table-scroll > .admin-reference-material-table {
    min-width: 1180px;
}

.admin-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

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

.admin-meta-grid > div {
    display: grid;
    gap: 4px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    padding: 10px 12px;
    background: var(--admin-surface);
}

.admin-reference-document-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-import-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.admin-import-form label {
    min-width: min(420px, 100%);
}

.admin-import-form--modal {
    display: grid;
    align-items: stretch;
    gap: 16px;
}

.admin-import-form--modal label {
    min-width: 0;
}

.admin-import-form--modal .form-actions {
    justify-content: flex-start;
}

.admin-reference-section-toolbar {
    margin-bottom: 0;
}

.admin-reference-section-list {
    display: grid;
    gap: 14px;
}

.admin-reference-section-list--compact {
    gap: 10px;
}

.admin-reference-section-card {
    display: grid;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 86%, transparent);
    border-radius: var(--admin-radius-lg);
    padding: 14px;
    background: var(--admin-surface);
}

.admin-reference-section-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.admin-reference-section-card__header h4 {
    margin: 0 0 3px;
    color: var(--admin-text-strong);
    font-size: 15px;
    line-height: 1.25;
}

.admin-reference-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
}

.admin-reference-section-active {
    margin-top: 0;
}

.admin-reference-section-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.admin-reference-section-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.admin-reference-section-badges .badge {
    margin: 0;
}

.admin-reference-document-section-view {
    display: grid;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 78%, transparent);
    border-radius: var(--admin-radius-lg);
    padding: 14px;
    background: color-mix(in srgb, var(--admin-surface) 94%, var(--admin-surface-muted));
}

.admin-reference-document-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.admin-reference-document-section-header h3 {
    margin: 0 0 2px;
    color: var(--admin-text-strong);
    font-size: 15px;
    line-height: 1.25;
}

.admin-reference-document-section-header .badge {
    margin: 0;
}

.admin-reference-document-content {
    max-height: 420px;
    margin: 0;
    overflow: auto;
    border: 1px solid color-mix(in srgb, var(--admin-border) 58%, transparent);
    border-radius: var(--admin-radius-md);
    padding: 12px 13px;
    background: var(--admin-surface-muted);
    color: var(--admin-text);
    font: 14px/1.55 var(--admin-font-sans);
    white-space: normal;
}

.admin-ai-chat-summary-card th {
    width: 220px;
}

.admin-ai-chat-history {
    display: grid;
    gap: 14px;
}

.admin-ai-chat-message-list {
    display: grid;
    gap: 14px;
}

.admin-ai-chat-message {
    display: grid;
    gap: 12px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 82%, transparent);
    border-left-width: 4px;
    border-radius: var(--admin-radius-lg);
    padding: 14px;
    background: var(--admin-surface);
}

.admin-ai-chat-message--user {
    border-left-color: var(--admin-warning);
}

.admin-ai-chat-message--assistant {
    border-left-color: var(--admin-success);
}

.admin-ai-chat-message-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.admin-ai-chat-message-header > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.admin-ai-chat-message-header code {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--admin-muted);
    font-size: 12px;
}

.admin-ai-chat-message-content {
    border: 1px solid color-mix(in srgb, var(--admin-border) 58%, transparent);
    border-radius: var(--admin-radius-md);
    padding: 12px 13px;
    background: color-mix(in srgb, var(--admin-surface-muted) 72%, var(--admin-surface));
    color: var(--admin-text);
    font: 14px/1.55 var(--admin-font-sans);
    white-space: normal;
}

.admin-ai-chat-context-summary {
    display: grid;
    gap: 4px;
    border: 1px solid color-mix(in srgb, var(--admin-primary) 18%, var(--admin-border));
    border-radius: var(--admin-radius-md);
    padding: 10px 12px;
    background: var(--admin-primary-soft);
    color: var(--admin-text);
}

.admin-ai-chat-message-details {
    display: grid;
    gap: 8px;
}

.admin-ai-chat-message-details details {
    border: 1px solid color-mix(in srgb, var(--admin-border) 72%, transparent);
    border-radius: var(--admin-radius-md);
    background: var(--admin-surface-muted);
}

.admin-ai-chat-message-details summary {
    padding: 9px 11px;
    color: var(--admin-text-strong);
    font-weight: 700;
    cursor: pointer;
}

.admin-ai-chat-message-details pre {
    max-height: 360px;
    margin: 0;
    overflow: auto;
    border-top: 1px solid color-mix(in srgb, var(--admin-border) 68%, transparent);
    padding: 12px;
    color: var(--admin-text);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-import-file-label {
    gap: 8px;
}

.admin-file-upload {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    border: 1px solid color-mix(in srgb, var(--admin-primary) 30%, var(--admin-border));
    border-radius: var(--admin-radius-md);
    padding: 7px;
    background: var(--admin-surface);
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.admin-file-upload:hover,
.admin-file-upload:focus-within {
    border-color: color-mix(in srgb, var(--admin-primary) 48%, var(--admin-border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 12%, transparent);
}

.admin-file-upload__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    padding: 0;
    background: transparent;
    opacity: 0;
    cursor: pointer;
}

.admin-file-upload__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 999px;
    padding: 7px 12px;
    background: var(--admin-primary-soft);
    color: var(--admin-primary);
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.admin-file-upload__name {
    min-width: 0;
    padding: 0 10px;
    overflow: hidden;
    color: var(--admin-muted);
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-file-upload--selected .admin-file-upload__name {
    color: var(--admin-text-strong);
}

.admin-date-range-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    min-height: 34px;
    color: var(--admin-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.admin-date-range-label__text {
    color: var(--admin-muted);
}

.admin-date-range__source-label {
    display: none !important;
}

.admin-date-range {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    max-width: 100%;
}

.admin-date-range__native {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    border: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.admin-date-range__control {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 224px;
    min-height: 34px;
    border: 0;
    border-radius: var(--admin-radius-md);
    padding: 6px 9px 6px 10px;
    background: var(--admin-primary-soft);
    color: var(--admin-primary);
    font: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.admin-date-range__control:hover,
.admin-date-range__control:focus-visible,
.admin-date-range__control[aria-expanded="true"] {
    background: color-mix(in srgb, var(--admin-primary-soft) 76%, var(--admin-surface));
    color: var(--admin-primary-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 12%, transparent);
    outline: 0;
}

.admin-date-range--empty .admin-date-range__value {
    color: color-mix(in srgb, var(--admin-muted) 74%, transparent);
}

.admin-date-range__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-date-range__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.admin-date-range__icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.admin-date-range__popover {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    left: 0;
    width: 536px;
    max-width: calc(100vw - 40px);
    border: 1px solid color-mix(in srgb, var(--admin-border) 82%, var(--admin-border-strong));
    border-radius: var(--admin-radius-md);
    padding: 12px;
    background: var(--admin-surface);
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(4, 17, 32, 0.20), 0 2px 5px rgba(4, 17, 32, 0.14);
}

.admin-date-range__header {
    display: grid;
    grid-template-columns: 30px 1fr 1fr 30px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-date-range__title,
.admin-date-range__nav,
.admin-date-range__day {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.admin-date-range__title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 2px;
    color: #111827;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    cursor: default;
}

.admin-date-range__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    padding: 0;
    color: #374151;
}

.admin-date-range__nav:hover,
.admin-date-range__nav:focus-visible {
    background: #e8f1fe;
    color: #0b78e3;
    outline: 0;
}

.admin-date-range__nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.admin-date-range__months {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-date-range__month {
    min-width: 0;
}

.admin-date-range__weekdays,
.admin-date-range__grid {
    display: grid;
    grid-template-columns: repeat(7, 30px);
    justify-content: center;
}

.admin-date-range__weekdays {
    margin-bottom: 4px;
}

.admin-date-range__weekdays span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
}

.admin-date-range__day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 0;
    padding: 0;
    color: #111827;
    font-size: 12px;
    font-weight: 500;
}

.admin-date-range__day:hover,
.admin-date-range__day:focus-visible {
    background: #e8f1fe;
    color: #0b78e3;
    outline: 0;
}

.admin-date-range__day--outside {
    background: transparent;
    color: #9ca3af;
    cursor: default;
}

.admin-date-range__day--outside:hover,
.admin-date-range__day--outside:focus-visible {
    background: transparent;
    color: #9ca3af;
    outline: 0;
}

.admin-date-range__day--today {
    box-shadow: inset 0 0 0 1px #0b78e3;
}

.admin-date-range__day--in-range {
    background: #e8f1fe;
    color: #0b417b;
}

.admin-date-range__day--range-start,
.admin-date-range__day--range-start:hover,
.admin-date-range__day--range-start:focus-visible,
.admin-date-range__day--range-end,
.admin-date-range__day--range-end:hover,
.admin-date-range__day--range-end:focus-visible {
    background: #1a73e8;
    color: #ffffff;
    box-shadow: none;
}

.admin-date-range__day--range-start {
    border-radius: 999px 0 0 999px;
}

.admin-date-range__day--range-end {
    border-radius: 0 999px 999px 0;
}

.admin-date-range__day--range-start.admin-date-range__day--range-end {
    border-radius: 999px;
}

@media (max-width: 720px) {
    .admin-date-range__control {
        min-width: min(224px, calc(100vw - 48px));
    }

    .admin-date-range__popover {
        width: 268px;
    }

    .admin-date-range__header {
        grid-template-columns: 30px 1fr 30px;
    }

    .admin-date-range__title:nth-child(3),
    .admin-date-range__month:nth-child(2) {
        display: none;
    }

    .admin-date-range__months {
        grid-template-columns: 1fr;
    }
}

.filter-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.filter-grid > label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    min-height: 34px;
    color: var(--admin-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.filter-grid > label:has(> select:not([multiple])) {
    position: relative;
    max-width: 340px;
    border-radius: var(--admin-radius-md);
    padding: 6px 34px 6px 10px;
    background: var(--admin-primary-soft);
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.filter-grid > label:has(> select:not([multiple]))::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--admin-primary);
    border-bottom: 1.5px solid var(--admin-primary);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.filter-grid > label:has(> select:not([multiple])):hover,
.filter-grid > label:has(> select:not([multiple])):focus-within {
    background: color-mix(in srgb, var(--admin-primary-soft) 76%, var(--admin-surface));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 12%, transparent);
}

.filter-multiselect,
.filter-select {
    position: relative;
    flex: 0 0 auto;
}

.filter-multiselect summary,
.filter-select summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: var(--admin-radius-md);
    padding: 6px 34px 6px 10px;
    background: var(--admin-primary-soft);
    color: var(--admin-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    list-style: none;
    cursor: pointer;
}

.filter-multiselect summary::-webkit-details-marker,
.filter-select summary::-webkit-details-marker {
    display: none;
}

.filter-multiselect summary::after,
.filter-select summary::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.16s ease;
}

.filter-multiselect[open] summary::after,
.filter-select[open] summary::after {
    transform: translateY(-30%) rotate(225deg);
}

.filter-choice-label {
    margin-right: 5px;
    color: var(--admin-muted);
}

.filter-choice-value {
    color: var(--admin-primary);
    white-space: nowrap;
}

.filter-check-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 260px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    padding: 7px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-surface);
}

.filter-grid .filter-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    padding: 7px 8px;
    background: transparent;
    color: var(--admin-text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.filter-grid .filter-check:hover,
.filter-grid .filter-check:focus-within {
    background: var(--admin-primary-soft);
    color: var(--admin-text-strong);
}

.filter-grid .filter-check:has(input:checked),
.filter-grid .filter-select-option--selected {
    background: var(--admin-primary-soft);
    color: var(--admin-primary-strong);
}

.filter-grid .filter-select-option {
    width: 100%;
    font: inherit;
    text-align: left;
}

.filter-select__native {
    display: none;
}

.filter-check input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--admin-primary);
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--admin-text-strong);
    font-weight: 650;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--admin-border);
    border-radius: 100px;
    padding: 9px 11px;
    background: var(--admin-surface);
    color: var(--admin-text);
    font: inherit;
    box-shadow: none;
    outline: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

textarea {
    min-height: 220px;
    border-radius: var(--admin-radius-md);
    line-height: 1.45;
    resize: vertical;
}

input[type="date"] {
    color-scheme: light;
    font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    width: 17px;
    height: 17px;
    margin: 0;
    opacity: 0.72;
    cursor: pointer;
}

input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

input[type="file"] {
    max-width: 420px;
}

.filter-grid input[type="text"],
.filter-grid input[type="number"],
.filter-grid input[type="date"],
.filter-grid select {
    width: auto;
    min-width: 96px;
    max-width: 280px;
    min-height: 34px;
    border: 0;
    border-radius: var(--admin-radius-md);
    padding: 6px 30px 6px 10px;
    background-color: var(--admin-primary-soft);
    color: var(--admin-primary);
    font-size: 14px;
    font-weight: 500;
}

.filter-grid input[type="text"] {
    min-width: 150px;
}

.filter-grid input[type="number"] {
    min-width: 86px;
}

.filter-grid input[type="date"] {
    min-width: 136px;
    padding-right: 8px;
}

.filter-grid .admin-date-range__native {
    min-width: 0;
    padding: 0;
}

.filter-grid select {
    min-width: 112px;
}

.filter-grid select:not([multiple]) {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    max-width: 190px;
    min-height: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: var(--admin-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

input:hover,
textarea:hover,
select:hover {
    border-color: color-mix(in srgb, var(--admin-primary) 20%, var(--admin-border));
}

input:focus,
textarea:focus,
select:focus {
    border-color: color-mix(in srgb, var(--admin-primary) 42%, var(--admin-border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 12%, transparent);
}

.filter-grid > label:has(> select:not([multiple])) select:not([multiple]):focus {
    box-shadow: none;
}

select[multiple] {
    min-height: 112px;
    border-radius: var(--admin-radius-md);
}

.filter-grid select[multiple] {
    min-height: 96px;
    padding: 7px;
}

.filter-grid select[multiple] option {
    border-radius: 6px;
    padding: 5px 7px;
}

.filter-grid select[multiple] option:checked {
    background: var(--admin-primary-soft);
    color: var(--admin-text-strong);
}

.choice-list {
    display: grid;
    gap: 10px;
}

.choice {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    padding: 12px;
    background: var(--admin-surface);
    font-weight: 400;
}

.choice input {
    margin-top: 3px;
}

.choice input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--admin-primary);
}

.choice--disabled {
    background: var(--admin-surface-muted);
    color: var(--admin-muted);
    cursor: not-allowed;
}

.choice--disabled input {
    cursor: not-allowed;
}

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

.stat-card {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    padding: 14px;
    background: var(--admin-surface);
}

.stat-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--admin-text-strong);
    font-size: 22px;
    line-height: 1.1;
}

.dashboard {
    display: grid;
    gap: 14px;
}

.dashboard-actions,
.dashboard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-table th {
    width: 220px;
}

.dashboard-table td {
    min-width: 520px;
}

.admin-body .dashboard-links a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid color-mix(in srgb, var(--admin-border) 84%, transparent);
    border-radius: var(--admin-radius-md);
    padding: 5px 10px;
    background: var(--admin-surface);
    color: var(--admin-primary);
    font-weight: 650;
    line-height: 1.25;
    white-space: nowrap;
}

.admin-body .dashboard-links a:hover,
.admin-body .dashboard-links a:focus-visible {
    border-color: color-mix(in srgb, var(--admin-primary) 34%, var(--admin-border));
    background: var(--admin-primary-soft);
    color: var(--admin-primary-strong);
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message,
.error {
    border-radius: var(--admin-radius-md);
    padding: 10px 12px;
    line-height: 1.35;
}

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

.message.error,
.error {
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.admin-body--login {
    display: grid;
    place-items: center;
    padding: 18px;
}

.login {
    width: min(430px, 100%);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-xl);
    padding: 28px;
    background: var(--admin-gradient-deep);
    box-shadow: var(--admin-shadow-soft);
}

.login .brand {
    justify-content: center;
    width: 100%;
    min-height: auto;
    padding: 0;
    margin-bottom: 30px;
    font-size: 20px;
}

.login .brand img {
    display: block;
    width: 100%;
    height: auto;
}

.login .error,
.login .success {
    display: flex;
    align-items: center;
    min-height: 40px;
    width: 100%;
    margin: 0 0 14px;
    border: 1px solid color-mix(in srgb, var(--admin-danger) 22%, transparent);
    border-radius: var(--admin-radius-lg);
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
}

.login .success {
    border-color: color-mix(in srgb, var(--admin-success) 24%, transparent);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.login h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.login p {
    margin: 0 0 20px;
    color: var(--admin-muted);
}

.login form {
    display: grid;
    gap: 14px;
}

.login button[type="submit"] {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 30px;
    background: var(--admin-primary);
    color: var(--admin-on-primary);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.login button[type="submit"]:hover,
.login button[type="submit"]:focus-visible {
    background: var(--admin-primary-strong);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--admin-primary) 14%, transparent);
    outline: 0;
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--admin-muted);
    font-weight: 400;
}

.row input {
    width: auto;
    min-height: auto;
}

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

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .nav form {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }
}

@media (max-width: 720px) {
    .admin-shell {
        padding: 10px;
    }

    .main {
        padding: 10px 0 28px;
    }

    .topbar,
    .toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 24px;
    }

    section.panel {
        padding: 14px;
    }

    th,
    td {
        padding: 10px 8px;
    }

    .admin-reference-section-card__header,
    .admin-reference-document-header,
    .admin-reference-document-section-header,
    .admin-ai-chat-message-header,
    .admin-reference-document-summary,
    .admin-reference-section-grid {
        grid-template-columns: 1fr;
    }

    .admin-reference-section-card__header,
    .admin-reference-document-header,
    .admin-reference-document-section-header,
    .admin-ai-chat-message-header {
        display: grid;
    }
}
