/* =========================================================
   WSBCO Golf Coach
   Dashboard UI
   ========================================================= */

:root {
    --bg: #f3f6f5;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --sidebar: #0f2924;
    --sidebar-soft: #173f35;
    --text: #18231f;
    --muted: #728079;
    --line: #dfe7e3;
    --accent: #1e725f;
    --accent-dark: #155444;
    --accent-soft: #e5f1ed;
    --shadow: 0 12px 28px rgba(17, 44, 37, 0.07);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
}


/* Sidebar */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    background:
        linear-gradient(
            180deg,
            #12352d 0%,
            var(--sidebar) 100%
        );
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 8px 26px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #ffffff;
    color: var(--sidebar);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-subtitle {
    margin-top: 2px;
    color: #b9cdc6;
    font-size: 13px;
}

.sidebar-nav {
    display: grid;
    gap: 7px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    color: #c9d8d3;
    font-size: 14px;
    font-weight: 650;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.nav-item.active {
    box-shadow:
        inset 3px 0 0 #8dd4bf;
}

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

.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.system-label {
    color: #91aaa2;
    font-size: 11px;
    line-height: 1.5;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    color: #dce9e5;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #86d8b9;
    box-shadow: 0 0 0 4px rgba(134, 216, 185, 0.12);
}


/* Main */

.main-content {
    min-width: 0;
    padding: 34px 38px 48px;
}

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

.eyebrow,
.panel-eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    margin: 7px 0 8px;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.page-subtitle {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 750;
}

.button-primary {
    background: var(--accent);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--accent-dark);
}

.button-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}


/* Metrics */

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

.metric-card {
    min-height: 154px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card-accent {
    background:
        linear-gradient(
            145deg,
            #173f35,
            #0f2b25
        );
    border-color: transparent;
    color: #ffffff;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-card-accent .metric-header,
.metric-card-accent .metric-detail {
    color: #b9cec7;
}

.metric-badge {
    padding: 4px 7px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric-card-accent .metric-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #d8eee7;
}

.metric-value {
    margin-top: 19px;
    font-size: 36px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.metric-unit {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.metric-detail {
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}


/* Panels */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
    gap: 18px;
}

.panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-large {
    min-height: 330px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel h2 {
    margin: 5px 0 0;
    font-size: 18px;
    letter-spacing: -0.025em;
}

.text-link {
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
}


/* Table */

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #edf1ef;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.club-name {
    font-weight: 750;
}

.unit {
    color: var(--muted);
    font-size: 10px;
}


/* Student list */

.student-list,
.session-list {
    display: grid;
}

.student-row,
.session-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 4px;
    border-bottom: 1px solid #edf1ef;
}

.student-row:last-child,
.session-row:last-child {
    border-bottom: none;
}

.student-row:hover,
.session-row:hover {
    background: var(--surface-soft);
}

.avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
}

.student-info,
.session-main {
    min-width: 0;
    flex: 1;
}

.student-name,
.session-title {
    overflow: hidden;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-meta,
.session-meta {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-arrow {
    color: #9aa8a2;
    font-size: 23px;
}


/* Sessions */

.session-date {
    flex: 0 0 48px;
    width: 48px;
    min-height: 51px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 11px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.session-month {
    color: var(--accent);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.session-day {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 850;
}

.session-shot-count {
    display: grid;
    min-width: 55px;
    text-align: right;
}

.session-shot-count strong {
    font-size: 15px;
}

.session-shot-count span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}


/* Quick actions */

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.quick-action:hover {
    border-color: #bfd3cb;
    background: #f2f7f5;
}

.quick-icon {
    flex: 0 0 37px;
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--sidebar-soft);
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
}

.quick-action strong,
.quick-action span {
    display: block;
}

.quick-action strong {
    font-size: 12px;
}

.quick-action span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}


/* Empty */

.empty-state {
    display: grid;
    justify-items: center;
    padding: 38px 20px 24px;
    text-align: center;
}

.empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 900;
}

.empty-state h3 {
    margin: 16px 0 6px;
    font-size: 16px;
}

.empty-state p {
    max-width: 390px;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.compact-empty {
    display: grid;
    gap: 5px;
    padding: 25px 4px;
}

.compact-empty strong {
    font-size: 13px;
}

.compact-empty span {
    color: var(--muted);
    font-size: 11px;
}


/* Responsive */

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

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

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 15px;
    }

    .brand {
        padding-bottom: 14px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        overflow-x: auto;
    }

    .nav-item {
        min-width: 115px;
        justify-content: center;
        padding: 0 10px;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        padding: 24px 18px 40px;
    }

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

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

    .metric-card {
        min-height: 132px;
    }

    .topbar-actions {
        width: 100%;
    }

    .button {
        flex: 1;
    }

    .panel {
        padding: 17px;
    }

    .session-shot-count {
        display: none;
    }
}
