:root {
    --system-navy: #0d3768;
    --system-blue: #174b91;
    --system-yellow: #ffd100;
    --system-red: #df1820;
    --system-ink: #10284b;
    --system-muted: #62718b;
    --system-line: #d6e0ec;
    --system-soft: #f4f7fb;
}

.system-page {
    background: #fff;
    color: var(--system-ink);
    min-height: 60vh;
}

.system-container {
    width: min(1440px, calc(100% - 48px));
    margin-inline: auto;
}

.system-hero {
    background:
        radial-gradient(circle at 90% 18%, rgba(255, 209, 0, .18), transparent 22rem),
        linear-gradient(125deg, #092b55 0%, #164c86 100%);
    border-bottom: 5px solid var(--system-yellow);
    color: #fff;
    padding: 58px 0 54px;
}

.system-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 32px;
}

.system-kicker {
    color: var(--system-yellow);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .16em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.system-hero h1 {
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    letter-spacing: -.045em;
    line-height: .98;
    margin: 0;
}

.system-hero p:last-child {
    color: rgba(255,255,255,.82);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 18px 0 0;
    max-width: 720px;
}

.system-manage-link {
    align-items: center;
    background: var(--system-yellow);
    border-radius: 8px;
    color: #071f40;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    min-height: 48px;
    padding: 0 22px;
    text-decoration: none;
}

.system-directory {
    padding: 54px 0 68px;
}

.system-directory-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.system-directory-heading h2 {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    letter-spacing: -.035em;
    margin: 0;
}

.system-directory-heading p {
    color: var(--system-muted);
    margin: 6px 0 0;
}

.system-total {
    background: #eaf1f9;
    border-radius: 999px;
    color: var(--system-navy);
    font-size: .82rem;
    font-weight: 800;
    padding: 8px 14px;
    white-space: nowrap;
}

.system-category-grid {
    display: grid;
    gap: 24px;
}

.system-category {
    background: #fff;
    border: 1px solid var(--system-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 40, 75, .07);
    overflow: hidden;
}

.system-category-heading {
    align-items: center;
    background: var(--system-navy);
    border-bottom: 4px solid var(--system-yellow);
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 24px;
}

.system-category-heading h3 {
    font-size: 1.16rem;
    margin: 0;
}

.system-category-heading span {
    color: rgba(255,255,255,.78);
    font-size: .78rem;
    font-weight: 700;
}

.system-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.system-table th {
    background: #eef3f9;
    color: #314a6c;
    font-size: .72rem;
    letter-spacing: .08em;
    padding: 13px 18px;
    text-align: left;
    text-transform: uppercase;
}

.system-table th:first-child,
.system-table td:first-child {
    text-align: center;
    width: 72px;
}

.system-table th:last-child,
.system-table td:last-child {
    text-align: center;
    width: 92px;
}

.system-table td {
    border-top: 1px solid #e2e9f2;
    padding: 16px 18px;
    vertical-align: middle;
}

.system-table tbody tr:hover {
    background: #f8fbff;
}

.system-name {
    display: block;
    font-size: 1rem;
    font-weight: 800;
}

.system-meta {
    align-items: center;
    color: var(--system-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .82rem;
    gap: 7px;
    line-height: 1.5;
    margin-top: 5px;
}

.system-unit {
    background: #e8f0fb;
    border-radius: 999px;
    color: var(--system-blue);
    font-size: .68rem;
    font-weight: 800;
    padding: 3px 8px;
    text-transform: uppercase;
}

.system-open-icon {
    align-items: center;
    background: var(--system-navy);
    border-radius: 9px;
    color: #fff;
    display: inline-flex;
    font-size: 1.12rem;
    height: 42px;
    justify-content: center;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease;
    width: 42px;
}

.system-open-icon:hover,
.system-open-icon:focus-visible {
    background: var(--system-blue);
    transform: translateY(-2px);
}

.system-empty {
    color: var(--system-muted);
    font-style: italic;
    padding-block: 22px !important;
    text-align: left !important;
}

.system-admin {
    background: var(--system-soft);
    border-top: 1px solid var(--system-line);
    padding: 54px 0 72px;
}

.system-admin-panel {
    background: #fff;
    border: 1px solid var(--system-line);
    border-top: 5px solid var(--system-yellow);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(16, 40, 75, .08);
    padding: clamp(22px, 4vw, 38px);
}

.system-admin-header {
    align-items: start;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.system-admin h2,
.system-admin h3 {
    margin-top: 0;
}

.system-admin h2 {
    font-size: 1.55rem;
    margin-bottom: 7px;
}

.system-admin h3 {
    font-size: 1.05rem;
    margin-bottom: 16px;
}

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

.system-login-form {
    display: flex;
    gap: 10px;
    max-width: 580px;
}

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

.system-form-grid .wide {
    grid-column: 1 / -1;
}

.system-field label {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.system-field input,
.system-field select,
.system-field textarea,
.system-login-form input,
.system-category-edit input {
    background: #fff;
    border: 1px solid #bfcddd;
    border-radius: 7px;
    box-sizing: border-box;
    font: inherit;
    min-height: 45px;
    padding: 10px 12px;
    width: 100%;
}

.system-field textarea {
    min-height: 86px;
    resize: vertical;
}

.system-button {
    background: var(--system-blue);
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: .84rem;
    font-weight: 800;
    min-height: 44px;
    padding: 0 18px;
}

.system-button.secondary {
    background: #e8eef6;
    color: var(--system-navy);
}

.system-button.danger {
    background: var(--system-red);
}

.system-flash {
    border-left: 4px solid #198754;
    background: #e9f8ef;
    color: #12613b;
    margin: 0 0 22px;
    padding: 13px 15px;
}

.system-flash.error {
    background: #fff0f1;
    border-color: var(--system-red);
    color: #94151b;
}

.system-admin-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr);
}

.system-admin-block {
    border: 1px solid var(--system-line);
    border-radius: 9px;
    padding: 20px;
}

.system-category-list,
.system-item-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.system-category-row,
.system-item-editor {
    background: var(--system-soft);
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 12px;
}

.system-category-edit {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.system-item-editor summary {
    cursor: pointer;
    font-weight: 800;
    padding: 4px;
}

.system-item-editor form {
    margin-top: 16px;
}

.system-check {
    align-items: center;
    display: flex;
    font-size: .84rem;
    font-weight: 700;
    gap: 8px;
}

.system-check input {
    height: 18px;
    width: 18px;
}

.system-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

@media (max-width: 850px) {
    .system-container {
        width: min(100% - 28px, 1440px);
    }

    .system-hero-inner,
    .system-directory-heading {
        align-items: start;
        flex-direction: column;
    }

    .system-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .system-hero {
        padding: 42px 0 38px;
    }

    .system-directory {
        padding-block: 38px 50px;
    }

    .system-category-heading {
        padding-inline: 16px;
    }

    .system-table th,
    .system-table td {
        padding: 13px 10px;
    }

    .system-table th:first-child,
    .system-table td:first-child {
        width: 40px;
    }

    .system-table th:last-child,
    .system-table td:last-child {
        width: 58px;
    }

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

    .system-login-form,
    .system-admin-header {
        align-items: stretch;
        flex-direction: column;
    }

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

    .system-form-grid .wide {
        grid-column: auto;
    }
}
