* {
    box-sizing: border-box;
}

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #72809a;
    --border: #e7eaf0;
    --primary: #6d47d9;
    --primary-dark: #5635bb;
    --accent: #1fc6a4;
    --danger: #dc4c64;
    --warning: #f5a524;
    --sidebar: #111827;
    --sidebar-soft: #1a2232;
    --shadow: 0 10px 35px rgba(18, 28, 45, .07);
    --radius: 18px;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

button, input, select, textarea {
    font: inherit;
}

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

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background:
        radial-gradient(circle at top left, rgba(109, 71, 217, .30), transparent 35%),
        var(--sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 30;
    border-right: 1px solid rgba(255,255,255,.06);
}

.brand {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    box-shadow: 0 8px 24px rgba(109, 71, 217, .34);
}

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

.brand span {
    display: block;
    margin-top: 1px;
    font-size: 10px;
    letter-spacing: .22em;
    color: #aeb7c8;
}

.nav {
    padding: 22px 14px;
    overflow-y: auto;
}

.nav-label {
    padding: 0 12px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    color: #6f7b90;
}

.nav-label-spaced {
    margin-top: 22px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    margin-bottom: 5px;
    border-radius: 12px;
    color: #bdc7d8;
    font-size: 14px;
    font-weight: 600;
    transition: .18s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.nav-item.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(109,71,217,.93), rgba(124,83,230,.82));
    box-shadow: 0 8px 25px rgba(80, 51, 180, .28);
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 17px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
}

.plan-card {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    border-radius: 15px;
    padding: 14px;
}

.plan-card strong,
.plan-card small {
    display: block;
}

.plan-card strong {
    margin: 8px 0 3px;
    font-size: 14px;
}

.plan-card small {
    color: #9ba7ba;
}

.plan-badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(31,198,164,.15);
    color: #70e2ca;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
}

.main {
    min-height: 100vh;
    margin-left: 270px;
}

.topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 30px;
    background: rgba(246,247,251,.90);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(218,222,231,.8);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.topbar h1 {
    font-size: 22px;
    margin: 2px 0 0;
    letter-spacing: -.02em;
}

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

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.mobile-menu {
    display: none;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 14px;
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #ede8ff;
    color: var(--primary);
    font-weight: 800;
}

.profile-text strong,
.profile-text span {
    display: block;
}

.profile-text strong {
    font-size: 13px;
}

.profile-text span {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.chevron {
    color: var(--muted);
}

.content {
    padding: 28px 30px 44px;
}

.hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.hero-copy h2 {
    margin: 0;
    font-size: 27px;
    letter-spacing: -.03em;
}

.hero-copy p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c55e6);
    color: #fff;
    box-shadow: 0 8px 22px rgba(109,71,217,.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

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

.stat-card,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 19px;
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.stat-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f1edff;
    color: var(--primary);
}

.stat-value {
    font-size: 29px;
    font-weight: 800;
    margin: 14px 0 3px;
    letter-spacing: -.03em;
}

.stat-meta {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
    gap: 18px;
}

.card {
    overflow: hidden;
}

.card-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.card-head h3 {
    margin: 0;
    font-size: 15px;
}

.card-body {
    padding: 18px 20px;
}

.training-list {
    display: grid;
    gap: 10px;
}

.training-item {
    display: grid;
    grid-template-columns: 66px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.training-time {
    font-weight: 800;
    color: var(--primary);
}

.training-title {
    font-size: 14px;
    font-weight: 700;
}

.training-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.badge-team {
    color: #166c5b;
    background: #e9fbf6;
}

.badge-individual {
    color: #5b3cc4;
    background: #f0ebff;
}

.notice-list {
    display: grid;
    gap: 12px;
}

.notice {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px;
    border-radius: 13px;
    background: var(--surface-soft);
}

.notice-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 5px;
    flex: 0 0 auto;
    background: var(--warning);
}

.notice strong {
    display: block;
    font-size: 12px;
}

.notice span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.table-card {
    margin-top: 20px;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.table th {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.table td {
    font-size: 13px;
}

.empty-state {
    padding: 44px 20px;
    text-align: center;
}

.empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 17px;
    background: #f0ebff;
    color: var(--primary);
    font-size: 24px;
}

.empty-state h3 {
    margin: 0;
}

.empty-state p {
    max-width: 440px;
    margin: 8px auto 18px;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-backdrop {
    display: none;
}

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 20px 0 50px rgba(0,0,0,.18);
    }

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

    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,.46);
        z-index: 25;
    }

    .main {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid;
        place-items: center;
    }

    .profile-text,
    .chevron {
        display: none;
    }

    .content,
    .topbar {
        padding-left: 18px;
        padding-right: 18px;
    }
}

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

    .hero-row {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-row .btn {
        width: 100%;
    }

    .training-item {
        grid-template-columns: 56px 1fr;
    }

    .training-item .badge {
        grid-column: 2;
        justify-self: start;
    }

    .content {
        padding-top: 20px;
    }
}
