@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit_400.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit_500.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit_600.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit_700.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #080611;
    --bg-soft: #0d0919;
    --panel: #120d22;
    --panel-raised: #19112d;
    --stroke: rgba(255, 255, 255, 0.09);
    --stroke-strong: rgba(255, 255, 255, 0.16);
    --text: #f7f2ff;
    --muted: #a99ec4;
    --muted-strong: #c8bedf;
    --pink: #ff5d9e;
    --violet: #a855f7;
    --cyan: #22d3ee;
    --green: #34d399;
    --amber: #fbbf24;
    --danger: #fb7185;
    --radius: 20px;
    --radius-small: 13px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(900px 600px at 12% -8%, rgba(139, 92, 246, 0.25), transparent 60%),
        radial-gradient(700px 500px at 100% 0%, rgba(255, 93, 158, 0.14), transparent 55%),
        radial-gradient(700px 700px at 50% 110%, rgba(34, 211, 238, 0.08), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: "Outfit", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

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

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 26px 18px 22px;
    border-right: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(20, 13, 37, 0.94), rgba(8, 6, 17, 0.9));
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 4px 8px;
}

.brand img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.brand strong {
    display: block;
    font-size: 14px;
    letter-spacing: 0.14em;
}

.brand small {
    display: block;
    color: var(--cyan);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.24em;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--muted-strong);
    font-weight: 500;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    color: var(--muted);
}

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

.nav-link.is-active {
    color: var(--text);
    border-color: rgba(168, 85, 247, 0.28);
    background: linear-gradient(100deg, rgba(168, 85, 247, 0.24), rgba(255, 93, 158, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-link.is-active svg {
    color: #fff;
}

.sidebar-note {
    margin-top: auto;
    padding: 15px;
    border: 1px solid var(--stroke);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 12px;
}

.sidebar-note p {
    margin: 8px 0 0;
}

.sidebar-note-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

.main {
    min-width: 0;
    padding: 30px 38px 60px;
}

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

.eyebrow {
    margin: 0 0 6px;
    color: var(--cyan);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    padding: 8px 13px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted-strong);
    font-size: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: linear-gradient(115deg, var(--violet), var(--pink));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
    box-shadow: 0 10px 26px rgba(168, 85, 247, 0.25);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(168, 85, 247, 0.34);
}

.btn:active {
    transform: translateY(0);
}

.btn svg {
    width: 17px;
    height: 17px;
}

.btn-quiet {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--stroke);
    color: var(--muted-strong);
    box-shadow: none;
}

.btn-quiet:hover {
    color: var(--text);
    border-color: var(--stroke-strong);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(115deg, #fb7185, #e11d48);
    box-shadow: 0 10px 26px rgba(225, 29, 72, 0.22);
}

.btn-small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-icon {
    padding: 9px 12px;
}

.btn[disabled] {
    opacity: 0.35;
    pointer-events: none;
}

.flash {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 13px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 14px;
}

.flash-success {
    border-color: rgba(52, 211, 153, 0.34);
    background: rgba(52, 211, 153, 0.08);
}

.flash-error {
    border-color: rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.08);
}

.page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.panel {
    padding: 24px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(25, 17, 45, 0.9), rgba(16, 11, 30, 0.9));
    box-shadow: var(--shadow);
}

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

.panel-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
}

.panel-sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

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

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(33, 22, 58, 0.92), rgba(15, 10, 29, 0.92));
    box-shadow: var(--shadow);
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    top: -46px;
    right: -38px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 70%);
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(255, 93, 158, 0.8));
}

.stat-icon svg {
    width: 19px;
    height: 19px;
    color: #fff;
}

.stat-value {
    font-size: 31px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.quick-grid,
.two-col {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
}

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

.wallpaper-card {
    overflow: hidden;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: rgba(19, 13, 35, 0.92);
    transition: border-color 160ms ease, transform 160ms ease;
}

.wallpaper-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #100b1f;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-badge {
    position: absolute;
    left: 11px;
    top: 11px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(8, 6, 17, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.card-body {
    padding: 14px;
}

.card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.card-meta {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 13px;
}

.card-actions .btn {
    flex: 1;
}

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    color: var(--muted-strong);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 -8px;
}

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

.table th {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--stroke);
    white-space: nowrap;
}

.table td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.row-thumb {
    width: 48px;
    height: 62px;
    border-radius: 9px;
    object-fit: cover;
    background: #100b1f;
}

.row-title {
    font-weight: 500;
}

.row-sub {
    color: var(--muted);
    font-size: 12px;
}

.table-actions {
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.category-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: 1px;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label,
.field-label {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border: 1px solid var(--stroke);
    border-radius: 11px;
    background: rgba(8, 6, 17, 0.6);
    color: var(--text);
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(168, 85, 247, 0.65);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.14);
}

input[type="color"] {
    width: 54px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--stroke);
    border-radius: 11px;
    background: rgba(8, 6, 17, 0.6);
    cursor: pointer;
}

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

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

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

.form-grid .span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--stroke);
}

.form-error {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid rgba(251, 113, 133, 0.38);
    background: rgba(251, 113, 133, 0.08);
    color: #ffd7de;
    font-size: 13px;
}

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

.check-pill {
    position: relative;
    cursor: pointer;
}

.check-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-pill span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    color: var(--muted-strong);
    font-size: 13px;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.check-pill input:checked + span {
    border-color: rgba(168, 85, 247, 0.66);
    background: rgba(168, 85, 247, 0.16);
    color: var(--text);
}

.check-pill input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.check-pill span svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.category-preview-icon {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 28px;
    color: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.category-preview-icon svg {
    width: 38px;
    height: 38px;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-field input[type="text"] {
    width: 130px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.preview-frame {
    padding: 10px;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    background: rgba(8, 6, 17, 0.4);
}

.preview-frame img {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 11px;
}

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

.empty-state h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
}

.empty-state p {
    margin: 0 auto 18px;
    max-width: 420px;
    font-size: 13px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.category-row-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 13px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.category-row-icon svg {
    width: 20px;
    height: 20px;
}

.category-row-main {
    flex: 1;
    min-width: 0;
}

.category-row-name {
    font-weight: 600;
}

.category-row-meta {
    color: var(--muted);
    font-size: 12px;
}

.category-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--stroke);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted-strong);
    cursor: pointer;
    transition: border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.icon-btn:hover {
    border-color: var(--stroke-strong);
    color: var(--text);
}

.icon-btn svg {
    width: 15px;
    height: 15px;
}

.icon-btn.is-danger {
    color: var(--danger);
}

.icon-btn[disabled] {
    opacity: 0.25;
    pointer-events: none;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 26px;
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    border: 1px solid var(--stroke);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(25, 17, 45, 0.96), rgba(12, 8, 24, 0.96));
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 28px;
}

.login-brand img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.login-brand strong {
    display: block;
    letter-spacing: 0.12em;
    font-size: 15px;
}

.login-brand small {
    color: var(--cyan);
    font-size: 9px;
    letter-spacing: 0.22em;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 600;
}

.login-card > p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 13px;
}

.login-card .field + .field {
    margin-top: 14px;
}

.login-card .btn {
    width: 100%;
    margin-top: 20px;
}

.login-foot {
    margin-top: 22px;
    color: rgba(169, 158, 196, 0.7);
    font-size: 11px;
    text-align: center;
}

.helper {
    color: var(--muted);
    font-size: 12px;
}

.danger-zone {
    border-color: rgba(251, 113, 133, 0.28);
}

.danger-zone .panel-title {
    color: #ffd7de;
}

.divider {
    height: 1px;
    background: var(--stroke);
    margin: 6px 0;
}

.steps {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
}

.steps li + li {
    margin-top: 7px;
}

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

    .quick-grid,
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        flex-direction: column;
        gap: 16px;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--stroke);
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav-link {
        white-space: nowrap;
        padding: 10px 13px;
    }

    .sidebar-note {
        display: none;
    }

    .main {
        padding: 22px 18px 40px;
    }

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

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

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

    .form-grid .span-2 {
        grid-column: auto;
    }

    .wallpaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .category-row {
        flex-wrap: wrap;
    }

    .category-row-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 720px) {
    .table .col-secondary {
        display: none;
    }

    .table th,
    .table td {
        padding: 11px 8px;
    }

    .table-actions .btn span {
        display: none;
    }
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
    }

    .topbar h1 {
        font-size: 27px;
    }

    .btn-icon span {
        display: none;
    }
}
