/* QBod Trainer Portal Styles */
/* Brand-aligned with main QBod website */

:root {
    --primary-teal: #26D0CE;
    --deep-teal: #1A8B8A;
    --light-teal: #3DE5E3;
    --mint-accent: #70F3D0;
    --carbon-black: #050505;
    --surface-dark: #0A0A0A;
    --surface-elevated: #111111;
    --surface-card: #161616;
    --surface-hover: #1a1a1a;
    --glass-border: rgba(255, 255, 255, 0.08);
    --white: #FFFFFF;
    --titanium: #8A9BAE;
    --titanium-light: #a8b8c8;
    --gradient-glow: linear-gradient(135deg, var(--deep-teal), var(--primary-teal), var(--mint-accent));

    /* Status colors — aligned with QBod brand teal/mint */
    --success: var(--primary-teal);
    --success-light: var(--mint-accent);
    --warning: #FBBF24;
    --error: #F87171;
    --info: var(--primary-teal);

    /* Sidebar */
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--carbon-black);
    color: var(--white);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface-dark);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    height: 40px;
    margin-bottom: 8px;
}

.portal-badge {
    display: inline-block;
    background: rgba(38, 208, 206, 0.1);
    color: var(--primary-teal);
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--titanium);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--surface-elevated);
    color: var(--white);
}

.nav-item.active {
    background: rgba(38, 208, 206, 0.1);
    color: var(--primary-teal);
}

.nav-icon {
    font-size: 12px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
}

.trainer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-elevated);
    border-radius: 8px;
}

.trainer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--carbon-black);
}

.trainer-info {
    display: flex;
    flex-direction: column;
}

.trainer-name {
    font-weight: 600;
    font-size: 13px;
}

.trainer-tier {
    font-size: 11px;
    color: var(--titanium);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--titanium);
    font-size: 14px;
}

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

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: var(--gradient-glow);
    color: var(--carbon-black);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(38, 208, 206, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    border-color: var(--primary-teal);
    color: var(--primary-teal);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-small:not(.secondary):not(.primary) {
    background: var(--surface-elevated);
    color: var(--white);
    border: 1px solid var(--glass-border);
}

.btn-small:not(.secondary):not(.primary):hover {
    border-color: var(--primary-teal);
}

.btn-small.primary {
    background: var(--gradient-glow);
    color: var(--carbon-black);
}

.btn-small.secondary {
    background: transparent;
    color: var(--titanium);
    border: 1px solid var(--glass-border);
}

.btn-small.secondary:hover {
    color: var(--white);
    border-color: var(--titanium);
}

.link-text {
    color: var(--primary-teal);
    font-size: 13px;
    font-weight: 500;
}

.link-text:hover {
    text-decoration: underline;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.stat-label {
    font-size: 12px;
    color: var(--titanium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
}

.stat-change.positive { color: var(--success); }
.stat-change.warning { color: var(--warning); }
.stat-change.neutral { color: var(--titanium); }

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* ==================== ATTENTION CARDS ==================== */
.attention-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.attention-card {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.attention-priority {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.attention-priority.high {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.attention-priority.medium {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.attention-priority.low {
    background: rgba(38, 208, 206, 0.15);
    color: var(--primary-teal);
}

.client-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-teal);
}

.client-info {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 600;
    font-size: 14px;
}

.client-goal {
    font-size: 12px;
    color: var(--titanium);
}

.attention-reason {
    font-size: 13px;
    color: var(--titanium);
    margin-bottom: 16px;
    line-height: 1.5;
}

.attention-actions {
    display: flex;
    gap: 8px;
}

/* ==================== ACTIVITY LIST ==================== */
.activity-list {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.activity-icon.goal {
    background: rgba(38, 208, 206, 0.15);
    color: var(--primary-teal);
}

.activity-icon.workout {
    background: rgba(112, 243, 208, 0.15);
    color: var(--mint-accent);
}

.activity-icon.client {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.activity-icon.ai {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.activity-content p {
    font-size: 13px;
    color: var(--white);
    margin-bottom: 4px;
}

.activity-content strong {
    color: var(--white);
}

.activity-time {
    font-size: 11px;
    color: var(--titanium);
}

/* ==================== QUICK ACTIONS ==================== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.quick-action-card {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.quick-action-card:hover {
    border-color: var(--primary-teal);
    transform: translateY(-4px);
}

.quick-action-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.quick-action-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.quick-action-card p {
    font-size: 12px;
    color: var(--titanium);
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--titanium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--white);
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(38, 208, 206, 0.1);
}

.form-input::placeholder {
    color: var(--titanium);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A9BAE' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.form-hint {
    font-size: 11px;
    color: var(--titanium);
    margin-top: 6px;
}

/* Input with unit */
.input-with-unit {
    position: relative;
}

.input-with-unit .form-input {
    padding-right: 50px;
}

.input-unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--titanium);
}

/* Checkbox/Radio */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-teal);
}

.form-checkbox span {
    font-size: 14px;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card.highlight {
    background: linear-gradient(180deg, rgba(38, 208, 206, 0.08) 0%, var(--surface-card) 100%);
    border-color: rgba(38, 208, 206, 0.3);
}

/* ==================== TABLES ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--titanium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
}

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

.data-table tr:hover td {
    background: var(--surface-hover);
}

/* ==================== TAGS/BADGES ==================== */
.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag.success {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.tag.warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.tag.error {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.tag.info {
    background: rgba(38, 208, 206, 0.15);
    color: var(--primary-teal);
}

.tag.neutral {
    background: var(--surface-elevated);
    color: var(--titanium);
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    height: 8px;
    background: var(--surface-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-glow);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 6px;
}

.progress-label .value {
    color: var(--primary-teal);
    font-weight: 600;
}

.progress-label .total {
    color: var(--titanium);
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-elevated);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--titanium);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.tab:hover {
    color: var(--white);
}

.tab.active {
    background: var(--surface-card);
    color: var(--white);
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--surface-elevated);
    color: var(--titanium);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--glass-border);
}

/* ==================== SECTION NAV (sticky) ==================== */
.section-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    gap: 4px;
    padding: 10px 0;
    margin-bottom: 8px;
    background: var(--carbon-black);
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
    display: none;
}

.section-nav-link {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--titanium);
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.section-nav-link:hover {
    color: var(--white);
    background: var(--surface-elevated);
}

.section-nav-link.active {
    color: var(--primary-teal);
    background: rgba(38, 208, 206, 0.1);
    border-color: rgba(38, 208, 206, 0.25);
}

/* ==================== 360 VIEW SECTIONS ==================== */
.section-360 {
    margin-bottom: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
}

.section-360:first-child {
    border-top: none;
    padding-top: 0;
}

/* Section header block: label + title + subtitle (matches homepage) */
.section-360-header {
    margin-bottom: 32px;
}

.section-360-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-teal);
    margin-bottom: 10px;
}

.section-360-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.2;
}

.section-360-subtitle {
    font-size: 15px;
    color: var(--titanium);
    margin-top: 8px;
    line-height: 1.6;
}

/* ==================== Q-SCORE BAR ==================== */
.q-score-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.q-score-item {
    flex: 1;
    min-width: 100px;
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: border-color 0.2s;
}

.q-score-item.overall {
    border-color: rgba(38, 208, 206, 0.4);
    background: linear-gradient(180deg, rgba(38, 208, 206, 0.06) 0%, var(--surface-card) 100%);
}

.q-score-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--titanium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.q-score-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.q-score-value.good { color: var(--success); }
.q-score-value.warning { color: var(--warning); }
.q-score-value.alert { color: var(--error); }

.q-score-delta {
    font-size: 12px;
    font-weight: 600;
}

.q-score-delta.positive { color: var(--success); }
.q-score-delta.negative { color: var(--error); }
.q-score-delta.neutral { color: var(--titanium); }

.q-score-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--titanium);
    margin-bottom: 16px;
}

.q-score-meta strong {
    color: var(--white);
}

/* ==================== LIMITING FACTORS ==================== */
.limiting-factors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.limiting-factor-group {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 3px solid var(--titanium);
}

.limiting-factor-group.nutrition { border-left-color: var(--mint-accent); }
.limiting-factor-group.fitness { border-left-color: #F97316; }
.limiting-factor-group.body { border-left-color: var(--primary-teal); }

.limiting-factor-domain {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.limiting-factor-group.nutrition .limiting-factor-domain { color: var(--mint-accent); }
.limiting-factor-group.fitness .limiting-factor-domain { color: #F97316; }
.limiting-factor-group.body .limiting-factor-domain { color: var(--primary-teal); }

.limiting-factor-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.limiting-factor-list li {
    font-size: 13px;
    color: var(--titanium-light);
    padding: 2px 0;
    padding-left: 16px;
    position: relative;
}

.limiting-factor-list li::before {
    content: none;
}

.limiting-factor-list li .factor-icon {
    margin-right: 4px;
}

.limiting-factor-list li.positive {
    color: var(--success);
}

.limiting-factor-list li.negative {
    color: var(--warning);
}

.limiting-factor-list li strong {
    color: var(--white);
    font-weight: 600;
}

.limiting-factor-list li.positive strong {
    color: var(--success);
}

.limiting-factor-list li.negative strong {
    color: var(--warning);
}

/* ==================== DAILY TABLE (360 view) ==================== */
.daily-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
}

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

.daily-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--titanium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.daily-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

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

.daily-table tr:hover td {
    background: var(--surface-hover);
}

.daily-table .cell-good {
    color: var(--success);
}

.daily-table .cell-warning {
    color: var(--warning);
}

.daily-table .cell-alert {
    color: var(--error);
}

.daily-table .cell-muted {
    color: var(--titanium);
}

.daily-table .date-cell {
    font-weight: 600;
    color: var(--white);
}

/* ==================== TABLE SUMMARY ROW ==================== */
.table-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    font-size: 13px;
    color: var(--titanium);
}

.table-summary strong {
    color: var(--white);
    font-weight: 600;
}

/* ==================== METRIC ROW ==================== */
.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--titanium);
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-value {
    font-weight: 700;
    color: var(--white);
}

.metric-value.good { color: var(--success); }
.metric-value.warning { color: var(--warning); }
.metric-value.alert { color: var(--error); }

.metric-delta {
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.metric-delta.positive { color: var(--success); }
.metric-delta.negative { color: var(--error); }

/* ==================== STATUS DOT ==================== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--titanium);
}

.status-dot.good { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.alert { background: var(--error); }

/* ==================== COACH MESSAGES ==================== */
.coach-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coach-message {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 3px solid var(--titanium);
}

.coach-message.focus { border-left-color: var(--primary-teal); }
.coach-message.nutrition { border-left-color: var(--success); }
.coach-message.fitness { border-left-color: #F97316; }
.coach-message.recovery { border-left-color: #A78BFA; }

.coach-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11px;
}

.coach-message-date {
    color: var(--titanium);
    font-weight: 600;
}

.coach-message-domain {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coach-message.focus .coach-message-domain {
    background: rgba(38, 208, 206, 0.15);
    color: var(--primary-teal);
}

.coach-message.nutrition .coach-message-domain {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.coach-message.fitness .coach-message-domain {
    background: rgba(249, 115, 22, 0.15);
    color: #F97316;
}

.coach-message.recovery .coach-message-domain {
    background: rgba(167, 139, 250, 0.15);
    color: #A78BFA;
}

.coach-message-text {
    font-size: 13px;
    color: var(--titanium-light);
    line-height: 1.5;
    font-style: italic;
}

/* ==================== PROGRESS TIMELINE ==================== */
.progress-timeline {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.progress-timeline .progress-bar {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.progress-timeline .progress-fill {
    border-radius: 6px;
}

.progress-timeline-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--titanium);
    margin-bottom: 16px;
}

.progress-timeline-label .pct {
    color: var(--primary-teal);
    font-weight: 700;
    font-size: 14px;
}

/* ==================== WEIGH-IN GRID ==================== */
.weighin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weighin-item {
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    text-align: center;
}

.weighin-item .weighin-date {
    font-size: 10px;
    color: var(--titanium);
    margin-bottom: 2px;
}

.weighin-item .weighin-value {
    font-weight: 700;
    color: var(--white);
}

/* ==================== WORKOUT CARDS ==================== */
.workout-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.workout-session {
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
}

.workout-session-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.workout-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    min-width: 60px;
}

.workout-type-tag {
    display: inline-block;
    background: rgba(38, 208, 206, 0.12);
    color: var(--primary-teal);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}

.workout-meta {
    font-size: 12px;
    color: var(--titanium);
}

.workout-exercises {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--glass-border);
}

.workout-exercise-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 13px;
    gap: 12px;
}

.exercise-name {
    font-weight: 500;
    color: var(--white);
    white-space: nowrap;
}

.exercise-muscle {
    font-weight: 400;
    font-size: 11px;
    color: var(--titanium);
    margin-left: 4px;
}

.exercise-sets {
    font-size: 12px;
    color: var(--titanium-light);
    text-align: right;
    flex-shrink: 0;
}

/* ==================== SECTION COLLAPSE ==================== */
.section-360-header {
    cursor: pointer;
    user-select: none;
}

.section-360-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-360-header .toggle-chevron {
    font-size: 28px;
    color: var(--titanium);
    transition: transform 0.25s ease, color 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.section-360-header:hover .toggle-chevron {
    color: var(--primary-teal);
}

.section-360.collapsed .toggle-chevron {
    transform: rotate(-90deg);
}

.section-360.collapsed .section-360-body {
    display: none;
}

/* Subtle hover feedback on header */
.section-360-header:hover .section-360-title {
    color: var(--primary-teal);
    transition: color 0.2s;
}

/* ==================== 360 VIEW CLIENT HEADER ==================== */
.client-360-header {
    margin-bottom: 48px;
}

.client-360-header h1 {
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    line-height: 1.1;
}

.client-360-subtitle {
    font-size: 15px;
    color: var(--titanium);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.client-360-subtitle .goal-tag {
    display: inline-block;
    background: rgba(38, 208, 206, 0.1);
    color: var(--primary-teal);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==================== EMPTY SECTION STATE ==================== */
.section-empty {
    text-align: center;
    padding: 24px;
    color: var(--titanium);
    font-size: 13px;
    background: var(--surface-card);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
}

/* ==================== TRAINER BRIEF ==================== */
.brief-timestamp {
    font-size: 11px;
    color: var(--titanium);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

/* Base card used by every brief section */
.brief-card {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

.brief-card-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-teal);
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--surface-elevated);
}

.brief-card-body {
    padding: 16px 18px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--titanium-light);
}

/* Domain insight cards — 3-column grid */
.brief-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.brief-insight-card {
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 16px 18px;
    overflow: hidden;
}

.brief-insight-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 10px;
}

.brief-insight-text {
    font-size: 13px;
    line-height: 1.65;
    color: var(--titanium-light);
}

/* Focus area items — stacked with dividers */
.brief-focus-item {
    padding: 12px 0;
}

.brief-focus-item.with-border {
    border-bottom: 1px solid var(--glass-border);
}

.brief-focus-item:first-child {
    padding-top: 0;
}

.brief-focus-item:last-child {
    padding-bottom: 0;
}

.brief-focus-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.brief-focus-detail {
    font-size: 13px;
    line-height: 1.6;
    color: var(--titanium-light);
}

/* Talking point items — stacked with mint accent + dividers */
.brief-tp {
    padding: 12px 0;
}

.brief-tp.with-border {
    border-bottom: 1px solid var(--glass-border);
}

.brief-tp:first-child {
    padding-top: 0;
}

.brief-tp:last-child {
    padding-bottom: 0;
}

.brief-tp-topic {
    font-size: 12px;
    font-weight: 700;
    color: var(--mint-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.brief-tp-context {
    font-size: 13px;
    line-height: 1.6;
    color: var(--titanium-light);
}

/* Responsive: stack insight cards on smaller screens */
@media (max-width: 900px) {
    .brief-insights-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .attention-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* ---- Sidebar: slide off-screen, toggle with .open ---- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }

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

    .mobile-menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 68px; /* room for hamburger */
    }

    /* ---- Dashboard grids ---- */
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* ---- Tables: horizontal scroll ---- */
    .data-table {
        min-width: 600px;
    }

    .daily-table {
        min-width: 600px;
    }

    .card:has(.data-table),
    .daily-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- Client 360 View ---- */
    .q-score-bar {
        flex-wrap: wrap;
    }

    .q-score-item {
        min-width: calc(50% - 8px);
        flex: 0 0 calc(50% - 8px);
    }

    .section-collapse-toggle {
        display: block;
    }

    .q-score-value {
        font-size: 26px;
    }

    .section-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 4px;
    }

    .section-nav-link {
        flex-shrink: 0;
    }

    .metric-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .workout-session-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .workout-exercise-row {
        flex-direction: column;
        gap: 4px;
    }

    /* ---- Filters: stack on mobile ---- */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    /* ---- Weighin grid ---- */
    .weighin-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== LOADING / ERROR / EMPTY STATES ==================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--titanium);
    font-size: 14px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--surface-elevated);
    border-top: 3px solid var(--primary-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--error);
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--titanium);
    font-size: 14px;
}

/* ==================== MOBILE HAMBURGER ==================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--surface-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-menu-toggle:hover {
    border-color: var(--primary-teal);
}

/* Sidebar overlay backdrop for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ==================== SMALL MOBILE (≤480px) ==================== */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
        padding-top: 64px;
    }

    .q-score-item {
        min-width: 100%;
        flex: 0 0 100%;
    }

    .weighin-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-summary {
        flex-direction: column;
        gap: 8px;
    }

    .client-mini {
        flex-wrap: wrap;
    }
}
