:root {
    --bg: #030405;
    --bg-soft: #06100b;
    --surface: #0a0f0c;
    --card-bg: rgba(0, 0, 0, 0.42);
    --line: rgba(0, 255, 102, 0.24);
    --line-strong: rgba(0, 255, 102, 0.54);
    --text: #f3f6f1;
    --muted: #a8b5ad;
    --primary: #00ff41;
    --primary-2: #00d9ff;
    --danger: #f85149;
    --warning: #d29922;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius: 8px;
    --radius-sm: 4px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;
    --admin-top-h: 56px;
    --nav-h: 48px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 8px rgba(0,255,65,.3); } 50% { box-shadow: 0 0 20px rgba(0,255,65,.6); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ─── ADMIN SHELL ─── */
.admin-shell { max-width: 1280px; margin: 0 auto; padding: 0 18px 72px; }
.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    height: var(--admin-top-h);
    border-bottom: 1px solid var(--line);
    padding: 0;
    margin-bottom: 0;
}
.admin-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--mono);
    font-weight: 900;
    font-size: .95rem;
}
.admin-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0,255,65,.45));
}
.admin-logo:hover { text-decoration: none; }
.admin-top-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ─── TAB NAV ─── */
.admin-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--line);
    height: var(--nav-h);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.tab-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.tab-btn:hover { color: var(--text); background: rgba(0,255,65,.04); }
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    box-shadow: 0 2px 12px rgba(0,255,65,.2);
}
.tab-btn i { font-size: .85rem; }

/* ─── TAB CONTENT ─── */
.tab-content { display: none; animation: fadeIn .25s ease; margin-top: 20px; }
.tab-content.active { display: block; }

/* ─── CARDS ─── */
.admin-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(0,255,65,.08), rgba(0,0,0,.42));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 20px;
}
.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.admin-card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.admin-card-header .eyebrow {
    font-size: .72rem;
    color: var(--primary);
    font-family: var(--mono);
    font-weight: 900;
    letter-spacing: .04em;
}

/* ─── STATS GRID ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.stat-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0,0,0,.28);
    padding: 14px 12px;
    display: grid;
    gap: 4px;
    transition: border-color .15s;
}
.stat-card:hover { border-color: rgba(0,255,65,.5); }
.stat-card-icon {
    font-size: 1.1rem;
    color: var(--primary);
    opacity: .7;
}
.stat-card strong {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -.02em;
}
.stat-card span {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 600;
}

/* ─── FILTER BAR ─── */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.filter-bar label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-weight: 700;
    font-size: .78rem;
}
.filter-bar input, .filter-bar select {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--text);
    background: rgba(0,0,0,.28);
    font: inherit;
    font-size: .85rem;
    outline: none;
    min-width: 140px;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.filter-bar-actions { display: flex; gap: 6px; align-items: end; padding-bottom: 1px; }

/* ─── SUBMISSIONS ─── */
.submission-list { display: grid; gap: 12px; }
.submission {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0,0,0,.22);
    padding: 16px;
}
.submission.is-new {
    border-color: rgba(0,255,65,.72);
    box-shadow: 0 0 22px rgba(0,255,65,.14);
}
.submission-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.submission-title { margin: 0; font-size: 1rem; font-weight: 600; }
.submission-meta {
    color: var(--muted);
    font-family: var(--mono);
    font-size: .78rem;
}
.field-list { display: grid; gap: 6px; margin: 0 0 10px; }
.field-list div {
    display: grid;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,255,65,.1);
}
.field-list dt {
    color: var(--primary);
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.field-list dd {
    margin: 0;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .9rem;
}
.submission-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ─── BLOG ─── */
.blog-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0,0,0,.22);
    padding: 16px;
    display: grid;
    gap: 8px;
}
.blog-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.blog-card-meta {
    font-size: .78rem;
    color: var(--muted);
    font-family: var(--mono);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.blog-card-excerpt {
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.blog-list { display: grid; gap: 12px; }
.blog-form-grid {
    display: grid;
    gap: 14px;
}
.blog-form-grid label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-weight: 700;
    font-size: .82rem;
}
.blog-form-grid input, .blog-form-grid select, .blog-form-grid textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text);
    background: rgba(0,0,0,.28);
    font: inherit;
    outline: none;
}
.blog-form-grid input:focus, .blog-form-grid select:focus, .blog-form-grid textarea:focus { border-color: var(--primary); }
.blog-form-grid textarea { resize: vertical; min-height: 80px; }
.blog-form-grid .blog-content-textarea { min-height: 200px; font-family: var(--mono); font-size: .85rem; }

/* ─── SETTINGS GRID ─── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.settings-grid .full-width { grid-column: 1 / -1; }
.settings-grid label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-weight: 700;
    font-size: .82rem;
}
.settings-grid input, .settings-grid select, .settings-grid .settings-readonly {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text);
    background: rgba(0,0,0,.28);
    font: inherit;
    outline: none;
}
.settings-grid input:focus { border-color: var(--primary); }
.settings-grid .settings-readonly {
    color: var(--muted);
    cursor: not-allowed;
    background: rgba(0,0,0,.12);
}
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}
.settings-toggle input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,.12);
    border-radius: 12px;
    border: 1px solid var(--line);
    position: relative;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}
.settings-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--muted);
    border-radius: 50%;
    transition: transform .2s, background .2s;
}
.settings-toggle input[type="checkbox"]:checked {
    background: rgba(0,255,65,.3);
    border-color: var(--primary);
}
.settings-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
    background: var(--primary);
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0,0,0,.28);
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    transition: background .15s, border-color .15s, box-shadow .15s;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:hover { background: rgba(0,255,65,.12); text-decoration: none; }
.btn.primary {
    background: linear-gradient(135deg, var(--primary), #7bff9e);
    color: #03150c;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(0,255,65,.25);
}
.btn.primary:hover { background: linear-gradient(135deg, #33ff6b, #a5ffba); box-shadow: 0 0 20px rgba(0,255,65,.4); }
.btn.secondary { color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover { background: rgba(0,255,65,.1); }
.btn.danger {
    background: rgba(248,81,73,0.1);
    border-color: var(--danger);
    color: var(--danger);
}
.btn.danger:hover { background: rgba(248,81,73,0.25); }
.btn-sm { padding: 5px 10px; font-size: .75rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── TAGS / BADGES ─── */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.tag.new, .tag.draft { color: #03150c; background: var(--warning); }
.tag.read, .tag.published { color: #03150c; background: var(--primary); }
.tag.archived { color: #06110d; background: #9ec5ff; }

/* ─── FORMS ─── */
.admin-form { display: grid; gap: 14px; }
.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
    font-size: .82rem;
}
.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text);
    background: rgba(0,0,0,.28);
    font: inherit;
    outline: none;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--primary); }
.admin-form .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.admin-form fieldset {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(0,255,65,.18);
    border-radius: var(--radius);
}
.admin-form legend {
    padding: 0 8px;
    color: var(--primary);
    font-family: var(--mono);
    font-weight: 900;
}

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    animation: fadeIn .15s ease;
}
.modal {
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(0,255,65,.08), rgba(0,0,0,.42));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 24px;
}
.modal h2 {
    font-size: 1.05rem;
    margin-bottom: 14px;
    font-family: var(--mono);
    color: var(--primary);
}
.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal .field-list { margin-bottom: 0; }
.modal textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,.28);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .85rem;
    outline: none;
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
}
.modal textarea:focus { border-color: var(--primary); }
.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* ─── TOAST ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: .82rem;
    z-index: 200;
    animation: toastIn .3s ease;
    color: #03150c;
    font-weight: 600;
}
.toast.success { background: #91e9b7; border-color: var(--primary); }
.toast.error { background: #ff9aa5; border-color: var(--danger); }

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.pagination .info { color: var(--muted); font-size: .82rem; }

/* ─── EMPTY STATE ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 8px;
    color: var(--muted);
}
.empty-state i { font-size: 2rem; opacity: .3; }
.empty-state p { font-size: .9rem; }

/* ─── SECURITY TABLE ─── */
.security-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.security-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.security-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,255,65,.08);
    color: var(--text);
    font-family: var(--mono);
    font-size: .8rem;
}
.security-table tr:hover td { background: rgba(0,255,65,.04); }

/* ─── EVENTS (sidebar) ─── */
.event-row {
    display: grid;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,255,65,.1);
}
.event-row strong {
    color: var(--text);
    font-family: var(--mono);
    font-size: .82rem;
}
.event-row span {
    color: var(--muted);
    font-size: .78rem;
    overflow-wrap: anywhere;
}

/* ─── NOTICE / ERROR ─── */
.notice, .error {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .85rem;
}
.notice { color: #03150c; background: rgba(0,255,65,.15); border: 1px solid var(--primary); }
.error { color: #2b060b; background: #ff9aa5; }
.empty { color: var(--muted); font-size: .9rem; }
.admin-small { color: var(--muted); font-size: .82rem; }

/* ─── MISC ─── */
.eyebrow {
    color: var(--primary);
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.login-card { max-width: 420px; margin: 10vh auto; }
.login-card .admin-logo { margin-bottom: 16px; }
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.password-section { max-width: 480px; }

/* ─── UTILITY ─── */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ─── RESPONSIVE ─── */
/* ─── PREMIUM POLISH ─── */
.stat-card {
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.admin-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.admin-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.4),
        0 0 24px rgba(0,255,65,0.06);
}

.submission {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.submission:hover {
    transform: translateY(-1px);
    border-color: rgba(0,255,65,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.modal {
    transition: transform 0.25s ease;
}

.blog-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.blog-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0,255,65,0.35);
}

.tab-btn {
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.tab-btn:hover {
    transform: translateY(-1px);
}
.tab-btn.active {
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .admin-card,
    .submission,
    .blog-card,
    .tab-btn {
        transition: none !important;
        transform: none !important;
    }
}

@media (max-width: 860px) {
    .settings-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-shell { padding: 0 12px 56px; }
    .admin-top { height: auto; padding: 10px 0; flex-wrap: wrap; }
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select { min-width: 0; width: 100%; }
    .filter-bar-actions { width: 100%; }
    .filter-bar-actions .btn { flex: 1; justify-content: center; }
    .submission-head { flex-direction: column; }
    .modal { padding: 18px; }
    .tab-content { margin-top: 14px; }
    .admin-card { padding: 14px; }
    .security-table { font-size: .75rem; }
    .security-table th, .security-table td { padding: 6px 8px; }
    .stat-card:hover,
    .admin-card:hover,
    .submission:hover,
    .blog-card:hover {
        transform: none !important;
    }
}
