:root {
    color-scheme: dark;
    font-family: 'gg sans', system-ui, sans-serif;
    background: #121214;
    color: #ffffff;
    --bg: #18191d;
    --surface: #1f2126;
    --surface-alt: #2b2d31;
    --text: #ffffff;
    --muted: #b5bac1;
    --accent: #5865f2;
    --danger: #f04747;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #121214;
    color: var(--text);
}

a {
    color: inherit;
}

.admin-shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.12);
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-card,
.auth-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.25);
    margin-bottom: 1.5rem;
}

.admin-card h2,
.auth-card h1 {
    margin-top: 0;
}

.admin-form,
.auth-form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid label,
.upload-label {
    display: grid;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.full-width {
    grid-column: 1 / -1;
}

label input,
label textarea,
.upload-label input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
}

label textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    padding: 0.95rem 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 18px 40px rgba(88, 101, 242, 0.24);
}

.button-muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.button-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.button-danger {
    background: var(--danger);
    color: #fff;
}

.alert {
    padding: 0.95rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(59, 165, 93, 0.12);
    border: 1px solid rgba(59, 165, 93, 0.18);
    color: #d5ffdc;
}

.alert-error {
    background: rgba(240, 71, 71, 0.12);
    border: 1px solid rgba(240, 71, 71, 0.18);
    color: #ffd5d5;
}

.image-grid {
    display: grid;
    gap: 1rem;
}

.image-card {
    background: var(--surface-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow: hidden;
}

.image-card img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.image-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    flex-wrap: wrap;
    color: var(--muted);
}

.image-details strong,
.image-details time {
    display: block;
}

.portfolio-empty {
    color: var(--muted);
}

@media (min-width: 720px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .image-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.image-rename {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rename-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rename-form input[type="text"] {
    flex: 1;
    min-height: 2.4rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
}

.rename-form .button {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    white-space: nowrap;
}
