/* ==============================
   VARIABLES PRINCIPALES
============================== */
:root {
    --primary: #2563eb;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
    --header-bg: #ffffff;
    --danger: #ef4444;
}

/* ==============================
   DARK MODE
============================== */
body.dark-theme {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --border: #334155;
    --header-bg: #1e293b;
}

/* ==============================
   BODY
============================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 15px;
    transition: background 0.3s, color 0.3s;
}

/* ==============================
   HEADER
============================== */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: var(--header-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0;
    color: var(--text);
}

#theme-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
#theme-toggle:hover { opacity: 0.85; }

#portfolio-link {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    text-decoration: none;
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#portfolio-link svg { display: block; }
#portfolio-link .pl-arrow { opacity: 0.85; }
#portfolio-link:hover {
    transform: translateY(calc(-50% - 1px));
    box-shadow: 0 6px 22px rgba(79, 70, 229, 0.6);
}

/* ==============================
   TOTAL DESTACADO (Arriba)
============================== */
.total-box {
    text-align: center;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.total-box h2 { 
    margin: 0; 
    font-size: 1.2rem; 
    font-weight: 500;
    opacity: 0.8;
}
.total-box strong { 
    font-size: 2.2rem; 
    color: var(--primary);
    display: block;
    margin-top: 5px;
}

/* ==============================
   JSON CONTROLS (Abajo)
============================== */
.json-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.json-controls button {
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
    flex: 1; /* Botones igual ancho */
    min-width: 150px;
    transition: opacity 0.2s;
}
.json-controls button:hover { opacity: 0.85; }

.json-import { background-color: #3b82f6; } /* azul */
.json-export { background-color: #10b981; } /* verde */

/* Switch Toggle EUR/USD */
.currency-switch { 
    display: flex; 
    align-items: center; 
    gap: 10px;
    background-color: var(--bg);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: bold;
}

.switch { 
    position: relative; 
    display: inline-block; 
    width: 40px; 
    height: 20px; 
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider { 
    position: absolute; cursor: pointer; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background-color: #cbd5e1; transition: .4s; border-radius: 20px; 
}
.slider:before { 
    position: absolute; content: ""; 
    height: 14px; width: 14px; 
    left: 3px; bottom: 3px; 
    background-color: white; transition: .4s; border-radius: 50%; 
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* ==============================
   FORMULARIO
============================== */
.form-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

#crypto-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

#crypto-form input, #crypto-form button {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

#crypto-form button {
    background: var(--primary);
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
#crypto-form button:hover { opacity: 0.9; }

/* ==============================
   TABLA RESPONSIVE
============================== */
.table-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: rgba(0,0,0,0.02);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

/* Pestañas por año */
/* Misma fórmula que los chips de activos (.asset-chips), que sí desliza */
.year-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 0 4px 10px;
    scrollbar-width: thin;
    margin-bottom: 10px;
}
.year-tabs::-webkit-scrollbar { height: 5px; }
.year-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.year-tab {
    flex: 0 0 auto; /* que no se encojan: desbordan y se deslizan */
    scroll-snap-align: center;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.year-tab:hover { opacity: 0.85; }
.year-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Aviso de backup */
.backup-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: bold;
}
.backup-banner button {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: #f59e0b;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* Barra de búsqueda */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 10px;
}
.search-icon { font-size: 1rem; }
.search-bar input[type="text"] {
    flex: 1;
    min-width: 140px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.search-count {
    font-size: 0.85rem;
    opacity: 0.7;
    white-space: nowrap;
}
.date-range-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    opacity: 0.85;
    white-space: nowrap;
}
.date-range-label input {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.85rem;
}
.limpiar-filtros-btn {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 0.8rem;
}
.limpiar-filtros-btn:hover { opacity: 0.8; }

/* Barra de restauración de backup */
.restore-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.restore-bar select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}
.restore-bar button {
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* Comparativa año anterior */
/* Comparativa anual: mini tabla clara (2 años + diferencia) */
.stats-comparison {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.stats-comparison .cmp-toplbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 10px;
}
.stats-comparison .cmp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
}
.stats-comparison .cmp-yr {
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.7;
}
.stats-comparison .cmp-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.stats-comparison .cmp-row.cur .cmp-yr { opacity: 1; font-weight: 600; }
.stats-comparison .cmp-row.prev .cmp-val { color: #94a3b8; }
.stats-comparison .cmp-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}
.stats-comparison .cmp-row.diff .cmp-yr { color: #2563eb; font-weight: 700; opacity: 1; }
.stats-comparison .cmp-row.diff .cmp-val { color: #2563eb; font-size: 1.15rem; }
body.dark-theme .stats-comparison .cmp-row.diff .cmp-yr,
body.dark-theme .stats-comparison .cmp-row.diff .cmp-val { color: #60a5fa; }
.stats-comparison .cmp-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.16);
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    margin-left: 8px;
}
body.dark-theme .stats-comparison .cmp-pill { color: #60a5fa; }

/* Cabeceras ordenables */
th.sortable {
    cursor: pointer;
    user-select: none;
}
th.sortable:hover { opacity: 0.8; }
th.sortable .sort-arrow {
    font-size: 0.75em;
    opacity: 0.6;
    margin-left: 4px;
}

/* Toast deshacer */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
}
.toast button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Sección plegable de estadísticas + gráfico */
.stats-details {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 10px;
}
.stats-details summary {
    cursor: pointer;
    font-weight: bold;
    padding: 4px 0;
    color: var(--text);
    user-select: none;
}
.stats-details summary:hover { opacity: 0.85; }

/* Resumen por activo */
.stats-summary {
    padding: 10px 0 4px;
}
.stats-line {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Selección rápida de moneda (chips recurrentes sobre el formulario) */
.coin-quick {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: nowrap; /* etiqueta + chips en una fila; los chips se deslizan */
}
.coin-quick-label {
    flex: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
}
/* Misma fórmula que .asset-chips (+ flex:1/min-width:0 por ser hijo flex) */
.coin-quick-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 0 4px 10px;
    scrollbar-width: thin;
}
.coin-quick-chips::-webkit-scrollbar { height: 5px; }
.coin-quick-chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.coin-quick-chip {
    flex: 0 0 auto; /* no se encogen: desbordan y se deslizan */
    scroll-snap-align: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 11px 5px 7px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.coin-quick-chip:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Icono de moneda (logo CoinGecko + fallback monograma) */
.coin-ic {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: none;
}
.coin-ic-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}
.coin-ic-mono {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.3px;
}
.coin-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

/* Tarjetas KPI (media mensual / coste medio / frecuencia) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
/* Pantallas medias: 2+2 (nunca 3+1). El móvil ≤600px ya baja a 1 por fila. */
@media (min-width: 601px) and (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
.kpi-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
}
.kpi-ic {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.kpi-ic svg { display: block; }
.kpi-ic.b { background: rgba(59, 130, 246, 0.16); color: #2563eb; }
.kpi-ic.v { background: rgba(139, 92, 246, 0.16); color: #7c3aed; }
.kpi-ic.a { background: rgba(245, 158, 11, 0.16); color: #d97706; }
body.dark-theme .kpi-ic.b { color: #60a5fa; }
body.dark-theme .kpi-ic.v { color: #a78bfa; }
body.dark-theme .kpi-ic.a { color: #fbbf24; }
.kpi-lab {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 2px;
}
.kpi-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.asset-chips-wrapper {
    position: relative;
}
.asset-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 2px 4px 10px;
    scrollbar-width: thin;
}
.asset-chips::-webkit-scrollbar { height: 5px; }
.asset-chips::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Fundido en los bordes para insinuar que hay más contenido al deslizar */
.asset-chips-wrapper::before,
.asset-chips-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 10px;
    width: 24px;
    pointer-events: none;
    z-index: 1;
}
.asset-chips-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--card-bg), transparent);
}
.asset-chips-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--card-bg), transparent);
}

.asset-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 110px;
}
.asset-chip .asset-chip-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.asset-chip .asset-chip-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.asset-chip .asset-chip-pct {
    opacity: 0.65;
    font-size: 0.8em;
}
.asset-chip > div:not(.asset-chip-top):not(.asset-chip-bar) {
    margin-bottom: 6px;
    font-size: 0.95em;
}
.asset-chip .asset-chip-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    overflow: hidden;
}
.asset-chip .asset-chip-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

/* Gráfico */
.chart-wrapper {
    overflow-x: auto;
    padding-top: 6px;
}
.chart-title {
    font-size: 0.85rem;
    font-weight: bold;
    opacity: 0.75;
    margin-bottom: 8px;
}
#spend-chart {
    max-width: 100%;
}

.json-export-csv { background-color: #f59e0b; } /* naranja */

/* Botón Borrar */
.btn-delete {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-delete:hover { opacity: 0.8; }

/* ==============================
   MEDIA QUERIES RESPONSIVE
============================== */
@media (max-width: 600px) {
    header h1 { font-size: 1.2rem; }

    /* En móvil dejamos solo el icono de cartera para no chocar con el título */
    #portfolio-link span, #portfolio-link .pl-arrow { display: none; }
    #portfolio-link { padding: 8px 11px; gap: 0; }

    /* Tarjetas KPI apiladas para que no queden apretadas */
    .kpi-grid { grid-template-columns: 1fr; }

    /* En móvil, los botones se apilan */
    .json-controls {
        flex-direction: column;
    }
    
    .json-controls button, .currency-switch {
        width: 100%;
        box-sizing: border-box;
    }

    /* Formulario apilado */
    #crypto-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Tabla ajustada */
    .table-wrapper {
        margin: 0 -15px;
        border-radius: 0;
        width: calc(100% + 30px);
    }

    /* Barra de búsqueda y filtros de fecha apilados */
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-bar input[type="text"] { width: 100%; }
    .date-range-label { justify-content: space-between; }
    .search-count { text-align: center; }

    /* Aviso de backup y restauración apilados */
    .backup-banner, .restore-bar {
        flex-direction: column;
    }

    /* Toast no se corta en pantallas estrechas */
    .toast {
        left: 15px;
        right: 15px;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

/* Landscape con poca altura (móvil apaisado): compactar secciones altas.
   El alto real del canvas lo fija app.js (ajustarTamanoCanvas), no CSS,
   para no desincronizar la resolución de dibujo con el tamaño mostrado. */
@media (max-width: 900px) and (max-height: 420px) and (orientation: landscape) {
    header { position: static; }
    .form-container, .stats-details { padding: 10px; }
}

/* ==============================
   SYNC ENTRE DISPOSITIVOS
   ============================== */
.json-sync {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background-color: #6366f1; /* indigo */
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.json-sync:hover { opacity: 0.85; }
.json-sync.sync-on { background-color: #16a34a; } /* verde = conectado */
.json-sync svg { display: block; }

/* Chivato de estado de sync en el título de la sección */
.sync-indicator {
    float: right;
    margin-top: 1px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    opacity: 0.6;
    letter-spacing: 0.2px;
}
.sync-indicator::before { content: '● '; }
.sync-indicator.on { color: #16a34a; border-color: #16a34a; opacity: 1; }

/* Sección "Copias y sincronización" */
.data-details .data-group { margin-top: 14px; }
.data-details .data-group + .data-group { border-top: 1px solid var(--border); padding-top: 14px; }
.data-group-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; color: var(--text); }
.data-group-desc { font-size: 0.8rem; opacity: 0.7; margin: 0 0 10px; line-height: 1.45; }

.currency-switch.currency-switch-top {
    width: fit-content;
    margin: 10px auto 0;
    justify-content: center;
}

.sync-ov {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.sync-box {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    max-width: 440px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.sync-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.sync-head h3 { margin: 0; font-size: 1.05rem; }
.sync-x {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}
.sync-x:hover { opacity: 1; }
.sync-desc {
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--text);
    opacity: 0.75;
    margin: 0 0 14px;
}
.sync-desc a { color: var(--primary); }
.sync-label {
    font-size: 0.75rem;
    opacity: 0.7;
    display: block;
    margin-bottom: 4px;
}
.sync-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}
.sync-input:focus { outline: none; border-color: var(--primary); }
.sync-status {
    font-size: 0.75rem;
    min-height: 16px;
    margin: 8px 0 12px;
    opacity: 0.7;
}
.sync-status.ok { color: #16a34a; opacity: 1; }
.sync-status.error { color: var(--danger); opacity: 1; }
.sync-status.working { color: #d97706; opacity: 1; }
.sync-actions { display: flex; gap: 10px; }
.sync-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid var(--border);
}
.sync-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.sync-secondary { background: var(--bg); color: var(--text); }
