:root {
    --bg: #101113;
    --surface: #181a1d;
    --surface-2: #202327;
    --surface-3: #2a2e33;
    --card: #1c1f23;
    --card-soft: #17191c;
    --line: rgba(235, 231, 222, 0.12);
    --line-strong: rgba(235, 231, 222, 0.24);
    --text: #f2eee6;
    --muted: #aaa49a;
    --accent: #68c3b7;
    --accent-2: #dc7465;
    --accent-soft: rgba(104, 195, 183, 0.12);
    --gold: #d8aa55;
    --danger: #ff8794;
    --success: #7ccf9b;
    --shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(242, 238, 230, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(242, 238, 230, 0.045) 1px, transparent 1px),
        linear-gradient(135deg, rgba(104, 195, 183, 0.08), transparent 44%),
        var(--bg);
    background-size: 34px 34px, 34px 34px, 100% 100%, auto;
}

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

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

button {
    cursor: pointer;
}

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

.login-shell {
    width: min(100%, 440px);
}

.glass-card,
.panel,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-card {
    padding: 30px;
}

.login-card h1 {
    margin: 18px 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: 0;
}

.login-card p {
    color: var(--muted);
    line-height: 1.55;
}

.brand-dot {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--surface);
    background: var(--text);
    box-shadow: 6px 6px 0 var(--accent);
}

.brand-dot::before {
    content: "*";
    color: var(--bg);
    font-weight: 900;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    border-right: 1px solid var(--line);
    background: rgba(16, 17, 19, 0.88);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 30px;
    font-weight: 900;
}

.admin-nav {
    display: grid;
    gap: 7px;
}

.admin-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.sidebar-footer strong {
    color: var(--text);
}

.sidebar-footer a {
    color: var(--danger);
    font-weight: 900;
}

.admin-main {
    min-width: 0;
    padding: 30px clamp(18px, 3vw, 42px) 60px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 900;
    font-size: 0.74rem;
}

.admin-topbar h1,
.panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.admin-topbar h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
}

.panel h2 {
    font-size: 1.12rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-2);
    font-weight: 850;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: var(--card);
}

.btn-primary {
    color: var(--bg);
    border-color: var(--accent);
    background: var(--accent);
    font-weight: 900;
}

.btn-secondary {
    color: var(--text);
    border-color: rgba(216, 170, 85, 0.34);
    background: rgba(216, 170, 85, 0.1);
}

.btn-ghost {
    background: transparent;
}

.btn-small {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.86rem;
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(255, 135, 148, 0.35);
    background: rgba(255, 135, 148, 0.1);
}

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

.stat-card {
    position: relative;
    padding: 18px;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--gold));
}

.stat-card span {
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.4rem;
    line-height: 1;
}

.content-grid {
    display: grid;
    gap: 18px;
}

.two-cols {
    grid-template-columns: 1.25fr 0.9fr;
}

.two-cols.wide-left {
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    align-items: start;
}

.panel {
    padding: 18px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.panel-head p,
.info-panel p {
    color: var(--muted);
    line-height: 1.55;
    margin: 7px 0 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

code {
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: var(--mono);
}

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

.small {
    font-size: 0.84rem;
}

.link {
    color: var(--accent);
    background: transparent;
    border: 0;
    padding: 0;
    font-weight: 900;
}

.link.danger {
    color: var(--danger);
}

.actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.actions-cell form {
    display: inline;
}

.alert {
    padding: 13px 15px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-weight: 800;
}

.alert-success {
    color: var(--success);
    border-color: rgba(124, 207, 155, 0.28);
    background: rgba(124, 207, 155, 0.08);
}

.alert-danger {
    color: var(--danger);
    border-color: rgba(255, 135, 148, 0.3);
    background: rgba(255, 135, 148, 0.08);
}

.form-stack,
.admin-form {
    display: grid;
    gap: 14px;
}

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

.form-row:has(label:nth-child(3)) {
    grid-template-columns: 1fr 1fr 0.55fr;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    outline: none;
    color: var(--text);
    background: var(--card-soft);
}

textarea {
    min-height: 95px;
    resize: vertical;
    line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="file"] {
    cursor: pointer;
}

.check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.check-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

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

.check-line span {
    margin: 0;
}

.form-actions,
.action-stack {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hint-box {
    margin-top: 4px;
    padding: 13px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--muted);
    background: var(--card-soft);
    line-height: 1.55;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 900;
}

.badge-green {
    color: var(--success);
    background: rgba(124, 207, 155, 0.1);
}

.badge-red {
    color: var(--danger);
    background: rgba(255, 135, 148, 0.1);
}

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

.filter-bar {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 220px) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.prompt-admin-list {
    display: grid;
    gap: 12px;
    max-height: 980px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(112, 109, 101, 0.16);
}

.prompt-admin-list::-webkit-scrollbar {
    width: 8px;
}

.prompt-admin-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--accent);
}

.prompt-admin-list::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(112, 109, 101, 0.16);
}

.prompt-admin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card-soft);
}

.prompt-admin-item h3 {
    margin: 8px 0 6px;
}

.prompt-admin-item p {
    color: var(--muted);
    margin: 0 0 7px;
    line-height: 1.45;
}

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

.item-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.item-actions {
    justify-content: flex-end;
    align-content: flex-start;
}

.item-actions form {
    margin: 0;
}

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

.current-image-box {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--card-soft);
}

.current-image-box img {
    width: 120px;
    height: 86px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
}

.current-image-box strong {
    display: block;
    margin-bottom: 5px;
}

.current-image-box p {
    margin: 0 0 9px;
    color: var(--muted);
    line-height: 1.45;
}

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

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .sidebar-footer {
        margin-top: 18px;
    }

    .two-cols,
    .two-cols.wide-left {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-main {
        padding: 18px 14px 44px;
    }

    .login-card {
        padding: 24px;
    }

    .admin-topbar,
    .panel-head {
        flex-direction: column;
        align-items: stretch;
    }

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

    .stats-grid,
    .form-row,
    .form-row:has(label:nth-child(3)),
    .filter-bar,
    .prompt-admin-item,
    .current-image-box {
        grid-template-columns: 1fr;
    }

    .current-image-box img {
        width: 100%;
        height: 160px;
    }
}
