/* ═══════════════════════════════════════════════════════════════
   Falconius Crypto – Design System
   Dark-Mode with Gold/Orange Crypto accent palette
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    /* Base Colors */
    --bg-primary:     #0d0f14;
    --bg-secondary:   #131620;
    --bg-tertiary:    #1a1e2e;
    --bg-card:        #161a28;
    --bg-card-hover:  #1c2132;
    --bg-input:       #1a1e2e;
    --bg-sidebar:     #0f1119;

    /* Accent – Crypto Gold */
    --accent:         #f7931a;
    --accent-light:   #ffb84d;
    --accent-dark:    #d47a0a;
    --accent-glow:    rgba(247, 147, 26, 0.15);
    --accent-gradient: linear-gradient(135deg, #f7931a 0%, #ffb84d 100%);

    /* Semantic */
    --success:        #00d68f;
    --success-bg:     rgba(0, 214, 143, 0.1);
    --danger:         #ff4d6a;
    --danger-bg:      rgba(255, 77, 106, 0.1);
    --warning:        #ffaa00;
    --warning-bg:     rgba(255, 170, 0, 0.1);
    --info:           #4d9fff;
    --info-bg:        rgba(77, 159, 255, 0.1);

    /* Text */
    --text-primary:   #e8ecf4;
    --text-secondary: #8892a4;
    --text-muted:     #5a6478;
    --text-inverse:   #0d0f14;

    /* Borders */
    --border:         rgba(255, 255, 255, 0.06);
    --border-light:   rgba(255, 255, 255, 0.1);
    --border-accent:  rgba(247, 147, 26, 0.3);

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(247, 147, 26, 0.15);

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 56px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
    --duration-slow: 350ms;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

::selection {
    background: rgba(247, 147, 26, 0.3);
    color: #fff;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Login Screen ───────────────────────────────────────────── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(247, 147, 26, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 184, 77, 0.04) 0%, transparent 50%),
        var(--bg-primary);
    animation: loginBgShift 20s ease-in-out infinite alternate;
}

@keyframes loginBgShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.login-container {
    text-align: center;
    padding: 3rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    max-width: 420px;
    width: 100%;
    animation: loginFadeIn 0.6s var(--ease);
}

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

.login-logo { margin-bottom: 2rem; }

.login-logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.2rem;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.3)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 16px rgba(247, 147, 26, 0.5)); }
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-logo h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 77, 106, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.login-footer {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 1.5rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(247, 147, 26, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn-login {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
    border-color: var(--border-accent);
}

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--duration-slow) var(--ease);
}

.sidebar-header {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.6rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    display: flex;
    align-items: center;
}

.btn-logout:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ── Mobile Header ──────────────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    align-items: center;
    gap: 0.75rem;
    z-index: 90;
}

.btn-menu {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.3rem;
}

.mobile-title {
    font-weight: 700;
    font-size: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ── Main Content ───────────────────────────────────────────── */
.app-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 2rem;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all var(--duration) var(--ease);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── KPI Cards ──────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.kpi-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.kpi-value.positive { color: var(--success); }
.kpi-value.negative { color: var(--danger); }

.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ── Freigrenze Progress Bar ────────────────────────────────── */
.freigrenze-bar {
    margin-top: 0.75rem;
}

.freigrenze-track {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.freigrenze-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-gradient);
    transition: width 0.8s var(--ease);
}

.freigrenze-fill.warn { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.freigrenze-fill.over { background: var(--danger); }

.freigrenze-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

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

thead th {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    transition: background var(--duration) var(--ease);
}

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

tbody tr:last-child td {
    border-bottom: none;
}

.cell-mono {
    font-family: var(--mono);
    font-size: 0.82rem;
}

.cell-positive { color: var(--success); }
.cell-negative { color: var(--danger); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info);    }
.badge-neutral {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* ── Filters ────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select, .filter-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-family: var(--font);
    font-size: 0.85rem;
    transition: border-color var(--duration) var(--ease);
    min-width: 140px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
}

.pagination button {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.pagination .active {
    background: var(--accent);
    color: var(--text-inverse);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ── Charts ─────────────────────────────────────────────────── */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.chart-card canvas {
    max-height: 300px;
}

/* ── Spinner ────────────────────────────────────────────────── */
.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1rem;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ── Toast / Notification ───────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s var(--ease);
    max-width: 360px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  }
.toast-info    { border-left: 3px solid var(--info);    }

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

/* ── Print Styles ───────────────────────────────────────────── */
@media print {
    .sidebar, .mobile-header, .sidebar-overlay,
    .btn, .filter-bar, .pagination, .toast-container { display: none !important; }

    .app-content { margin-left: 0 !important; padding: 0 !important; }

    body {
        background: #fff;
        color: #000;
        font-size: 10pt;
    }

    .card, .kpi-card, .table-container, .chart-card {
        border: 1px solid #ddd;
        background: #fff;
        box-shadow: none;
        break-inside: avoid;
    }

    .kpi-value { color: #000; }
    .cell-positive { color: #006600; }
    .cell-negative { color: #cc0000; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

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

    .mobile-header {
        display: flex;
    }

    .app-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(var(--header-height) + 1rem);
    }

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

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: 1.3rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select, .filter-input {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s var(--ease) both;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }
.animate-in:nth-child(6) { animation-delay: 300ms; }

/* ── Haltedauer Ampel ───────────────────────────────────────── */
.holding-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.holding-dot.free  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.holding-dot.close { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.holding-dot.taxed { background: var(--danger);  box-shadow: 0 0 6px var(--danger);  }

/* ── Sync Overlay ──────────────────────────────────────────── */
#sync-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

#sync-overlay.visible {
    opacity: 1;
}

.sync-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(247, 147, 26, 0.1);
    width: 420px;
    max-width: 90vw;
    overflow: hidden;
    animation: syncSlideIn 0.35s var(--ease);
}

@keyframes syncSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sync-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.sync-header svg {
    color: var(--accent);
    animation: syncRotate 1.5s linear infinite;
}

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

.sync-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sync-steps {
    padding: 1rem 1.5rem;
}

.sync-step {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    opacity: 0.5;
    transition: all 0.3s var(--ease);
}

.sync-step:last-child {
    border-bottom: none;
}

.sync-step.active,
.sync-step.done,
.sync-step.warning {
    opacity: 1;
}

.sync-step-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sync-step-info {
    flex: 1;
    min-width: 0;
}

.sync-step-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sync-step-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-step.active .sync-step-detail {
    color: var(--text-secondary);
}

.sync-step-count {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.sync-check {
    font-size: 1.2rem;
    color: var(--success);
    text-shadow: 0 0 8px var(--success);
    animation: syncCheckPop 0.3s var(--ease);
}

.sync-warn {
    font-size: 1.2rem;
    color: var(--warning);
    text-shadow: 0 0 8px var(--warning);
}

.sync-pending {
    font-size: 1rem;
    opacity: 0.4;
}

@keyframes syncCheckPop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.sync-step.done .sync-step-label {
    color: var(--success);
}

.sync-step.warning .sync-step-label {
    color: var(--warning);
}

.sync-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    text-align: center;
}

.sync-summary {
    font-size: 0.88rem;
    font-weight: 600;
}

.sync-success {
    color: var(--success);
}

.sync-neutral {
    color: var(--text-secondary);
}
