@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

:root {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #0a0f1f;
    color: #f3f4f8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top left, #14294e 0%, #0b0d1b 45%);
    min-height: 100vh;
}

.shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.super-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    font-size: 0.75rem;
    margin: 0 0 0.5rem;
    color: #86c9ff;
}

.super-header h1 {
    margin: 0;
    font-size: 2rem;
}

.tagline {
    margin: 0.5rem 0 0;
    color: #b4c6f5;
}

.card {
    background: rgba(15, 22, 46, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.75rem;
    animation: fadeIn 0.3s ease;
}

.page-section {
    display: block;
}

.page-section.page-hidden {
    display: none;
}

.primary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.primary-nav .nav-link {
    border: none;
    background: transparent;
    color: #b4c6f5;
    padding: 0.45rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.primary-nav .nav-link.active {
    background: linear-gradient(120deg, #0ad0ff, #2afe9d);
    color: #0a1330;
    font-weight: 600;
}

.flex-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.panel-grid {
    display: grid;
    gap: 1.25rem;
}

.panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-form input,
.inline-form button,
#event-form input,
#event-form select,
#event-form textarea,
#login-form input,
#login-form button {
    border-radius: 999px;
    border: 1px solid #23315c;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    color: #f7f9ff;
}

.inline-form input,
#login-form input {
    flex: 1 1 160px;
}

.inline-form button,
#event-form button,
#login-form button {
    cursor: pointer;
    background: #1eaef5;
    border-color: #1eaef5;
    color: #fff;
    transition: opacity 0.2s ease;
}

.inline-form button:hover,
#login-form button:hover {
    opacity: 0.85;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stack-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #b8c2e2;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
#admin-user-select,
#admin-role-select {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    color: #f7f9ff;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
}

.stack-form select option,
.ghost-select option,
select option {
    background: #0f1630;
    color: #f7f9ff;
}

.stack-form textarea {
    border-radius: 14px;
    resize: vertical;
    min-height: 110px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#login-form button {
    border-radius: 10px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.list-item p {
    margin: 0.2rem 0;
    color: #b8c2e2;
}

.list-item strong {
    color: #f7f9ff;
}

.meta {
    font-size: 0.8rem;
    color: #8897c9;
}

.badge {
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.success {
    background: rgba(82, 250, 196, 0.15);
    border-color: rgba(82, 250, 196, 0.4);
    color: #77ffcd;
}

.badge.muted {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d6ef;
}

.badge.draft {
    background: rgba(255, 204, 128, 0.15);
    border-color: rgba(255, 204, 128, 0.4);
    color: #ffcc80;
}

.badge.scheduled {
    background: rgba(153, 204, 255, 0.15);
    border-color: rgba(153, 204, 255, 0.4);
    color: #99ccff;
}

.badge.active {
    background: rgba(82, 250, 196, 0.15);
    border-color: rgba(82, 250, 196, 0.4);
    color: #77ffcd;
}

.badge.closed {
    background: rgba(214, 92, 124, 0.15);
    border-color: rgba(214, 92, 124, 0.4);
    color: #ff96a6;
}

button.primary {
    background: #26c0c0;
    border-color: #26c0c0;
}

button.warning {
    background: #ff904d;
    border-color: #ff904d;
}

button.ghost {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
}

.status {
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: #c7e4ff;
}

.status.error {
    border-color: rgba(255, 99, 131, 0.5);
    background: rgba(255, 99, 131, 0.1);
    color: #ff96a6;
}



.credentials {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.credentials .hint {
    margin-top: 0.2rem;
    color: #8fb3e2;
    font-size: 0.8rem;
}

.list-item .list-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.list-item .list-actions button {
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
}

.event-item {
    align-items: flex-start;
}

.event-item .list-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hidden-panel {
    display: none;
}

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

.admin-entry strong {
    font-size: 1rem;
}

.admin-entry .meta {
    margin-top: 0.2rem;
}

.admin-entry-actions {
    display: flex;
    gap: 0.5rem;
}

#admin-user-select {
    width: 100%;
}

#admin-list .badge {
    margin-left: 0.5rem;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ghost-select {
    background: transparent;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f7f9ff;
    padding: 0.35rem 0.9rem;
}

.ghost-select option {
    color: #0b0d1b;
}

.token-panel-head {
    align-items: flex-start;
}

.token-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.token-picker select {
    min-width: 220px;
}

.token-picker button {
    white-space: nowrap;
}

.token-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sub-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inline-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #b8c2e2;
}

.inline-checkbox input {
    width: 18px;
    height: 18px;
}

.token-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.token-entry-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.token-entry .badge {
    margin-left: 0;
}

.token-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
    display: inline-block;
    color: #c7e4ff;
    font-size: 0.85rem;
}

.token-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #8897c9;
}

.token-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.package-token-field select {
    width: 100%;
}

.package-hint {
    font-size: 0.8rem;
    color: #8897c9;
    margin: 0;
}

.divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    margin: 1rem 0;
}

#package-results a {
    text-decoration: none;
    text-align: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #f7f9ff;
}

.readonly-field {
    display: none;
}

.hidden {
    display: none !important;
}

@media (min-width: 900px) {
    .panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
