:root {
    color-scheme: dark;
    --bg: #0f1218;
    --surface: #1a1f2a;
    --surface-raised: #222836;
    --surface-hover: #2a3140;
    --surface-muted: #161b24;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-subtle: rgba(59, 130, 246, 0.14);
    --primary-border: rgba(59, 130, 246, 0.35);
    --primary-text: #93c5fd;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-subtle: rgba(248, 113, 113, 0.12);
    --danger-subtle-hover: rgba(248, 113, 113, 0.22);
    --danger-border: rgba(248, 113, 113, 0.45);
    --danger-text: #fca5a5;
    --danger-focus-ring: rgba(248, 113, 113, 0.35);
    --success: #4ade80;
    --warning: #fbbf24;
    --text: #e8edf4;
    --text-secondary: #94a3b8;
    --text-on-primary: #fff;
    --border: #2e3648;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.45);
    --focus-ring: rgba(59, 130, 246, 0.28);
    --sidebar-width: 240px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --table-header-bg: #1e2430;
    --row-hover-bg: #252c3a;
    --sticky-shadow: rgba(0, 0, 0, 0.35);
    /* Incomplete translation highlight */
    --trans-missing-bg: #1c222d;
    --trans-missing-bg-hover: #242b38;
    --trans-missing-border: #3d4a5c;
    --trans-missing-accent: #64748b;
    --trans-missing-placeholder: #64748b;
    /* Status badges */
    --badge-draft-bg: #2a3140;
    --badge-draft-fg: #94a3b8;
    --badge-active-bg: rgba(74, 222, 128, 0.15);
    --badge-active-fg: #4ade80;
    --badge-archived-bg: rgba(251, 191, 36, 0.15);
    --badge-archived-fg: #fbbf24;
    --badge-in-progress-bg: var(--primary-subtle);
    --badge-in-progress-fg: var(--primary-text);
    --badge-pending-bg: var(--badge-draft-bg);
    --badge-pending-fg: var(--badge-draft-fg);
    --badge-admin-bg: rgba(167, 139, 250, 0.18);
    --badge-admin-fg: #c4b5fd;
    --badge-supervisor-bg: rgba(244, 114, 182, 0.15);
    --badge-supervisor-fg: #f9a8d4;
    --badge-coach-bg: rgba(74, 222, 128, 0.12);
    --badge-coach-fg: #86efac;
    --badge-you-bg: var(--primary-subtle);
    --badge-you-fg: var(--primary-text);
    --badge-warn-bg: rgba(251, 191, 36, 0.15);
    --badge-warn-fg: #fcd34d;
    --badge-q-bg: var(--primary-subtle);
    --badge-q-fg: var(--primary-text);
    --badge-opt-bg: #2a3140;
    --badge-opt-fg: #cbd5e1;
    --badge-app-bg: rgba(74, 222, 128, 0.12);
    --badge-app-fg: #86efac;
    --badge-str-bg: rgba(167, 139, 250, 0.15);
    --badge-str-fg: #c4b5fd;
    --badge-branch-bg: rgba(167, 139, 250, 0.18);
    --badge-branch-fg: #c4b5fd;
    --lang-chip-fixed-bg: var(--primary-subtle);
    --lang-chip-fixed-border: var(--primary-border);
    --toast-success-bg: #1a2e22;
    --toast-success-fg: #bbf7d0;
    --toast-success-border: #3d6b4f;
    --toast-error-bg: #2e1a1a;
    --toast-error-fg: #fecaca;
    --toast-error-border: #7f3f3f;
    --toast-info-bg: #1a2438;
    --toast-info-fg: #bfdbfe;
    --toast-info-border: #3b5a8a;
    --save-flash-bg: var(--primary-subtle);
    --progress-track: #2e3648;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

pre, code {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
}
pre {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--text);
}
code {
    background: var(--surface-raised);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}
.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.1rem;
}
.sidebar-brand small {
    display: block;
    font-weight: 400;
    font-size: .75rem;
    color: var(--text-secondary);
}
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    list-style: none;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--surface-hover);
    color: var(--primary);
}
.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: .85rem;
}
.sidebar-footer .user-info {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover:not(.btn-primary):not(.btn-danger) {
    background: var(--surface-hover);
    box-shadow: var(--shadow);
}
.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow);
}
.btn-danger {
    background: var(--danger-subtle);
    color: var(--danger-text);
    border-color: var(--danger-border);
}
.btn-danger:hover {
    background: var(--danger-subtle-hover);
    border-color: var(--danger);
    color: var(--danger-hover);
    box-shadow: 0 0 0 1px var(--danger-border);
}
.btn-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--danger-focus-ring);
}
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
}
.btn-icon:hover:not(.btn-icon-danger) {
    background: var(--surface-hover);
    border-radius: 4px;
    color: var(--text);
}
.btn-icon-danger {
    color: var(--danger-text);
}
.btn-icon-danger:hover {
    background: var(--danger-subtle);
    color: var(--danger-hover);
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group { flex: 1; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-draft      { background: var(--badge-draft-bg); color: var(--badge-draft-fg); }
.badge-active     { background: var(--badge-active-bg); color: var(--badge-active-fg); }
.badge-archived   { background: var(--badge-archived-bg); color: var(--badge-archived-fg); }
.badge-completed  { background: var(--badge-active-bg); color: var(--badge-active-fg); }
.badge-in_progress { background: var(--badge-in-progress-bg); color: var(--badge-in-progress-fg); }
.badge-pending    { background: var(--badge-pending-bg); color: var(--badge-pending-fg); }
.badge-activity-app_sync   { background: var(--badge-coach-bg); color: var(--badge-coach-fg); }
.badge-activity-app_change { background: var(--badge-in-progress-bg); color: var(--badge-in-progress-fg); }
.badge-activity-web_change { background: var(--badge-supervisor-bg); color: var(--badge-supervisor-fg); }
.badge-activity-web_export { background: var(--badge-admin-bg); color: var(--badge-admin-fg); }
.badge-activity-api_error   { background: var(--badge-archived-bg); color: var(--badge-archived-fg); }
.security-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 20px;
    margin-bottom: 16px;
}
.security-settings-grid .form-group {
    margin-bottom: 0;
}
.revoke-confirm-input {
    width: 100%;
    max-width: 360px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: var(--font-mono, ui-monospace, monospace);
}
.user-actions-cell {
    white-space: nowrap;
}
.user-actions-cell .btn + .btn {
    margin-left: 6px;
}
.activity-log-card .table-wrapper { max-height: 420px; overflow: auto; }
.activity-log-card .filter-bar label {
    margin: 0;
    line-height: 1.2;
}
.activity-log-detail {
    font-size: 0.8rem;
    max-width: 280px;
    word-break: break-word;
}
table.data-table.activity-log-table th,
table.data-table.activity-log-table td {
    vertical-align: top;
    line-height: 1.45;
}
table.data-table.activity-log-table .activity-log-col-time,
table.data-table.activity-log-table .activity-log-col-meta {
    white-space: nowrap;
}
table.data-table.activity-log-table .activity-log-col-kind {
    white-space: nowrap;
}
table.data-table.activity-log-table .activity-log-col-route code {
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}
table.data-table.activity-log-table code {
    font-size: 0.8rem;
    line-height: 1.45;
    vertical-align: top;
}
table.data-table.activity-log-table .badge {
    vertical-align: top;
}
.activity-log-changes-cell {
    min-width: 220px;
    max-width: 420px;
}
.activity-log-subject,
.activity-log-actor {
    font-size: 0.85rem;
}
.activity-log-subject strong,
.activity-log-actor strong {
    color: var(--text);
}
.activity-log-role {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.activity-log-error {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--danger);
    line-height: 1.35;
}
.activity-change-raw {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-family: var(--font-mono, ui-monospace, monospace);
    word-break: break-all;
}
.activity-changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.activity-changes-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 3px 10px 3px 0;
    vertical-align: top;
    white-space: nowrap;
    line-height: 1.45;
}
.activity-changes-table td {
    padding: 3px 0;
    word-break: break-word;
    color: var(--text);
    vertical-align: top;
    line-height: 1.45;
}
.activity-changes-table tr + tr th,
.activity-changes-table tr + tr td {
    border-top: 1px solid var(--border);
    padding-top: 4px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-start {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.page-header-titles {
    min-width: 0;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.page-header .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    flex-shrink: 0;
}
.btn-home svg {
    width: 20px;
    height: 20px;
}

.user-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mobile-logout-btn,
.mobile-change-password-btn {
    display: none;
    position: fixed;
    top: 12px;
    z-index: 150;
    box-shadow: var(--shadow);
}
.mobile-logout-btn {
    right: 12px;
}
.mobile-change-password-btn {
    right: 96px;
}
.coach-supervisor-select {
    max-width: 100%;
    min-width: 160px;
    font-size: 0.85rem;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}

/* Questionnaire dashboard root (not .q-grid — avoids grid layout on nested cards) */
.q-dashboard-root {
    display: block;
    width: 100%;
}

/* Questionnaire dashboard — category sections with horizontal card rows */
.q-dashboard-groups {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
}

.q-category-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.q-category-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .02em;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.q-category-title .category-title-input {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    width: 100%;
    max-width: 480px;
}

.category-german-input {
    width: 100%;
    min-width: 140px;
    max-width: 320px;
    padding: 6px 10px;
    font-size: .9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: inherit;
}

.category-german-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

.category-german-input:disabled {
    opacity: .6;
}

/* Category rows: horizontal flow, wrap when the line is full */
.q-category-grid {
    display: flex;
    flex-flow: row wrap;
    align-items: stretch;
    align-content: flex-start;
    gap: 16px;
    width: 100%;
    min-width: 0;
    margin: 0;
}

.q-category-grid > .q-card {
    flex: 0 0 300px;
    width: 300px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Questionnaire card grid (legacy / other pages) */
.q-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.q-card .drag-handle {
    margin-right: 6px;
    cursor: grab;
    color: var(--text-secondary);
}
.q-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
}
.q-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.q-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 12px;
}
.q-card-title {
    font-size: 1.05rem;
    font-weight: 600;
}
.q-card-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: .85rem;
}
.q-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Tables — scroll inside wrapper so sticky headers stay visible */
.table-wrapper {
    overflow: auto;
    max-height: min(72vh, calc(100vh - 220px));
    -webkit-overflow-scrolling: touch;
}
table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
}
table.data-table th,
table.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
table.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--table-header-bg);
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border);
}
table.data-table tr:hover td {
    background: var(--row-hover-bg);
}
table.data-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 2px 0 4px var(--sticky-shadow);
}
table.data-table thead th.sticky-col {
    z-index: 5;
    top: 0;
    background: var(--table-header-bg);
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: ' \2195'; opacity: .4; }
th.sort-asc::after { content: ' \2191'; opacity: 1; }
th.sort-desc::after { content: ' \2193'; opacity: 1; }

/* Accordion / question list */
.question-list {
    list-style: none;
}
.question-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--surface);
}
.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}
.question-header:hover { background: var(--row-hover-bg); }
.drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.question-header .q-text {
    flex: 1;
    font-weight: 500;
}
.question-header .q-type {
    font-size: .8rem;
    color: var(--text-secondary);
    background: var(--surface-raised);
    padding: 2px 8px;
    border-radius: 4px;
}
.question-body {
    display: none;
    padding: 0 16px 16px 42px;
}
.question-item.open .question-body {
    display: block;
}
.question-item.open .chevron {
    transform: rotate(90deg);
}
.chevron {
    transition: transform .2s;
    font-size: .8rem;
    color: var(--text-secondary);
}

/* Answer options inside a question */
.option-list {
    list-style: none;
    margin-top: 8px;
}
.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 4px;
    background: var(--surface-muted);
    font-size: .875rem;
}
.option-item .opt-text { flex: 1; }
.option-item .opt-points {
    font-weight: 600;
    color: var(--primary-text);
    font-size: .8rem;
    background: var(--primary-subtle);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Translations panel */
.translations-panel {
    margin-top: 12px;
    padding: 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.translations-panel h4 {
    font-size: .85rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.translation-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.translation-row input[type="text"] {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .85rem;
}
.translation-row .lang-code {
    font-weight: 600;
    font-size: .8rem;
    width: 30px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Inline edit */
.inline-edit {
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 4px;
    font: inherit;
    border-radius: 4px;
    width: 100%;
    transition: border-color .15s;
}
.inline-edit:hover { border-color: var(--border); }
.inline-edit:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Login */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card .subtitle {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-bottom: 24px;
}
.login-card .login-privacy-note {
    color: var(--text-secondary);
    font-size: .8rem;
    line-height: 1.4;
    margin: -12px 0 20px;
}
.error-text { color: var(--danger); font-size: .85rem; margin-top: 8px; }

/* Toast */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 16px 12px 14px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .3s, transform .3s;
    max-width: 360px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    background: var(--surface-raised);
    color: var(--text);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success {
    background: var(--toast-success-bg);
    color: var(--toast-success-fg);
    border-color: var(--toast-success-border);
    border-left-color: var(--success);
}
.toast-error {
    background: var(--toast-error-bg);
    color: var(--toast-error-fg);
    border-color: var(--toast-error-border);
    border-left-color: var(--danger);
}
.toast-info {
    background: var(--toast-info-bg);
    color: var(--toast-info-fg);
    border-color: var(--toast-info-border);
    border-left-color: var(--primary);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .85rem;
    background: var(--surface);
}
.filter-bar input[type="search"],
.filter-bar input[type="text"].filter-search {
    min-width: 180px;
}
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: .85rem;
    color: var(--text-secondary);
}
.pagination-bar .btn {
    min-width: 2.5rem;
}
.data-toolbar-hint {
    font-size: .8rem;
    color: var(--text-secondary);
}
#qdb-table th.col-key {
    font-size: .75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#qdb-table thead tr:nth-child(1) th[data-id] {
    font-size: .7rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state svg { margin-bottom: 16px; opacity: .4; }
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

/* Dragging */
.question-item.dragging {
    opacity: .5;
    border-style: dashed;
}
.option-item.dragging {
    opacity: .5;
    border-style: dashed;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .q-grid { grid-template-columns: 1fr; }
    body.logged-in .mobile-logout-btn,
    body.logged-in .mobile-change-password-btn {
        display: inline-flex;
    }
    body.logged-in .page-header {
        padding-right: 200px;
    }
}

@media (max-width: 520px) {
    .q-category-grid > .q-card {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* Role badges */
.badge-admin      { background: var(--badge-admin-bg); color: var(--badge-admin-fg); }
.badge-supervisor { background: var(--badge-supervisor-bg); color: var(--badge-supervisor-fg); }
.badge-coach      { background: var(--badge-coach-bg); color: var(--badge-coach-fg); }
.badge-you        { background: var(--badge-you-bg); color: var(--badge-you-fg); font-size: .7rem; }

/* Dashboard — category keys panel */
.category-keys-table code {
    font-size: .8rem;
}
table.data-table tbody tr.row-orphan-category td {
    background: color-mix(in srgb, var(--surface-hover) 60%, transparent);
}

/* Assignment page — client table sized to rows (max 50); coach panel matches */
.assign-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.assign-layout {
    display: grid;
    grid-template-columns: minmax(260px, min(32vw, 380px)) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.assign-layout > .assign-coaches,
.assign-layout > .assign-clients-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.assign-panel-header {
    flex-shrink: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.assign-panel-header h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.assign-panel-header .filter-bar {
    margin-bottom: 0;
}

.assign-panel-body {
    flex: 0 0 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px 10px;
}

.assign-coaches .assign-panel-footer--align {
    flex-shrink: 0;
    margin-top: auto;
    visibility: hidden;
    pointer-events: none;
}

.assign-clients-toolbar {
    flex-shrink: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assign-clients-toolbar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.assign-clients-toolbar-top h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.assign-clients-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.assign-clients-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.assign-clients-filters .filter-search {
    flex: 1 1 200px;
    min-width: 160px;
    max-width: 100%;
}

.assign-clients-filters select {
    flex: 0 1 auto;
    min-width: 140px;
    max-width: 100%;
}

.assign-table-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.assign-table-panel .table-wrapper {
    flex: none;
    overflow: auto;
    box-sizing: border-box;
    max-height: none;
}

.assign-panel-footer,
.assign-clients-footer {
    flex-shrink: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.assign-panel-footer .pagination-bar,
.assign-clients-footer .pagination-bar {
    margin-top: 0;
}

.assign-clients-footer .pagination-bar + .selection-info {
    margin-top: 8px;
}

.assign-action-card {
    flex-shrink: 0;
    padding: 14px 16px;
}

.assign-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.assign-action-row select {
    flex: 1 1 220px;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: inherit;
}

.assign-action-card h4 {
    margin: 0;
    font-size: .95rem;
}

@media (max-width: 1100px) {
    .assign-layout {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .assign-layout {
        grid-template-columns: 1fr;
    }
}

/* Coach list */
.coach-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.coach-list-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.coach-list-item:last-child {
    margin-bottom: 0;
}

.coach-list-item:hover {
    background: var(--surface-hover);
}

.coach-list-item.active {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.coach-list-empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: .875rem;
}

.coach-name {
    font-weight: 600;
    font-size: .9rem;
    word-break: break-word;
}

.coach-supervisor {
    font-size: .8rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.coach-client-count {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 2px;
}

/* Selection info bar */
.selection-info {
    margin: 0;
    padding: 8px 12px;
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    border-radius: 6px;
    font-size: .875rem;
    color: var(--primary-text);
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}
.tab-bar button {
    padding: 10px 20px;
    font-size: .9rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color .15s, border-color .15s;
}
.tab-bar button:hover { color: var(--text); }
.tab-bar button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Metadata form in editor */
.meta-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 600px) {
    .meta-form { grid-template-columns: 1fr; }
}

/* Inline form cards (add/edit question, add/edit option) */
.inline-form-card {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.inline-form-card h4 {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.inline-form-card .form-group { margin-bottom: 10px; }

/* Type select */
.type-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}
.type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Checkbox label */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Modal dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: color-mix(in srgb, var(--bg) 30%, rgba(0, 0, 0, 0.65));
}
.modal-overlay[hidden] {
    display: none;
}
body.modal-open {
    overflow: hidden;
}
.modal-dialog {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}
.modal-dialog h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}
.modal-dialog .modal-subtitle {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.modal-dialog .modal-subtitle strong {
    color: var(--text);
}
.modal-dialog .modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}
.password-mode-fieldset {
    border: none;
    margin: 0 0 16px;
    padding: 0;
}
.password-mode-fieldset > legend {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 0;
}
.password-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.password-mode-option {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.password-mode-option:hover {
    background: var(--surface-hover);
}
.password-mode-option:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.password-mode-option input {
    margin: 0 10px 0 0;
    vertical-align: top;
    accent-color: var(--primary);
}
.password-mode-option-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.password-mode-option-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-left: 26px;
}
.modal-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 14px;
    line-height: 1.45;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Options builder (inside add-question form) */
.options-builder {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
}

/* Pending options list (before question is saved) */
.pending-options-list {
    list-style: none;
    margin-bottom: 6px;
}
.pending-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: .875rem;
}
.pending-option-item .opt-text { flex: 1; }
.pending-options-empty {
    font-size: .8rem;
    color: var(--text-secondary);
    padding: 4px 0 6px;
    font-style: italic;
}

/* Branch indicator on answer options */
.opt-branch {
    font-size: .75rem;
    font-weight: 600;
    color: var(--badge-branch-fg);
    background: var(--badge-branch-bg);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Config section inside question forms */
.config-section {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
}
.config-section .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    resize: vertical;
}

/* Condition details toggle */
.condition-details summary {
    list-style: none;
}
.condition-details summary::-webkit-details-marker {
    display: none;
}
.condition-details summary::before {
    content: '\25B6 ';
    font-size: .7rem;
    transition: transform .2s;
    display: inline-block;
    margin-right: 4px;
}
.condition-details[open] summary::before {
    transform: rotate(90deg);
}

/* ── Translations page ── */
.trans-page { padding: 20px 24px; }
.trans-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 16px;
}
.trans-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    font-size: .85rem;
    color: var(--text-secondary);
}
.trans-control span { font-weight: 500; }
.trans-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--surface);
}
.trans-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.trans-type-select { width: auto; min-width: 140px; flex-shrink: 0; }
.trans-lang-panel {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.trans-lang-panel summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
    user-select: none;
}
.trans-lang-panel[open] summary { margin-bottom: 12px; }
.trans-lang-panel .lang-chips { margin-bottom: 10px; }
.trans-hint { padding: 24px 0; text-align: center; font-size: .9rem; }
.text-muted { color: var(--text-secondary); }
.required-mark { color: var(--danger); font-weight: 600; }
.trans-list-header {
    display: grid;
    grid-template-columns: minmax(100px, 0.75fr) 1fr 1fr;
    gap: 12px;
    padding: 8px 14px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    background: var(--table-header-bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.trans-qn-block {
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.trans-qn-block:last-child { border-bottom: none; margin-bottom: 0; }
.trans-qn-hidden { display: none !important; }
.trans-qn-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 14px;
}
.trans-group {
    margin-bottom: 18px;
}
.trans-group-hidden { display: none !important; }
.trans-group-title {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.trans-groups-wrap .trans-list-header { margin-top: 0; }
.trans-list-in-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
#transGroupedRoot {
    max-height: calc(100vh - 360px);
    overflow-y: auto;
}
.trans-list {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: calc(100vh - 360px);
    overflow-y: auto;
}
.trans-list-item {
    display: grid;
    grid-template-columns: minmax(100px, 0.75fr) 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.trans-list-item:last-child { border-bottom: none; }
.trans-list-item:hover { background: var(--row-hover-bg); }
.trans-list-item-missing {
    background: var(--trans-missing-bg);
    box-shadow: inset 3px 0 0 var(--trans-missing-accent);
}
.trans-list-item-missing:hover { background: var(--trans-missing-bg-hover); }
.trans-list-key {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}
.trans-key-text {
    font-family: monospace;
    font-size: .8rem;
    line-height: 1.35;
    color: var(--text-secondary);
    word-break: break-word;
}
.trans-list-source {
    min-width: 0;
}
.trans-source-text {
    display: block;
    font-size: .9rem;
    line-height: 1.4;
    color: var(--text);
    word-break: break-word;
}
.lang-chip-fixed {
    background: var(--lang-chip-fixed-bg);
    border-color: var(--lang-chip-fixed-border);
}
.trans-list-item .trans-cell-input {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    padding: 8px 10px;
}
.trans-input-missing {
    border-color: var(--trans-missing-border) !important;
    background: var(--surface) !important;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.12);
}
.trans-input-missing::placeholder {
    color: var(--trans-missing-placeholder);
    font-style: normal;
}

@media (max-width: 768px) {
    .trans-list-header,
    .trans-list-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .trans-list-header { display: none; }
    .trans-list-item .trans-list-key::before {
        content: 'Key';
        display: block;
        font-size: .7rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-bottom: 2px;
    }
    .trans-list-item .trans-list-source::before {
        content: 'German';
        display: block;
        font-size: .7rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-bottom: 2px;
    }
    .trans-list-item .trans-cell-input[data-field="translation"] {
        margin-top: 4px;
    }
}

/* ── Language manager ── */
.lang-manager {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.lang-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: .85rem;
}
.lang-chip strong { color: var(--primary); }
.lang-chip-name { color: var(--text-secondary); }
.lang-chip-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.lang-chip-remove:hover { color: var(--danger); }
.lang-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.lang-add-code {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .85rem;
}
.lang-add-name {
    width: 160px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .85rem;
}

/* ── Translations toolbar ── */
.trans-toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.trans-search-wrap { flex: 1; min-width: 200px; }
.trans-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--font);
}
.trans-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.trans-filter-types {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* ── Translations table ── */
.trans-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.trans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.trans-table th {
    position: sticky;
    top: 0;
    background: var(--table-header-bg);
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    z-index: 1;
}
.trans-table td { padding: 2px 4px; }
.trans-table tbody tr { border-bottom: 1px solid var(--border); }
.trans-table tbody tr:hover { background: var(--row-hover-bg); }
.trans-row-hidden { display: none !important; }
#tabContent-translations .trans-list,
#tabContent-translations .trans-list-header {
    margin-top: 0;
}

.col-key { min-width: 180px; }
.col-type { width: 50px; text-align: center; }
.col-lang { min-width: 160px; }

.cell-key {
    font-family: monospace;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    padding: 6px 10px !important;
}
.cell-type { text-align: center; padding: 6px 4px !important; }

.trans-type-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-q   { background: var(--badge-q-bg); color: var(--badge-q-fg); }
.badge-opt { background: var(--badge-opt-bg); color: var(--badge-opt-fg); }
.badge-app { background: var(--badge-app-bg); color: var(--badge-app-fg); }
.badge-str { background: var(--badge-str-bg); color: var(--badge-str-fg); }

.cell-trans { position: relative; }
.cell-missing { background: var(--trans-missing-bg); }

.trans-cell-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: .85rem;
    font-family: var(--font);
    background: transparent;
    transition: border-color .15s, background .15s;
}
.trans-cell-input:hover {
    border-color: var(--border);
    background: var(--surface);
}
.trans-cell-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 2px var(--focus-ring);
}
.trans-cell-input::placeholder {
    color: var(--trans-missing-placeholder);
    font-style: normal;
    font-size: .8rem;
}
.trans-cell-input:not(.trans-input-missing)::placeholder {
    color: var(--text-secondary);
}
.trans-cell-input.save-flash {
    animation: saveFlash .4s ease;
}
@keyframes saveFlash {
    0%   { background: var(--save-flash-bg); }
    100% { background: var(--surface); }
}
.trans-list-item .trans-cell-input.save-flash {
    animation: saveFlash .4s ease;
}

/* ── Stats bar ── */
.trans-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: .82rem;
    color: var(--text-secondary);
}
.trans-stats-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.trans-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--progress-track);
    border-radius: 3px;
    overflow: hidden;
}
.trans-progress-fill {
    display: block;
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width .3s ease;
}

.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.field-hint code {
    font-size: 0.75rem;
}

.badge-warn {
    background: var(--badge-warn-bg);
    color: var(--badge-warn-fg);
}

.opt-key {
    font-size: 0.75rem;
    margin-right: 8px;
    color: var(--text-secondary);
}

/* Callouts */
.callout-warn {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--badge-warn-bg);
    border-radius: 8px;
    color: var(--badge-warn-fg);
}
.callout-danger {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--toast-error-bg);
    border-radius: 8px;
    color: var(--toast-error-fg);
}
.insights-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.page-header-sub {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
}
.home-kpi-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.home-kpi-link:hover {
    border-color: var(--primary-border);
    background: var(--surface-hover);
}
.home-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.home-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.home-link-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.home-link-card:hover {
    border-color: var(--primary-border);
    background: var(--surface-hover);
}
.home-link-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.home-link-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.insights-kpi {
    padding: 20px;
    text-align: center;
}
.insights-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.insights-kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}
.insights-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.insights-chart-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.insights-chart-hint {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.insights-vchart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding: 8px 4px 0;
    border-bottom: 1px solid var(--border);
}
.insights-vchart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.insights-vchart-bar-wrap {
    flex: 1;
    width: 100%;
    max-width: 36px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.insights-vchart-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--primary-hover), var(--primary));
    transition: height 0.2s ease;
}
.insights-vchart-value {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1;
}
.insights-vchart-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.insights-hchart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.insights-hchart-row {
    display: grid;
    grid-template-columns: minmax(100px, 28%) 1fr minmax(40px, auto);
    gap: 10px;
    align-items: center;
    font-size: 0.85rem;
}
.insights-hchart-label {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.insights-hchart-track {
    height: 22px;
    background: var(--surface-muted);
    border-radius: 4px;
    overflow: hidden;
}
.insights-hchart-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}
.insights-hchart-fill--warn {
    background: linear-gradient(90deg, #d97706, var(--warning));
}
.insights-hchart-fill--muted {
    background: var(--border);
}
.insights-hchart-num {
    text-align: right;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.followup-note-input {
    width: 100%;
    min-width: 180px;
    max-width: 320px;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
}
.export-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.export-actions-cell .btn {
    margin: 0;
}
.coach-recent-panel {
    padding: 12px 8px 8px 32px;
    background: var(--surface-muted);
    border-radius: 8px;
    margin: 4px 0 8px;
}
.coach-recent-scroll {
    max-height: min(420px, 55vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.coach-recent-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.coach-recent-toolbar .filter-search {
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}
.coach-client-groups {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 8px;
}
.coach-client-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--surface);
    overflow: hidden;
}
.coach-client-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    width: 100%;
    text-align: left;
    padding: 10px 12px !important;
    justify-content: flex-start;
}
.coach-client-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: normal;
}
.coach-client-uploads {
    padding: 0 12px 12px 32px;
    border-top: 1px solid var(--border);
}
.coach-recent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}
.data-table-compact td,
.data-table-compact th {
    padding: 8px 10px;
    font-size: 0.85rem;
}
.btn-link {
    background: none;
    border: none;
    padding: 0 6px 0 0;
    color: var(--accent);
    cursor: pointer;
    min-width: auto;
}
.coach-detail-row td {
    border-top: none;
    padding-top: 0;
}
.client-detail-panel {
    padding: 12px 8px 8px 32px;
    background: var(--surface-muted);
    border-radius: 8px;
    margin: 4px 0 8px;
}
.client-detail-meta {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.client-qn-panel {
    padding: 10px 8px 10px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 8px;
}
.client-version-panel {
    padding: 8px 8px 8px 28px;
    margin-top: 8px;
    border-left: 3px solid var(--primary-border);
}
.client-detail-row td {
    border-top: none;
    padding-top: 0;
}
tr.answer-changed td {
    background: rgba(251, 191, 36, 0.1);
}
tr.answer-changed .answer-value-cell {
    font-weight: 600;
    color: var(--badge-warn-fg);
}
.client-qn-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

input:disabled,
select:disabled {
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Questionnaire availability condition editor */
.condition-editor {
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.condition-mode-panel {
    margin-top: 12px;
}
.condition-requires-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.condition-requires-item {
    margin: 0;
}
.condition-answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.condition-answer-grid select,
.condition-editor .form-group > select {
    width: 100%;
}
.condition-anyof-rule {
    margin-bottom: 12px;
    padding: 12px;
}
.condition-json-fallback {
    width: 100%;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}
.condition-locked-message .meta-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 720px) {
    .condition-locked-message .meta-form {
        grid-template-columns: 1fr;
    }
}

/* Questionnaire preview tab (all-in-one) */
.qp-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.qp-banner {
    padding: 10px 14px;
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--primary-text);
}
.qp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.qp-visible-count {
    font-size: .875rem;
    color: var(--text-secondary);
}
.qp-scroll {
    padding: 0;
    max-height: min(75vh, 900px);
    overflow-y: auto;
}
.qp-form {
    display: flex;
    flex-direction: column;
}
.qp-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.qp-section:last-child {
    border-bottom: none;
}
.qp-section[hidden] {
    display: none !important;
}
.qp-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.qp-section-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-subtle);
    color: var(--primary-text);
    font-size: .8rem;
    font-weight: 600;
    flex-shrink: 0;
}
.qp-section-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-secondary);
}
.qp-id {
    font-size: .8rem;
    padding: 2px 6px;
    background: var(--surface-muted);
    border-radius: 4px;
}
.qp-type {
    font-size: .8rem;
}
.qp-question-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 14px;
    line-height: 1.45;
}
.qp-note {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
}
.qp-note-after { margin-top: 12px; margin-bottom: 0; }
.qp-hint {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}
.qp-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qp-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.qp-option:hover {
    border-color: var(--primary-border);
    background: var(--surface-muted);
}
.qp-option input { flex-shrink: 0; }
.qp-select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
}
.qp-select-sm { max-width: 140px; }
.qp-date-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.qp-text-input {
    width: 100%;
    max-width: 480px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
}
.qp-slider {
    display: flex;
    align-items: center;
    gap: 16px;
}
.qp-slider input[type=range] { flex: 1; max-width: 400px; }
.qp-slider-value {
    min-width: 3rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.qp-form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
}
.qp-form-stack label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .875rem;
    font-weight: 500;
}
.qp-form-stack input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
}
.qp-review-note {
    margin-bottom: 4px;
}
.qp-review-codes .qp-readonly-field {
    background: var(--bg, #f4f4f5);
    color: var(--text-secondary);
    cursor: default;
    border-style: dashed;
    user-select: all;
}
.qp-glass-table {
    overflow-x: auto;
    margin-top: 8px;
}
.qp-glass-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.qp-glass-table th,
.qp-glass-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: center;
}
.qp-glass-table th:first-child,
.qp-glass-table td:first-child {
    text-align: left;
    font-weight: 500;
}
.qp-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Glass-scale symptom rows in editor */
.glass-symptoms-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.glass-symptom-row {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.glass-symptoms-empty {
    padding: 12px;
    color: var(--text-secondary);
    font-size: .85rem;
    font-style: italic;
}
.glass-score-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.glass-score-cell label {
    display: block;
    font-size: .7rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.glass-score-cell input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.value-score-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.value-score-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .85rem;
}
.value-score-label {
    min-width: 2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.value-score-pts {
    width: 4rem;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.modal-dialog-wide {
    max-width: 640px;
}

/* Scoring profiles on questionnaire dashboard */
#scoringProfilesPanel {
    width: 100%;
    margin-top: 28px;
}
.scoring-profiles-section {
    margin-top: 0;
}
.scoring-profiles-card {
    padding: 24px;
}
.scoring-section-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}
.scoring-section-desc,
.scoring-empty-hint {
    margin: 0;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.scoring-empty-hint {
    padding: 8px 0;
}
.scoring-profiles-list {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.scoring-profile-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: var(--surface-muted);
    color: var(--text);
}
.scoring-profile-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.scoring-profile-card-main {
    min-width: 0;
    flex: 1;
}
.scoring-profile-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.scoring-profile-name-row strong {
    font-size: 1rem;
    color: var(--text);
}
.scoring-profile-desc {
    margin: 0 0 8px;
    font-size: .875rem;
    line-height: 1.45;
    color: var(--text-secondary);
}
.scoring-profile-bands {
    margin: 0;
    font-size: .85rem;
    color: var(--primary-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.scoring-profile-member-count {
    margin: 12px 0 8px;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.scoring-profile-members {
    border-top: 1px solid var(--border);
    padding-top: 4px;
}
.scoring-profile-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.scoring-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.scoring-modal-section-title {
    margin: 18px 0 0;
    font-size: .95rem;
    color: var(--text);
}
.scoring-profile-active-row {
    margin-bottom: 12px;
}
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: var(--text);
    cursor: pointer;
}
.scoring-profile-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-muted);
}
.scoring-profile-picker input,
.scoring-profile-picker select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}
.scoring-profile-picker input:focus,
.scoring-profile-picker select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.scoring-profile-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.scoring-profile-add-row select {
    flex: 1;
    min-width: 0;
}
.scoring-band-labels {
    margin: 4px 0 8px;
    min-height: 1.5rem;
}
.scoring-band-ranges-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.scoring-band-range-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 10px;
    align-items: center;
}
.scoring-band-range-row.scoring-band-range-header {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.scoring-band-range-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}
.scoring-band-range-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.scoring-band-max-placeholder {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 8px 10px;
}
.scoring-band-strips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.scoring-profile-q-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.scoring-profile-q-row:last-child { border-bottom: none; }
.scoring-profile-q-name {
    flex: 1;
    min-width: 120px;
    font-weight: 500;
    color: var(--text);
}
.scoring-profile-q-weight {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.scoring-profile-q-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.sp-weight-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--text-secondary);
}
.sp-weight-wrap input {
    width: 72px;
}
.band-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.band-badge.band-green { background: #14532d; color: #bbf7d0; border: 1px solid #166534; }
.band-badge.band-yellow { background: #713f12; color: #fef08a; border: 1px solid #854d0e; }
.band-badge.band-red { background: #7f1d1d; color: #fecaca; border: 1px solid #991b1b; }
.band-badge.band-none { background: #334155; color: #cbd5e1; border: 1px solid #475569; }

/* Client list — scoring profiles */
.client-scoring-legend {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-elevated, rgba(0, 0, 0, 0.02));
}
.client-scoring-legend-title {
    margin: 0 0 6px;
}
.client-scoring-legend-body {
    margin: 0 0 10px;
    line-height: 1.45;
}
.client-scoring-legend-body .band-badge {
    margin: 0 2px;
    vertical-align: middle;
}
.client-scoring-legend-dl {
    display: grid;
    gap: 8px 16px;
    margin: 0;
    font-size: .8125rem;
}
@media (min-width: 640px) {
    .client-scoring-legend-dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.client-scoring-legend-dl dt {
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.client-scoring-legend-dl dd {
    margin: 2px 0 0;
    color: var(--text-secondary);
    line-height: 1.4;
}
.client-profile-scores {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.client-profile-score-block {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-elevated, rgba(0, 0, 0, 0.02));
    font-size: .8125rem;
    line-height: 1.35;
}
.client-profile-score-block.is-incomplete {
    opacity: 0.85;
}
.client-profile-score-block.has-coach-override {
    border-color: rgba(251, 191, 36, 0.45);
}
.client-profile-score-block-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.client-profile-score-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 4px;
}
.client-profile-score-row:first-of-type {
    margin-top: 0;
}
.client-profile-score-label {
    flex: 0 0 4.75rem;
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.client-profile-score-total {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: .75rem;
}
.client-profile-score-total::before {
    content: "total ";
    opacity: 0.75;
}
.client-profile-override-hint {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #ca8a04;
}

/* Coach category picker (clients list) */
.coach-band-picker {
    position: relative;
    display: inline-flex;
    max-width: 100%;
}
.coach-band-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    max-width: 100%;
}
.coach-band-trigger:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    background: var(--surface-hover, rgba(0, 0, 0, 0.03));
}
.coach-band-picker.is-open .coach-band-trigger,
.coach-band-trigger:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.coach-band-trigger-badge .band-badge {
    margin: 0;
}
.coach-band-trigger-caret {
    font-size: .65rem;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
}
.coach-band-picker.is-saving .coach-band-trigger {
    opacity: 0.6;
    pointer-events: none;
}
.coach-band-menu {
    min-width: 11.5rem;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.coach-band-menu-label {
    margin: 0 0 8px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.coach-band-menu-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.coach-band-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, border-color 0.12s;
}
.coach-band-option:hover {
    background: var(--surface-hover, rgba(0, 0, 0, 0.04));
}
.coach-band-option.is-selected {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.coach-band-option-agree {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
}
.coach-band-option-agree-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.coach-band-confirm-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin: 8px 0 4px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-elevated, rgba(0, 0, 0, 0.02));
}
.coach-band-confirm-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 5.5rem;
}
.coach-band-confirm-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.coach-band-confirm-arrow {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1;
}
.client-profile-score-hint,
.client-profile-score-meta {
    margin: 6px 0 0;
    font-size: .75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.client-scoring-profiles-detail {
    margin-bottom: 12px;
}
.scoring-profile-detail-card {
    margin-top: 8px;
}
.client-profile-dots-cell {
    min-width: 200px;
    max-width: 320px;
    vertical-align: top;
}
.client-profile-dots-empty {
    color: var(--text-secondary);
}
