/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #ab1053;
    --primary-light: #fce8f0;
    --primary-dark: #8a0d43;
    --accent: #c4246a;
    --danger: #dc3545;
    --danger-light: #fde8ea;
    --warning: #f0ad4e;
    --warning-light: #fef7e8;
    --success: #28a745;
    --success-light: #e8f5eb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --sidebar-width: 260px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    /* Brand palette (for tier system + brand accents) */
    --brand-pink: #f74aa0;
    --brand-pink-light: #fde3ef;
    --brand-teal: #90c7c4;
    --brand-teal-light: #e4f1f0;
    --brand-blush: #f5d4d5;
    --brand-blush-dark: #b86c6e;
    --brand-gray: #bebec2;
    --brand-gray-light: #ececed;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

/* ===== Layout ===== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-800);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 12px 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 16px;
}

.sidebar-clients {
    flex: 1;
    padding: 0 12px 12px;
    overflow-y: auto;
}

.sidebar-search {
    position: sticky;
    top: 0;
    padding: 8px 0;
    background: var(--gray-800);
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.06);
    color: white;
    font-size: 13px;
    outline: none;
}

.sidebar-search input::placeholder {
    color: var(--gray-400);
}

.sidebar-search input:focus {
    border-color: var(--accent);
}

.sidebar-client-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: var(--gray-300);
}

.sidebar-client-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-client-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
}

.sidebar-client-consistency {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    min-width: 0; /* let wide content (tab bar, tables) scroll inside instead of widening the page */
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    max-width: 1400px;
}

/* ===== Views ===== */
.view {
    display: none;
}

.view.active {
    display: block;
}

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

.view-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.client-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

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

/* ===== Buttons ===== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-back {
    background: transparent;
    color: var(--gray-500);
    padding: 8px 12px;
}

.btn-back:hover {
    color: var(--gray-800);
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    background: var(--gray-200);
    color: var(--gray-600);
}

.btn-small:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-small.active {
    background: var(--primary);
    color: white;
}

.btn-icon {
    padding: 4px 8px;
    background: transparent;
    font-size: 16px;
    color: var(--gray-400);
}

.btn-icon:hover {
    color: var(--gray-700);
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
}

.card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 500;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.summary-card.attention .card-value {
    color: var(--danger);
}

/* ===== Targets Bar ===== */
.targets-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 20px;
}

.target-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.target-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    font-weight: 500;
}

.target-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ===== Consistency Badge ===== */
.consistency-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.consistency-green {
    background: var(--success-light);
    color: var(--success);
}

.consistency-yellow {
    background: var(--warning-light);
    color: #b8860b;
}

.consistency-red {
    background: var(--danger-light);
    color: var(--danger);
}

.consistency-na {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* ===== Tables ===== */
.table-wrapper {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-500);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.cell-green {
    color: var(--success);
    font-weight: 600;
}

.cell-yellow {
    color: #b8860b;
    font-weight: 600;
}

.cell-red {
    color: var(--danger);
    font-weight: 600;
}

.cell-na {
    color: var(--gray-400);
}

.weight-change-positive {
    color: var(--danger);
}

.weight-change-negative {
    color: var(--success);
}

.weight-change-neutral {
    color: var(--gray-500);
}

.client-name-cell {
    font-weight: 600;
    color: var(--gray-800);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    box-shadow: inset 0 -2px 0 var(--gray-200); /* bottom line; lets the bar scroll without clipping the active underline */
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Charts ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    min-height: 300px;
}

.chart-card canvas {
    max-height: 280px;
}

/* ===== Date Range Picker ===== */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.date-range-picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}

.date-range-picker input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
}

.quick-ranges {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

/* ===== Forms ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.targets-grid {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,122,109,0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

/* ===== Modals ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 720px;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
}

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

.modal form,
.modal > div:not(.modal-header) {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    margin-top: 8px;
}

.checkin-form-sections {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 8px;
    padding-right: 8px;
}

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

.checkin-header h3 {
    margin-bottom: 0;
}

/* ===== Check-In Detail ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.detail-row .detail-label {
    color: var(--gray-500);
}

.detail-row .detail-value {
    font-weight: 600;
    color: var(--gray-800);
}

.detail-notes {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    font-size: 14px;
    display: none;
}

.empty-state.visible {
    display: block;
}

/* ===== Action Buttons in Table ===== */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btns .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* ===== Login Screen ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gray-800) 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.login-card {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: var(--primary);
    padding: 32px 32px 24px;
    text-align: center;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.login-header p {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.login-body {
    padding: 32px;
}

.login-message {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray-400);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--gray-200);
}

.login-divider span {
    padding: 0 12px;
}

.login-body .form-group {
    margin-bottom: 12px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 18px;
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 300;
    color: var(--gray-500);
    font-size: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Sidebar Footer ===== */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.btn-signout {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-400);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-signout:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

/* ===== Macro Paste Zone ===== */
.macro-paste-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 16px;
    background: var(--gray-50);
    outline: none;
}

.macro-paste-zone:focus,
.macro-paste-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.macro-paste-zone.processing {
    border-color: var(--primary);
    background: var(--primary-light);
    cursor: default;
}

.paste-zone-idle svg {
    color: var(--gray-400);
    margin-bottom: 6px;
}

.paste-zone-idle p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 2px;
}

.paste-hint {
    font-size: 11px;
    color: var(--gray-400);
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
    margin: 0 auto 8px;
}

.paste-zone-processing p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.ocr-progress-bar {
    width: 80%;
    max-width: 200px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin: 0 auto 4px;
    overflow: hidden;
}

.ocr-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.ocr-status-text {
    font-size: 11px;
    color: var(--gray-400);
}

/* ===== OCR Result Strip ===== */
.ocr-result {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.ocr-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--gray-700);
}

.ocr-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
}

.ocr-badge.low {
    background: var(--warning);
    color: var(--gray-800);
}

.ocr-result-values {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.ocr-value-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ocr-value-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 14px;
}

.ocr-input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    background: white;
}

.ocr-input:focus {
    border-color: var(--primary);
    outline: none;
}

.ocr-value-group span {
    font-size: 12px;
    color: var(--gray-500);
}

.ocr-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ocr-result-actions select {
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    background: white;
}

.btn-sm {
    padding: 5px 12px !important;
    font-size: 12px !important;
}

/* ===== Daily Macro Section ===== */
.daily-macro-section {
    margin-bottom: 16px;
}

.daily-macro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    user-select: none;
}

.daily-macro-toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--gray-400);
}

.daily-macro-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.daily-macro-table {
    margin-top: 4px;
}

.daily-macro-table.collapsed {
    display: none;
}

.daily-macro-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.daily-macro-row-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.daily-day-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.daily-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    text-align: center;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.daily-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(171,16,83,0.1);
}

.daily-input.filled {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ===== Macro Averages Section ===== */
.macro-averages-section {
    margin-top: 12px;
}

.macro-avg-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.macro-avg-label strong {
    font-size: 13px;
    color: var(--gray-700);
}

.macro-avg-indicator {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
    margin-top: 4px;
}

.btn-link:hover {
    color: var(--primary);
}

/* Daily macro detail in check-in detail view */
.daily-breakdown-table {
    width: 100%;
    font-size: 12px;
    margin-top: 8px;
}

.daily-breakdown-table th,
.daily-breakdown-table td {
    padding: 4px 8px;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}

.daily-breakdown-table th {
    color: var(--gray-400);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* ===== Phase Badges ===== */
.phase-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-fat-loss {
    background: #fde8ea;
    color: #dc3545;
}

.phase-reverse {
    background: #e8f0fe;
    color: #1a73e8;
}

.phase-maintenance {
    background: #e8f5eb;
    color: #28a745;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.status-active, .status-monthly {
    background: var(--success-light);
    color: var(--success);
}

.status-expiring {
    background: var(--warning-light);
    color: #b8860b;
}

.status-ended {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== Client Dates Info ===== */
.client-dates-info {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
    padding-left: 0;
}

.view-header {
    flex-wrap: wrap;
}

/* ===== Protocols Tab ===== */
.protocols-form .form-group {
    margin-bottom: 16px;
}

.protocols-form textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    font-family: inherit;
    resize: vertical;
}

.protocols-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(171,16,83,0.1);
}

.protocols-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.protocols-save-status {
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
    transition: opacity 0.3s;
}

/* ===== Photo Upload Zone ===== */
.photo-upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 12px;
    background: var(--gray-50);
}

.photo-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-upload-zone svg {
    color: var(--gray-400);
    margin-bottom: 6px;
}

.photo-upload-zone p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 2px;
}

/* ===== Photo Preview Grid ===== */
.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(220,53,69,0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Photo Comparison View ===== */
.photo-comparison-controls {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.photo-compare-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-compare-select label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.photo-compare-select select {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    background: white;
}

.photo-comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 200px;
}

.photo-compare-side {
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.photo-compare-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--gray-400);
    font-size: 14px;
}

.photo-compare-side img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.photo-compare-side img:hover {
    opacity: 0.9;
}

.photo-compare-date-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
}

/* ===== Photo Lightbox ===== */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photo-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
}

/* ===== Check-in Detail Photos ===== */
.detail-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.detail-photo-thumb {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: border-color 0.2s;
}

.detail-photo-thumb:hover {
    border-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: visible;
    }

    .sidebar-header h1, .sidebar-subtitle,
    .sidebar-clients, .nav-btn span:not(.nav-icon) {
        display: none;
    }

    .nav-btn {
        justify-content: center;
        padding: 12px;
    }

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

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

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

/* ===== Client Portal Styles ===== */

/* Portal Header */
.portal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.portal-branding h2 {
    color: var(--primary);
    margin: 0;
}

.portal-welcome {
    color: var(--gray-500);
    font-size: 14px;
}

.portal-phase-info {
    flex: 1;
}

/* Portal Tab Content */
.portal-tab-content {
    display: none;
}

.portal-tab-content.active {
    display: block;
}

/* Portal Badge Styles */
.portal-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-linked {
    background: var(--success-light);
    color: var(--success);
}

.portal-invited {
    background: var(--warning-light);
    color: #b8860b;
}

.portal-none {
    background: var(--gray-100);
    color: var(--gray-400);
}

.missed-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fff3cd;
    color: #856404;
}

/* Invite Accept View */
.invite-accept-container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.invite-accept-card {
    max-width: 500px;
    width: 100%;
    padding: 32px;
}

.invite-accept-header {
    text-align: center;
    margin-bottom: 24px;
}

.invite-accept-header h2 {
    color: var(--primary);
    margin-bottom: 8px;
}

.invite-accept-header p {
    color: var(--gray-500);
}

.invite-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 12px;
    gap: 16px;
}

.invite-card-info p {
    margin-bottom: 4px;
    font-size: 14px;
}

/* Invite Modal */
.invite-help-text {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.invite-instructions-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
}

.invite-instructions-box p {
    margin-bottom: 4px;
}

.invite-success-message p {
    font-size: 14px;
}

/* Protocols Read-Only */
.protocols-readonly {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.protocol-section h4 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.protocol-content {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--gray-700);
    min-height: 40px;
}

/* Client portal no-sidebar layout */
@media (max-width: 768px) {
    .invite-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== Coach Notes ===== */
.note-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.note-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-400);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 10px;
}

.note-card.note-pinned {
    background: #fffef0;
    border-color: var(--warning);
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.note-category-badge {
    font-size: 11px;
    font-weight: 600;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.note-date {
    font-size: 12px;
    color: var(--gray-400);
}

.note-pin-icon {
    font-size: 14px;
}

.note-text {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

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

.note-actions .btn-link {
    font-size: 12px;
}

/* ===== Phase Timeline ===== */
.phase-timeline-entry {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-left: 2px solid var(--gray-200);
    margin-left: 8px;
    padding-left: 20px;
    position: relative;
}

.phase-timeline-entry:last-child {
    border-left-color: transparent;
}

.phase-timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    left: -8px;
    top: 16px;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

.phase-timeline-content {
    flex: 1;
}

.phase-timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.phase-current-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-light);
    padding: 1px 8px;
    border-radius: 10px;
}

.phase-timeline-dates {
    font-size: 13px;
    color: var(--gray-500);
}

.phase-timeline-notes {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
    font-style: italic;
}

.phase-timeline-current {
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 0 -8px;
    padding: 12px 8px 12px 28px;
}

/* ===== Weekly Summary ===== */
.summary-export-content {
    max-height: 60vh;
    overflow-y: auto;
}

.summary-header {
    margin-bottom: 20px;
}

.summary-header h2 {
    color: var(--primary);
    margin-bottom: 2px;
}

.summary-header p {
    color: var(--gray-500);
    margin-bottom: 8px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section h4 {
    color: var(--primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.summary-metrics {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.summary-metric {
    text-align: center;
    min-width: 80px;
}

.summary-metric-label {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
}

.summary-metric-value {
    font-size: 18px;
    font-weight: 600;
}

.summary-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-bar-item > span:first-child {
    width: 130px;
    font-size: 13px;
    flex-shrink: 0;
}

.summary-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.summary-bar {
    height: 18px;
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.3s;
}

.summary-bar-row > span {
    font-size: 13px;
    font-weight: 600;
    min-width: 40px;
}

.summary-bar-overall {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--gray-200);
}

.summary-feedback {
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    white-space: pre-wrap;
}

/* ===== Progress Report ===== */
.report-content {
    max-height: 60vh;
    overflow-y: auto;
}

.report-header {
    margin-bottom: 20px;
}

.report-header h2 {
    color: var(--primary);
    margin-bottom: 2px;
}

.report-header p {
    color: var(--gray-500);
    margin-bottom: 8px;
}

.report-summary-cards {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.report-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.report-card-label {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-card-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-top: 2px;
}

.report-section {
    margin-bottom: 20px;
}

.report-section h4 {
    color: var(--primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.report-table {
    font-size: 14px;
}

.report-milestones {
    padding-left: 20px;
}

.report-milestones li {
    margin: 4px 0;
    font-size: 14px;
}

.report-photos-grid {
    display: flex;
    gap: 24px;
}

.report-photo-col {
    flex: 1;
}

.report-photo {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 4px 0;
}

/* ===== Tier System ===== */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tier-badge .tier-lock {
    font-size: 9px;
    opacity: 0.75;
}

.tier-1 {
    background: var(--brand-pink-light);
    color: var(--brand-pink);
    border-color: var(--brand-pink);
}

.tier-2 {
    background: var(--brand-teal-light);
    color: #2d7a77;
    border-color: var(--brand-teal);
}

.tier-3 {
    background: var(--brand-gray-light);
    color: #5a5a5e;
    border-color: var(--brand-gray);
}

.tier-na {
    background: var(--gray-100);
    color: var(--gray-500);
    border-color: var(--gray-200);
}

/* ===== Flag Pills ===== */
.flag-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    vertical-align: middle;
}

.flag-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: var(--brand-blush);
    color: var(--brand-blush-dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.flag-pill.flag-critical {
    background: var(--danger-light);
    color: var(--danger);
}

.flag-pill.flag-info {
    background: var(--brand-teal-light);
    color: #2d7a77;
}

.flag-pill .flag-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ===== Dashboard Quick Actions + Meta ===== */
.client-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.client-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.client-meta-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--gray-500);
}

.coach-action-btn {
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray-700);
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.coach-action-btn:hover {
    background: var(--brand-pink-light);
    border-color: var(--brand-pink);
    color: var(--brand-pink);
}

.coach-action-btn.touched {
    background: var(--brand-teal-light);
    border-color: var(--brand-teal);
    color: #2d7a77;
}

.coach-action-btn .meta-label {
    font-weight: 400;
    color: var(--gray-500);
    font-size: 10px;
}

.coach-actions-cell {
    white-space: nowrap;
}

.coach-actions-cell .coach-action-btn + .coach-action-btn {
    margin-left: 4px;
}

/* Dashboard group toggle */
.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.view-toggle {
    display: inline-flex;
    background: var(--gray-100);
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}

.view-toggle button {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-600);
}

.view-toggle button.active {
    background: white;
    color: var(--brand-pink);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Tier-grouped dashboard */
.tier-group {
    margin-bottom: 24px;
}

.tier-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    border-left: 4px solid var(--gray-300);
    background: var(--gray-50);
}

.tier-group.tier-group-1 .tier-group-header { border-left-color: var(--brand-pink); background: var(--brand-pink-light); }
.tier-group.tier-group-2 .tier-group-header { border-left-color: var(--brand-teal); background: var(--brand-teal-light); }
.tier-group.tier-group-3 .tier-group-header { border-left-color: var(--brand-gray); background: var(--brand-gray-light); }

.tier-group-header h3 {
    margin: 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tier-group-header .tier-group-count {
    font-weight: 500;
    color: var(--gray-600);
    font-size: 12px;
}

.tier-group-header .tier-group-rules {
    margin-left: auto;
    font-size: 11px;
    color: var(--gray-600);
    text-align: right;
    font-weight: 500;
    max-width: 50%;
}

.tier-group-body {
    background: white;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.tier-group-body .data-table {
    margin: 0;
}

.tier-group-empty {
    padding: 14px;
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
}

/* Client profile tier row */
.client-tier-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px 0;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 4px solid var(--brand-pink);
    font-size: 13px;
}

.client-tier-row .tier-meta {
    color: var(--gray-600);
    font-size: 12px;
}

.client-tier-row .tier-meta strong {
    color: var(--gray-800);
}

/* ===== Weekly Tasks View ===== */
.weekly-tasks-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.weekly-tasks-summary .card {
    padding: 14px 16px;
}

.weekly-tasks-summary .summary-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.weekly-tasks-summary .summary-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.weekly-tasks-summary .summary-count.today { color: var(--brand-pink); }
.weekly-tasks-summary .summary-count.overdue { color: var(--danger); }

.weekly-day-block {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    margin-bottom: 14px;
    overflow: hidden;
}

.weekly-day-block.is-today {
    border-color: var(--brand-pink);
    box-shadow: 0 0 0 2px var(--brand-pink-light);
}

.weekly-day-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.weekly-day-block.is-today .weekly-day-header {
    background: var(--brand-pink-light);
}

.weekly-day-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--gray-800);
}

.weekly-day-header .day-date {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.weekly-day-header .today-chip {
    background: var(--brand-pink);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.weekly-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.weekly-task-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    flex-wrap: wrap;
}

.weekly-task-list li:last-child {
    border-bottom: none;
}

.weekly-task-list .task-client {
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    text-decoration: none;
}

.weekly-task-list .task-client:hover {
    color: var(--brand-pink);
}

.weekly-task-list .task-kind {
    color: var(--gray-600);
    font-size: 12px;
}

.weekly-task-list .task-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
}

.weekly-task-list .task-status.done {
    color: var(--success);
}

.weekly-task-list .task-status.pending {
    color: var(--gray-500);
}

.weekly-task-list .task-status.overdue {
    color: var(--danger);
}

.weekly-day-empty {
    padding: 14px;
    color: var(--gray-500);
    font-size: 12px;
    text-align: center;
}

/* Print styles */
@media print {
    body * { visibility: hidden; }
    .summary-export-content, .summary-export-content *,
    .report-content, .report-content * { visibility: visible; }
    .summary-export-content, .report-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-height: none;
        overflow: visible;
    }
}

/* ===== Onboarding Questionnaire ===== */
.onboarding-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 24px;
}

.onboarding-header h2 {
    color: var(--primary);
    margin-bottom: 8px;
}

.onboarding-header p,
.onboarding-intro {
    color: var(--gray-500);
}

.onboarding-section {
    margin-bottom: 20px;
}

.onboarding-intro {
    margin: -4px 0 16px;
    font-size: 14px;
}

.onboarding-question {
    margin-bottom: 18px;
    padding: 4px 0;
    border-radius: var(--radius);
}

.onboarding-question.onboarding-missing {
    background: var(--primary-light);
    padding: 10px 12px;
}

.onboarding-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.onboarding-required {
    color: var(--primary);
}

.onboarding-question input[type="text"],
.onboarding-question input[type="number"],
.onboarding-question input[type="date"],
.onboarding-question select,
.onboarding-question textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 16px; /* 16px stops iPhone from zooming in on focus */
    font-family: inherit;
    background: #fff;
}

.onboarding-question input:focus,
.onboarding-question select:focus,
.onboarding-question textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.onboarding-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.onboarding-choice {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.onboarding-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.onboarding-choice span {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    font-size: 14px;
    color: var(--gray-700);
    background: #fff;
    transition: all 0.15s;
}

.onboarding-choice input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.onboarding-choice input:focus-visible + span {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.onboarding-scale {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.onboarding-scale-choice span {
    min-width: 40px;
    text-align: center;
}

.onboarding-scale-end {
    font-size: 13px;
    color: var(--gray-500);
}

.onboarding-error {
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    min-height: 1em;
}

.onboarding-actions {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.onboarding-actions .btn {
    padding: 14px 28px;
    font-size: 16px;
}

/* Coach-side Intake tab */
.intake-submitted {
    color: var(--gray-500);
    font-size: 14px;
}

.intake-list {
    margin: 0 0 24px;
}

.intake-list dt {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    margin-top: 12px;
}

.intake-list dd {
    margin: 4px 0 0;
    color: var(--gray-800);
    white-space: pre-wrap;
}

.intake-blank,
.intake-scale-hint {
    color: var(--gray-400);
    font-style: italic;
}

/* Forgot password */
.forgot-password-link {
    display: block;
    margin-left: auto;
    font-size: 13px;
}

.login-error.login-success {
    color: var(--success);
}
