:root {
    --bg: #0d1117;
    --bg-panel: #161b22;
    --bg-panel-alt: #0f141b;
    --border: #30363d;
    --text: #c9d1d9;
    --muted: #8b949e;
    --accent: #1f6feb;
    --accent-soft: rgba(31, 111, 235, 0.12);
    --warning: #d29922;
    --warning-soft: rgba(210, 153, 34, 0.14);
    --radius: 12px;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: #0f141b;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-name {
    font-size: 28px;
    font-weight: 600;
}

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

.header-chip {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    font-size: 13px;
    font-weight: 600;
}

.header-chip-muted {
    color: var(--muted);
    font-weight: 500;
}

.header-action-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(13, 17, 23, 0.92);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.header-action-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.header-parent-brand {
    width: 210px;
    max-width: 32vw;
    height: auto;
    opacity: 0.9;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    min-height: calc(100vh - 79px);
}

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

.login-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-panel-alt) 100%);
    box-shadow: var(--shadow);
    padding: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-intro {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.field-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0d1117;
    color: var(--text);
    font: inherit;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.login-submit {
    margin-top: 8px;
    border: 0;
    cursor: pointer;
}

.login-error {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(248, 81, 73, 0.42);
    border-radius: 12px;
    background: rgba(248, 81, 73, 0.12);
    color: #ffd7d5;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-panel-alt) 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.panel-header h1,
.panel-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.panel-sub {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.panel-body {
    padding: 16px;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.nav-link,
.list-card {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(13, 17, 23, 0.92);
    transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.nav-link:hover,
.list-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.warning-panel {
    padding: 14px;
    border: 1px solid rgba(210, 153, 34, 0.35);
    border-radius: 12px;
    background: var(--warning-soft);
    color: #ffd38a;
}

.warning-panel p {
    margin: 6px 0 0;
    color: #d7b77a;
    line-height: 1.5;
}

.section-intro {
    margin-bottom: 14px;
    color: var(--muted);
    line-height: 1.5;
}

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

.month-jump-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.month-jump-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(13, 17, 23, 0.92);
    color: var(--text);
    font-size: 13px;
}

.month-jump-link span {
    color: var(--muted);
    font-size: 12px;
}

.month-group-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.month-group {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(13, 17, 23, 0.55);
    overflow: hidden;
}

.month-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.month-group-summary::-webkit-details-marker {
    display: none;
}

.month-group-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.month-card-list {
    padding: 0 16px 16px;
}

.list-card-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.list-card-meta {
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    background: rgba(13, 17, 23, 0.7);
}

.toolbar {
    margin-bottom: 14px;
}

.primary-btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.primary-btn:hover {
    background: #388bfd;
}

.manifest-block {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(13, 17, 23, 0.92);
    color: var(--text);
    overflow-x: auto;
    line-height: 1.45;
}

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

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

    .header-right {
        flex-wrap: wrap;
    }

    .header-parent-brand {
        width: 180px;
        max-width: 100%;
    }
}
