:root {
    --bg: #050b16;
    --bg-2: #071528;
    --panel: rgba(10, 27, 49, .88);
    --panel-2: rgba(13, 36, 65, .72);
    --text: #f5f9ff;
    --muted: #9fb4cc;
    --blue: #2f8cff;
    --cyan: #38d9ff;
    --green: #3df2b4;
    --danger: #ff6b6b;
    --line: rgba(154, 201, 255, .16);
    --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(47, 140, 255, .24), transparent 34%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, #030812 100%);
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(154, 201, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(154, 201, 255, .045) 1px, transparent 1px);
    background-size: 54px 54px;
}

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

button,
input,
textarea {
    font: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

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

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

.login-card,
.panel,
.stats-grid article,
.message-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.login-card {
    padding: 34px;
}

.login-logo,
.admin-brand img {
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .25);
    background: rgba(47, 140, 255, .1);
    box-shadow: 0 0 28px rgba(56, 217, 255, .18);
}

.login-logo {
    width: 78px;
    height: 78px;
    margin-bottom: 18px;
    border-radius: 18px;
}

.login-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.login-card h1,
.topbar h1 {
    margin-bottom: 8px;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.05;
}

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

.eyebrow {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 12px;
    padding: 6px 10px;
    border: 1px solid rgba(56, 217, 255, .28);
    border-radius: 999px;
    background: rgba(47, 140, 255, .12);
    color: #9befff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.login-form,
.form-grid,
.admin-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
}

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

input:focus,
textarea:focus {
    border-color: rgba(56, 217, 255, .62);
    box-shadow: 0 0 0 4px rgba(56, 217, 255, .08);
}

.btn,
.ghost-btn,
.remove-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn {
    border: 0;
    padding: 0 20px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #03101f;
    box-shadow: 0 16px 38px rgba(47, 140, 255, .28);
}

.btn:hover,
.ghost-btn:hover,
.remove-item:hover {
    transform: translateY(-2px);
}

.ghost-btn {
    border: 1px solid rgba(56, 217, 255, .28);
    background: rgba(255, 255, 255, .045);
    color: var(--text);
    padding: 0 15px;
}

.ghost-btn.danger,
.remove-item {
    border-color: rgba(255, 107, 107, .34);
    color: #ffd4d4;
}

.ghost-btn.mini,
.remove-item {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
}

.remove-item {
    border: 1px solid rgba(255, 107, 107, .34);
    background: rgba(255, 107, 107, .08);
}

.notice,
.demo-box,
.empty-state {
    border-radius: 12px;
    padding: 13px 14px;
    font-weight: 800;
}

.notice {
    margin-bottom: 18px;
}

.notice.success {
    border: 1px solid rgba(61, 242, 180, .34);
    background: rgba(61, 242, 180, .1);
    color: #b6ffe7;
}

.notice.error {
    border: 1px solid rgba(255, 107, 107, .34);
    background: rgba(255, 107, 107, .1);
    color: #ffd4d4;
}

.demo-box {
    margin-top: 18px;
    border: 1px dashed rgba(56, 217, 255, .26);
    background: rgba(56, 217, 255, .07);
    color: var(--muted);
    font-size: 14px;
}

.back-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--cyan);
    font-weight: 900;
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px;
    border-right: 1px solid var(--line);
    background: rgba(3, 10, 21, .76);
    backdrop-filter: blur(18px);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 900;
}

.admin-brand img {
    width: 46px;
    height: 46px;
    padding: 7px;
    border-radius: 13px;
    object-fit: contain;
}

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

.admin-nav a {
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 800;
}

.admin-nav a:hover {
    border-color: rgba(56, 217, 255, .2);
    background: rgba(56, 217, 255, .07);
    color: var(--text);
}

.sidebar-actions {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.admin-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 80px;
}

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

.status-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 900;
    font-size: 13px;
}

.status-pill.ok {
    border: 1px solid rgba(61, 242, 180, .34);
    color: #b6ffe7;
    background: rgba(61, 242, 180, .09);
}

.status-pill.bad {
    border: 1px solid rgba(255, 107, 107, .34);
    color: #ffd4d4;
    background: rgba(255, 107, 107, .09);
}

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

.stats-grid article {
    padding: 20px;
}

.stats-grid strong {
    display: block;
    color: var(--cyan);
    font-size: 34px;
    line-height: 1;
}

.stats-grid span {
    color: var(--muted);
    font-weight: 800;
}

.panel {
    scroll-margin-top: 26px;
    padding: 24px;
    margin-bottom: 18px;
}

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

.panel-head h2 {
    margin-bottom: 0;
    font-size: 28px;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.subhead {
    margin: 24px 0 12px;
    color: #cfefff;
}

.repeat-list {
    display: grid;
    gap: 12px;
}

.repeat-item {
    display: grid;
    grid-template-columns: 110px 1fr 1.2fr auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(154, 201, 255, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
}

.repeat-list.compact .repeat-item {
    grid-template-columns: 1fr 1fr auto;
}

#projects-list .repeat-item {
    grid-template-columns: 1fr 1.4fr 1fr auto;
}

#skills-list .repeat-item {
    grid-template-columns: 1fr 180px auto;
}

code {
    color: #9befff;
}

.savebar {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 22px;
    padding: 14px;
    border: 1px solid rgba(56, 217, 255, .22);
    border-radius: 16px;
    background: rgba(5, 14, 27, .88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    color: var(--muted);
    font-weight: 800;
}

.message-list {
    display: grid;
    gap: 12px;
}

.message-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 18px;
    box-shadow: none;
}

.message-card h3 {
    margin-bottom: 4px;
}

.message-card p:last-child {
    margin-bottom: 0;
}

.empty-state {
    border: 1px dashed rgba(154, 201, 255, .22);
    background: rgba(255, 255, 255, .035);
    color: var(--muted);
}

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

    .sidebar {
        position: static;
        height: auto;
    }

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

    .sidebar-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .repeat-item,
    #projects-list .repeat-item,
    #skills-list .repeat-item,
    .repeat-list.compact .repeat-item {
        grid-template-columns: 1fr 1fr;
    }

    .remove-item {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .admin-main {
        width: min(100% - 24px, 1180px);
        padding-top: 20px;
    }

    .topbar,
    .panel-head,
    .savebar,
    .message-card {
        display: grid;
    }

    .stats-grid,
    .form-grid.two,
    .admin-nav,
    .sidebar-actions,
    .repeat-item,
    #projects-list .repeat-item,
    #skills-list .repeat-item,
    .repeat-list.compact .repeat-item {
        grid-template-columns: 1fr;
    }

    .login-card,
    .panel {
        padding: 20px;
    }
}
