﻿/* ============================================================
   CMPX Design Tokens
   All hardcoded values should eventually reference these tokens.
   Phase 1a: Foundation â€” created Feb 2026
   ============================================================ */
:root {
    /* --- Colour Palette --- */
    --color-primary:        #3498db;
    --color-primary-dark:   #2980b9;
    --color-primary-light:  #5dade2;
    --color-secondary:      #4CB6C3;
    --color-secondary-dark: #3a9aa5;
    --color-navy:           #104378;

    --color-success:        #27ae60;
    --color-success-light:  #48bb78;
    --color-danger:         #e74c3c;
    --color-danger-light:   #e53e3e;
    --color-warning:        #f39c12;
    --color-warning-light:  #f6ad55;
    --color-info:           #3498db;
    --color-purple:         #9b59b6;

    /* Grays */
    --color-gray-900:       #2c3e50;
    --color-gray-800:       #34495e;
    --color-gray-700:       #4a5568;
    --color-gray-600:       #6c757d;
    --color-gray-500:       #95a5a6;
    --color-gray-400:       #adb5bd;
    --color-gray-300:       #ccc;
    --color-gray-200:       #e0e0e0;
    --color-gray-100:       #ecf0f1;
    --color-gray-50:        #f5f7fa;

    /* Semantic Backgrounds */
    --bg-body:              #f5f7fa;
    --bg-card:              #ffffff;
    --bg-sidebar:           linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    --bg-hover:             #f8f9fa;
    --bg-selected:          rgba(52, 152, 219, 0.1);
    --bg-muted:             #edf2f7;

    /* Semantic Borders */
    --border-color:         #e0e0e0;
    --border-light:         #ecf0f1;
    --border-input:         #e2e8f0;

    /* Semantic Text */
    --text-primary:         #2c3e50;
    --text-secondary:       #4a5568;
    --text-muted:           #95a5a6;
    --text-light:           #6c757d;
    --text-inverse:         #ffffff;

    /* --- Spacing Scale (8px base) --- */
    --space-1:   4px;
    --space-2:   8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* --- Typography --- */
    --font-family:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-family-mono:     'Consolas', 'Monaco', 'Courier New', monospace;

    --font-size-xs:   10px;
    --font-size-sm:   12px;
    --font-size-base: 14px;
    --font-size-md:   16px;
    --font-size-lg:   18px;
    --font-size-xl:   20px;
    --font-size-2xl:  24px;
    --font-size-3xl:  28px;
    --font-size-4xl:  32px;

    --font-weight-normal:   400;
    --font-weight-medium:   500;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;

    --line-height-tight:    1.25;
    --line-height-normal:   1.5;
    --line-height-relaxed:  1.75;

    /* --- Border Radius --- */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 50%;

    /* --- Shadows --- */
    --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md:  0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg:  0 5px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl:  0 10px 40px rgba(0, 0, 0, 0.3);

    /* --- Z-Index Scale --- */
    --z-base:      1;
    --z-dropdown: 100;
    --z-sticky:   500;
    --z-overlay:  1000;
    --z-modal:    1001;
    --z-toast:    2000;

    /* --- Transitions --- */
    --transition-fast:   0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow:   0.5s ease;

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

/* ============================================================
   Migrated from index.html <style> block
   Section-specific styles ΓÇö will be progressively deduplicated
   and tokenized during Phase 2+
   ============================================================ */

/* NOTE: * reset and body styles removed — using tokenized versions below */

/* body: migrated height constraint moved to tokenized version below */

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 196px;
    background: #4CB6C3;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: width 0.3s ease;
    position: relative;
    z-index: 100;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header p,
.sidebar.collapsed .sidebar-header h1 span,
.sidebar.collapsed .nav-item span:not(.nav-icon) {
    display: none;
}

.sidebar.collapsed .sidebar-header h1 {
    font-size: 32px;
    text-align: center;
    margin-bottom: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 15px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px 10px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 20px 10px;
}

.sidebar.collapsed .sidebar-toggle {
    padding: 10px;
}

/* Show/hide titles based on sidebar state */
.sidebar.collapsed .sidebar-title-expanded {
    display: none;
}

.sidebar:not(.collapsed) .sidebar-title-collapsed {
    display: none;
}

/* Logo size adjustments */
.sidebar-header img {
    width: 80%;
    height: auto;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header img {
    width: 80% !important;
    height: auto !important;
}

.sidebar:not(.collapsed) .sidebar-header img {
    width: 80% !important;
    height: auto !important;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.sidebar.collapsed .sidebar-header {
    padding: 25px 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar.collapsed .sidebar-header > div {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-header h1 {
    font-size: 22px;
    margin-bottom: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.sidebar-header h1 span {
    margin-left: 8px;
}

.sidebar-header p {
    transition: all 0.3s;
    white-space: nowrap;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    width: 100%;
    margin-bottom: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-nav {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}

.nav-item span:not(.nav-icon) {
    transition: opacity 0.3s, width 0.3s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.15);
}

.nav-item.active {
    background: rgba(255,255,255,0.25);
}

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

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.topbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.topbar h2 {
    color: #333;
    font-size: 24px;
}

.login-btn {
    padding: 10px 24px;
    background: #104378;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.login-btn:hover {
    background: #0d3560;
    transform: translateY(-2px);
}

/* User Menu Styles */
.user-menu-container {
    position: relative;
}

.user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #104378;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-transform: uppercase;
}

.user-avatar-btn:hover {
    background: #0d3560;
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.user-dropdown-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.user-dropdown-email {
    font-size: 12px;
    color: #6c757d;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
}

.user-dropdown-item .dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.user-dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

.user-dropdown-item.danger {
    color: #dc3545;
}

.user-dropdown-item.danger:hover {
    background: #fff5f5;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.programs-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.goals-panel, .programs-panel, .levels-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height: fit-content;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #DBDBDB;
}

.panel-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.btn-add {
    background: #104378;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #0d3560;
}

.list-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 5px;
}

.list-item {
    padding: 20px 15px;
    margin-bottom: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80px;
    border: 2px solid transparent;
}

.list-item:hover {
    background: #e0e0e0;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.list-item.active {
    background: #104378;
    color: white;
    border-color: #4CB6C3;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(16, 67, 120, 0.3);
}

.list-item-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-view {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-y: auto;
    flex: 1;
}

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

.week-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.week-subtitle {
    font-size: 14px;
    color: #666;
}

.days-horizontal {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.day-card {
    min-width: 200px;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #104378;
    cursor: pointer;
    transition: all 0.3s;
}

.day-card:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.day-name {
    font-size: 16px;
    font-weight: bold;
    color: #104378;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-day-icon {
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

.day-card:hover .edit-day-icon {
    opacity: 1;
}

.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exercise-item {
    font-size: 13px;
    color: #666;
    padding: 8px;
    background: white;
    border-radius: 6px;
    line-height: 1.5;
}

.exercise-item.completed {
    text-decoration: line-through;
    opacity: 0.6;
    background: #e8f5e9;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.section-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-primary {
    background: #cfe2ff;
    color: #084298;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.client-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #104378;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.client-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.client-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-container {
    margin-top: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #104378;
    transition: width 0.3s;
}

.completion-badge {
    display: inline-block;
    background: #104378;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.add-card {
    background: #104378;
    padding: 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: white;
}

.add-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.add-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 2px solid #DBDBDB;
}

.tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: #104378;
}

.tab.active {
    color: #104378;
    border-bottom-color: #104378;
}

.tab-content {
    display: none;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #104378;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.chart-container {
    height: 300px;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #104378;
    color: white;
}

.btn-primary:hover {
    background: #0d3560;
}

.btn-secondary {
    background: #DBDBDB;
    color: #333;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.session-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #104378;
}

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

.session-date {
    font-weight: bold;
    color: #104378;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #DBDBDB;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #104378;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 900px;
}

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

.modal-header h2 {
    color: #104378;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.program-assignment {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #104378;
}

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

.program-name {
    font-weight: bold;
    color: #104378;
    font-size: 16px;
}

.program-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft {
    background: #ffeaa7;
    color: #856404;
}

.status-active {
    background: #55efc4;
    color: #155724;
}

.status-completed {
    background: #dfe6e9;
    color: #636e72;
}

.program-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.completion-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #DBDBDB;
}

.completion-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.level-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.level-control label {
    margin: 0;
    font-size: 14px;
}

.level-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.level-btn.decrease {
    background: #ff6b6b;
    color: white;
}

.level-btn.increase {
    background: #4caf50;
    color: white;
}

.current-level {
    padding: 8px 16px;
    background: #104378;
    color: white;
    border-radius: 6px;
    font-weight: 600;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-button:hover {
    background: #4b5563;
}

.program-builder {
    display: grid;
    gap: 15px;
}

.day-editor {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4CB6C3;
}

.day-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.day-editor-title {
    font-weight: bold;
    color: #333;
}

.exercise-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.exercise-editor input {
    flex: 1;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.add-method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #DBDBDB;
}

.add-method-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    flex: 1;
}

.add-method-tab:hover {
    color: #5DBBBD;
}

.add-method-tab.active {
    color: #5DBBBD;
    border-bottom-color: #5DBBBD;
}

.add-method-content {
    display: none;
}

.add-method-content.active {
    display: block;
}

.code-input-container {
    text-align: center;
    padding: 20px 0;
}

.code-input {
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: bold;
    text-transform: uppercase;
    max-width: 300px;
    margin: 0 auto;
}

.template-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.adherence-metric {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.adherence-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.adherence-percentage {
    font-weight: bold;
    font-size: 16px;
}

.adherence-percentage.high {
    color: #4caf50;
}

.adherence-percentage.medium {
    color: #ff9800;
}

.adherence-percentage.low {
    color: #ff6b6b;
}

.exercise-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.exercise-card {
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: #4CB6C3;
}

.exercise-video {
    width: 100%;
    height: 200px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #999;
}

.exercise-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exercise-card-content {
    padding: 20px;
}

.exercise-card-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.exercise-card-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.exercise-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-category {
    background: #104378;
    color: white;
}

.badge-difficulty {
    background: #DBDBDB;
    color: #333;
}

.badge-difficulty.beginner {
    background: #4caf50;
    color: white;
}

.badge-difficulty.intermediate {
    background: #ff9800;
    color: white;
}

.badge-difficulty.advanced {
    background: #ff6b6b;
    color: white;
}

.exercise-card-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exercise-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #DBDBDB;
}

.exercise-card-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-add-to-program {
    background: #104378;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-add-to-program:hover {
    background: #0d3560;
}

.library-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #DBDBDB;
}

.library-exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.library-exercise-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #DBDBDB;
    transition: all 0.3s;
    cursor: pointer;
}

.library-exercise-item:hover {
    border-color: #104378;
    box-shadow: 0 2px 8px rgba(16, 67, 120, 0.2);
}

.library-exercise-item.added {
    border-color: #4caf50;
    background: #e8f5e9;
}

.library-exercise-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.library-exercise-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.added-exercises-list {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.added-exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #104378;
}

.added-exercise-item.from-library {
    border-left-color: #4caf50;
}

.added-exercise-info {
    flex: 1;
}

.added-exercise-name {
    font-weight: 600;
    color: #333;
}

.added-exercise-source {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

.btn-remove-exercise {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-remove-exercise:hover {
    background: #ff5252;
}

.library-search {
    margin-bottom: 15px;
}

.toggle-view-btn {
    background: #DBDBDB;
    color: #333;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.toggle-view-btn:hover {
    background: #c5c5c5;
}

.toggle-view-btn.active {
    background: #104378;
    color: white;
}

.report-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.report-card h3 {
    color: #104378;
    margin-bottom: 20px;
    font-size: 18px;
}

.report-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.report-filters select {
    max-width: 200px;
}

.metric-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #104378 0%, #4CB6C3 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
}

.metric-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
}

.metric-change {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.9;
}

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

.athlete-ranking-table th {
    background: #f9f9f9;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #DBDBDB;
}

.athlete-ranking-table td {
    padding: 12px;
    border-bottom: 1px solid #DBDBDB;
}

.athlete-ranking-table tr:hover {
    background: #f9f9f9;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: bold;
    color: white;
}

.rank-1 {
    background: #FFD700;
    color: #333;
}

.rank-2 {
    background: #C0C0C0;
    color: #333;
}

.rank-3 {
    background: #CD7F32;
    color: white;
}

.rank-other {
    background: #DBDBDB;
    color: #333;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-indicator .progress-bar-container {
    flex: 1;
    height: 6px;
}

.exercise-performance-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.btn-edit-exercise {
    background: #104378;
    color: white;
}

.btn-edit-exercise:hover {
    background: #0d3560;
}

.btn-delete-exercise {
    background: #ff6b6b;
    color: white;
}

.btn-delete-exercise:hover {
    background: #ff5252;
}

.equipment-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #DBDBDB;
    font-size: 13px;
    color: #666;
}

.channels-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

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

.channels-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.channels-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.channel-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f9f9f9;
    border: 2px solid #DBDBDB;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.channel-chip:hover {
    background: #e8f5f5;
    border-color: #104378;
}

.channel-chip.active {
    background: #104378;
    color: white;
    border-color: #104378;
}

.channel-chip .channel-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.channel-chip.active .channel-count {
    background: rgba(255,255,255,0.3);
}

.btn-manage-channels {
    padding: 6px 16px;
    background: #104378;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-manage-channels:hover {
    background: #0d3560;
}

.channel-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.channel-input-row input {
    flex: 1;
}

.channels-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.channel-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.channel-manage-item .channel-name {
    font-weight: 600;
    color: #333;
}

.channel-manage-item .channel-url {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

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

.btn-fetch-videos {
    background: #104378;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-fetch-videos:hover {
    background: #0d3560;
}

.btn-fetch-videos:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.fetch-status {
    font-size: 12px;
    color: #104378;
    margin-top: 5px;
}

.import-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

.import-note strong {
    display: block;
    margin-bottom: 5px;
}

/* Quick Stats for Users View */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quick-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    transition: all 0.2s ease;
}

.quick-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.quick-stat-card.highlight {
    background: linear-gradient(135deg, #104378 0%, #1e5c99 100%);
    color: white;
}

.quick-stat-card.highlight .quick-stat-value {
    color: white;
}

.quick-stat-card.highlight .quick-stat-label {
    color: rgba(255,255,255,0.85);
}

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

.quick-stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.quick-stat-split {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: baseline;
}

.quick-stat-split .online {
    color: #4CB6C3;
}

.quick-stat-split .in-person {
    color: #27ae60;
}

.quick-stat-split .divider {
    color: #999;
    font-size: 18px;
}

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

/* Patients List Styles */
.patients-filter-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.patients-filter-row .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.patients-filter-row .filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.patients-filter-row select {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    min-width: 160px;
    background: white;
    cursor: pointer;
}

.patients-filter-row select:focus {
    outline: none;
    border-color: #4CB6C3;
    box-shadow: 0 0 0 3px rgba(76, 182, 195, 0.15);
}

.patients-filter-row .spacer {
    flex: 1;
}

/* Patient Card with Adherence Badge */
.patient-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid transparent;
}

.patient-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #4CB6C3;
}

.patient-card.selected {
    border-color: #104378;
    background: #f0f7ff;
}

.patient-card .patient-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #104378;
}

.patient-card .patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CB6C3 0%, #104378 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.patient-card .patient-info {
    flex: 1;
    min-width: 0;
}

.patient-card .patient-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    margin-bottom: 4px;
}

.patient-card .patient-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.patient-card .patient-tag {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
}

.patient-card .adherence-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.patient-card .adherence-badge.high {
    background: #d4edda;
    color: #155724;
}

.patient-card .adherence-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.patient-card .adherence-badge.low {
    background: #f8d7da;
    color: #721c24;
}

.patient-card .adherence-badge.none {
    background: #e9ecef;
    color: #6c757d;
}

/* Patients List Container */
.patients-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.patients-list-empty {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
}

.patients-list-empty h3 {
    margin: 0 0 8px;
    color: #333;
}

.patients-list-empty p {
    color: #666;
    margin: 0;
}

/* Session Location Badge */
.session-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.session-location-badge.online {
    background: #e3f2fd;
    color: #1565c0;
}

.session-location-badge.in-person {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Location Toggle Buttons for Session Modal */
.session-location-toggle {
    display: flex;
    gap: 8px;
}

.location-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #666;
}

.location-option:hover {
    border-color: #104378;
    background: #f8f9fa;
}

.location-option.active {
    border-color: #104378;
    background: #e8f4f8;
    color: #104378;
    font-weight: 600;
}

/* Recipient Chips for Batch Modal */
.recipient-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recipient-chip {
    background: #e8f4f8;
    color: #104378;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.recipient-chip:hover {
    background: #d1e9f0;
}

.recipient-chip .remove-btn {
    background: none;
    border: none;
    color: #104378;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

.recipient-chip .remove-btn:hover {
    opacity: 1;
}

/* Batch Action Bar */
.batch-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #104378;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(16, 67, 120, 0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.batch-action-bar .selected-count {
    font-weight: 600;
}

.batch-action-bar button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.batch-action-bar button:hover {
    background: rgba(255,255,255,0.25);
}

.batch-action-bar button.primary {
    background: white;
    color: #104378;
    border-color: white;
}

.batch-action-bar button.primary:hover {
    background: #f0f7ff;
}

/* Online Sessions Styles */
.sessions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-toggle-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #DBDBDB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.view-toggle-btn.active {
    background: #104378;
    color: white;
    border-color: #104378;
}

.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

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

.calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-nav button {
    padding: 8px 16px;
    background: #104378;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.calendar-month {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    color: #666;
    padding: 10px;
    font-size: 14px;
}

.calendar-day {
    min-height: 100px;
    border: 2px solid #DBDBDB;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    border-color: #4CB6C3;
    box-shadow: 0 2px 8px rgba(76, 182, 195, 0.3);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border-color: #104378;
    background: #f0f7ff;
}

.calendar-day-number {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.calendar-session {
    background: linear-gradient(135deg, #104378 0%, #4CB6C3 100%);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 3px;
    cursor: pointer;
    transition: transform 0.2s;
}

.calendar-session:hover {
    transform: scale(1.05);
}

.calendar-session.upcoming {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
}

.calendar-session.completed {
    background: linear-gradient(135deg, #666 0%, #999 100%);
}

.calendar-session.cancelled {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
}

/* Unified Sessions Layout - List on left (40%), Calendar on right (60%) */
.sessions-unified-layout {
    display: grid;
    grid-template-columns: 40% 58%;
    gap: 2%;
    align-items: start;
}

.sessions-list-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sessions-list-panel .sessions-list {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.sessions-list-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #DBDBDB;
}

.sessions-list-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.session-card.highlighted {
    box-shadow: 0 0 0 3px #4CB6C3, 0 4px 15px rgba(76, 182, 195, 0.3);
}

@media (max-width: 1200px) {
    .sessions-unified-layout {
        grid-template-columns: 1fr;
    }

    .sessions-list-panel {
        height: auto !important;
        max-height: none;
        order: 2;
    }

    .sessions-unified-layout .calendar-container {
        order: 1;
    }
}

/* Users Tab Content */
.users-tab-content {
    display: none;
}

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

.users-filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.users-filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.users-filter-bar .filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.users-filter-bar .filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
}

/* Templates Tab Content */
.templates-tab-content {
    display: none;
}

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

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.session-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #104378;
    transition: all 0.3s;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.session-card.upcoming {
    border-left-color: #4caf50;
}

.session-card.completed {
    border-left-color: #666;
}

.session-card.cancelled {
    border-left-color: #ff6b6b;
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.session-info {
    flex: 1;
}

.session-client-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.session-datetime {
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.session-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-scheduled {
    background: #e3f2fd;
    color: #1976d2;
}

.status-upcoming {
    background: #e8f5e9;
    color: #388e3c;
}

.status-completed {
    background: #f5f5f5;
    color: #666;
}

.status-cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.session-details {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.session-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Teams status indicators */
.teams-status {
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.teams-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #f57c00;
}

.teams-created {
    background: rgba(76, 175, 80, 0.15);
    color: #388e3c;
}

.teams-failed {
    background: rgba(244, 67, 54, 0.15);
    color: #d32f2f;
}

.session-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #DBDBDB;
}

.session-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-join-meeting {
    background: #4caf50;
    color: white;
}

.btn-join-meeting:hover {
    background: #45a049;
}

.btn-reschedule {
    background: #ff9800;
    color: white;
}

.btn-reschedule:hover {
    background: #f57c00;
}

.btn-cancel-session {
    background: #ff6b6b;
    color: white;
}

.btn-retry-teams {
    background: #2196f3;
    color: white;
}

.btn-retry-teams:hover {
    background: #1976d2;
}

.btn-view-details {
    background: #607d8b;
    color: white;
}

.btn-view-details:hover {
    background: #546e7a;
}

.btn-cancel-session:hover {
    background: #ff5252;
}

.btn-add-notes {
    background: #104378;
    color: white;
}

.btn-add-notes:hover {
    background: #0d3560;
}

.teams-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #5558af;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.webhook-config-section {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.webhook-config-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.webhook-config-header h3 {
    margin: 0;
    color: #856404;
}

.webhook-url-display {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 10px;
}

.copy-webhook-btn {
    background: #104378;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.copy-webhook-btn:hover {
    background: #0d3560;
}

.integration-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-top: 15px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
}

.status-indicator.inactive {
    background: #ff6b6b;
}

.filters-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.filter-group select {
    min-width: 150px;
}

.session-notes {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.session-notes-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.session-notes-content {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #ff5252;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #4CB6C3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 20px;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.loading-subtext {
    margin-top: 8px;
    color: #718096;
    font-size: 14px;
}

.loading-progress {
    margin-top: 30px;
    width: 300px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CB6C3, #667eea);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Floating Program Panel */
.floating-panel {
    position: fixed;
    top: 100px;
    right: 100px;
    width: 450px;
    height: 85vh;
    max-height: 85vh;
    background: linear-gradient(135deg, #104378, #4CB6C3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    transform-origin: top right;
}

.floating-panel.minimized {
    width: 55px;
    height: 55px;
    border-radius: 50%;
}

.floating-panel.minimized .floating-panel-body {
    display: none;
}

.floating-panel.minimized .floating-panel-tabs {
    display: none;
}

.floating-panel-header,
.floating-panel-body {
    opacity: 1;
    transition: all 0.3s ease;
}

.floating-panel.hidden {
    display: none;
}

.floating-panel-header {
    background: linear-gradient(135deg, #104378, #4CB6C3);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.floating-panel-header.dragging {
    cursor: grabbing;
}

.floating-panel-tabs {
    display: flex;
    gap: 5px;
}

.floating-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
}

.floating-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.floating-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.floating-tab-content {
    display: none;
}

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

.floating-panel-header .minimize-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-weight: 300;
}

.floating-panel-header .minimize-btn:hover {
    transform: scale(1.2);
}

.floating-panel-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
    background: white;
    border-radius: 0 0 12px 12px;
}

.floating-panel .form-group {
    margin-bottom: 20px;
}

.floating-panel .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.floating-panel .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.floating-panel .form-control:focus {
    outline: none;
    border-color: #4CB6C3;
    box-shadow: 0 0 0 3px rgba(76, 182, 195, 0.1);
}

.floating-panel .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#template-preview h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #104378;
}

.exercise-day {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4CB6C3;
}

.exercise-day-title {
    font-weight: 600;
    color: #104378;
    margin-bottom: 8px;
}

.exercise-item {
    padding: 6px 0;
    color: #555;
    font-size: 13px;
}

/* ==================== ANALYTICS STYLES ==================== */
.analytics-time-filter {
    display: flex;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
}
.analytics-time-filter button {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}
.analytics-time-filter button:hover {
    color: #333;
}
.analytics-time-filter button.active {
    background: white;
    color: #4A90A4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-analytics-export {
    padding: 8px 16px;
    background: #4A90A4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-analytics-export:hover {
    background: #3d7a8c;
}

.analytics-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
}
.analytics-tab-btn {
    padding: 10px 20px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.analytics-tab-btn:hover {
    background: #eee;
    color: #333;
}
.analytics-tab-btn.active {
    background: #4A90A4;
    color: white;
}
.analytics-tab-btn i {
    font-size: 14px;
}

.analytics-filter-bar {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.analytics-filter-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.analytics-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.analytics-filter-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
}
.analytics-filter-select {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 13px;
    min-width: 140px;
    background: white;
}
.analytics-filter-divider {
    width: 1px;
    height: 40px;
    background: #e5e5e5;
}
.analytics-date-picker {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-compare-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}
.analytics-compare-toggle .toggle-switch {
    width: 40px;
    height: 22px;
    background: #ddd;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
}
.analytics-compare-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}
.analytics-compare-toggle.active .toggle-switch {
    background: #4A90A4;
}
.analytics-compare-toggle.active .toggle-switch::after {
    left: 20px;
}
.analytics-clear-btn {
    padding: 6px 12px;
    border: none;
    background: #ff4d4f;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.analytics-filter-chips {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.analytics-filter-chip {
    padding: 4px 10px;
    background: #e8f4f8;
    border-radius: 20px;
    font-size: 12px;
    color: #4A90A4;
    display: flex;
    align-items: center;
    gap: 6px;
}
.analytics-filter-chip i {
    cursor: pointer;
    opacity: 0.7;
}
.analytics-filter-chip i:hover {
    opacity: 1;
}

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

.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}
.analytics-stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.analytics-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.analytics-stat-label {
    font-size: 13px;
    color: #666;
}
.analytics-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.analytics-stat-icon.blue { background: #e8f4f8; color: #4A90A4; }
.analytics-stat-icon.green { background: #e8f8ec; color: #52c41a; }
.analytics-stat-icon.purple { background: #f0e8f8; color: #722ed1; }
.analytics-stat-icon.orange { background: #fff4e8; color: #fa8c16; }
.analytics-stat-icon.red { background: #fee8e8; color: #ff4d4f; }
.analytics-stat-icon.teal { background: #e8f8f5; color: #13c2c2; }
.analytics-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.analytics-stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.analytics-stat-change.positive { color: #52c41a; }
.analytics-stat-change.negative { color: #ff4d4f; }
.analytics-stat-change.neutral { color: #999; }

.analytics-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.analytics-col-4 { flex: 0 0 calc(33.333% - 14px); }
.analytics-col-6 { flex: 0 0 calc(50% - 10px); }
.analytics-col-8 { flex: 0 0 calc(66.666% - 7px); }
.analytics-col-12 { flex: 0 0 100%; }

.analytics-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.analytics-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.analytics-card-actions {
    display: flex;
    gap: 4px;
}
.analytics-card-actions button {
    padding: 5px 10px;
    border: none;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
}
.analytics-card-actions button.active {
    background: #4A90A4;
    color: white;
}

.analytics-health-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}
.analytics-health-item:last-child {
    border-bottom: none;
}
.analytics-health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.analytics-health-dot.good { background: #52c41a; }
.analytics-health-dot.warning { background: #fa8c16; }
.analytics-health-dot.bad { background: #ff4d4f; }
.analytics-health-content {
    flex: 1;
}
.analytics-health-label {
    font-size: 13px;
    color: #666;
}
.analytics-health-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.analytics-program-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}
.analytics-program-item:last-child {
    border-bottom: none;
}
.analytics-program-rank {
    width: 24px;
    height: 24px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}
.analytics-program-info {
    flex: 1;
}
.analytics-program-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.analytics-program-meta {
    font-size: 12px;
    color: #999;
}
.analytics-program-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-progress-bar {
    width: 80px;
    height: 6px;
    background: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
}
.analytics-progress-fill {
    height: 100%;
    background: #4A90A4;
    border-radius: 3px;
}
.analytics-program-rate {
    font-size: 12px;
    font-weight: 600;
    color: #4A90A4;
    width: 35px;
    text-align: right;
}

.analytics-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.analytics-activity-item:last-child {
    border-bottom: none;
}
.analytics-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.analytics-activity-icon.session { background: #e8f4f8; color: #4A90A4; }
.analytics-activity-icon.client { background: #e8f8ec; color: #52c41a; }
.analytics-activity-icon.program { background: #f0e8f8; color: #722ed1; }
.analytics-activity-icon.goal { background: #fff4e8; color: #fa8c16; }
.analytics-activity-icon.mdt { background: #e8f8f5; color: #13c2c2; }
.analytics-activity-icon.exercise { background: #fee8e8; color: #ff4d4f; }
.analytics-activity-content {
    flex: 1;
}
.analytics-activity-text {
    font-size: 13px;
    color: #333;
}
.analytics-activity-time {
    font-size: 11px;
    color: #999;
}

.analytics-badge-new {
    padding: 2px 8px;
    background: #e8f8ec;
    color: #52c41a;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Heatmap styles */
.analytics-heatmap-container {
    padding: 10px 0;
}
.analytics-heatmap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.analytics-heatmap-labels {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.analytics-heatmap-labels span {
    width: 30px;
    text-align: center;
    font-size: 10px;
    color: #999;
}
.analytics-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 30px);
    gap: 4px;
}
.analytics-heatmap-cell {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: #f5f5f5;
}
.analytics-heatmap-cell.level-1 { background: #c6e8ec; }
.analytics-heatmap-cell.level-2 { background: #8dd0d8; }
.analytics-heatmap-cell.level-3 { background: #4cb6c3; }
.analytics-heatmap-cell.level-4 { background: #3a9aa5; }

/* Peak hours */
.analytics-peak-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.analytics-peak-hour {
    width: 70px;
    font-size: 12px;
    color: #666;
}
.analytics-peak-bar {
    flex: 1;
    height: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}
.analytics-peak-fill {
    height: 100%;
    background: #4A90A4;
    border-radius: 4px;
}
.analytics-peak-count {
    width: 30px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Wearable cards */
.analytics-wearable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}
.analytics-wearable-card {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
}
.analytics-wearable-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.analytics-wearable-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.analytics-wearable-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.analytics-wearable-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}
.analytics-wearable-stat {
    display: flex;
    flex-direction: column;
}
.analytics-wearable-stat .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.analytics-wearable-stat .label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
}
.analytics-wearable-bar {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}
.analytics-wearable-fill {
    height: 100%;
    border-radius: 3px;
}

/* Insights */
.analytics-insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}
.analytics-insight:last-child {
    margin-bottom: 0;
}
.analytics-insight.success {
    background: #e8f8ec;
    color: #389e0d;
}
.analytics-insight.warning {
    background: #fff7e6;
    color: #d46b08;
}
.analytics-insight.info {
    background: #e6f7ff;
    color: #096dd9;
}
.analytics-insight i {
    margin-top: 2px;
}

/* Predictors */
.analytics-predictors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.analytics-predictor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 13px;
}
.analytics-predictor-item.positive i { color: #52c41a; }
.analytics-predictor-item.negative i { color: #ff4d4f; }
.predictor-name { flex: 1; color: #333; }
.predictor-impact {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.predictor-impact.high { background: #fff1f0; color: #ff4d4f; }
.predictor-impact.medium { background: #fff7e6; color: #fa8c16; }
.predictor-impact.low { background: #f6ffed; color: #52c41a; }

/* Program cards */
.analytics-program-card {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}
.analytics-program-card:last-child {
    margin-bottom: 0;
}
.analytics-program-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.analytics-program-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.analytics-category-badge {
    padding: 3px 8px;
    background: #e8f4f8;
    color: #4A90A4;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.analytics-program-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}
.analytics-program-card-stats .stat {
    display: flex;
    flex-direction: column;
}
.analytics-program-card-stats .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.analytics-program-card-stats .label {
    font-size: 10px;
    color: #999;
}
.analytics-program-card-progress {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}
.analytics-program-card-progress .progress-fill {
    height: 100%;
    background: #4A90A4;
    border-radius: 3px;
}

/* Drop-off points */
.analytics-dropoff-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.analytics-dropoff-item:last-child {
    border-bottom: none;
}
.dropoff-stage { color: #666; }
.dropoff-pct { font-weight: 600; color: #ff4d4f; }

/* Exercise items */
.analytics-exercise-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.analytics-exercise-item:last-child {
    border-bottom: none;
}
.analytics-exercise-rank {
    width: 24px;
    height: 24px;
    background: #4A90A4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}
.analytics-exercise-info { flex: 1; }
.analytics-exercise-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.analytics-exercise-region {
    font-size: 11px;
    color: #999;
}
.analytics-exercise-stats {
    text-align: right;
}
.analytics-exercise-stats .count {
    display: block;
    font-size: 12px;
    color: #666;
}
.analytics-exercise-stats .outcome {
    display: block;
    font-size: 11px;
    color: #52c41a;
    font-weight: 500;
}

/* MDT team cards */
.analytics-mdt-team-card {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}
.analytics-mdt-team-card:last-child {
    margin-bottom: 0;
}
.analytics-mdt-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.analytics-mdt-team-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.analytics-member-count {
    font-size: 12px;
    color: #999;
}
.analytics-mdt-team-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}
.analytics-mdt-team-stats .stat {
    display: flex;
    flex-direction: column;
}
.analytics-mdt-team-stats .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.analytics-mdt-team-stats .label {
    font-size: 10px;
    color: #999;
}
.analytics-mdt-team-progress {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}
.analytics-mdt-team-progress .progress-fill {
    height: 100%;
    background: #722ed1;
    border-radius: 3px;
}

/* Collaboration metrics */
.analytics-collab-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.analytics-collab-item:last-child {
    border-bottom: none;
}
.collab-label { color: #666; }
.collab-value { font-weight: 600; color: #333; }

/* Contributor items */
.analytics-contributor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.analytics-contributor-item:last-child {
    border-bottom: none;
}
.analytics-contributor-info .name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: block;
}
.analytics-contributor-info .role {
    font-size: 11px;
    color: #999;
}
.analytics-contributor-stats {
    text-align: right;
    font-size: 12px;
    color: #666;
}
.analytics-contributor-stats span {
    display: block;
}

/* Mini table */
.analytics-mini-table {
    width: 100%;
    font-size: 13px;
}
.analytics-mini-table td {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.analytics-mini-table tr:last-child td {
    border-bottom: none;
}
.analytics-mini-table .positive {
    color: #52c41a;
    font-weight: 500;
}
.analytics-correlation-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.analytics-correlation-badge.strong { background: #f6ffed; color: #52c41a; }
.analytics-correlation-badge.moderate { background: #fff7e6; color: #fa8c16; }
.analytics-correlation-badge.weak { background: #fff1f0; color: #ff4d4f; }

/* Empty State Banner */
.analytics-empty-banner {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f4f8 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px dashed #d0d7de;
}
.empty-banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
}
.empty-banner-content > i {
    font-size: 48px;
    color: #4A90A4;
    opacity: 0.5;
}
.empty-banner-text {
    flex: 1;
}
.empty-banner-text h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
}
.empty-banner-text p {
    margin: 0;
    color: #666;
    font-size: 14px;
}
.btn-load-sample {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4A90A4 0%, #3a7a8e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-load-sample:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 164, 0.35);
}
.btn-load-sample:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Section Empty States */
.analytics-section-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fafafa;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px dashed #e0e0e0;
}
.analytics-section-empty i {
    font-size: 36px;
    color: #ccc;
    margin-bottom: 12px;
}
.analytics-section-empty p {
    color: #999;
    margin: 0 0 15px 0;
    font-size: 14px;
}
.btn-load-sample-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #4A90A4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-load-sample-sm:hover {
    background: #3a7a8e;
}

/* Phase 3: Performance Section */
.analytics-performance-section {
    margin-bottom: 20px;
}
.analytics-performance-comparison {
    display: flex;
    gap: 15px;
}
.analytics-performance-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.analytics-performance-card.good {
    border-left: 4px solid #52c41a;
}
.analytics-performance-card.warning {
    border-left: 4px solid #fa8c16;
}
.performance-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.analytics-performance-card.good .performance-icon {
    background: #f6ffed;
    color: #52c41a;
}
.analytics-performance-card.warning .performance-icon {
    background: #fff7e6;
    color: #fa8c16;
}
.performance-info {
    display: flex;
    flex-direction: column;
}
.performance-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
}
.performance-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.performance-rate {
    font-size: 12px;
    color: #666;
}

/* Phase 3: Drop-off Analysis */
.analytics-dropoff-header {
    margin-bottom: 15px;
}
.analytics-dropoff-header h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}
.analytics-subtitle {
    font-size: 11px;
    color: #999;
}
.analytics-dropoff-item.highlight {
    background: #fff7e6;
    border-left: 3px solid #fa8c16;
    padding-left: 12px;
}
.dropoff-program {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

/* Phase 3: Response Time Analysis */
.analytics-response-analysis {
    margin-bottom: 20px;
}
.analytics-response-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}
.analytics-response-stat {
    text-align: center;
}
.analytics-response-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}
.analytics-response-stat .label {
    font-size: 11px;
    color: #999;
}
.analytics-response-distribution h5 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #666;
}
.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dist-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 12px;
}
.dist-value { font-weight: 600; }
.dist-value.good { color: #52c41a; }
.dist-value.warning { color: #fa8c16; }
.dist-value.bad { color: #ff4d4f; }

/* Phase 3: Cases Needing Attention */
.analytics-attention-cases {
    margin-bottom: 20px;
}
.analytics-attention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.analytics-attention-header h4 {
    margin: 0;
    font-size: 14px;
    color: #fa8c16;
}
.attention-count {
    font-size: 12px;
    color: #999;
}
.analytics-attention-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.analytics-attention-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff7e6;
    border-radius: 6px;
    font-size: 13px;
}
.case-title { flex: 1; color: #333; }
.case-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin: 0 10px;
}
.case-status.open { background: #e6f7ff; color: #1890ff; }
.case-response { font-size: 11px; color: #999; }

/* Phase 3: Meeting Attendance */
.analytics-attendance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}
.analytics-attendance-stat {
    text-align: center;
}
.analytics-attendance-stat .value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}
.analytics-attendance-stat .label {
    font-size: 11px;
    color: #999;
}
.analytics-attendance-outcomes {
    display: flex;
    gap: 20px;
    padding: 12px;
    background: #f6ffed;
    border-radius: 6px;
    font-size: 13px;
    color: #389e0d;
}

/* Phase 3: Wearable Summary */
.analytics-wearable-summary {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #e8f4f8 0%, #f5f7fa 100%);
    border-radius: 10px;
    margin-bottom: 20px;
}
.summary-stat {
    text-align: center;
}
.summary-stat .value {
    font-size: 22px;
    font-weight: 700;
    color: #4A90A4;
}
.summary-stat .label {
    font-size: 11px;
    color: #666;
}

/* Phase 3: Correlation Card */
.analytics-correlation-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.correlation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.correlation-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}
.correlation-value {
    font-size: 18px;
    font-weight: 700;
}
.correlation-value.strong { color: #52c41a; }
.correlation-value.moderate { color: #fa8c16; }
.correlation-value.weak { color: #999; }
.correlation-interpretation {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.correlation-datapoints {
    font-size: 11px;
    color: #999;
}

/* Phase 3: Predictor Insight */
.analytics-predictor-insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    background: #f6ffed;
    border-radius: 8px;
    margin-bottom: 15px;
}
.analytics-predictor-insight i {
    color: #52c41a;
    font-size: 18px;
    margin-top: 2px;
}
.analytics-predictor-insight p {
    margin: 0;
    font-size: 14px;
    color: #389e0d;
}
.analytics-predictor-comparison {
    display: flex;
    gap: 10px;
}
.comparison-item {
    flex: 1;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    text-align: center;
}
.comparison-item.good {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
}
.comparison-item.warning {
    background: #fff7e6;
    border: 1px solid #ffd591;
}
.comparison-item .label {
    font-size: 11px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}
.comparison-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Contributions header */
.analytics-contributions-header h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.analytics-contributor-stats .percentage {
    color: #4A90A4;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .analytics-row {
        flex-wrap: wrap;
    }
    .analytics-col-4, .analytics-col-6, .analytics-col-8 {
        flex: 0 0 100%;
    }
}

/* ============================================================

/* ============================================================
   Migrated from views/services.html <style> block
   ============================================================ */

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-published {
    background: #d1fae5;
    color: #065f46;
}

/* Checklist items */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}

.checklist-item.complete .check-icon {
    color: #48bb78;
}

.checklist-item.incomplete .check-icon {
    color: #cbd5e0;
}

/* Plan cards */
.plan-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
}

.plan-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plan-card.popular {
    border-color: #4299e1;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.plan-card .popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #4299e1;
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.plan-card .plan-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.plan-card .plan-price {
    font-size: 2rem;
    font-weight: bold;
    color: #4299e1;
}

.plan-card .plan-period {
    color: #718096;
    font-size: 0.9rem;
}

.plan-card .plan-other-prices {
    font-size: 0.7rem;
    color: #a0aec0;
    margin-top: 5px;
}

.plan-card ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    text-align: left;
}

.plan-card li {
    padding: 6px 0;
    font-size: 0.85rem;
    color: #4a5568;
}

.plan-card li::before {
    content: "âœ“ ";
    color: #48bb78;
}

/* Insurance network cards */
.insurance-network-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.insurance-network-card .network-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}

.insurance-network-card .network-info {
    flex: 1;
}

.insurance-network-card .network-info h5 {
    margin: 0 0 3px 0;
    color: #2d3748;
}

.insurance-network-card .network-info p {
    margin: 0;
    color: #718096;
    font-size: 0.85rem;
}

/* Transaction list items */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f7fafc;
}

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

.transaction-source {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.transaction-source.private {
    background: #ebf8ff;
    color: #2b6cb0;
}

.transaction-source.insurance {
    background: #f0fff4;
    color: #276749;
}

.transaction-source.platform {
    background: #faf5ff;
    color: #6b46c1;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Period buttons */
.period-btn.active {
    background: white !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #2d3748 !important;
}

/* Profile type selector */
.profile-type-option {
    transition: all 0.2s;
}

.profile-type-option:hover {
    border-color: #90cdf4 !important;
    background: #f0f9ff;
}

.profile-type-option.selected {
    border-color: #4299e1 !important;
    background: #ebf8ff;
}

.profile-type-option input:checked + span + span,
.profile-type-option.selected span:last-child {
    color: #2b6cb0;
}

/* ==================== PIPELINE TAB ==================== */
.pipeline-src-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.pipeline-src-card span:first-child { font-size: 18px; }
.pipeline-src-card strong { display: block; color: #2d3748; font-size: 13px; }
.pipeline-src-count { display: block; font-size: 11px; color: #718096; }

.pipeline-metric {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.pipeline-metric-label { font-size: 12px; color: #718096; margin-bottom: 4px; }
.pipeline-metric-value { font-size: 26px; font-weight: 700; color: #2d3748; }
.pipeline-metric-trend { font-size: 12px; color: #48bb78; margin-top: 4px; }
.pipeline-metric-trend.negative { color: #e53e3e; }

.pipeline-churn-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.pipeline-churn-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    vertical-align: middle;
}
.pipeline-reason-bar {
    margin-bottom: 10px;
}
.pipeline-reason-bar label {
    font-size: 12px;
    color: #4a5568;
    display: block;
    margin-bottom: 3px;
}
.pipeline-reason-bar .bar-fill {
    height: 22px;
    background: linear-gradient(135deg, #e53e3e, #fc8181);
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding-left: 8px;
    min-width: 36px;
}

/* ==================== BRAND TAB ==================== */
.brand-upload-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    color: #a0aec0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.brand-upload-zone:hover {
    border-color: #4299e1;
    color: #4299e1;
}
.brand-upload-zone.has-image {
    border-style: solid;
    padding: 10px;
}
.brand-upload-zone.has-image img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.brand-color-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-color-item input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
}

/* ==================== PAGES TAB ==================== */
/* Filter Tabs */
.pages-filter-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #718096;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pages-filter-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.pages-filter-tab:hover:not(.active) {
    color: #667eea;
}
.pages-filter-tab .count {
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.pages-filter-tab.active .count {
    background: #667eea;
    color: white;
}

/* Page Cards */
.page-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}
.page-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: #cbd5e0;
    transform: translateY(-2px);
}
.page-card-banner {
    height: 8px;
}
.page-card-banner.bio { background: linear-gradient(135deg, #48bb78, #38a169); }
.page-card-banner.corporate { background: linear-gradient(135deg, #ed8936, #dd6b20); }
.page-card-banner.study { background: linear-gradient(135deg, #9f7aea, #805ad5); }
.page-card-banner.blog { background: linear-gradient(135deg, #4299e1, #3182ce); }

.page-card-body { padding: 20px; }
.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.page-title-group { flex: 1; }
.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}
.page-type-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.type-bio { background: #c6f6d5; color: #22543d; }
.type-corporate { background: #feebc8; color: #c05621; }
.type-study { background: #e9d8fd; color: #553c9a; }
.type-blog { background: #bee3f8; color: #2b6cb0; }

.page-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.status-published { background: #c6f6d5; color: #22543d; }
.status-draft { background: #fef3c7; color: #92400e; }
.status-recruiting { background: #e9d8fd; color: #553c9a; }

.page-description {
    color: #718096;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-meta {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #a0aec0;
    flex-wrap: wrap;
}
.page-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}
.page-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ==================== COLLATERALS TAB ==================== */
.collateral-filter {
    padding: 7px 14px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
}
.collateral-filter.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}
.collateral-filter:hover:not(.active) {
    border-color: #4299e1;
    color: #4299e1;
}

.collateral-template-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.collateral-template-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.collateral-template-card .preview {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    text-align: center;
}
.collateral-template-card .preview.business-card { background: linear-gradient(135deg, #104378, #1e5c99); }
.collateral-template-card .preview.flyer { background: linear-gradient(135deg, #48bb78, #38a169); }
.collateral-template-card .preview.poster { background: linear-gradient(135deg, #ed8936, #dd6b20); }
.collateral-template-card .preview.social { background: linear-gradient(135deg, #9f7aea, #805ad5); }
.collateral-template-card .preview.sticker { background: linear-gradient(135deg, #ed64a6, #d53f8c); }
.collateral-template-card .preview.other { background: linear-gradient(135deg, #718096, #4a5568); }

.collateral-template-card .info {
    padding: 12px;
}
.collateral-template-card .info .name {
    font-weight: 600;
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 3px;
}
.collateral-template-card .info .type {
    font-size: 11px;
    color: #718096;
}
.collateral-template-card .use-btn {
    display: block;
    width: 100%;
    padding: 9px;
    background: #f8fafc;
    border: none;
    border-top: 1px solid #e2e8f0;
    color: #4299e1;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.collateral-template-card .use-btn:hover {
    background: #edf2f7;
}

.collateral-export-option {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    transition: all 0.2s;
}
.collateral-export-option:hover {
    border-color: #4299e1;
    box-shadow: 0 2px 8px rgba(66,153,225,0.15);
}

/* Responsive */
@media (max-width: 768px) {
    #pagesGrid {
        grid-template-columns: 1fr;
    }

    #pageEditorView > div:last-child {
        grid-template-columns: 1fr;
    }

    .plan-cards {
        grid-template-columns: 1fr !important;
    }

    #brand-tab > div:last-child {
        grid-template-columns: 1fr;
    }

    #pagesFilterTabs {
        flex-wrap: wrap;
    }
}

/* ============================================================
   Migrated from views/settings.html <style> block
   ============================================================ */

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4299e1;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.5);
}

/* Theme and accent color selection */
.theme-option:hover {
    border-color: #4299e1 !important;
    background: #f7fafc !important;
}

.theme-option.active {
    border-color: #4299e1 !important;
    background: #ebf8ff !important;
}

.accent-color {
    transition: all 0.2s;
}

.accent-color:hover {
    transform: scale(1.1);
}

.accent-color.active {
    box-shadow: 0 0 0 2px currentColor, 0 0 0 4px white !important;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
}

/* Team member cards hover effect */
.team-member-card {
    transition: all 0.2s;
}

.team-member-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
   End of migrated styles ΓÇö Original styles.css content below
   ============================================================ */


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

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

/* Layout */
.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    padding: var(--space-5) 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
    padding: 0 var(--space-5) 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: var(--space-5);
}

.logo h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.logo p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.nav-item {
    padding: 15px var(--space-5);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--color-primary);
}

.nav-item.active {
    background: var(--bg-selected);
    border-left-color: var(--color-primary);
}

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

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.view {
    display: none;
    animation: fadeIn 0.3s;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-header h2 {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: var(--color-gray-500);
    color: var(--text-inverse);
}

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

.btn-success {
    background: var(--color-success);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--text-inverse);
}

.btn-sm,
.btn-small {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

/* Tabs — accessible tab component */
.tabs[role="tablist"] {
    display: flex;
    gap: var(--space-3);
    border-bottom: 2px solid var(--border-light);
}

.tab {
    padding: var(--space-3) var(--space-5);
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

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

.tab:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.tab.active,
.tab[aria-selected="true"] {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

/* Modal — unified pattern for .modal and .modal-overlay */
.modal,
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-normal);
}

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

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-normal);
}

/* Modal size variants */
.modal-sm  { max-width: 400px; }
.modal-md  { max-width: 600px; }
.modal-lg  { max-width: 900px; }
.modal-xl  { max-width: 1100px; }
.modal-content.large,
.modal-content.modal-large  { max-width: 900px; }
.modal-content.modal-medium { max-width: 600px; }
.modal-content.modal-small  { max-width: 400px; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.modal-header h3,
.modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}

.modal-close,
.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover,
.close-btn:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.modal-body {
    padding: var(--space-5);
}

.modal-description {
    color: var(--text-light);
    margin-bottom: var(--space-4);
}

.modal-hint {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-normal);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

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

.form-error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}

.form-hint {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: var(--color-danger);
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.form-required::after {
    content: ' *';
    color: var(--color-danger);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

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

thead {
    background: var(--bg-hover);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-light);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
}

tr:hover {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.badge-success {
    background: #d4edda;
    color: var(--color-success);
}

.badge-warning {
    background: #fff3cd;
    color: var(--color-warning);
}

.badge-danger {
    background: #f8d7da;
    color: var(--color-danger);
}

.badge-info {
    background: #d1ecf1;
    color: var(--color-primary);
}

/* Calendar */
.calendar-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.calendar-nav {
    display: flex;
    gap: var(--space-3);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-3);
}

.calendar-day {
    aspect-ratio: 1;
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.today {
    background: var(--color-primary);
    color: var(--text-inverse);
    font-weight: var(--font-weight-bold);
}

.calendar-day.has-session {
    background: #d4edda;
    border-color: var(--color-success);
}

/* Charts */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-5);
}

.chart-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-5);
    color: var(--text-primary);
}

/* Filters */
.filters {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-5);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    transition: width var(--transition-normal);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px var(--space-5);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-5);
}

.empty-state-text {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-5);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--color-info);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success { border-left-color: var(--color-success); }
.toast-error   { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info    { border-left-color: var(--color-info); }

.toast-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error   .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info    .toast-icon { color: var(--color-info); }

.toast-message {
    flex: 1;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.toast-dismiss {
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.toast-dismiss:hover {
    color: var(--text-primary);
}

/* Inline Loading Spinner */
.spinner {
    display: inline-block;
    border: 3px solid var(--border-light);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-md { width: 32px; height: 32px; }
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

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

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px var(--space-5);
    color: var(--text-muted);
}

.loading-state .spinner {
    margin-bottom: var(--space-4);
}

/* Playground Mode Styles */
.view-mode-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-body);
    border-radius: var(--radius-md);
    margin-left: auto;
}

.view-mode-toggle span {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-light);
}

.toggle-switch {
    position: relative;
    width: 120px;
    height: 36px;
    background: var(--border-color);
    border-radius: 18px;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.toggle-switch::before {
    content: attr(data-left);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-light);
    z-index: var(--z-base);
}

.toggle-switch::after {
    content: attr(data-right);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-light);
    z-index: var(--z-base);
}

.toggle-switch .toggle-slider {
    position: absolute;
    width: 56px;
    height: 28px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-navy));
    border-radius: 14px;
    top: 4px;
    left: 4px;
    transition: transform var(--transition-normal);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toggle-switch.playground .toggle-slider {
    transform: translateX(56px);
}

/* Playground Container */
.playground-container {
    display: none;
    position: relative;
    min-height: 800px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    overflow: visible;
}

.playground-container.active {
    display: block;
}

/* Classic Container */
.classic-container {
    display: block;
}

.classic-container.hidden {
    display: none;
}

/* Playground Grid */
.playground-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 60px;
    gap: 15px;
    min-height: 700px;
}

/* Playground Tiles */
.playground-tile {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: box-shadow var(--transition-fast), z-index 0s;
    min-width: 200px;
    min-height: auto;
}

.playground-tile:hover {
    box-shadow: var(--shadow-lg);
}

.playground-tile.dragging {
    opacity: 0.9;
    box-shadow: var(--shadow-xl);
    z-index: var(--z-overlay) !important;
    cursor: grabbing;
}

.playground-tile.minimized {
    min-height: 50px !important;
    height: 50px !important;
    grid-row-end: span 1 !important;
}

.playground-tile.minimized .tile-content,
.playground-tile.minimized .tile-footer {
    display: none;
}

.playground-tile.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 80vw !important;
    height: 80vh !important;
    z-index: var(--z-modal) !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

/* Tile Header */
.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 15px;
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-light);
    cursor: grab;
    flex-shrink: 0;
}

.tile-header:active {
    cursor: grabbing;
}

.tile-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tile-title-icon {
    font-size: var(--font-size-md);
}

.tile-controls {
    display: flex;
    gap: var(--space-1);
}

.tile-control-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: var(--color-gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-light);
}

.tile-control-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.tile-control-btn.active {
    background: var(--color-secondary);
    color: var(--text-inverse);
}

/* Tile Content */
.tile-content {
    flex: 1;
    padding: 15px;
    overflow: auto;
    position: relative;
}

.tile-chart-container {
    width: 100%;
    height: 100%;
    min-height: 150px;
    position: relative;
}

/* Tile Footer (Chart Type Selector) */
.tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) 15px;
    background: var(--bg-hover);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.chart-type-selector {
    display: flex;
    gap: var(--space-1);
}

.chart-type-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-gray-300);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-light);
}

.chart-type-btn:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.chart-type-btn.active {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--text-inverse);
}

.tile-time-range {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, var(--color-gray-300) 50%);
    border-radius: 0 0 var(--radius-lg) 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.playground-tile:hover .resize-handle {
    opacity: 1;
}

/* Tile Sizes */
.tile-small {
    grid-column: span 4;
    grid-row: span 3;
}

.tile-medium {
    grid-column: span 6;
    grid-row: span 4;
}

.tile-large {
    grid-column: span 8;
    grid-row: span 5;
}

.tile-wide {
    grid-column: span 12;
    grid-row: span 3;
}

/* Tile Overlay for expanded */
.tile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-overlay);
}

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

/* Tile specific styles */
.tile-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-100);
}

.tile-stat:last-child {
    border-bottom: none;
}

.tile-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
}

.tile-stat-info {
    flex: 1;
}

.tile-stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.tile-stat-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.tile-stat-trend {
    font-size: var(--font-size-sm);
    padding: 2px var(--space-2);
    border-radius: var(--radius-md);
}

.tile-stat-trend.up {
    background: #d4edda;
    color: var(--color-success);
}

.tile-stat-trend.down {
    background: #f8d7da;
    color: var(--color-danger);
}

/* Notes tile specific */
.notes-input {
    width: 100%;
    height: calc(100% - 40px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--font-size-base);
    resize: none;
    background: var(--color-gray-50);
}

.notes-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    background: var(--bg-card);
}

/* Advisory Board tile specific */
.adboard-mini-comment {
    padding: var(--space-3);
    background: #f7fafc;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    border-left: 3px solid #667eea;
}

.adboard-mini-comment.observation {
    border-left-color: var(--color-primary);
}

.adboard-mini-comment.concern {
    border-left-color: var(--color-warning);
}

.adboard-mini-author {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.adboard-mini-text {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-top: var(--space-1);
    line-height: var(--line-height-normal);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 10px 0;
    }

    .logo {
        padding: 10px 20px;
    }

    .main-content {
        padding: 20px;
    }

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

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

    .filters {
        flex-direction: column;
    }
}

/* ===========================================
   COLLATERALS TAB STYLES
   =========================================== */

/* Collateral Filter Tabs */
.collateral-filter {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4a5568;
    transition: all 0.2s;
}

.collateral-filter:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.collateral-filter.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.collateral-filter .filter-count {
    opacity: 0.7;
    font-size: 12px;
}

.collateral-filter.active .filter-count {
    opacity: 0.9;
}

/* Collateral Cards */
.collateral-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.collateral-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.collateral-card-preview {
    position: relative;
}

.collateral-card-info {
    border-top: 1px solid #f0f0f0;
}

.collateral-card-actions button:hover {
    background: #f7fafc !important;
}

/* Create Dropdown Styling */
#collateralCreateDropdown button:hover {
    background: #edf2f7 !important;
}

/* Export Dropdown */
.export-dropdown button:hover {
    background: #f7fafc !important;
}

/* ===========================================
   COLLATERAL EDITOR STYLES
   =========================================== */

.collateral-editor-container {
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collateral-editor-header button:hover {
    background: #edf2f7 !important;
}

.collateral-editor-form::-webkit-scrollbar {
    width: 6px;
}

.collateral-editor-form::-webkit-scrollbar-track {
    background: #f7fafc;
}

.collateral-editor-form::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.collateral-editor-form::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.editor-section-header:hover {
    background: #f7fafc;
    border-radius: 4px;
    margin: 0 -8px;
    padding: 8px !important;
}

.editor-section-content {
    animation: fadeIn 0.2s ease-out;
}

/* Form inputs in editor */
.collateral-editor-form input:focus,
.collateral-editor-form textarea:focus,
.collateral-editor-form select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.collateral-editor-form input[type="color"] {
    cursor: pointer;
    padding: 2px;
}

.collateral-editor-form input[type="radio"],
.collateral-editor-form input[type="checkbox"] {
    cursor: pointer;
    accent-color: #4299e1;
}

/* Preview canvas */
.collateral-preview-canvas {
    transition: all 0.2s ease-out;
}

/* Editor dropdown */
#editorExportDropdown button:hover {
    background: #f7fafc !important;
}

/* ===========================================
   COLLATERAL SAMPLES MODAL STYLES
   =========================================== */

.collateral-samples-container {
    animation: slideUp 0.2s ease-out;
}

#samplesListContainer::-webkit-scrollbar {
    width: 6px;
}

#samplesListContainer::-webkit-scrollbar-track {
    background: #f7fafc;
}

#samplesListContainer::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.sample-card {
    transition: all 0.15s ease-out;
}

.sample-card:not(.loaded):hover {
    border-color: #4299e1 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.sample-card.selected {
    border-color: #4299e1 !important;
    background: #ebf8ff !important;
}

.sample-card.selected .sample-checkbox {
    border-color: #4299e1 !important;
    background: #4299e1 !important;
}

.sample-card.selected .sample-checkbox .checkmark {
    display: block !important;
    color: white !important;
}

.sample-card.loaded {
    cursor: not-allowed;
}

/* ===========================================
   DATE RANGE PICKER & ARCHIVE INDICATORS
   =========================================== */

.date-range-section {
    margin-bottom: 20px;
}

.date-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.date-range-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4a5568;
    transition: all 0.15s ease;
}

.btn-preset:hover {
    border-color: #4299e1;
    color: #4299e1;
}

.btn-preset.active {
    background: #4299e1;
    border-color: #4299e1;
    color: #fff;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
}

.custom-date-range input[type="date"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.custom-date-range span {
    color: #718096;
    font-size: 13px;
}

/* Archive Indicator */
.archive-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.archive-indicator.hidden {
    display: none;
}

.archive-badge {
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #bee3f8;
}

/* Archive Months List */
.archive-months-list {
    margin-top: 12px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 13px;
}

.archive-months-list.hidden {
    display: none;
}

.archive-months-list .label {
    color: #718096;
    margin-right: 8px;
}

.archive-months-list .month-badge {
    display: inline-block;
    background: #edf2f7;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px 4px 2px 0;
}

.archive-months-list .no-archive-info {
    color: #718096;
    font-style: italic;
}

/* Archive Loading Indicator */
.archive-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    color: #92400e;
    font-size: 13px;
}

.archive-loading.hidden {
    display: none;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #fcd34d;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Archive Error Message */
.archive-error {
    margin-top: 12px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 13px;
}

.archive-error.hidden {
    display: none;
}

.archive-error::before {
    content: "âš ï¸ ";
}

/* ========== VITALS TAB STYLES ========== */

/* HRV Insights Grid */
.hrv-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.insight-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.insight-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-value {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.insight-value.positive {
    color: #16a34a;
}

.insight-value.negative {
    color: #dc2626;
}

.insight-value.neutral {
    color: #64748b;
}

.insight-value.recovery-good {
    color: #16a34a;
}

.insight-value.recovery-moderate {
    color: #d97706;
}

.insight-value.recovery-low {
    color: #dc2626;
}

/* ========== TREND INDICATORS ========== */
.trend-indicator {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.trend-positive {
    color: #16a34a;
    background: #dcfce7;
}

.trend-negative {
    color: #dc2626;
    background: #fee2e2;
}

.trend-stable {
    color: #64748b;
    background: #f1f5f9;
}

/* ========== VITAL ALERT BADGES ========== */
.stat-card.alert-warning {
    border: 2px solid #f59e0b;
    background: #fffbeb;
}

.stat-card.alert-danger {
    border: 2px solid #dc2626;
    background: #fef2f2;
}

.stat-card.alert-info {
    border: 2px solid #3b82f6;
    background: #eff6ff;
}

.alert-badge {
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.stat-card.alert-warning .alert-badge {
    color: #92400e;
    background: #fef3c7;
}

.stat-card.alert-danger .alert-badge {
    color: #991b1b;
    background: #fecaca;
}

.stat-card.alert-info .alert-badge {
    color: #1e40af;
    background: #dbeafe;
}

.insight-note {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #94a3b8;
}

.chart-description {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 15px;
}

.no-data-message {
    padding: 20px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 8px;
}

.no-data-message p {
    margin: 0;
}

.no-data-text {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* Chart visual distinction for archived data */
.chart-archived-section {
    position: relative;
}

.chart-archived-section::before {
    content: "ðŸ“¦ Archived";
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(66, 153, 225, 0.1);
    color: #2b6cb0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* No archive data message */
.no-archive-data {
    text-align: center;
    padding: 20px;
    color: #718096;
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .date-range-picker {
        flex-direction: column;
        align-items: stretch;
    }

    .preset-buttons {
        justify-content: center;
    }

    .custom-date-range {
        justify-content: center;
    }
}

/* ========== MDT TEAMS LINK STATUS ========== */

.mdt-teams-status {
    margin: 10px 0;
}

.teams-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.teams-status.ready {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e9f9 100%);
    border: 1px solid #6264a7;
}

.teams-status.ready i.fa-microsoft {
    color: #6264a7;
    font-size: 18px;
}

.teams-status.pending {
    background: #fff8e6;
    border: 1px solid #f0c040;
    flex-wrap: wrap;
}

.teams-status.in-person {
    background: #f0f9f4;
    border: 1px solid #27ae60;
}

.teams-status.in-person i {
    color: #27ae60;
}

.teams-status.in-person small {
    color: #666;
    margin-left: auto;
}

.teams-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.teams-loading i {
    color: #f39c12;
}

.teams-loading span {
    color: #856404;
}

.teams-join-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #6264a7;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.teams-join-btn:hover {
    background: #4b4d8c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(98, 100, 167, 0.3);
}

.teams-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.teams-retry-btn:hover {
    background: #c0392b;
}

.teams-success {
    color: #27ae60;
    font-size: 13px;
    margin-left: auto;
}

.teams-link-received {
    animation: teamsLinkReceived 0.5s ease;
}

@keyframes teamsLinkReceived {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); background: #d4edda; }
    100% { transform: scale(1); }
}

/* Data Source Banner */
.data-source-banner {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.data-source-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.data-source-banner-content.not-connected {
    color: #6c757d;
    font-style: italic;
}

.data-source-banner .wearable-icon {
    font-size: 20px;
}

.data-source-banner .last-sync-badge {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
}

/* Data Freshness Indicator */
.freshness-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.freshness-indicator .freshness-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.freshness-indicator.fresh {
    background: #d4edda;
    color: #155724;
}

.freshness-indicator.fresh .freshness-dot {
    background: #28a745;
}

.freshness-indicator.stale {
    background: #fff3cd;
    color: #856404;
}

.freshness-indicator.stale .freshness-dot {
    background: #ffc107;
}

.freshness-indicator.very-stale {
    background: #f8d7da;
    color: #721c24;
}

.freshness-indicator.very-stale .freshness-dot {
    background: #dc3545;
}

.freshness-indicator.unknown {
    background: #e9ecef;
    color: #6c757d;
}

.freshness-indicator.unknown .freshness-dot {
    background: #6c757d;
}

/* Comparison Toggle */
.comparison-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #e9ecef;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 13px;
    color: #6c757d;
}

/* Comparison period legend */
.comparison-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

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

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.current {
    background: #3498db;
}

.legend-color.previous {
    background: #95a5a6;
}

/* Anomaly Indicators */
.anomaly-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 15px;
}

.anomaly-summary.critical {
    background: #f8d7da;
    border-color: #dc3545;
}

.anomaly-summary .anomaly-icon {
    font-size: 20px;
}

.anomaly-summary .anomaly-count {
    font-weight: 600;
    color: #856404;
}

.anomaly-summary.critical .anomaly-count {
    color: #721c24;
}

.anomaly-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.anomaly-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.anomaly-badge.critical {
    background: rgba(220, 53, 69, 0.2);
}

.anomaly-badge:hover {
    background: rgba(255, 193, 7, 0.4);
}

/* Data Quality Indicator */
.data-quality-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-left: 15px;
}

.data-quality-indicator.excellent {
    background: #d4edda;
    color: #155724;
}

.data-quality-indicator.good {
    background: #d1ecf1;
    color: #0c5460;
}

.data-quality-indicator.partial {
    background: #fff3cd;
    color: #856404;
}

.data-quality-indicator.poor {
    background: #f8d7da;
    color: #721c24;
}

.data-quality-indicator.missing {
    background: #e9ecef;
    color: #6c757d;
}

.quality-bar {
    width: 60px;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.quality-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.data-quality-indicator.excellent .quality-bar-fill {
    background: #28a745;
}

.data-quality-indicator.good .quality-bar-fill {
    background: #17a2b8;
}

.data-quality-indicator.partial .quality-bar-fill {
    background: #ffc107;
}

.data-quality-indicator.poor .quality-bar-fill {
    background: #dc3545;
}

/* Correlation Insights */
.correlation-insights {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.correlation-insights h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #3498db;
}

.insight-item.positive {
    border-left-color: #28a745;
}

.insight-item.negative {
    border-left-color: #dc3545;
}

.insight-item.pattern {
    border-left-color: #6f42c1;
}

.insight-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.insight-text {
    font-size: 13px;
    line-height: 1.4;
}

.insight-strength {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

/* Threshold Configuration */
.threshold-config {
    padding: 20px;
}

.threshold-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.threshold-group h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #495057;
}

.threshold-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.threshold-label {
    width: 120px;
    font-size: 13px;
    color: #6c757d;
}

.threshold-input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.threshold-unit {
    font-size: 12px;
    color: #6c757d;
}

.threshold-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Data Point Notes */
.chart-note-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #6f42c1;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.chart-note-popup {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px;
    max-width: 250px;
    z-index: 100;
}

.chart-note-popup .note-date {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 8px;
}

.chart-note-popup .note-content {
    font-size: 13px;
    line-height: 1.4;
}

.chart-note-popup .note-author {
    font-size: 11px;
    color: #6c757d;
    margin-top: 8px;
    font-style: italic;
}

/* Print Summary View */
.print-summary-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.print-summary-btn:hover {
    background: #5a6268;
}

.print-summary-container {
    display: none;
}

@media print {
    .print-summary-container {
        display: block !important;
    }

    .sidebar, .nav-item, .tabs, .date-range-picker,
    .comparison-toggle, .btn, button, .modal {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
    }

    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .chart-container {
        max-height: 200px !important;
    }
}

.print-header {
    display: none;
    padding: 20px;
    border-bottom: 2px solid #2c3e50;
    margin-bottom: 20px;
}

@media print {
    .print-header {
        display: block !important;
    }
}

.print-header h1 {
    font-size: 24px;
    margin: 0 0 5px 0;
}

.print-header .print-meta {
    font-size: 12px;
    color: #6c757d;
}

/* Baseline Comparison */
.baseline-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

.baseline-indicator.above {
    background: #d4edda;
    color: #155724;
}

.baseline-indicator.below {
    background: #f8d7da;
    color: #721c24;
}

.baseline-indicator.normal {
    background: #e9ecef;
    color: #6c757d;
}

/* Configure Thresholds Button */
.configure-thresholds-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    color: #6c757d;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.configure-thresholds-btn:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

/* ============================================
   QUESTIONS LIBRARY STYLES
   ============================================ */

/* Questions Toolbar */
.questions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.questions-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

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

/* Questions Split Layout */
.questions-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    min-height: 500px;
}

.questions-layout.panel-collapsed {
    grid-template-columns: 1fr 50px;
}

/* Questions Grid Container */
.questions-grid-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Question Card */
.question-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.question-card.selected {
    border-color: #3498db;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.question-card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.question-type-badge {
    font-size: 16px;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
}

.question-category-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.question-standard-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
}

.question-card-body {
    margin-bottom: 10px;
}

.question-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.question-help-text {
    font-size: 12px;
    color: #888;
    margin: 8px 0 0 0;
    font-style: italic;
}

.question-card-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.required-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 4px;
}

.question-preview {
    font-size: 11px;
    color: #666;
    margin-left: auto;
}

/* Question Side Panel */
.question-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.question-panel.collapsed {
    width: 50px;
    min-width: 50px;
}

.question-panel.collapsed .panel-body {
    display: none;
}

.question-panel.collapsed .panel-header h3 {
    display: none;
}

.question-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.question-panel .panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.panel-collapse-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.panel-collapse-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.question-panel .panel-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-panel-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    text-align: center;
    padding: 40px;
}

/* Form Styles for Question Editor */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.type-specific-options {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.option-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.option-row .form-input {
    flex: 1;
}

.btn-remove-option {
    width: 32px;
    height: 38px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    transition: all 0.2s;
}

.btn-remove-option:hover {
    background: #fee;
    border-color: #e74c3c;
    color: #e74c3c;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.panel-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Tab Badge */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    background: #3498db;
    color: white;
    border-radius: 9px;
    margin-left: 6px;
}

/* Dropdown Menu */
.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
    text-align: center;
}

.loading-state p,
.empty-state p {
    margin: 0 0 15px 0;
}

/* ============================================
   PROGRAM BUILDER STYLES
   ============================================ */

/* Programs Layout */
.programs-layout {
    display: grid;
    grid-template-columns: 200px 200px 1fr;
    gap: 20px;
    min-height: 500px;
}

/* Goals and Levels Panels */
.goals-panel,
.levels-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
}

.goals-panel .panel-header,
.levels-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.panel-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.btn-add {
    width: 28px;
    height: 28px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-add:hover {
    background: #2980b9;
}

.list-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.list-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:hover {
    background: #f5f5f5;
}

.list-item.active {
    background: #e3f2fd;
    border-left: 3px solid #3498db;
}

.level-weeks {
    font-size: 11px;
    color: #888;
    margin-left: 8px;
}

.btn-delete-small {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.list-item:hover .btn-delete-small {
    opacity: 1;
}

.btn-delete-small:hover {
    background: #fee;
    color: #e74c3c;
}

/* Week View */
.week-view {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.week-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.week-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.week-subtitle {
    font-size: 13px;
    color: #666;
}

#week-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-week-nav {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-week-nav:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #999;
}

.btn-week-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.week-indicator {
    font-weight: 600;
    font-size: 13px;
    padding: 0 10px;
}

.btn-add-week {
    padding: 6px 12px;
    border: 1px dashed #3498db;
    background: transparent;
    color: #3498db;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-week:hover {
    background: #e3f2fd;
}

/* Days Container */
.days-horizontal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    flex: 1;
    min-height: 400px;
}

.day-column {
    background: #fafafa;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.day-column.rest-day {
    background: #f5f5f5;
}

.day-header {
    padding: 10px;
    background: #f0f0f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rest-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: normal;
    text-transform: none;
}

.rest-toggle input {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.rest-label {
    color: #888;
}

.day-content {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    min-height: 200px;
}

.empty-day {
    color: #bbb;
    font-size: 12px;
    text-align: center;
    padding: 20px 10px;
}

.rest-indicator {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 30px 10px;
    font-style: italic;
}

/* Day Items */
.day-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    transition: all 0.2s;
}

.day-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.day-item.exercise-item {
    border-left: 3px solid #3498db;
}

.day-item.question-item {
    border-left: 3px solid #9b59b6;
}

.item-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-details {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.item-timing {
    font-size: 10px;
    color: #9b59b6;
    margin-top: 2px;
}

.btn-remove-item {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.2s;
}

.day-item:hover .btn-remove-item {
    opacity: 1;
}

.btn-remove-item:hover {
    background: #fee;
    color: #e74c3c;
}

/* Day Actions */
.day-actions {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-top: 1px solid #e0e0e0;
}

.btn-add-item {
    flex: 1;
    padding: 6px 8px;
    border: 1px dashed #ccc;
    background: transparent;
    color: #888;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-item:hover {
    border-color: #3498db;
    color: #3498db;
    background: #f0f7ff;
}

/* Item Selection Modal */
.modal-large {
    max-width: 700px;
    max-height: 80vh;
}

.item-selection-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.selection-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-gray-100);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.selection-item:hover {
    background: var(--color-gray-50);
}

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

.selection-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.selection-thumb.placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.selection-info {
    flex: 1;
    min-width: 0;
}

.selection-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.selection-meta {
    font-size: 12px;
    color: #888;
}

.empty-message {
    padding: 30px;
    text-align: center;
    color: #888;
}

/* ============================================
   EXERCISE LIBRARY GRID STYLES
   ============================================ */

.exercise-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.exercise-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.exercise-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.exercise-thumbnail {
    height: 160px;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exercise-details {
    padding: 15px;
}

.exercise-details h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.exercise-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.exercise-details p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Channels Section */
.channels-section {
    margin-bottom: 20px;
}

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

.channels-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.btn-manage-channels {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-manage-channels:hover {
    background: #f5f5f5;
    border-color: #999;
}

.channels-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.channel-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.channel-icon {
    font-size: 24px;
}

.channel-info {
    flex: 1;
}

.channel-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.channel-url {
    font-size: 12px;
    color: #888;
}

.btn-import {
    padding: 6px 12px;
    border: 1px solid #3498db;
    background: transparent;
    color: #3498db;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-import:hover {
    background: #3498db;
    color: white;
}

/* ============================================
   COLLAPSIBLE PANELS
   ============================================ */

.goals-panel.collapsed,
.levels-panel.collapsed {
    width: 50px;
    min-width: 50px;
}

.goals-panel.collapsed .list-items,
.levels-panel.collapsed .list-items {
    display: none;
}

.goals-panel.collapsed .panel-title,
.levels-panel.collapsed .panel-title {
    display: none;
}

.goals-panel.collapsed .btn-add,
.levels-panel.collapsed .btn-add {
    display: none;
}

/* ============================================
   TEMPLATE LIBRARY V2
   ============================================ */

.template-library-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - 200px);
}

/* Template tab badge (count indicator) */
.tab-badge {
    display: inline-block;
    background: #e9ecef;
    color: #666;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
}

.tab.active .tab-badge {
    background: #104378;
    color: white;
}

/* Template Content Area */
.template-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Programs Split Layout */
.programs-split-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100%;
    min-height: 500px;
}

/* Program List Panel */
.program-list-panel {
    background: #fafbfc;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-panel-header {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-panel-header input,
.list-panel-header select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.list-panel-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.list-panel-actions .btn {
    flex: 1;
}

.program-list {
    flex: 1;
    overflow-y: auto;
}

.program-list-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.program-list-item:hover {
    background: #f5f7fa;
}

.program-list-item.selected {
    background: #e8f4fc;
    border-left: 3px solid #104378;
}

.program-list-item .item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.program-list-item .item-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.program-list-item .item-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
}

.program-list-item .item-status.active { background: #e8f5e9; color: #27ae60; }
.program-list-item .item-status.draft { background: #fff3e0; color: #e67e22; }

.list-group-header {
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    background: #f0f2f5;
    border-bottom: 1px solid #e0e0e0;
}

.list-empty {
    padding: 30px 15px;
    text-align: center;
    color: #adb5bd;
    font-size: 13px;
}

.grid-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #adb5bd;
    font-size: 14px;
}

.panel-empty {
    padding: 30px 15px;
    text-align: center;
    color: #adb5bd;
    font-size: 13px;
}

/* Program Builder Area */
.program-builder-area {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    overflow: hidden;
}

.builder-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.builder-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.builder-empty-state h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.builder-active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.builder-header {
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.builder-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.builder-title-input {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 4px 0;
    outline: none;
}

.builder-title-input:focus {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.builder-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: #fff3e0;
    color: #e67e22;
}

.builder-status.active {
    background: #e8f5e9;
    color: #27ae60;
}

.builder-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.builder-meta select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    min-width: 150px;
}

/* Week Navigation */
.week-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.week-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.week-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.week-tab:hover {
    background: #f5f7fa;
}

.week-tab.active {
    background: linear-gradient(135deg, #104378 0%, #4CB6C3 100%);
    color: white;
    border-color: transparent;
}

/* Days Grid */
.days-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f8f9fa;
    gap: 10px;
}

.day-column {
    background: white;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.day-column.rest-day {
    background: #fafafa;
}

.day-column.drag-over {
    background: #e8f4fc;
    border: 2px dashed #104378;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.day-name {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
}

.day-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.day-item.exercise {
    border-left-color: #27ae60;
}

.day-item.question {
    border-left-color: #3498db;
}

.day-item:hover {
    background: #e8eaed;
}

.day-item .item-icon {
    font-size: 14px;
}

.day-item .item-info {
    flex: 1;
    min-width: 0;
}

.day-item .item-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-item .item-detail {
    font-size: 10px;
    color: #6c757d;
}

.day-item .btn-remove {
    width: 18px;
    height: 18px;
    border: none;
    background: #fee;
    color: #e74c3c;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.day-item:hover .btn-remove {
    opacity: 1;
}

.day-add-btn {
    margin-top: auto;
    padding: 8px;
    border: 1px dashed #ccc;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
}

.day-add-btn:hover {
    border-color: #104378;
    color: #104378;
}

.rest-indicator {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 13px;
}

/* Builder Legend */
.builder-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.exercise { background: #27ae60; }
.legend-color.question { background: #3498db; }
.legend-color.rest { background: #e0e0e0; }

/* Content Toolbar (for Exercises/Questions tabs) */
.content-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

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

.toolbar-right {
    display: flex;
    gap: 8px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    color: #adb5bd;
}

.search-box input {
    padding: 10px 12px 10px 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #104378;
}

.content-toolbar select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Items Grid (Exercises/Questions) */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 350px);
}

.items-grid.questions-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.item-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.item-card .card-thumb {
    height: 100px;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8eaed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-card .no-thumb-icon {
    font-size: 32px;
    opacity: 0.4;
}

.item-card .card-body {
    padding: 12px;
}

.item-card .card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-card .card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.item-card .tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f2f5;
}

.item-card .tag.category { background: #e3f2fd; color: #1976d2; }
.item-card .tag.difficulty { background: #f3e5f5; color: #7b1fa2; }
.item-card .tag.type { background: #e8f5e9; color: #388e3c; }
.item-card .tag.required { background: #ffebee; color: #c62828; }

/* Question Card specific */
.question-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.question-card .question-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: #f0f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.question-card .card-body {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.question-card .question-text {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   TEMPLATE FLOATING PANEL
   ============================================ */

.template-floating-panel {
    position: fixed;
    top: 100px;
    right: 80px;
    width: 400px;
    max-height: calc(100vh - 150px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.template-floating-panel.hidden {
    display: none;
}

.template-floating-panel.minimized {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
}

.template-floating-panel.minimized .template-panel-body {
    display: none;
}

.template-floating-panel.minimized .panel-title-area {
    display: none;
}

.template-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #104378 0%, #4CB6C3 100%);
    color: white;
    cursor: move;
}

.panel-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title-area .panel-icon {
    font-size: 18px;
}

.panel-title-area .panel-title {
    font-size: 15px;
    font-weight: 600;
}

.panel-actions {
    display: flex;
    gap: 4px;
}

.template-panel-header .btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.template-panel-header .btn-icon:hover {
    background: rgba(255,255,255,0.3);
}

.template-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Panel Form Styles */
.template-panel-body .form-group {
    margin-bottom: 16px;
}

.template-panel-body .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.template-panel-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.template-panel-body .form-control:focus {
    outline: none;
    border-color: #104378;
}

.template-panel-body textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.template-panel-body .form-row {
    display: flex;
    gap: 12px;
}

.template-panel-body .form-row .form-group {
    flex: 1;
}

.template-panel-body .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.template-panel-body .form-actions .btn {
    flex: 1;
}

/* Browse Items Mode */
.panel-browse-section {
    margin-bottom: 16px;
}

.panel-browse-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.panel-browse-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: #f0f2f5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
}

.panel-browse-tab:hover {
    background: #e8eaed;
}

.panel-browse-tab.active {
    background: #104378;
    color: white;
}

.panel-browse-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.panel-browse-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.panel-browse-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-browse-item:hover {
    background: #e8f4fc;
}

.panel-browse-item .item-icon {
    font-size: 16px;
}

.panel-browse-item .item-info {
    flex: 1;
    min-width: 0;
}

.panel-browse-item .item-name {
    font-size: 13px;
    font-weight: 500;
}

.panel-browse-item .item-meta {
    font-size: 11px;
    color: #6c757d;
}

.panel-browse-item .btn-add {
    width: 24px;
    height: 24px;
    border: none;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.panel-browse-item .btn-add:hover {
    background: #219a52;
}

/* Edit Item Mode in Panel */
.panel-edit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.panel-edit-header .edit-icon {
    font-size: 28px;
}

.panel-edit-header .edit-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.panel-edit-header .edit-info .edit-category {
    font-size: 12px;
    color: #6c757d;
}

/* Standard Sets Grid */
.standard-sets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.standard-set-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.standard-set-card:hover {
    border-color: #104378;
    background: #f8f9fa;
}

.standard-set-card.selected {
    border-color: #27ae60;
    background: #e8f5e9;
}

.standard-set-card .set-icon {
    font-size: 24px;
}

.standard-set-card .set-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.standard-set-card .set-info p {
    font-size: 12px;
    color: #6c757d;
}

.standard-set-card .set-check {
    margin-left: auto;
    color: #27ae60;
    font-size: 18px;
}

/* Goals Manager */
.goals-list {
    margin-bottom: 16px;
}

.goal-manager-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.goal-manager-item input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.goal-manager-item .levels-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.goal-manager-item .level-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: white;
    border-radius: 12px;
    font-size: 12px;
}

.goal-manager-item .btn-remove-level {
    width: 14px;
    height: 14px;
    border: none;
    background: #fee;
    color: #e74c3c;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
}

.add-goal-row {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.add-goal-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
    .programs-split-layout {
        grid-template-columns: 220px 1fr;
    }

    .days-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .template-floating-panel {
        width: 350px;
        right: 20px;
    }
}

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

    .program-list-panel {
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .template-floating-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 600px) {
    .days-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Mobile-Responsive Media Queries
   Breakpoints: 1024px (tablet), 768px (mobile), 480px (small mobile)
   Added Feb 2026
   ============================================================ */

/* --- Hamburger / Mobile Menu Toggle --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: calc(var(--z-overlay) + 5);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* Hamburger-to-X animation when sidebar is open */
.sidebar-open .mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.sidebar-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}
.sidebar-open .mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Sidebar Overlay (mobile backdrop) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-overlay) - 1);
}

/* ============================================================
   Tablet  -  max-width: 1024px
   ============================================================ */
@media (max-width: 1024px) {

    /* --- Layout --- */
    .main-content {
        padding: var(--space-4);
    }

    .topbar {
        padding: 12px 20px;
    }

    .topbar h2 {
        font-size: var(--font-size-xl);
    }

    /* --- Sidebar: narrower on tablet --- */
    .sidebar {
        width: 200px;
    }

    .sidebar.collapsed {
        width: 60px;
    }

    /* --- Stats Grids: 2 columns --- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* --- Cards --- */
    .card {
        padding: var(--space-5);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .stat-value {
        font-size: var(--font-size-2xl);
    }

    /* --- Modals --- */
    .modal-content {
        max-width: 90vw;
    }

    .modal-content.large,
    .modal-content.modal-large {
        max-width: 95vw;
    }

    .modal-lg {
        max-width: 90vw;
    }

    .modal-xl {
        max-width: 95vw;
    }

    /* --- Form Rows: keep 2-col but tighter gap --- */
    .form-row {
        gap: 10px;
    }

    /* --- Programs Split Layout --- */
    .standard-sets-grid {
        grid-template-columns: 1fr;
    }

    /* --- Tables --- */
    .table-container {
        padding: var(--space-3);
    }

    th, td {
        padding: 10px 8px;
        font-size: var(--font-size-sm);
    }
}

/* ============================================================
   Mobile  -  max-width: 768px
   ============================================================ */
@media (max-width: 768px) {

    /* --- Show hamburger toggle --- */
    .mobile-menu-toggle {
        display: flex;
    }

    /* --- Sidebar: hidden off-screen by default, overlay when open --- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        z-index: var(--z-overlay);
    }

    .sidebar.collapsed {
        width: 260px;
        transform: translateX(-100%);
    }

    /* When sidebar is open via toggle */
    .sidebar-open .sidebar,
    .sidebar-open .sidebar.collapsed {
        transform: translateX(0);
    }

    /* Restore hidden items when sidebar is open on mobile */
    .sidebar-open .sidebar.collapsed .sidebar-header p,
    .sidebar-open .sidebar.collapsed .sidebar-header h1 span,
    .sidebar-open .sidebar.collapsed .nav-item span:not(.nav-icon) {
        display: inline;
    }

    .sidebar-open .sidebar.collapsed .sidebar-header {
        padding: 25px 20px;
    }

    .sidebar-open .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 12px 20px;
    }

    .sidebar-open .sidebar.collapsed .sidebar-nav {
        padding: 20px 15px;
    }

    /* Show overlay backdrop */
    .sidebar-open .sidebar-overlay {
        display: block;
    }

    /* --- Main Content: full width --- */
    .app-container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: var(--space-3);
    }

    /* --- Topbar --- */
    .topbar {
        padding: 10px 15px;
        gap: 10px;
    }

    .topbar h2 {
        font-size: var(--font-size-lg);
    }

    .topbar-left {
        gap: 10px;
    }

    /* --- Stats Grids: single column --- */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .analytics-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* --- Stat Cards --- */
    .stat-card {
        padding: var(--space-4);
    }

    .stat-value {
        font-size: var(--font-size-xl);
    }

    .stat-label {
        font-size: var(--font-size-sm);
    }

    /* --- Cards: full width, reduced padding --- */
    .card {
        padding: var(--space-4);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-3);
    }

    .card h3 {
        font-size: var(--font-size-md);
        margin-bottom: var(--space-3);
    }

    /* --- Typography --- */
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }
    h4 { font-size: var(--font-size-md); }

    /* --- Tabs: horizontal scroll --- */
    .tabs {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;  /* Firefox */
        gap: 2px;
    }

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

    .tab {
        padding: 10px 16px;
        font-size: var(--font-size-sm);
        flex-shrink: 0;
    }

    /* --- Form Layouts: single column --- */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group {
        margin-bottom: var(--space-3);
    }

    input, select, textarea {
        padding: 10px;
        font-size: var(--font-size-base);
    }

    /* --- Modals: full width --- */
    .modal {
        padding: 10px;
        align-items: flex-end;
    }

    .modal-content,
    .modal-content.large,
    .modal-content.modal-large,
    .modal-content.modal-medium {
        max-width: 100%;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 85vh;
        padding: var(--space-5);
    }

    .modal-sm,
    .modal-md,
    .modal-lg,
    .modal-xl {
        max-width: 100%;
    }

    .modal-header {
        margin-bottom: var(--space-3);
    }

    .modal-header h2 {
        font-size: var(--font-size-lg);
    }

    /* --- Tables: horizontal scroll --- */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: var(--space-2);
    }

    table {
        min-width: 600px;
    }

    th, td {
        padding: 8px 6px;
        font-size: var(--font-size-sm);
        white-space: nowrap;
    }

    /* --- Programs Split Layout --- */
    .programs-split-layout {
        grid-template-columns: 1fr;
    }

    .program-list-panel {
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* --- Items Grid --- */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    /* --- Floating Panels --- */
    .template-floating-panel {
        position: fixed;
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-height: 60vh;
    }

    /* --- Buttons --- */
    .login-btn {
        padding: 8px 16px;
        font-size: var(--font-size-sm);
    }

    /* --- Analytics Stat Cards --- */
    .analytics-stat-card {
        padding: var(--space-4);
    }

    /* --- User Menu --- */
    .user-menu-container {
        position: static;
    }

    /* --- Inline grid overrides (for elements using style="display:grid") --- */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Preserve 2-col for small paired fields */
    [style*="grid-template-columns"].keep-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ============================================================
   Small Mobile  -  max-width: 480px
   ============================================================ */
@media (max-width: 480px) {

    /* --- Layout --- */
    .main-content {
        padding: var(--space-2);
    }

    .topbar {
        padding: 8px 12px;
    }

    .topbar h2 {
        font-size: var(--font-size-md);
    }

    /* --- Stats --- */
    .stats-grid,
    .analytics-stats-grid {
        gap: 8px;
    }

    .stat-card,
    .analytics-stat-card {
        padding: var(--space-3);
    }

    .stat-value {
        font-size: var(--font-size-lg);
    }

    .stat-label {
        font-size: var(--font-size-xs);
    }

    /* --- Cards --- */
    .card {
        padding: var(--space-3);
        border-radius: var(--radius-sm);
    }

    .card h3 {
        font-size: var(--font-size-base);
    }

    /* --- Typography further reduction --- */
    h1 { font-size: var(--font-size-xl); }
    h2 { font-size: var(--font-size-lg); }
    h3 { font-size: var(--font-size-md); }
    h4 { font-size: var(--font-size-base); }

    body {
        font-size: var(--font-size-sm);
    }

    /* --- Tabs --- */
    .tab {
        padding: 8px 12px;
        font-size: 11px;
    }

    /* --- Modals --- */
    .modal {
        padding: 0;
    }

    .modal-content,
    .modal-content.large,
    .modal-content.modal-large,
    .modal-content.modal-medium {
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        padding: var(--space-4);
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: var(--font-size-md);
    }

    /* --- Forms --- */
    input, select, textarea {
        padding: 8px;
        font-size: var(--font-size-sm);
    }

    label {
        font-size: var(--font-size-sm);
        margin-bottom: 4px;
    }

    /* --- Tables --- */
    th, td {
        padding: 6px 4px;
        font-size: 11px;
    }

    /* --- Buttons --- */
    .login-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    button, .btn {
        font-size: var(--font-size-sm);
        padding: 8px 12px;
    }

    /* --- Days Grid --- */
    .days-grid {
        grid-template-columns: 1fr;
    }

    /* --- Items Grid --- */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    /* --- Floating Panel --- */
    .template-floating-panel {
        max-height: 50vh;
    }

    /* --- Goal Manager --- */
    .goal-manager-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .goal-manager-item .levels-tags {
        justify-content: flex-start;
    }

    /* --- Sidebar (when open) --- */
    .sidebar-open .sidebar {
        width: 80vw;
        max-width: 280px;
    }
}
