:root {
    --bg: #02030a;
    --surface: rgba(10, 15, 30, .82);
    --surface-2: rgba(16, 24, 44, .78);
    --surface-3: #151f38;
    --line: rgba(148, 163, 184, .16);
    --line-strong: rgba(165, 180, 252, .28);
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #7357ff;
    --primary-2: #38bdf8;
    --green: #10b981;
    --red: #ef4444;
    --amber: #f59e0b;
    --shadow: 0 28px 90px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 18% 0%, rgba(115, 87, 255, .28), transparent 34%),
        radial-gradient(circle at 86% 14%, rgba(56, 189, 248, .12), transparent 28%),
        linear-gradient(135deg, #02030a 0%, #070b18 48%, #050816 100%);
    color: var(--text);
    font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, transparent 0 45%, rgba(129, 140, 248, .10) 46%, transparent 48%),
        radial-gradient(circle at 52% 110%, rgba(79, 70, 229, .18), transparent 34%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
}

a { color: #c4b5fd; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; }

.admin-shell {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 14px;
    background: rgba(2, 3, 10, .78);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(22px);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.sidebar-logo {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    box-shadow: 0 16px 42px rgba(79, 70, 229, .18);
}

.sidebar-logo img,
.brand-mark img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.side-nav {
    width: 100%;
    margin-top: 34px;
    display: grid;
    gap: 12px;
}

.side-nav a {
    width: 100%;
    min-height: 58px;
    display: grid;
    place-items: center;
    gap: 4px;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 18px;
    transition: .18s ease;
}

.side-nav a span { font-size: 18px; }
.side-nav a strong { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.side-nav a:hover,
.side-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(115, 87, 255, .28), rgba(56, 189, 248, .12));
    border-color: var(--line-strong);
    box-shadow: 0 16px 36px rgba(79, 70, 229, .16);
}

.side-exit {
    margin-top: auto;
    writing-mode: vertical-rl;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.admin-main {
    position: relative;
    z-index: 1;
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 22px 28px 52px;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.brand,
.topbar-actions,
.hero-actions,
.actions,
.section-head {
    display: flex;
    align-items: center;
}

.brand { gap: 13px; }
.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
}

.brand h1 {
    font-size: 22px;
    letter-spacing: -.03em;
}

.brand p,
.muted,
.stat small,
.event-main small,
.member-name p {
    color: var(--muted);
    font-size: 12px;
}

.topbar-actions {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .72);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-dashboard {
    min-height: 352px;
    display: grid;
    grid-template-columns: minmax(0, .88fr) minmax(360px, 1.12fr);
    gap: 22px;
    margin-bottom: 20px;
}

.hero-copy,
.hero-visual,
.card {
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.hero-copy {
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.hero-copy::after {
    content: "YB";
    position: absolute;
    right: -24px;
    bottom: -45px;
    color: rgba(255, 255, 255, .035);
    font-size: 170px;
    font-weight: 900;
    letter-spacing: -.08em;
}

.eyebrow {
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
}

.hero-copy h2 {
    max-width: 720px;
    margin-top: 12px;
    font-size: clamp(30px, 4vw, 56px);
    line-height: 1.02;
    letter-spacing: -.06em;
}

.hero-copy p {
    max-width: 680px;
    margin-top: 18px;
    color: #cbd5e1;
    line-height: 1.75;
}

.hero-actions {
    gap: 10px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.hero-visual {
    min-height: 352px;
    background:
        linear-gradient(90deg, rgba(2, 3, 10, .14), rgba(2, 3, 10, .24)),
        url("admin-hero.png") center/cover no-repeat;
    position: relative;
    overflow: hidden;
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: auto 24px 24px auto;
    width: 150px;
    height: 150px;
    border-radius: 44px;
    border: 1px solid rgba(165, 180, 252, .22);
    background: rgba(255, 255, 255, .04);
    backdrop-filter: blur(8px);
}

.card {
    padding: 22px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    min-height: 138px;
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: rgba(115, 87, 255, .16);
}

.stat span {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.stat strong {
    display: block;
    margin: 12px 0 6px;
    font-size: 36px;
    letter-spacing: -.04em;
}

.glow { border-color: rgba(16, 185, 129, .36); }
.warn-stat { border-color: rgba(245, 158, 11, .42); }
.danger-stat { border-color: rgba(239, 68, 68, .42); }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr);
    gap: 20px;
    margin-bottom: 20px;
}

.section-head {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.section-head h2 {
    margin-top: 6px;
    font-size: 22px;
    letter-spacing: -.03em;
}

form {
    display: grid;
    gap: 12px;
}

.create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide { grid-column: 1 / -1; }

.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 15px;
    background: rgba(2, 6, 23, .45);
    color: #e2e8f0;
}

.check-field input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--primary);
}

label {
    display: grid;
    gap: 7px;
    color: #dbeafe;
    font-size: 12px;
    font-weight: 900;
}

input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 15px;
    background: rgba(2, 6, 23, .66);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
    transition: .15s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(129, 140, 248, .58);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .18);
}

textarea {
    min-height: 92px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    color: white;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(79, 70, 229, .22);
}

.button.secondary,
button.secondary { background: rgba(30, 41, 59, .92); }
.button.ghost { background: rgba(255, 255, 255, .06); box-shadow: none; }
.button.green,
button.green { background: linear-gradient(135deg, #059669, #047857); }
.button.amber,
button.amber { background: linear-gradient(135deg, #d97706, #92400e); }
.button.danger,
button.danger { background: linear-gradient(135deg, #dc2626, #991b1b); }

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 11px;
    background: rgba(148, 163, 184, .14);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.pill.green { background: rgba(16, 185, 129, .16); color: #86efac; }
.pill.red { background: rgba(239, 68, 68, .16); color: #fca5a5; }
.pill.amber { background: rgba(245, 158, 11, .16); color: #fde68a; }

.message {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(16, 185, 129, .32);
    border-radius: 18px;
    background: rgba(16, 185, 129, .12);
    color: #bbf7d0;
}

.message.error,
.error {
    border-color: rgba(239, 68, 68, .34);
    background: rgba(239, 68, 68, .12);
    color: #fecaca;
}

.event-card {
    min-height: 480px;
}

.event-list {
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
}

.event-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, .38);
}

.event-row.success { border-color: rgba(16, 185, 129, .22); }
.event-row.fail { border-color: rgba(239, 68, 68, .24); }

.event-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(148, 163, 184, .14);
    font-weight: 900;
}

.event-row.success .event-icon {
    background: rgba(16, 185, 129, .16);
    color: #86efac;
}

.event-row.fail .event-icon {
    background: rgba(239, 68, 68, .16);
    color: #fca5a5;
}

.event-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.event-main span {
    color: #cbd5e1;
    font-size: 13px;
}

.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 20px;
    color: var(--muted);
}

.member-card,
.audit-card {
    margin-bottom: 20px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

td { color: #e2e8f0; }

code {
    color: #c4b5fd;
    background: rgba(99, 102, 241, .12);
    border: 1px solid rgba(165, 180, 252, .14);
    padding: 4px 8px;
    border-radius: 9px;
}

.member-table {
    min-width: 1180px;
}

.service-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.member-name {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(115, 87, 255, .86), rgba(56, 189, 248, .48));
    color: white;
    font-weight: 900;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-form input {
    width: 76px;
    min-height: 38px;
    padding: 8px 10px;
}

.password-form input {
    width: 118px;
}

.inline-form button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12px;
}

.footer {
    margin-top: 24px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(1020px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 22px;
}

.login-card .hero {
    padding: 22px;
    min-height: 450px;
    background:
        linear-gradient(120deg, rgba(2, 3, 10, .12), rgba(2, 3, 10, .38)),
        url("admin-hero.png") center/cover no-repeat;
    display: block;
    overflow: hidden;
    position: relative;
}

.login-card .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(2, 3, 10, .86), rgba(2, 3, 10, .18) 54%, rgba(2, 3, 10, .06)),
        linear-gradient(90deg, rgba(2, 3, 10, .55), transparent 62%);
}

.login-hero-overlay {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
    min-height: 406px;
    padding: 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.login-hero-overlay h2 {
    margin-top: auto;
    font-size: clamp(32px, 5vw, 52px);
    line-height: .98;
    letter-spacing: -.07em;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .6);
}

.login-hero-overlay p {
    max-width: 430px;
    margin-top: 12px;
    color: #dbeafe;
    line-height: 1.72;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}

.login-form-card {
    padding: 38px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(8, 13, 26, .96));
}

.login-form-card h2 {
    margin-top: 10px;
    font-size: 31px;
    letter-spacing: -.04em;
}

.login-form-card .muted {
    margin: 9px 0 24px;
    color: #a8b3c7;
}

.login-form-card form {
    gap: 15px;
}

.login-form-card input {
    background: rgba(15, 23, 42, .92);
    border-color: rgba(148, 163, 184, .16);
}

.login-primary {
    margin-top: 6px;
    min-height: 48px;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    color: #020617;
    box-shadow: 0 18px 42px rgba(226, 232, 240, .12);
}

.login-primary:hover {
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
}

.image-badge {
    margin-bottom: 0;
    background: rgba(3, 7, 18, .72);
    border-color: rgba(255, 255, 255, .13);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
    backdrop-filter: blur(10px);
}

.image-badge img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-badge {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    font-weight: 900;
}

@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero-dashboard,
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
    }
    .side-nav {
        width: auto;
        margin: 0;
        grid-auto-flow: column;
        grid-auto-columns: 48px;
        overflow-x: auto;
    }
    .side-nav a {
        min-height: 48px;
        border-radius: 15px;
    }
    .side-nav a strong,
    .side-exit { display: none; }
    .admin-main { padding: 18px 14px 42px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .hero-dashboard { display: block; }
    .hero-visual { min-height: 230px; margin-top: 14px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .create-form,
    .login-card { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr; }
    .hero-copy { padding: 24px; }
    .hero-copy h2 { font-size: 32px; }
    .section-head { align-items: flex-start; flex-direction: column; }
}
