/* Suite 3 Dashboard - Professional Grey Theme */

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

:root,
[data-theme="light"] {
    /* Loro Piana Inspired Color Palette — Light */
    --primary-bg: #f7f5f1;
    --secondary-bg: #f0ede7;
    --tertiary-bg: #e8e3db;
    --accent-bg: #ddd6cc;
    --text-primary: #2c2a26;
    --text-secondary: #4a453d;
    --text-muted: #7a7067;
    --text-dim: #a09588;
    --accent-warm: #c5a572;
    --accent-camel: #b89968;
    --accent-sage: #9ba082;
    --accent-clay: #b47c5f;
    --border-color: #d4cfc7;
    --border-light: #e2ddd5;
    --shadow-soft: rgba(44, 42, 38, 0.08);
    --gradient-primary: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-camel) 100%);
    --status-online: #4CAF50;
    --status-offline: #f44336;
    --inactive-indicator: #999;
}

[data-theme="dark"] {
    /* Loro Piana Inspired Color Palette — Dark */
    --primary-bg: #1a1816;
    --secondary-bg: #22201c;
    --tertiary-bg: #2c2a26;
    --accent-bg: #3a3530;
    --text-primary: #e8e3db;
    --text-secondary: #d4cfc7;
    --text-muted: #a09588;
    --text-dim: #7a7067;
    --accent-warm: #c5a572;
    --accent-camel: #b89968;
    --accent-sage: #9ba082;
    --accent-clay: #b47c5f;
    --border-color: #3a3530;
    --border-light: #4a453d;
    --shadow-soft: rgba(0, 0, 0, 0.2);
    --gradient-primary: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    --gradient-accent: linear-gradient(135deg, rgba(197, 165, 114, 0.15) 0%, rgba(184, 153, 104, 0.15) 100%);
    --status-online: #66bb6a;
    --status-offline: #ef5350;
    --inactive-indicator: #5a5550;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    line-height: 1.5;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Hide header elements (removed from HTML but keep JS references working) */
#lastUpdateTime, #connectionStatus, #currentTime, #currentDate, #systemStatus, #dataAge {
    display: none !important;
}

/* Header Styles */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), var(--accent-orange));
    animation: pulse-gradient 3s ease-in-out infinite;
}

@keyframes pulse-gradient {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.dashboard-title {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.location-info {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-left: 15px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.update-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.update-time {
    color: var(--accent-green);
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.connection-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: heartbeat 2s infinite;
}

.connection-status.offline {
    background: var(--accent-red);
    animation: none;
}

@keyframes heartbeat {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.4; }
}

.current-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.time-display {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.date-display {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dashboard Grid - 4x3 responsive layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "calendar reminders execflow pilottips"
        "market upx wellness aviation";
    gap: 20px;
    flex: 1;
    height: 100%;
}

/* Tablet: 2x5 grid */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "calendar reminders"
            "execflow pilottips"
            "market aviation"
            "upx wellness";
    }
}

/* Mobile: single column, scrollable */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "calendar"
            "reminders"
            "execflow"
            "pilottips"
            "aviation"
            "market"
            "upx"
            "wellness";
    }
}

/* Block Styles */
.dashboard-block {
    background: var(--gradient-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-soft);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.dashboard-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-soft);
    background: var(--gradient-accent);
}

/* Countdown bar at top of rotating blocks */
.block-countdown-bar {
    height: 3px;
    background: var(--border-light);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.countdown-bar-fill {
    height: 100%;
    background: var(--accent-camel);
    width: 100%;
    border-radius: 20px 20px 0 0;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid var(--border-color);
}

.block-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
}

.block-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
}

.block-content {
    flex: 1;
    padding: 20px 25px;
    overflow-y: auto;
}

/* Calendar Block */
.calendar-block {
    grid-area: calendar;
}

/* Reminders Block */
.reminders-block {
    grid-area: reminders;
}

/* Market Block */
.market-block {
    grid-area: market;
}

/* UPX Block */
.upx-block {
    grid-area: upx;
}

/* ExecFlow Block - spans 2 rows */
.execflow-block {
    grid-area: execflow;
    overflow-y: auto;
}

.execflow-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.execflow-task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: var(--tertiary-bg);
    border-radius: 10px;
    border-left: 3px solid var(--accent-warm);
}

.execflow-task-item.in_progress {
    border-left-color: var(--accent-sage);
}

.execflow-task-item.pending {
    border-left-color: var(--accent-clay);
}

.execflow-task-priority {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-bg);
    color: var(--text-muted);
    text-transform: uppercase;
}

.execflow-task-priority.urgent {
    background: rgba(198, 40, 40, 0.12);
    color: #ef5350;
}

.execflow-task-priority.high {
    background: rgba(230, 81, 0, 0.12);
    color: #ff8a65;
}

.execflow-task-content {
    flex: 1;
}

.execflow-task-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.execflow-task-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Wellness Block
   ============================================ */

.wellness-block {
    grid-area: wellness;
    overflow: hidden;
}

.wellness-item-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.wellness-card {
    background: var(--tertiary-bg);
    border-radius: 14px;
    padding: 20px 22px;
    border-left: 4px solid var(--accent-sage);
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

.wellness-card.fade-out {
    opacity: 0;
}

.wellness-card.category-breathing {
    border-left-color: #7fb3d3;
}

.wellness-card.category-gabor-mate {
    border-left-color: #a78bba;
}

.wellness-card.category-mindfulness {
    border-left-color: var(--accent-sage);
}

/* Wellness category badge */
.wellness-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 6px;
    color: #fff;
}

.wellness-category-badge.badge-breathing {
    background: #7fb3d3;
    color: var(--text-primary);
}

.wellness-category-badge.badge-gabor-mate {
    background: #a78bba;
}

.wellness-category-badge.badge-mindfulness {
    background: var(--accent-sage);
}

/* Wellness icon + title row */
.wellness-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.wellness-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.wellness-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Wellness content */
.wellness-content {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

/* Gabor Maté quotes italic styling */
.wellness-card.category-gabor-mate .wellness-content {
    font-style: italic;
}

.wellness-attribution {
    display: block;
    font-style: normal;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Wellness progress / counter */
.wellness-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.wellness-counter {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    white-space: nowrap;
}

/* Wellness fade animation */
@keyframes wellnessFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wellness-card.fade-in {
    animation: wellnessFadeIn 0.5s ease-out forwards;
}

/* TV size adjustments for wellness */
@media (min-width: 1920px) {
    .wellness-title {
        font-size: 1.3rem;
    }
    .wellness-content {
        font-size: 1.2rem;
    }
}

/* Remove duplicate block definitions */

.current-event {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--tertiary-bg);
    border-radius: 16px;
    border-left: 4px solid var(--accent-warm);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.event-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-warm);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.event-details {
    flex: 1;
}

.event-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-warm);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.event-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 4px 0;
}

.event-participants {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.upcoming-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.event-item-title {
    color: var(--text-primary);
    font-weight: 500;
}

.event-item-time {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

/* Reminders Block */
.reminders-block {
    /* flows naturally in grid */
}

.reminder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.reminder-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-camel);
    flex-shrink: 0;
}

.reminder-priority.today {
    background: var(--accent-clay);
}

.reminder-content {
    flex: 1;
}

.reminder-title {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.reminder-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    gap: 10px;
}

/* Market / Numbers Block */
.market-block {
    /* flows naturally in grid */
}

.numbers-content {
    padding: 12px 20px !important;
}

.numbers-layout {
    display: flex;
    gap: 16px;
    height: 100%;
}

.numbers-market {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.numbers-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 10px;
    background: var(--tertiary-bg);
    border-radius: 8px;
}

.numbers-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 55px;
    flex-shrink: 0;
}

.numbers-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    flex: 1;
}

.numbers-divider {
    width: 1px;
    background: var(--border-color);
    align-self: stretch;
    margin: 4px 0;
}

.numbers-api {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
}

.api-totals-row {
    display: flex;
    gap: 12px;
}

.api-total-item {
    flex: 1;
    background: var(--tertiary-bg);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.api-total-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.market-change {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.market-change.positive {
    color: var(--accent-sage);
}

.market-change.negative {
    color: var(--accent-clay);
}

/* API Costs - kept for compatibility */
.api-costs-totals {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.api-cost-period {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.api-cost-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.api-cost-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.api-cost-value.cost-low {
    color: var(--accent-sage);
}

.api-cost-value.cost-medium {
    color: var(--accent-warm);
}

.api-cost-value.cost-high {
    color: var(--accent-clay);
}

/* Provider breakdown */
.api-costs-providers {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.api-provider-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--tertiary-bg);
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-weight: 500;
}

/* Agent persona costs */
.api-agent-costs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.api-persona-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--tertiary-bg);
    border-radius: 8px;
}

.api-persona-emoji {
    font-size: 1rem;
    line-height: 1;
}

.api-persona-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    flex: 1;
}

.api-persona-cost {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

/* Agent breakdown bars */
.api-costs-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-agent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
}

.api-agent-name {
    width: 80px;
    text-align: right;
    color: var(--text-muted);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.api-agent-bar-container {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.api-agent-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.api-agent-bar.bar-low {
    background: var(--accent-sage);
}

.api-agent-bar.bar-medium {
    background: var(--accent-warm);
}

.api-agent-bar.bar-high {
    background: var(--accent-clay);
}

.api-agent-cost {
    width: 50px;
    text-align: right;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    flex-shrink: 0;
}

/* TV adjustments for Numbers block */
@media (min-width: 1920px) {
    .numbers-layout {
        gap: 20px;
    }
    .numbers-row {
        padding: 8px 12px;
    }
    .numbers-label {
        font-size: 0.85rem;
        width: 65px;
    }
    .numbers-val {
        font-size: 1.15rem;
    }
    .market-change {
        font-size: 0.9rem;
    }
    .api-total-item {
        padding: 10px 12px;
    }
    .api-total-label {
        font-size: 0.8rem;
    }
    .api-cost-value {
        font-size: 1.3rem;
    }
    .api-costs-providers {
        font-size: 0.8rem;
    }
    .api-provider-tag {
        padding: 3px 10px;
    }
    .api-agent-row {
        font-size: 0.8rem;
        gap: 10px;
    }
    .api-agent-name {
        width: 90px;
    }
    .api-agent-bar-container {
        height: 10px;
    }
    .api-agent-cost {
        width: 60px;
    }
}

/* UPX Block */
.upx-block {
    /* flows naturally in grid */
}

/* X Block - OpenClaw Updates */
.x-block {
    /* flows naturally in grid */
}

.upx-task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: var(--tertiary-bg);
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent-camel);
    box-shadow: 0 2px 6px var(--shadow-soft);
}

.upx-task-item.priority {
    border-left-color: var(--accent-clay);
}

/* X Updates Block Styles */
.x-updates-list {
    max-height: 100%;
    overflow-y: auto;
}

.x-update-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: var(--tertiary-bg);
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent-sage);
    box-shadow: 0 2px 6px var(--shadow-soft);
    transition: background-color 0.2s ease;
}

.x-update-item:hover {
    background: var(--accent-bg);
}

.x-update-content {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.x-update-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.x-update-author {
    font-weight: 600;
    color: var(--text-secondary);
}

.x-update-time {
    color: var(--text-dim);
}

.x-update-link {
    color: var(--accent-sage);
    text-decoration: none;
    margin-left: 10px;
    font-size: 1.1em;
}

.x-update-link:hover {
    opacity: 0.7;
}

.upx-task-content {
    flex: 1;
}

.upx-task-title {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.upx-task-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================
   Check Ride Tips Block
   ============================================ */

/* Grid area assignment */
.checkride-block {
    grid-area: pilottips;
    overflow: hidden;
}

.aviation-block {
    grid-area: aviation;
    overflow: hidden;
}

/* Counter in header (hidden - no more check ride) */
.checkride-counter {
    display: none;
}

.days-left {
    display: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-clay);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    background: rgba(180, 124, 95, 0.12);
    padding: 3px 10px;
    border-radius: 8px;
    letter-spacing: 0.3px;
}

.days-left.urgent {
    color: #c62828;
    background: rgba(198, 40, 40, 0.1);
    animation: pulse 1.5s infinite;
}

/* Tip container */
.checkride-tip-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.checkride-tips-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

.checkride-tips-stack.fade-out {
    opacity: 0;
}

.checkride-tips-stack.fade-in {
    animation: tipFadeIn 0.5s ease-out forwards;
}

.checkride-tip-card {
    background: var(--tertiary-bg);
    border-radius: 12px;
    padding: 14px 18px;
    border-left: 4px solid var(--accent-sage);
}

.checkride-tip-card.importance-high {
    border-left-color: var(--accent-clay);
    box-shadow: 0 0 0 1px rgba(180, 124, 95, 0.15);
}

/* Category badge */
.checkride-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    color: #fff;
}

/* Category colors */
.checkride-category-badge.cat-airspace      { background: #5c6bc0; }
.checkride-category-badge.cat-weather       { background: #42a5f5; }
.checkride-category-badge.cat-navigation    { background: #26a69a; }
.checkride-category-badge.cat-regulations   { background: #8d6e63; }
.checkride-category-badge.cat-emergency     { background: #ef5350; }
.checkride-category-badge.cat-systems       { background: #7e57c2; }
.checkride-category-badge.cat-performance   { background: #66bb6a; }
.checkride-category-badge.cat-aerodynamics  { background: #ffa726; color: var(--text-primary); }
.checkride-category-badge.cat-radio         { background: #78909c; }
.checkride-category-badge.cat-airport       { background: #ab47bc; }

/* Tip title */
.checkride-tip-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Tip content */
.checkride-tip-content {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.45;
    white-space: pre-line;
}

/* Progress bar area */
.checkride-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-camel);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.tip-count {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    white-space: nowrap;
}

/* Tip fade animation */
@keyframes tipFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* fade-in handled by .checkride-tips-stack */

/* TV size adjustments for checkride */
@media (min-width: 1920px) {
    .checkride-tip-title {
        font-size: 1.15rem;
    }
    .checkride-tip-content {
        font-size: 1.05rem;
    }
    .days-left {
        font-size: 1.1rem;
    }
    .checkride-tip-card {
        padding: 16px 20px;
    }
}

/* Loading States */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px 20px;
    text-align: center;
}

/* Footer */
.dashboard-footer {
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.system-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.system-status.error {
    color: var(--accent-red);
}

.data-age.stale {
    color: var(--accent-orange);
}

/* Responsive Design for Large Screens (TV) */
@media (min-width: 1920px) {
    .dashboard-title {
        font-size: 1.1rem;
    }
    
    .location-info {
        font-size: 1.1rem;
    }
    
    .time-display {
        font-size: 2.2rem;
    }
    
    .block-title {
        font-size: 1.6rem;
    }
    
    .market-value {
        font-size: 1.5rem;
    }
    
    .dashboard-container {
        padding: 30px;
        gap: 25px;
    }
    
    .block-content {
        padding: 25px 30px;
    }
}

/* Tablet adjustments */
@media (max-width: 1200px) {
    .dashboard-container {
        padding: 15px;
        gap: 15px;
        height: auto;
        min-height: 100vh;
    }
    
    body {
        overflow: auto;
    }
    
    .main-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        align-items: center;
    }
    
    .block-content {
        padding: 15px;
    }
    
    .dashboard-block {
        min-height: 200px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 12px;
        gap: 12px;
        height: auto;
        min-height: 100vh;
    }
    
    body {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .dashboard-grid {
        gap: 12px;
    }
    
    .block-title {
        font-size: 1.05rem;
    }
    
    .block-header {
        padding: 14px 16px 10px;
    }
    
    .block-content {
        padding: 12px 16px;
    }
    
    .dashboard-block {
        border-radius: 14px;
        min-height: auto;
    }
    
    /* Calendar mobile */
    .current-event {
        padding: 14px;
        border-radius: 12px;
        margin-bottom: 14px;
    }
    
    .event-time {
        font-size: 1rem;
    }
    
    .event-title {
        font-size: 0.95rem;
    }
    
    /* Numbers / Market mobile — stack vertically */
    .numbers-layout {
        flex-direction: column;
        gap: 12px;
    }
    
    .numbers-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
    
    .numbers-row {
        padding: 5px 8px;
    }
    
    .numbers-label {
        font-size: 0.7rem;
        width: 50px;
    }
    
    .numbers-val {
        font-size: 0.9rem;
    }
    
    .api-totals-row {
        gap: 8px;
    }
    
    .api-total-item {
        padding: 6px 8px;
    }
    
    .api-agent-name {
        width: 60px;
        font-size: 0.65rem;
    }
    
    /* Check ride mobile */
    .checkride-tip-card {
        padding: 12px 14px;
    }
    
    .checkride-tip-title {
        font-size: 0.9rem;
    }
    
    .checkride-tip-content {
        font-size: 0.85rem;
    }
    
    .days-left {
        font-size: 0.85rem;
    }
    
    /* Wellness mobile */
    .wellness-card {
        padding: 14px 16px;
    }
    
    .wellness-title {
        font-size: 0.95rem;
    }
    
    .wellness-content {
        font-size: 0.9rem;
    }
    
    /* ExecFlow mobile */
    .execflow-task-item {
        padding: 10px 12px;
    }
    
    .execflow-task-title {
        font-size: 0.85rem;
    }
    
    /* UPX mobile */
    .upx-task-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    /* Disable hover effects on mobile */
    .dashboard-block:hover {
        transform: none;
        box-shadow: 0 4px 16px var(--shadow-soft);
        background: var(--gradient-primary);
    }
    
    /* Reminders mobile */
    .reminder-title {
        font-size: 0.9rem;
    }
    
    .reminder-meta {
        font-size: 0.75rem;
    }
}

/* ============================================
   Aviation Weather Block
   ============================================ */

.aviation-weather-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aviation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.aviation-station {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.aviation-flight-cat {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 8px;
    color: #fff;
}

.aviation-flight-cat.cat-vfr { background: var(--accent-sage); }
.aviation-flight-cat.cat-mvfr { background: #5c6bc0; }
.aviation-flight-cat.cat-ifr { background: var(--accent-warm); color: var(--text-primary); }
.aviation-flight-cat.cat-lifr { background: var(--accent-clay); }

.aviation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.aviation-detail-item {
    background: var(--tertiary-bg);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aviation-detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aviation-detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.aviation-raw {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    padding: 6px 10px;
    background: var(--tertiary-bg);
    border-radius: 6px;
    word-break: break-all;
    line-height: 1.4;
}

/* Aviation fade transitions */
.aviation-weather-container {
    transition: opacity 0.4s ease-in-out;
}
.aviation-weather-container.aviation-fade-out {
    opacity: 0;
}
.aviation-weather-container.aviation-fade-in {
    animation: aviationFadeIn 0.4s ease-out forwards;
}
@keyframes aviationFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Aviation navigation controls */
.aviation-nav-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 10px;
}

.aviation-nav-btn {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    line-height: 1;
}

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

.aviation-add-btn {
    font-size: 1rem;
    font-weight: 700;
}

/* Aviation add form */
.aviation-add-form {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 25px;
    background: var(--tertiary-bg);
    border-bottom: 1px solid var(--border-color);
}

.aviation-add-input {
    flex: 1;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    outline: none;
}

.aviation-add-input:focus {
    border-color: var(--accent-camel);
}

.aviation-add-submit {
    font-size: 0.75rem;
    width: auto;
    padding: 0 10px;
    font-weight: 600;
}

.aviation-add-cancel {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Aviation remove nav button (next to + button) */
.aviation-remove-nav-btn {
    color: #e57373 !important;
    font-size: 1.2rem !important;
    font-weight: 700;
}

.aviation-remove-nav-btn:hover,
.aviation-remove-nav-btn:active {
    color: #fff !important;
    background: #e57373 !important;
}

/* Aviation confirm remove overlay */
.aviation-confirm-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(229, 115, 115, 0.08);
    border: 1px solid rgba(229, 115, 115, 0.2);
    border-radius: 8px;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    animation: aviationFadeIn 0.2s ease-out;
}

.aviation-confirm-remove button {
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.aviation-confirm-yes {
    background: #e57373;
    color: #fff;
    border-color: #e57373 !important;
}

.aviation-confirm-yes:hover {
    background: #ef5350;
}

.aviation-confirm-no {
    background: var(--tertiary-bg);
    color: var(--text-secondary);
}

.aviation-confirm-no:hover {
    background: var(--accent-bg);
}

/* Aviation station counter badge */
.aviation-station-counter {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-left: auto;
    margin-right: 4px;
    font-family: 'SF Mono', monospace;
}

/* Swipe hint */
.aviation-swipe-hint {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-align: center;
    opacity: 0.5;
    margin-top: 2px;
}

/* Aviation station dots */
.aviation-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}
.aviation-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s;
}
.aviation-dot.active {
    background: var(--accent-camel);
}

.aviation-taf-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding-top: 4px;
    border-top: 1px solid var(--border-light);
}

.aviation-time-info {
    font-size: 0.7rem;
    color: var(--accent-blue, #64b5f6);
    opacity: 0.7;
    margin-top: 4px;
    letter-spacing: 0.02em;
}

/* ============================================
   Team Block
   ============================================ */

/* Grid area assignment */
/* Team Toggle Button */
.team-toggle {
    position: fixed;
    top: 16px;
    right: 68px;
    z-index: 100;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 8px var(--shadow-soft);
}
.team-toggle:hover {
    background: var(--accent-bg);
    transform: scale(1.05);
}

/* Team Modal */
.team-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.team-modal-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.team-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.team-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.team-modal-close:hover { color: var(--text-primary); }

.team-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--tertiary-bg);
    border-radius: 10px;
    border-left: 3px solid var(--accent-warm);
    transition: background 0.2s;
}
.tm-row:hover { background: var(--accent-bg); }
.tm-row.brain { border-left-color: var(--accent-sage); }
.tm-emoji { font-size: 1.3rem; flex-shrink: 0; }
.tm-info { flex: 1; min-width: 0; }
.tm-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.tm-model { font-size: 0.65rem; color: var(--text-dim); background: var(--accent-bg); padding: 1px 5px; border-radius: 3px; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.tm-role { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.tm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-online); flex-shrink: 0; }

/* Scrollbar Styles */
/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.theme-toggle:hover {
    background: var(--accent-bg);
    transform: scale(1.05);
}

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

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-bg);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}