/*
 * MIDEX admin panel.
 * Visual language follows the public site (sise4ki.github.io/MIDEX):
 * near-black surfaces, warm off-white text, orange accent, Manrope + Unbounded.
 */

@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Unbounded";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/unbounded-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Unbounded";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/unbounded-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #0a0a0d;
    --surface: #131318;
    --surface-2: #1c1c23;
    --surface-3: #24242d;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #f4f2ee;
    --muted: rgba(244, 242, 238, .62);
    --faint: rgba(244, 242, 238, .4);
    --accent: #ff5f1f;
    --accent-hover: #e04a10;
    --accent-soft: rgba(255, 95, 31, .14);
    --lime: #d4ff3f;
    --violet: #7c5cff;
    --success: #3ecf8e;
    --warning: #ffb547;
    --danger: #ff4d5e;
    --info: #8b7bff;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --radius-lg: 24px;
    --radius: 16px;
    --radius-sm: 12px;
    --sidebar: 264px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color .2s var(--ease);
}

a:hover {
    color: var(--accent);
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--text);
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: 1.05;
}

h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.2;
}

h3 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.02em;
}

p {
    margin: 0;
}

small {
    color: var(--muted);
    font-size: 12.5px;
}

pre {
    margin: 10px 0 0;
    padding: 12px 14px;
    max-width: 460px;
    overflow: auto;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

::selection {
    background: var(--accent);
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, .35);
    border-radius: 8px;
}

/* ---------- Shell ---------- */

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100vh;
    padding: 26px 16px 18px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 10px;
}

.sidebar-brand img {
    display: block;
    width: 136px;
    height: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: flex-start;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.eyebrow + h1 {
    margin-top: 16px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14.5px;
    font-weight: 700;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}

.nav a svg {
    flex: none;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--text);
}

.nav a.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 26px rgba(255, 95, 31, .3);
}

.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff2e63);
    color: #fff;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
    line-height: 1.25;
}

.sidebar-user-info strong {
    display: block;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info span {
    display: block;
    overflow: hidden;
    color: var(--faint);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
}

.icon-button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar,
.nav-toggle {
    display: none;
}

.main {
    min-width: 0;
    padding: 34px clamp(18px, 3.2vw, 48px) 64px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.page-head-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.page-subtitle {
    color: var(--muted);
    font-size: 15px;
}

.page-actions,
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

/* ---------- Cards ---------- */

.card {
    position: relative;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.card-head p {
    color: var(--muted);
    font-size: 14px;
}

.card > h2,
.card > h3 {
    margin-bottom: 18px;
}

.card h3 {
    margin-top: 28px;
    margin-bottom: 14px;
}

.card-accent::before {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 95, 31, .7), transparent 40%, transparent 70%, rgba(124, 92, 255, .5));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card-flush {
    padding: 0;
    overflow: hidden;
}

.card-flush > .card-head {
    margin: 0;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

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

.note {
    color: var(--muted);
    font-size: 14px;
}

/* ---------- Stats ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.stat {
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color .3s var(--ease), transform .3s var(--ease);
}

.stat:hover {
    border-color: rgba(255, 95, 31, .5);
    transform: translateY(-2px);
}

.stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(24px, 2.4vw, 34px);
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: 1.05;
}

.stat strong.mono {
    font-size: clamp(17px, 1.6vw, 22px);
    letter-spacing: .02em;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.stat span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13.5px;
}

.stat-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.stat-accent span {
    color: rgba(255, 255, 255, .85);
}

/* ---------- Dashboard tiles ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(26px, 4vw, 44px);
    margin-bottom: 20px;
    background:
        radial-gradient(ellipse 50% 70% at 85% 10%, rgba(255, 95, 31, .3), transparent 70%),
        radial-gradient(ellipse 45% 60% at 10% 100%, rgba(124, 92, 255, .2), transparent 70%),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 32px;
}

.hero h1 {
    font-size: clamp(28px, 4.4vw, 56px);
}

.hero h1 em {
    background: linear-gradient(100deg, #ffb088 0%, #ff5f1f 40%, #ff2e63 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-right: .08em;
}

.hero p {
    margin-top: 14px;
    max-width: 520px;
    color: var(--muted);
    font-size: 16px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: border-color .3s var(--ease), transform .3s var(--ease), background-color .3s var(--ease);
}

.tile:hover {
    color: var(--text);
    border-color: rgba(255, 95, 31, .5);
    transform: translateY(-3px);
}

.tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}

.tile-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tile strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.03em;
}

.tile strong::after {
    content: "↗";
    color: var(--muted);
    transition: transform .25s var(--ease), color .25s var(--ease);
}

.tile:hover strong::after {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.tile-text span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13.5px;
}

/* ---------- Buttons ---------- */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 18px;
    background: transparent;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}

button:hover,
.btn:hover {
    background: rgba(255, 255, 255, .06);
    border-color: var(--text);
    color: var(--text);
}

button[type="submit"],
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 10px 26px rgba(255, 95, 31, .28);
}

button[type="submit"]:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(255, 95, 31, .16), 0 14px 32px rgba(255, 95, 31, .4);
    transform: translateY(-1px);
}

button.btn-ghost,
.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
    box-shadow: none;
}

button.btn-ghost:hover,
.btn-ghost:hover {
    background: rgba(255, 255, 255, .06);
    border-color: var(--text);
    transform: none;
    box-shadow: none;
}

button.btn-danger,
.btn-danger {
    background: transparent;
    border-color: rgba(255, 77, 94, .45);
    color: var(--danger);
    box-shadow: none;
}

button.btn-danger:hover,
.btn-danger:hover {
    background: rgba(255, 77, 94, .12);
    border-color: var(--danger);
    color: #ff8a95;
    transform: none;
    box-shadow: none;
}

button.btn-light,
.btn-light {
    background: var(--text);
    border-color: var(--text);
    color: #0f1115;
    box-shadow: none;
}

button.btn-light:hover,
.btn-light:hover {
    background: #fff;
    border-color: #fff;
    color: #0f1115;
}

.btn-sm,
td button,
td .btn {
    min-height: 32px;
    padding: 5px 13px;
    font-size: 12.5px;
}

td button[type="submit"] {
    box-shadow: none;
}

button:disabled,
button:disabled:hover {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---------- Forms ---------- */

label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]),
label.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color-scheme: dark;
    transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}

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

select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23f4f2ee' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

select option {
    background: var(--surface-2);
    color: var(--text);
}

input[type="file"] {
    padding: 8px;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 14px;
    background: var(--surface-3);
    border: 0;
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: var(--faint);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
    background-color: rgba(255, 255, 255, .08);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 95, 31, .18);
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: .55;
    cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px 18px;
}

.form-grid > .span-all,
.form-grid > div:has(> textarea) {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.form-actions + .note {
    margin-top: 16px;
}

.form-hint {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.inline-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-fields > * {
    flex: 1 1 160px;
}

.input-suffix {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-suffix > input,
.input-suffix > select {
    flex: 1 1 auto;
    min-width: 0;
}

.input-suffix span {
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
}

fieldset {
    margin: 0 0 14px;
    padding: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

legend {
    float: left;
    width: 100%;
    margin-bottom: 14px;
    padding: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.02em;
}

legend + * {
    clear: both;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.toolbar > input,
.toolbar > select,
.toolbar > .toolbar-field {
    flex: 1 1 170px;
    width: auto;
    min-width: 0;
}

.toolbar > input[type="text"],
.toolbar > input[type="search"] {
    flex-basis: 260px;
}

.toolbar .toolbar-field label {
    margin-bottom: 5px;
    font-size: 11px;
}

.toolbar button {
    min-height: 46px;
}

/* ---------- Tables ---------- */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.card .table-wrap,
.card-flush .table-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.card:not(.card-flush) .table-wrap {
    margin: 0 -24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    padding: 13px 18px;
    background: rgba(255, 255, 255, .025);
    border-bottom: 1px solid var(--line);
    color: var(--faint);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody td,
tbody th {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

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

tbody tr {
    transition: background-color .2s var(--ease);
}

tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

td a {
    font-weight: 700;
}

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

td .actions form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

td .actions form input[type="text"],
td .actions form select {
    width: auto;
    min-height: 32px;
    padding: 4px 12px;
    font-size: 12.5px;
    border-radius: 10px;
}

td .actions form select {
    padding-right: 32px;
    background-position: right 12px center;
}

td details form {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 12px;
    min-width: 320px;
}

td details form textarea,
td details form button {
    grid-column: 1 / -1;
}

td details input,
td details textarea {
    min-height: 38px;
    font-size: 13px;
}

details summary {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::after {
    content: " ▾";
}

details[open] summary::after {
    content: " ▴";
}

.nowrap {
    white-space: nowrap;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    letter-spacing: .02em;
}

/* Key / value table */

.kv tbody th {
    width: 38%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.kv tbody td {
    font-weight: 600;
}

.kv tbody tr:hover {
    background: transparent;
}

.dl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px 22px;
    margin: 0;
}

.dl div {
    min-width: 0;
}

.dl dt {
    margin-bottom: 4px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.dl dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success {
    background: rgba(62, 207, 142, .12);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 181, 71, .12);
    color: var(--warning);
}

.badge-danger {
    background: rgba(255, 77, 94, .12);
    color: var(--danger);
}

.badge-info {
    background: rgba(139, 123, 255, .14);
    color: var(--info);
}

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

.chip {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 3px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid;
    border-radius: var(--radius);
    font-weight: 600;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.alert-success {
    background: rgba(62, 207, 142, .08);
    border-color: rgba(62, 207, 142, .35);
    color: #9be8c4;
}

.alert-error {
    background: rgba(255, 77, 94, .08);
    border-color: rgba(255, 77, 94, .35);
    color: #ffb3ba;
}

.alert-warning {
    background: rgba(255, 181, 71, .08);
    border-color: rgba(255, 181, 71, .35);
    color: #ffd699;
}

.alert-highlight {
    flex-direction: column;
    background: linear-gradient(135deg, rgba(255, 95, 31, .2), rgba(255, 95, 31, .05));
    border-color: rgba(255, 95, 31, .5);
    color: var(--text);
}

.alert-highlight code {
    align-self: flex-start;
    padding: 8px 14px;
    background: var(--bg);
    border-radius: 10px;
    color: var(--lime);
    font: 700 18px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .06em;
    user-select: all;
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-weight: 700;
}

.pagination-links a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-links .is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination-links .is-disabled {
    color: var(--faint);
}

/* ---------- Login ---------- */

.auth {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    overflow: hidden;
}

.auth::before,
.auth::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.auth::before {
    top: -260px;
    right: -180px;
    width: 720px;
    height: 720px;
    background: radial-gradient(circle, rgba(255, 95, 31, .5), transparent 65%);
}

.auth::after {
    bottom: -220px;
    left: -220px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(124, 92, 255, .28), transparent 65%);
}

.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 0%, transparent 75%);
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 40px 38px 34px;
    background: rgba(19, 19, 24, .92);
    border: 1px solid var(--line-strong);
    border-radius: 32px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
}

.auth-card img {
    display: block;
    width: 150px;
    height: auto;
    margin-bottom: 26px;
}

.auth-card h1 {
    font-size: 26px;
}

.auth-card .note {
    margin: 8px 0 28px;
}

.auth-card .field {
    margin-bottom: 16px;
}

.auth-card .field-error {
    margin-top: 6px;
    color: #ffb3ba;
    font-size: 13px;
}

.auth-card button[type="submit"] {
    width: 100%;
    min-height: 54px;
    margin-top: 22px;
    font-size: 15px;
}

.auth-footer {
    margin-top: 26px;
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-align: center;
    text-transform: uppercase;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        background: rgba(19, 19, 24, .85);
        border-bottom: 1px solid var(--line);
        -webkit-backdrop-filter: saturate(160%) blur(18px);
        backdrop-filter: saturate(160%) blur(18px);
    }

    .topbar img {
        display: block;
        width: 116px;
        height: auto;
    }

    .topbar label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin: 0;
        border: 1px solid var(--line-strong);
        border-radius: 50%;
        color: var(--text);
        cursor: pointer;
    }

    .topbar label svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .sidebar {
        position: fixed;
        top: 69px;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(300px, 86vw);
        height: auto;
        transform: translateX(-105%);
        transition: transform .35s var(--ease);
    }

    .sidebar-brand {
        display: none;
    }

    .nav-toggle:checked ~ .shell .sidebar {
        transform: none;
        box-shadow: 30px 0 60px rgba(0, 0, 0, .5);
    }

    .main {
        padding: 24px 16px 48px;
    }

    .toolbar > input,
    .toolbar > select,
    .toolbar > .toolbar-field,
    .toolbar > button {
        flex: 1 1 100%;
    }

    .input-suffix {
        flex-wrap: wrap;
    }

    .input-suffix > button {
        flex: 1 1 auto;
    }

    .card {
        padding: 18px;
        border-radius: 20px;
    }

    .card:not(.card-flush) .table-wrap {
        margin: 0 -18px;
    }

    .auth-card {
        padding: 30px 22px 26px;
        border-radius: 24px;
    }
}
