:root {
    --navy: #111c31;
    --blue: #405cdb;
    --bg: #f5f7fc;
    --line: #e3e9f2;
    --text: #23334d;
    --muted: #65758d
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif
}

a {
    color: var(--blue);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button,
input,
select,
textarea {
    font: inherit
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--blue);
    color: white;
    padding: 10px 16px;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600
}

button:hover,
.button:hover {
    filter: brightness(.94);
    text-decoration: none
}

button:disabled {
    opacity: .5;
    cursor: default
}

.secondary {
    color: var(--text);
    background: #fff;
    border-color: #ced7e6
}

.danger {
    background: #b83248
}

.shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    position: sticky;
    top: 0;
    width: 260px;
    flex: 0 0 260px;
    height: 100vh;
    overflow-y: auto;
    background: var(--navy);
    color: #aabbd4;
    padding: 24px 16px;
    display: flex;
    flex-direction: column
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    margin: 0 8px 35px
}

.brand-mark {
    background: #5369ed;
    border-radius: 11px;
    padding: 7px 14px;
    font-size: 23px;
    font-weight: 800
}

.brand small,
.profile small {
    display: block;
    color: #9aaac5;
    font-size: 12px
}

.brand strong {
    font-size: 18px
}

.nav-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #879ab8;
    margin: 22px 12px 12px
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #b6c4da;
    border-radius: 10px;
    padding: 12px;
    margin: 4px 0;
    font-size: 13px
}

.sidebar nav a>span {
    width: 23px;
    font-size: 22px;
    text-align: center
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #2b3e68;
    color: white;
    text-decoration: none
}

.profile {
    margin-top: auto;
    padding: 25px 12px 0
}

.profile strong {
    color: #fff
}

.workspace {
    flex: 1;
    min-width: 0
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 32px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-size: 13px
}

.topbar form {
    margin-left: auto
}

.content {
    padding: 28px 32px 45px;
    max-width: 1500px;
    margin: auto
}

.page-heading {
    margin-bottom: 25px
}

.page-heading>span {
    color: var(--blue);
    font-size: 10px;
    letter-spacing: 1.6px;
    font-weight: 750
}

h1 {
    font-size: 29px;
    letter-spacing: -.6px;
    margin: 7px 0
}

h2 {
    font-size: 19px;
    margin: 0 0 15px
}

h3 {
    font-size: 16px
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 24px;
    margin: 0 0 22px;
    box-shadow: 0 6px 23px #14243b05;
    min-width: 0
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 22px
}

.fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 15px
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px
}

input,
select,
textarea {
    border: 1px solid #cfd9e8;
    border-radius: 8px;
    padding: 10px 12px;
    background: white;
    color: var(--text);
    width: 100%;
    min-width: 0;
    min-height: 44px
}

input[type=checkbox] {
    width: 19px;
    height: 19px;
    min-height: 19px;
    accent-color: var(--blue)
}

.check {
    flex-direction: row;
    align-items: center;
    gap: 9px
}

.check input {
    flex: 0 0 19px
}

textarea {
    resize: vertical;
    min-height: 90px
}

:focus-visible {
    outline: 3px solid #9aaef4;
    outline-offset: 3px
}

.scroll {
    max-width: 100%;
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px
}

th {
    background: #f5f7fb;
    font-size: 12px;
    white-space: nowrap
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top
}

td {
    overflow-wrap: anywhere
}

td.actions {
    min-width: 170px
}

.actions form {
    display: inline-block;
    margin: 5px 4px 0 0
}

.actions .button,
.actions button {
    font-size: 12px;
    padding: 8px 10px
}

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

.toolbar label {
    margin: 0
}

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

.muted,
small {
    color: var(--muted)
}

.notice {
    border-radius: 10px;
    padding: 14px 17px;
    margin: 0 0 22px
}

.success {
    background: #e6f5ee;
    color: #20644a
}

.error {
    background: #fff0f0;
    color: #9e263d
}

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

.badge {
    display: inline-block;
    border-radius: 99px;
    background: #edf1fe;
    color: #405ac4;
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap
}

.badge.off {
    background: #f1f2f5;
    color: #626c7b
}

.stat {
    font-size: 34px;
    font-weight: 750;
    display: block
}

.menu-button,
.close-menu,
.overlay {
    display: none
}

footer {
    padding: 10px 32px 25px;
    font-size: 12px;
    color: var(--muted)
}

.preview {
    display: block;
    max-width: 180px;
    max-height: 180px;
    object-fit: contain
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px
}

.auth-card {
    width: 100%;
    max-width: 430px
}

.auth-card .brand {
    background: var(--navy);
    margin: -24px -24px 24px;
    padding: 25px;
    border-radius: 14px 14px 0 0
}

.auth-card button[type=submit] {
    width: 100%
}

.inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

details>summary {
    cursor: pointer;
    color: var(--blue);
    padding: 8px 0
}

details form {
    min-width: min(100%, 230px);
    margin-top: 12px
}

.permission-cell {
    text-align: center
}

.permission-cell input {
    margin: auto
}

.summary {
    max-width: 360px
}

.long-value {
    overflow-wrap: anywhere;
    word-break: break-word
}

@media(max-width:950px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .2s;
        z-index: 20
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .overlay.open {
        display: block;
        position: fixed;
        inset: 0;
        background: #071425a6;
        z-index: 19;
        border-radius: 0;
        width: 100%;
        height: 100%
    }

    .menu-button,
    .close-menu {
        display: block;
        background: transparent;
        color: var(--text);
        padding: 5px 10px;
        font-size: 22px
    }

    .close-menu {
        color: white;
        margin-left: auto
    }

    .content {
        padding: 24px 20px
    }

    .topbar {
        padding: 12px 20px
    }

    .topbar>span {
        min-width: 0
    }

    .brand {
        gap: 8px
    }

    .sidebar .brand {
        margin-left: 0;
        margin-right: 0
    }
}

@media(max-width:580px) {
    .content {
        padding: 22px 12px
    }

    .panel {
        padding: 17px;
        border-radius: 12px
    }

    .topbar {
        padding: 10px 12px;
        gap: 8px
    }

    .topbar>span {
        font-size: 12px
    }

    .topbar .secondary {
        padding: 8px 12px
    }

    h1 {
        font-size: 25px
    }

    .fields,
    .grid {
        grid-template-columns: minmax(0, 1fr)
    }

    th,
    td {
        padding: 10px 8px
    }

    .toolbar form {
        width: 100%
    }

    .toolbar label {
        flex: 1;
        min-width: 0
    }

    .auth-card .brand {
        margin: -17px -17px 24px
    }

    .actions .button,
    .actions button {
        min-height: 44px
    }

    .scroll table {
        min-width: 540px
    }

    .auth-page {
        padding: 16px
    }

    .auth-card {
        max-width: 430px
    }
}

[hidden] {
    display: none !important
}