* {
    box-sizing: border-box;
}

:root {
    --bg: #eef2f7;
    --surface: rgba(255, 255, 255, .82);
    --surface-solid: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --soft: #f8fafc;
    --border: rgba(148, 163, 184, .28);
    --dark: #07111f;
    --dark-2: #0f172a;
    --primary: #2563eb;
    --primary-2: #06b6d4;
    --accent: #22c55e;
    --danger: #ef4444;
    --warning: #f97316;
    --shadow: 0 22px 55px rgba(15, 23, 42, .12);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, .08);
    --radius: 22px;
    --sidebar-width: 292px;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(37, 99, 235, .22), transparent 32%),
        radial-gradient(circle at 85% 0%, rgba(6, 182, 212, .22), transparent 28%),
        radial-gradient(circle at 80% 90%, rgba(34, 197, 94, .14), transparent 30%),
        var(--bg);
}

a {
    color: inherit;
}

svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 18px auto 18px 18px;
    width: var(--sidebar-width);
    border-radius: 30px;
    background:
        linear-gradient(160deg, rgba(7, 17, 31, .98), rgba(15, 23, 42, .96)),
        radial-gradient(circle at top left, rgba(37, 99, 235, .38), transparent 40%);
    color: #fff;
    padding: 18px;
    box-shadow: 0 24px 70px rgba(2, 6, 23, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 30;
}

.sidebar::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -70px;
    top: -60px;
    background: linear-gradient(135deg, rgba(34, 197, 94, .36), rgba(6, 182, 212, .18));
    filter: blur(4px);
    border-radius: 999px;
    pointer-events: none;
}

.brand {
    position: relative;
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 16px 28px rgba(37, 99, 235, .28);
}

.brand-mark svg {
    width: 28px;
    height: 28px;
}

.brand strong {
    display: block;
    font-size: 18px;
    letter-spacing: -.03em;
}

.brand small,
.sidebar-card small,
.mini-user small {
    display: block;
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
    margin-top: 2px;
}

.nav {
    position: relative;
    margin-top: 18px;
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 18px;
    text-decoration: none;
    color: rgba(255, 255, 255, .74);
    transition: .18s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transform: translateX(3px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(6, 182, 212, .76));
    color: #fff;
    box-shadow: 0 14px 24px rgba(37, 99, 235, .22);
}

.nav-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .08);
}

.nav-link.active .nav-icon {
    background: rgba(255, 255, 255, .18);
}

.sidebar-card {
    position: relative;
    margin-top: auto;
    margin-bottom: 14px;
    padding: 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, .12);
}

.sidebar-footer {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, .11);
    padding-top: 14px;
}

.mini-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mini-user div {
    min-width: 0;
}

.mini-user strong,
.mini-user small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 12px 22px rgba(37, 99, 235, .22);
    flex: 0 0 auto;
}

.avatar.small {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    font-size: 13px;
}

.logout-link {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .76);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 16px;
}

.logout-link:hover {
    background: rgba(239, 68, 68, .13);
    color: #fff;
}

.main {
    width: 100%;
    margin-left: calc(var(--sidebar-width) + 34px);
    padding: 20px 24px 30px 0;
}

.app-header {
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 8px 4px;
}

.app-header h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -.05em;
}

.app-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.sidebar-toggle {
    display: none;
    border: 0;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--surface-solid);
    box-shadow: var(--shadow-soft);
    color: var(--dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-pill,
.user-pill {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 8px 12px;
    box-shadow: var(--shadow-soft);
}

.search-pill {
    color: var(--muted);
    min-width: 210px;
}

.user-pill strong,
.user-pill small {
    display: block;
    line-height: 1.15;
}

.user-pill small {
    color: var(--muted);
    font-size: 12px;
}

.content {
    width: 100%;
}

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 24px;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(30, 64, 175, .88)),
        radial-gradient(circle at 85% 20%, rgba(34, 197, 94, .3), transparent 32%);
    color: #fff;
    border-radius: 30px;
    padding: clamp(24px, 4vw, 38px);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.hero h2 {
    margin: 0 0 10px;
    font-size: clamp(28px, 5vw, 54px);
    line-height: 1;
    letter-spacing: -.06em;
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    max-width: 700px;
}

.hero-badge,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bfdbfe;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 13px;
    margin-bottom: 14px;
}

.hero-orb {
    width: 210px;
    height: 210px;
    justify-self: end;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .8), rgba(6, 182, 212, .65)),
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .55), transparent 24%);
    box-shadow: inset 0 0 60px rgba(255, 255, 255, .12), 0 30px 60px rgba(0, 0, 0, .2);
}

.hero-orb svg {
    width: 112px;
    height: 112px;
    opacity: .92;
}

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

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -45px auto;
    width: 118px;
    height: 118px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.stat-card small {
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    font-size: 38px;
    letter-spacing: -.06em;
}

.card {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-soft);
}

.card h2,
.card h3 {
    margin-top: 0;
    letter-spacing: -.03em;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, .65);
}

thead {
    background: #0f172a;
    color: #fff;
}

th,
td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
    font-size: 14px;
}

tbody tr:hover {
    background: rgba(37, 99, 235, .04);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #e0f2fe;
    color: #0369a1;
}

.badge.green {
    background: #dcfce7;
    color: #166534;
}

.badge.orange {
    background: #ffedd5;
    color: #9a3412;
}

.badge.gray {
    background: #f1f5f9;
    color: #475569;
}

.module-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    overflow: hidden;
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .58)),
        radial-gradient(circle at 90% 10%, rgba(37, 99, 235, .14), transparent 34%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: clamp(24px, 4vw, 36px);
    margin-bottom: 18px;
}

.module-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -.06em;
}

.module-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.module-hero .eyebrow {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.hero-ball {
    width: 130px;
    height: 130px;
    border-radius: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    transform: rotate(8deg);
    box-shadow: 0 24px 45px rgba(37, 99, 235, .23);
}

.hero-ball svg {
    width: 72px;
    height: 72px;
}

.empty-state {
    text-align: center;
    padding: 42px 20px;
    color: var(--muted);
}

.empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #dbeafe;
}

.empty-icon svg {
    width: 36px;
    height: 36px;
}

.empty-state h3 {
    color: var(--text);
    margin: 0 0 8px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .22), transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, .18), transparent 30%),
        #eef2f7;
}

.login-shell {
    width: min(1120px, 100%);
    min-height: 660px;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #fff;
}

.login-art {
    position: relative;
    overflow: hidden;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        linear-gradient(150deg, rgba(7, 17, 31, .98), rgba(30, 64, 175, .9)),
        radial-gradient(circle at 75% 20%, rgba(34, 197, 94, .32), transparent 28%);
}

.login-art::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: rgba(6, 182, 212, .22);
}

.login-art h1 {
    position: relative;
    margin: 22px 0 12px;
    font-size: clamp(40px, 6vw, 74px);
    line-height: .9;
    letter-spacing: -.08em;
}

.login-art p {
    position: relative;
    max-width: 500px;
    color: rgba(255, 255, 255, .72);
    font-size: 17px;
}

.login-logo {
    position: relative;
    display: flex;
    gap: 13px;
    align-items: center;
}

.login-logo .brand-mark {
    position: relative;
}

.pitch-card {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .08);
    border-radius: 24px;
    padding: 18px;
}

.pitch-line {
    height: 10px;
    width: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    margin: 11px 0;
}

.pitch-line.short {
    width: 68%;
}

.login-panel {
    padding: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-panel h2 {
    margin: 0 0 8px;
    font-size: 34px;
    letter-spacing: -.05em;
}

.login-panel p {
    margin: 0 0 26px;
    color: var(--muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 800;
    margin-bottom: 7px;
    color: #334155;
}

.input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 15px;
    font-size: 15px;
    outline: none;
    transition: .18s ease;
    background: #fff;
}

.input:focus {
    border-color: rgba(37, 99, 235, .55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.btn {
    appearance: none;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    border-radius: 16px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 16px 26px rgba(37, 99, 235, .2);
}

.btn.full {
    width: 100%;
}

.btn.dark {
    background: #0f172a;
}

.btn.light {
    background: #e2e8f0;
    color: #0f172a;
    box-shadow: none;
}

.alert {
    border-radius: 16px;
    padding: 13px 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert.error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.alert.success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.help-text {
    color: var(--muted);
    font-size: 13px;
    margin-top: 14px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 1050px) {
    .stats-grid,
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-actions .search-pill {
        display: none;
    }
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-120%);
        transition: .24s ease;
        inset: 12px auto 12px 12px;
        width: min(310px, calc(100vw - 24px));
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, .45);
        backdrop-filter: blur(4px);
        z-index: 20;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .main {
        margin-left: 0;
        padding: 16px;
    }

    .sidebar-toggle {
        display: grid;
        place-items: center;
    }

    .app-header {
        align-items: flex-start;
    }

    .user-pill {
        display: none;
    }

    .hero,
    .login-shell {
        grid-template-columns: 1fr;
    }

    .hero-orb,
    .login-art {
        display: none;
    }

    .login-panel {
        padding: 30px;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .module-hero {
        align-items: flex-start;
    }

    .hero-ball {
        display: none;
    }

    th,
    td {
        font-size: 13px;
        padding: 11px;
    }
}
