:root {
    --bg-color: var(--tg-theme-bg-color, #fff);
    --text-color: var(--tg-theme-text-color, #000);
    --hint-color: var(--tg-theme-hint-color, #888);
    --link-color: var(--tg-theme-link-color, #2481cc);
    --button-color: var(--tg-theme-button-color, #2481cc);
    --button-text-color: var(--tg-theme-button-text-color, #fff);
    --secondary-bg-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#app {
    padding: 16px;
    padding-bottom: 80px;
    /* Space for FAB */
}

h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

/* Tabs */
#tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--hint-color);
}

.tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--hint-color);
    font-weight: 500;
    cursor: pointer;
}

.tab.active {
    color: var(--link-color);
    border-bottom: 2px solid var(--link-color);
}

/* List Items */
.med-item,
.history-item {
    background-color: var(--secondary-bg-color);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.med-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.med-info p {
    margin: 0;
    font-size: 14px;
    color: var(--hint-color);
}

.delete-btn {
    color: #ff3b30;
    background: none;
    border: none;
    font-size: 20px;
    padding: 8px;
}

/* FAB */
#add-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--button-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* Modal */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#med-modal,
#workout-group-modal,
#workout-variant-modal,
#workout-exercise-modal,
#bp-modal,
#weight-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-color);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 11;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

#workout-session-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-color);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 11;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}


#med-modal.hidden,
#workout-group-modal.hidden,
#workout-variant-modal.hidden,
#workout-exercise-modal.hidden,
#bp-modal.hidden,
#weight-modal.hidden,
#workout-session-modal.hidden,
#modal-overlay.hidden,
.view {
    display: none;
}

.view.active {
    display: block;
}

input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--hint-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 16px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

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

.secondary {
    background-color: var(--secondary-bg-color);
    color: var(--text-color);
}

/* Schedule Form */
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--hint-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* Day Selector */
.days-select {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.days-select span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-bg-color);
    font-size: 12px;
    cursor: pointer;
    border: 2px solid transparent;
}

.days-select span.selected {
    background: var(--button-color);
    color: var(--button-text-color);
    border-color: var(--button-color);
}

/* Time Inputs */
.time-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.remove-time {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.small-btn {
    background: none;
    color: var(--link-color);
    border: none;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    cursor: pointer;
}

/* Archived Medications */
.med-item.archived {
    opacity: 0.5;
}

.med-item.archived h4 {
    text-decoration: line-through;
}

/* Form Row */
.form-row {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* History Grouping */
.history-group {
    background-color: var(--secondary-bg-color);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.history-header {
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-items {
    padding-left: 28px;
    /* Indent under icon */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-subitem {
    background: rgba(0, 0, 0, 0.05);
    /* slightly clearer than bg */
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    display: inline-block;
}

/* Dark mode adjustment if needed */
@media (prefers-color-scheme: dark) {
    .history-subitem {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Weekly Hub */
#weekly-hub-container {
    background-color: var(--secondary-bg-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.weekly-header {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-color);
}

.weekly-days {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.day-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

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

.day-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e0e0e0;
    /* Default empty/pending */
    position: relative;
    /* We will use conic-gradient via inline style for charts */
}

.day-date {
    font-size: 10px;
    color: var(--hint-color);
    margin-top: 4px;
}

/* BP Section */
.bp-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.bp-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

#bp-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bp-item {
    background-color: var(--secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bp-reading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bp-values {
    font-size: 20px;
    font-weight: 600;
}

.bp-values .bp-sys {
    color: var(--text-color);
}

.bp-values .bp-dia {
    color: var(--hint-color);
    font-weight: 400;
    font-size: 16px;
}

.bp-meta {
    font-size: 12px;
    color: var(--hint-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.bp-pulse {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.bp-category {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.bp-category.normal {
    background: #d4edda;
    color: #155724;
}

.bp-category.highnormal {
    background: #fff3cd;
    color: #856404;
}

.bp-category.grade1 {
    background: #ffe5d5;
    color: #c45a00;
}

.bp-category.grade2 {
    background: #f8d7da;
    color: #721c24;
}

/* BP Date Groups */
.bp-date-group {
    margin-bottom: 16px;
}

.bp-date-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--hint-color);
    padding: 8px 0;
    border-bottom: 1px solid var(--secondary-bg-color);
    margin-bottom: 8px;
}

/* BP Modal */
#bp-modal h3 {
    margin: 0;
    font-size: 18px;
}

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

.modal-header .actions {
    margin: 0;
}

.bp-inputs-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.bp-input-group {
    flex: 1;
}

.bp-input-group label {
    display: block;
    font-size: 12px;
    color: var(--hint-color);
    margin-bottom: 4px;
}

.bp-input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--hint-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 16px;
    text-align: center;
}

#bp-notes {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--hint-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

#bp-list:empty::before {
    content: 'No blood pressure readings yet.';
    display: block;
    text-align: center;
    color: var(--hint-color);
    padding: 40px 20px;
}

/* Weight Section */
.weight-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.weight-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

#weightChart {
    height: 250px;
    margin-bottom: 20px;
    background: var(--secondary-bg-color);
    border-radius: 8px;
    padding: 20px 10px;
    box-sizing: border-box;
    position: relative;
}

svg.chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-line {
    fill: none;
    stroke: #4ECDC4;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point {
    fill: #4ECDC4;
    stroke: var(--bg-color);
    stroke-width: 2;
}

.chart-area {
    fill: rgba(78, 205, 196, 0.1);
    stroke: none;
}

.chart-label {
    font-size: 10px;
    fill: var(--hint-color);
    text-anchor: middle;
}

.chart-grid {
    stroke: var(--hint-color);
    stroke-width: 0.5;
    opacity: 0.2;
    stroke-dasharray: 4 4;
}

.chart-goal-line {
    stroke: #22c55e;
    stroke-width: 2;
    stroke-dasharray: 6 4;
}

.chart-plan-line {
    stroke: #67e8f9;
    stroke-width: 2;
    opacity: 0.7;
}

/* Weight Stats Container */
#weight-stats {
    margin: 16px 0;
}

.weight-stats-container {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: var(--secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.weight-stats-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weight-stat-item {
    font-size: 13px;
    line-height: 1.5;
}

.weight-stat-label {
    color: var(--hint-color);
    font-weight: 400;
}

.weight-stat-value {
    font-weight: 600;
    color: var(--text-color);
}

/* BP Chart Styles */
#bpChart {
    width: 100%;
    height: 200px;
    background: var(--secondary-bg-color);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

#bp-averages {
    margin-bottom: 16px;
}

.bp-avg-row {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.bp-avg-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bp-avg-label {
    font-size: 12px;
    color: var(--hint-color);
}

.bp-avg-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.bp-chart-systolic {
    stroke: #22c55e;
    stroke-width: 2;
    fill: none;
}

.bp-chart-diastolic {
    stroke: #3b82f6;
    stroke-width: 2;
    fill: none;
}

.bp-chart-pulse {
    stroke: #ef4444;
    stroke-width: 1.5;
    fill: none;
}

.bp-chart-target {
    stroke: #f97316;
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    opacity: 0.8;
}

.bp-chart-point-sys {
    fill: #22c55e;
}

.bp-chart-point-dia {
    fill: #3b82f6;
}

.bp-chart-point-pulse {
    fill: #ef4444;
}

/* BP classification colors for points */
.bp-chart-point-normal {
    fill: #22c55e;
    stroke: var(--bg-color);
    stroke-width: 2;
}

.bp-chart-point-highnormal {
    fill: #eab308;
    stroke: var(--bg-color);
    stroke-width: 2;
}

.bp-chart-point-grade1 {
    fill: #f97316;
    stroke: var(--bg-color);
    stroke-width: 2;
}

.bp-chart-point-grade2 {
    fill: #ef4444;
    stroke: var(--bg-color);
    stroke-width: 2;
}

/* Average line styling */
.bp-chart-avg-line {
    stroke: var(--hint-color);
    stroke-width: 2;
    stroke-dasharray: 6 4;
    opacity: 0.6;
}

#weight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.weight-item {
    background-color: var(--secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weight-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weight-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.weight-trend {
    font-size: 14px;
    color: var(--hint-color);
}

.weight-meta {
    font-size: 12px;
    color: var(--hint-color);
}

#weight-list:empty::before {
    content: 'No weight logs yet.';
    display: block;
    text-align: center;
    color: var(--hint-color);
    padding: 40px 20px;
}

#weight-modal h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

/* Inventory Section */
.inventory-section {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--secondary-bg-color);
    border-radius: 8px;
}

.inventory-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    background: rgba(78, 205, 196, 0.15);
    color: #2d9c93;
    margin-top: 6px;
}

.inventory-badge.low {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.restock-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.restock-row input {
    width: 80px;
    margin-bottom: 0;
}

.restock-history {
    margin-top: 12px;
    font-size: 12px;
    color: var(--hint-color);
}

.restock-history ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.restock-history li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.hint {
    font-size: 12px;
    color: var(--hint-color);
    margin: 4px 0;
}

/* Weight Ruler Component */
.weight-display-container {
    margin: 20px 0;
    text-align: center;
}

.weight-display {
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: 16px;
    padding: 24px 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 200px;
}

.weight-display-input {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: transparent;
    border: none;
    color: var(--bg-color);
    width: 120px;
    text-align: right;
    outline: none;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
    /* Remove spinner in Firefox */
}

.weight-display-input::-webkit-inner-spin-button,
.weight-display-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.weight-display-unit {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.8;
}

.weight-ruler-container {
    position: relative;
    height: 120px;
    margin: 24px 0;
    overflow: hidden;
    background: linear-gradient(to bottom, #f59e0b, #f59e0b);
    border-radius: 12px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x;
}

.weight-ruler-container:active {
    cursor: grabbing;
}

.weight-ruler {
    position: absolute;
    height: 100%;
    display: flex;
    align-items: flex-end;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.weight-tick {
    position: absolute;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.6);
}

.weight-tick.major {
    height: 45%;
    width: 2px;
    background: rgba(0, 0, 0, 0.8);
}

.weight-tick.minor {
    height: 25%;
}

.weight-tick-label {
    position: absolute;
    bottom: 55%;
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
    transform: translateX(-50%);
    white-space: nowrap;
}

.weight-ruler-indicator {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(0, 0, 0, 0.9);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
}

.weight-ruler-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid rgba(0, 0, 0, 0.9);
}

/* Exercise Log Entry */
.exercise-log-entry {
    background: var(--secondary-bg-color);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.exercise-log-entry h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.log-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.log-input-group {
    flex: 1;
}

.log-input-group label {
    display: block;
    font-size: 0.8em;
    color: var(--hint-color);
    margin-bottom: 4px;
}

.log-input-group input {
    margin-bottom: 0;
    padding: 8px;
}

/* Next Workout Card */
.next-workout-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.next-workout-card.notified,
.next-workout-card.in-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left: 4px solid #ffd700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.next-workout-card.today {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-left: 4px solid #fff;
}

.next-workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85em;
}

.next-workout-status {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.next-workout-card.notified .next-workout-status,
.next-workout-card.in-progress .next-workout-status,
.next-workout-card.today .next-workout-status {
    color: rgba(255, 255, 255, 0.95);
}

.next-workout-date {
    opacity: 0.8;
}

.next-workout-info h3 {
    margin: 0 0 6px 0;
    font-size: 1.3em;
}

.next-workout-info p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.95em;
}

.next-workout-card.notified .next-workout-info h3,
.next-workout-card.in-progress .next-workout-info h3,
.next-workout-card.today .next-workout-info h3 {
    color: white;
}

.next-workout-card.notified .next-workout-info p,
.next-workout-card.in-progress .next-workout-info p,
.next-workout-card.today .next-workout-info p {
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== Sync Status Styles ==================== */

/* Sync Status Bar */
.sync-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.sync-status-bar.offline {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.sync-status-bar.syncing {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.sync-status-bar.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.sync-status-bar.synced {
    background: var(--secondary-bg-color);
    color: var(--hint-color);
    border: 1px solid transparent;
    padding: 4px 16px;
}

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

.sync-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Pending Sync Indicator on Items */
.pending-sync {
    border-left: 4px solid #f59e0b !important;
    position: relative;
}

.sync-pending-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toast Notifications */
.sync-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    text-align: center;
}

.sync-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.sync-toast.info {
    background: #1e40af;
    color: white;
}

.sync-toast.success {
    background: #059669;
    color: white;
}

.sync-toast.error {
    background: #dc2626;
    color: white;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .sync-status-bar.offline {
        background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
        color: #fecaca;
        border-color: #b91c1c;
    }

    .sync-status-bar.syncing {
        background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
        color: #bae6fd;
        border-color: #0369a1;
    }

    .sync-status-bar.pending {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
        color: #fde68a;
        border-color: #b45309;
    }

    .sync-pending-badge {
        background: #78350f;
        color: #fde68a;
    }
}

/* Settings Toggle Styles */
.setting-item {
    background-color: var(--secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.setting-item h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.setting-desc {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--hint-color);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle 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: .4s;
    border-radius: 34px;
}

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

input:checked+.toggle-slider {
    background-color: var(--link-color);
}

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