/* ============================================================
   QUANTUM DASHBOARD — Dark / Light Theme
   ============================================================ */

/* ============ DARK THEME (default) ============ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-elevated: #1e1e2a;

    --text-primary: #eaeaf0;
    --text-secondary: #8888a0;
    --text-muted: #555570;

    --accent-cyan: #00f0ff;
    --accent-violet: #8b5cf6;
    --accent-green: #22d97f;
    --accent-orange: #ff9f43;
    --accent-red: #ff5a5a;
    --accent-pink: #f471b5;

    --gradient-main: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 100%);
    --gradient-green: linear-gradient(135deg, #22d97f 0%, #00f0ff 100%);
    --gradient-warm: linear-gradient(135deg, #ff9f43 0%, #f471b5 100%);
    --gradient-fire: linear-gradient(135deg, #ff5a5a 0%, #ff9f43 100%);

    --glass-bg: rgba(22, 22, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    --header-bg: rgba(10, 10, 15, 0.85);
    --period-active-text: #0a0a0f;

    --cal-empty: var(--bg-elevated);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 50%;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============ LIGHT THEME ============ */
body.light {
    --bg-primary: #f4f5f7;
    --bg-secondary: #ebedf0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-elevated: #e8e9ed;

    --text-primary: #1a1a2e;
    --text-secondary: #5c5c7a;
    --text-muted: #9999aa;

    --accent-cyan: #0099cc;
    --accent-violet: #7c3aed;
    --accent-green: #16a364;
    --accent-orange: #e68a2e;
    --accent-red: #dc3545;
    --accent-pink: #d946a8;

    --gradient-main: linear-gradient(135deg, #0099cc 0%, #7c3aed 100%);
    --gradient-green: linear-gradient(135deg, #16a364 0%, #0099cc 100%);
    --gradient-warm: linear-gradient(135deg, #e68a2e 0%, #d946a8 100%);
    --gradient-fire: linear-gradient(135deg, #dc3545 0%, #e68a2e 100%);

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.07);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    --header-bg: rgba(244, 245, 247, 0.9);
    --period-active-text: #ffffff;

    --cal-empty: #e8e9ed;
}

/* ============ RESET ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    transition: background 0.4s ease, color 0.4s ease;
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-violet);
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ============ HEADER ============ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 20px 12px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.4s ease;
}

.header-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(0, 240, 255, 0.15), transparent 70%);
    pointer-events: none;
    transition: opacity 0.4s;
}

body.light .header-glow {
    opacity: 0.3;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 240, 255, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 240, 255, 0.15);
    animation: logoPulse 3s ease-in-out infinite;
}

body.light .logo-icon {
    background: rgba(0, 153, 204, 0.08);
    border-color: rgba(0, 153, 204, 0.2);
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
    }
}

.app-title {
    font-size: 20px;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.app-greeting {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* ============ THEME TOGGLE ============ */
.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--accent-cyan);
}

.theme-toggle:active {
    transform: scale(0.92);
}

.theme-icon {
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Dark mode: show sun (to switch to light), hide moon */
.theme-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon.moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Light mode: show moon (to switch to dark), hide sun */
body.light .theme-icon.sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

body.light .theme-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ============ TAB NAVIGATION ============ */
.tab-nav {
    display: flex;
    gap: 4px;
    padding: 6px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 69px;
    z-index: 99;
    transition: background 0.4s ease;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:active {
    transform: scale(0.96);
}

.tab-btn.active {
    background: rgba(0, 240, 255, 0.08);
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.08);
}

body.light .tab-btn.active {
    background: rgba(0, 153, 204, 0.1);
    box-shadow: 0 0 10px rgba(0, 153, 204, 0.05);
}

.tab-btn svg {
    flex-shrink: 0;
}

/* ============ PERIOD SWITCHER ============ */
.period-nav {
    display: flex;
    gap: 0;
    margin: 12px 16px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 4px;
    position: relative;
    border: 1px solid var(--glass-border);
    transition: background 0.4s ease;
}

.period-nav.hidden {
    display: none;
}

.period-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(33.333% - 2.67px);
    height: calc(100% - 8px);
    background: var(--gradient-main);
    border-radius: 8px;
    transition: transform var(--spring);
    opacity: 0.9;
    z-index: 1;
}

.period-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: var(--transition);
    border-radius: 8px;
}

.period-btn.active {
    color: var(--period-active-text);
}

/* ============ MAIN CONTENT ============ */
.content {
    padding: 16px;
    min-height: 60vh;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ LOADING SPINNER ============ */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-elevated);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    transition: background 0.3s, border-color 0.3s;
}

body.light .card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.card:hover {
    background: var(--bg-card-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.card-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.15);
}

body.light .card-badge {
    background: rgba(0, 153, 204, 0.08);
    border-color: rgba(0, 153, 204, 0.15);
}

/* ============ SECTION TITLE ============ */
.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* ============ PRACTICE CARD (Day view) ============ */
.practice-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.practice-item:last-child {
    margin-bottom: 0;
}

.practice-status {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 2px;
}

.practice-status.done {
    background: rgba(34, 217, 127, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 217, 127, 0.3);
}

.practice-status.pending {
    background: rgba(85, 85, 112, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(85, 85, 112, 0.3);
}

body.light .practice-status.pending {
    background: rgba(200, 200, 210, 0.3);
    border-color: rgba(150, 150, 170, 0.3);
}

.practice-info {
    flex: 1;
    min-width: 0;
}

.practice-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.mini-tasks {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.mini-dot.filled {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

body.light .mini-dot.filled {
    box-shadow: 0 0 4px rgba(0, 153, 204, 0.3);
}

.weak-link-toggle {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.weak-link-toggle:hover {
    color: var(--accent-orange);
}

.weak-link-text {
    font-size: 11px;
    color: var(--accent-orange);
    margin-top: 6px;
    padding: 8px;
    background: rgba(255, 159, 67, 0.06);
    border-radius: 8px;
    border-left: 2px solid var(--accent-orange);
    line-height: 1.4;
    display: none;
}

.weak-link-text.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        max-height: 100px;
        transform: translateY(0);
    }
}

/* ============ PROGRESS BARS ============ */
.progress-bar-container {
    margin-bottom: 10px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
}

.progress-label-name {
    color: var(--text-secondary);
}

.progress-label-value {
    color: var(--text-primary);
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--gradient-main);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill.green {
    background: var(--gradient-green);
}

.progress-fill.warm {
    background: var(--gradient-warm);
}

.progress-fill.fire {
    background: var(--gradient-fire);
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    border-radius: 10px;
}

body.light .progress-fill::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
}

/* ============ TASK CARD (Day planner) ============ */
.task-item {
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.task-dual-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============ STATS VIEW (Week/Month) ============ */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-ring-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

body.light .stat-ring-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.ring-container {
    width: 80px;
    height: 80px;
    position: relative;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 6;
}

.ring-fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ring-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}

/* ============ HEATMAP ============ */
.heatmap-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

body.light .heatmap-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.heatmap-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.heatmap-grid {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(7, 1fr);
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--bg-elevated);
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

.heatmap-cell.level-1 {
    background: rgba(0, 240, 255, 0.1);
}

.heatmap-cell.level-2 {
    background: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 4px rgba(0, 240, 255, 0.15);
}

.heatmap-cell.level-3 {
    background: rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
}

.heatmap-cell.level-4 {
    background: rgba(0, 240, 255, 0.7);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

body.light .heatmap-cell.level-1 {
    background: rgba(0, 153, 204, 0.1);
}

body.light .heatmap-cell.level-2 {
    background: rgba(0, 153, 204, 0.25);
    box-shadow: none;
}

body.light .heatmap-cell.level-3 {
    background: rgba(0, 153, 204, 0.4);
    box-shadow: none;
}

body.light .heatmap-cell.level-4 {
    background: rgba(0, 153, 204, 0.6);
    box-shadow: none;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.heatmap-legend .heatmap-cell {
    width: 10px;
    height: 10px;
}

/* ============ WEEKLY BREAKDOWN ============ */
.breakdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--accent-cyan);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.breakdown-toggle:hover {
    background: var(--bg-card-hover);
}

.breakdown-toggle:active {
    transform: scale(0.98);
}

.breakdown-toggle svg {
    transition: transform 0.3s ease;
}

.breakdown-toggle.open svg {
    transform: rotate(180deg);
}

.breakdown-container {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.breakdown-container.open {
    max-height: 600px;
}

.breakdown-day {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: var(--transition);
}

body.light .breakdown-day {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.breakdown-day-label {
    width: 30px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
}

.breakdown-day-num {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.breakdown-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.breakdown-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.breakdown-bar-row .bar-track {
    flex: 1;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 10px;
    overflow: hidden;
}

.breakdown-bar-row .bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
}

.breakdown-bar-row .bar-pct {
    width: 28px;
    text-align: right;
    font-weight: 700;
    color: var(--text-secondary);
}

.breakdown-day.inactive {
    opacity: 0.4;
}

/* ============ CALENDAR (Month view) ============ */
.calendar-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

body.light .calendar-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.calendar-month {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 6px;
}

.calendar-weekday {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.calendar-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--cal-empty);
    transition: background 0.4s ease, transform 0.2s ease;
    cursor: default;
    position: relative;
}

.calendar-cell.empty {
    background: transparent;
}

.calendar-cell.today {
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 800;
}

.calendar-cell.weekend {
    opacity: 0.4;
}

/* Score colors: green (good) -> yellow -> red (bad) */
.calendar-cell.score-high {
    background: rgba(34, 217, 127, 0.6);
    color: #fff;
}

.calendar-cell.score-good {
    background: rgba(34, 217, 127, 0.35);
    color: var(--text-primary);
}

.calendar-cell.score-mid {
    background: rgba(255, 210, 63, 0.45);
    color: var(--text-primary);
}

.calendar-cell.score-low {
    background: rgba(255, 159, 67, 0.5);
    color: var(--text-primary);
}

.calendar-cell.score-bad {
    background: rgba(255, 90, 90, 0.5);
    color: #fff;
}

body.light .calendar-cell.score-high {
    background: rgba(22, 163, 100, 0.5);
    color: #fff;
}

body.light .calendar-cell.score-good {
    background: rgba(22, 163, 100, 0.25);
}

body.light .calendar-cell.score-mid {
    background: rgba(230, 190, 40, 0.35);
}

body.light .calendar-cell.score-low {
    background: rgba(230, 138, 46, 0.35);
}

body.light .calendar-cell.score-bad {
    background: rgba(220, 53, 69, 0.4);
    color: #fff;
}

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 10px;
    color: var(--text-muted);
}

.calendar-legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ============ TEAM MEMBER CARD ============ */
.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: var(--transition);
}

body.light .member-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.member-card:hover {
    background: var(--bg-card-hover);
}

.member-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.member-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.metric-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metric-dot.cyan {
    background: var(--accent-cyan);
}

.metric-dot.green {
    background: var(--accent-green);
}

.metric-dot.violet {
    background: var(--accent-violet);
}

.metric-dot.orange {
    background: var(--accent-orange);
}

.metric-value {
    font-weight: 700;
    color: var(--text-primary);
}

.metric-label {
    color: var(--text-muted);
}

.comparison-bar-bg {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 10px;
    margin-top: 8px;
    position: relative;
}

.comparison-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
}

.comparison-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 10px;
    background: var(--accent-orange);
    border-radius: 2px;
    transition: left 1s ease;
}

/* ============ TEAM AVG CARD ============ */
.team-avg-card {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

body.light .team-avg-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.team-avg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-main);
}

.team-avg-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.team-avg-values {
    display: flex;
    gap: 16px;
}

.team-avg-item {
    flex: 1;
    text-align: center;
}

.team-avg-number {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.team-avg-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 600;
}

/* ============ TODAY'S TASKS ============ */
.today-task-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: var(--transition);
}

body.light .today-task-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.today-task-card:hover {
    background: var(--bg-card-hover);
}

.task-time-badge {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    border: 1px solid;
}

.task-time-badge .time-hour {
    font-size: 18px;
    line-height: 1;
}

.task-time-badge .time-min {
    font-size: 10px;
    opacity: 0.7;
}

.task-time-badge.t0 {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.2);
    color: var(--accent-cyan);
}

.task-time-badge.t1 {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
    color: var(--accent-violet);
}

.task-time-badge.t2 {
    background: rgba(34, 217, 127, 0.08);
    border-color: rgba(34, 217, 127, 0.2);
    color: var(--accent-green);
}

.today-task-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.today-task-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ============ ANIMATIONS ============ */
.animate-in {
    animation: cardIn 0.4s ease forwards;
    opacity: 0;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger>*:nth-child(1) {
    animation-delay: 0s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.05s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.1s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.15s;
}

.stagger>*:nth-child(5) {
    animation-delay: 0.2s;
}

.stagger>*:nth-child(6) {
    animation-delay: 0.25s;
}

.stagger>*:nth-child(7) {
    animation-delay: 0.3s;
}

.stagger>*:nth-child(8) {
    animation-delay: 0.35s;
}

@keyframes barGrow {
    from {
        width: 0;
    }
}

.progress-fill.animated {
    animation: barGrow 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ringDash {
    from {
        stroke-dashoffset: var(--ring-circumference);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 380px) {
    .tab-btn span {
        font-size: 11px;
    }

    .stats-grid {
        gap: 8px;
    }

    .ring-container {
        width: 68px;
        height: 68px;
    }

    .ring-value {
        font-size: 15px;
    }

    .calendar-cell {
        font-size: 10px;
    }
}

@media (min-width: 430px) {
    body {
        max-width: 430px;
        margin: 0 auto;
    }
}

/* ============ DAY EFFICIENCY CARD ============ */
.day-efficiency-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
    gap: 12px;
}

.day-efficiency-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.day-efficiency-card.eff-high::before {
    background: linear-gradient(90deg, #22d97f, #00f0ff);
}

.day-efficiency-card.eff-good::before {
    background: linear-gradient(90deg, #00f0ff, #8b5cf6);
}

.day-efficiency-card.eff-mid::before {
    background: linear-gradient(90deg, #ff9f43, #ffd23f);
}

.day-efficiency-card.eff-low::before {
    background: linear-gradient(90deg, #ff9f43, #ff5a5a);
}

.day-efficiency-card.eff-bad::before {
    background: linear-gradient(90deg, #ff5a5a, #c0392b);
}

.eff-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.eff-emoji {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.eff-texts {
    min-width: 0;
}

.eff-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.eff-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eff-gauge-wrap {
    position: relative;
    width: 120px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eff-gauge {
    display: block;
    overflow: visible;
}

.eff-value-wrap {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.eff-value {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.eff-unit {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Override gradient for efficiency color zones */
.eff-high .eff-value {
    background: linear-gradient(90deg, #22d97f, #00f0ff);
    -webkit-background-clip: text;
    background-clip: text;
}

.eff-good .eff-value {
    background: linear-gradient(90deg, #00f0ff, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
}

.eff-mid .eff-value {
    background: linear-gradient(90deg, #ff9f43, #ffd23f);
    -webkit-background-clip: text;
    background-clip: text;
}

.eff-low .eff-value {
    background: linear-gradient(90deg, #ff9f43, #ff5a5a);
    -webkit-background-clip: text;
    background-clip: text;
}

.eff-bad .eff-value {
    background: linear-gradient(90deg, #ff5a5a, #c0392b);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ============ INSIGHT FIELDS (Слабое звено / Инсайт) ============ */
.task-insight-fields {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-insight-row {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.task-insight-label {
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 2px;
}

.task-insight-val {
    color: var(--text-secondary);
}

/* ============ DAY-LEVEL WEAK LINK / INSIGHT CARD ============ */
.day-insight-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent-orange);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

body.light .day-insight-card {
    border-left-color: #d97706;
}

.day-insight-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-insight-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.day-insight-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ============ DATE NAVIGATOR ============ */
.date-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 6px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    gap: 8px;
}

body.light .date-navigator {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.date-nav-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.date-nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-cyan);
    border-color: rgba(0, 240, 255, 0.2);
}

.date-nav-btn:active {
    transform: scale(0.92);
}

body.light .date-nav-btn:hover {
    border-color: rgba(0, 153, 204, 0.25);
}

.date-nav-center {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.date-nav-main {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.date-nav-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.date-nav-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(0, 240, 255, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light .date-nav-badge {
    background: rgba(0, 153, 204, 0.1);
    border-color: rgba(0, 153, 204, 0.2);
    color: var(--accent-cyan);
}

/* ============ TASK SUMMARY CARD ============ */
.task-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

body.light .task-summary-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.task-summary-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-summary-count {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.task-summary-done {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.task-summary-sep {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-muted);
}

.task-summary-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
}

.task-summary-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-summary-ring {
    position: relative;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
}

.mini-ring-value {
    position: relative;
    font-size: 11px;
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ TASK STATUS ICONS ============ */
.task-card-body {
    flex: 1;
    min-width: 0;
}

.task-status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.task-status-icon.task-done {
    background: rgba(34, 217, 127, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 217, 127, 0.25);
}

.task-status-icon.task-progress {
    background: rgba(0, 240, 255, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.task-status-icon.task-pending {
    background: rgba(85, 85, 112, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(85, 85, 112, 0.25);
}

.today-task-card.task-done {
    border-left: 3px solid var(--accent-green);
}

.today-task-card.task-progress {
    border-left: 3px solid var(--accent-cyan);
}

.today-task-card.task-pending {
    border-left: 3px solid var(--text-muted);
    opacity: 0.75;
}

/* ============ WEEK DAY CARDS (Tasks view) ============ */
.week-day-card {
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.week-day-card:last-child {
    margin-bottom: 0;
}

.week-day-card.is-today {
    border-left: 3px solid var(--accent-cyan);
    background: var(--bg-card-hover);
}

.week-day-card.is-weekend {
    opacity: 0.55;
}

body.light .week-day-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.week-day-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-day-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.week-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 12px;
}

.today-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 14px rgba(0, 240, 255, 0.7);
    }
}

.week-day-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.week-day-bar {
    width: 100%;
    height: 5px;
    background: var(--bg-elevated);
    border-radius: 10px;
    overflow: hidden;
}

.week-day-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--gradient-green);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.week-day-empty {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* ============ MONTH SUMMARY (Tasks) ============ */
.task-month-summary {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 20px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

body.light .task-month-summary {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.task-month-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.task-month-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.task-month-stat-value.accent {
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.task-month-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.task-month-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
}

/* ============ CALENDAR TASK CELLS ============ */
.task-cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: default;
}

.cal-task-count {
    font-size: 7px;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.empty-state p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}