:root {
    --primary: #036c55;
    --primary-dim: #005f4a;
    --surface: #f8faf9;
    --surface-container-low: #f0f4f3;
    --surface-container-lowest: #ffffff;
    --surface-container-high: #e4e9e8;
    --outline-variant: #acb3b2;
    --on-surface: #2d3433;
    --on-surface-variant: #596060;
    --error: #a73b21;
}

body {
    font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
    background: radial-gradient(circle at top left, #edf7f3 0%, #f8faf9 42%, #eef6f4 100%);
    color: var(--on-surface);
    min-height: 100vh;
}

.brand-headline {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

.shell-sidebar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    border-right: 1px solid rgba(172, 179, 178, 0.2);
}

.shell-topbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(172, 179, 178, 0.2);
}

.topbar-sync-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar-sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 198px;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(3, 108, 85, 0.14);
    border-radius: 999px;
    background: rgba(248, 252, 250, 0.94);
    box-shadow: 0 10px 22px rgba(45, 52, 51, 0.08);
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.topbar-sync-indicator:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(45, 52, 51, 0.11);
}

.topbar-sync-dot {
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #8ca39d;
    box-shadow: 0 0 0 0 rgba(140, 163, 157, 0.3);
}

.topbar-sync-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-sync-title {
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.1;
    color: #174d40;
    white-space: nowrap;
}

.topbar-sync-sub {
    margin-top: 0.12rem;
    font-size: 0.66rem;
    line-height: 1.1;
    color: rgba(45, 68, 63, 0.76);
    white-space: nowrap;
}

.topbar-sync-indicator.is-queued {
    border-color: rgba(196, 135, 3, 0.22);
    background: rgba(255, 248, 232, 0.96);
}

.topbar-sync-indicator.is-queued .topbar-sync-dot {
    background: #d49112;
    animation: sync-pulse-compact 1.6s ease-out infinite;
}

.topbar-sync-indicator.is-running {
    border-color: rgba(14, 110, 154, 0.2);
    background: rgba(236, 247, 252, 0.96);
}

.topbar-sync-indicator.is-running .topbar-sync-dot {
    background: #167ea8;
    animation: sync-spin-glow 0.95s linear infinite;
}

.topbar-sync-indicator.is-success {
    border-color: rgba(3, 108, 85, 0.18);
    background: rgba(239, 250, 246, 0.96);
}

.topbar-sync-indicator.is-success .topbar-sync-dot {
    background: #08936f;
    animation: sync-pulse-compact 1.8s ease-out 1;
}

.topbar-sync-indicator.is-error {
    border-color: rgba(167, 59, 33, 0.2);
    background: rgba(253, 242, 239, 0.97);
}

.topbar-sync-indicator.is-error .topbar-sync-dot {
    background: #c24b2a;
    animation: sync-pulse-compact 1.1s ease-out infinite;
}

.topbar-sync-indicator.is-paused {
    border-color: rgba(117, 124, 123, 0.18);
    background: rgba(243, 246, 245, 0.96);
}

.topbar-sync-indicator.is-paused .topbar-sync-dot {
    background: #7c948d;
    animation: none;
}

.topbar-sync-indicator.is-idle .topbar-sync-dot,
.topbar-sync-indicator .topbar-sync-dot {
    background: #7c948d;
}

.topbar-sync-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.62rem 0.38rem 0.44rem;
    border: 1px solid rgba(3, 108, 85, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 22px rgba(45, 52, 51, 0.06);
    color: #174d40;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.topbar-sync-toggle:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(45, 52, 51, 0.09);
}

.topbar-sync-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.66;
    box-shadow: none;
}

.topbar-sync-toggle-track {
    position: relative;
    width: 2rem;
    height: 1.1rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(124, 148, 141, 0.34);
    transition: background 0.18s ease;
}

.topbar-sync-toggle-thumb {
    position: absolute;
    top: 0.14rem;
    left: 0.14rem;
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(45, 52, 51, 0.16);
    transition: transform 0.18s ease;
}

.topbar-sync-toggle-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar-sync-toggle.is-on {
    border-color: rgba(3, 108, 85, 0.18);
    background: rgba(239, 250, 246, 0.96);
}

.topbar-sync-toggle.is-on .topbar-sync-toggle-track {
    background: rgba(8, 147, 111, 0.42);
}

.topbar-sync-toggle.is-on .topbar-sync-toggle-thumb {
    transform: translateX(0.9rem);
}

.topbar-sync-toggle.is-off {
    border-color: rgba(117, 124, 123, 0.18);
    color: #5b6463;
}

.topbar-sync-toggle.is-busy {
    pointer-events: none;
    opacity: 0.8;
}

.glass-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(172, 179, 178, 0.2);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(45, 52, 51, 0.06);
}

.nav-link {
    border-radius: 9999px;
    color: var(--on-surface-variant);
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(3, 108, 85, 0.08);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(3, 108, 85, 0.14);
    font-weight: 600;
}

.btn-brand {
    border: none;
    color: #e4fff3;
    background: linear-gradient(120deg, var(--primary), var(--primary-dim));
}

.btn-brand:hover {
    color: #e4fff3;
    transform: translateY(-1px);
}

.table-clean th {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--on-surface-variant);
    text-transform: uppercase;
}

.table-clean tr:hover td {
    background: rgba(240, 244, 243, 0.7);
}

.status-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-weight: 700;
}

.status-ok {
    color: #0c6b52;
    background: rgba(3, 108, 85, 0.12);
}

.status-warn {
    color: var(--error);
    background: rgba(167, 59, 33, 0.12);
}

.status-neutral {
    color: #5b6463;
    background: rgba(89, 96, 96, 0.12);
}

.shell-sidebar-footer {
    max-width: 260px;
}

.sync-status-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(3, 108, 85, 0.16);
    background: linear-gradient(160deg, rgba(236, 248, 244, 0.98) 0%, rgba(218, 238, 230, 0.92) 100%);
    box-shadow: 0 18px 30px rgba(6, 84, 67, 0.12);
    padding: 0.85rem;
    isolation: isolate;
}

.sync-status-card::before {
    content: "";
    position: absolute;
    inset: -42% -70% auto;
    height: 130%;
    background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.68) 45%, transparent 72%);
    transform: translateX(-45%) rotate(7deg);
    animation: sync-sheen 4.5s ease-in-out infinite;
    z-index: -1;
}

.sync-status-orb {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 9999px;
    margin-bottom: 0.45rem;
    border: 2px solid rgba(3, 108, 85, 0.25);
    background: #0e9d7c;
    box-shadow: 0 0 0 0 rgba(14, 157, 124, 0.45);
    animation: sync-pulse 1.8s ease-out infinite;
}

.sync-status-card.is-pending {
    border-color: rgba(187, 112, 0, 0.34);
    background: linear-gradient(160deg, rgba(255, 248, 230, 0.98) 0%, rgba(252, 236, 200, 0.92) 100%);
}

.sync-status-card.is-pending .sync-status-orb {
    border-color: rgba(187, 112, 0, 0.3);
    background: #d68a0d;
    box-shadow: 0 0 0 0 rgba(214, 138, 13, 0.45);
}

.sync-status-headline {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1f5d4f;
}

.sync-status-label {
    margin-top: 0.4rem;
    font-size: 0.63rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(47, 84, 75, 0.7);
}

.sync-status-time {
    margin-top: 0.08rem;
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #0c4f3f;
}

.sync-status-sub {
    margin-top: 0.16rem;
    font-size: 0.68rem;
    line-height: 1.35;
    color: rgba(45, 68, 63, 0.82);
}

.sync-process-btn {
    border: none;
    border-radius: 0.75rem;
    padding: 0.48rem 0.75rem;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #ecfff8;
    background: linear-gradient(115deg, #0a7a60 0%, #04634f 100%);
    box-shadow: 0 10px 18px rgba(4, 99, 79, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.sync-process-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: saturate(1.08);
    box-shadow: 0 12px 24px rgba(4, 99, 79, 0.3);
}

.sync-process-btn:disabled {
    cursor: not-allowed;
    color: rgba(235, 248, 241, 0.8);
    background: linear-gradient(115deg, #83a097 0%, #6f8e84 100%);
    box-shadow: none;
}

@keyframes sync-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 157, 124, 0.45);
    }
    70% {
        box-shadow: 0 0 0 11px rgba(14, 157, 124, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 157, 124, 0);
    }
}

@keyframes sync-sheen {
    0% {
        transform: translateX(-58%) rotate(7deg);
        opacity: 0;
    }
    28% {
        opacity: 0.9;
    }
    55% {
        opacity: 0.4;
    }
    100% {
        transform: translateX(48%) rotate(7deg);
        opacity: 0;
    }
}

@keyframes sync-pulse-compact {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 157, 124, 0.3);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(14, 157, 124, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 157, 124, 0);
    }
}

@keyframes sync-spin-glow {
    0% {
        transform: rotate(0deg) scale(1);
        box-shadow: 0 0 0 0 rgba(22, 126, 168, 0.22);
    }
    50% {
        transform: rotate(180deg) scale(1.08);
        box-shadow: 0 0 0 7px rgba(22, 126, 168, 0);
    }
    100% {
        transform: rotate(360deg) scale(1);
        box-shadow: 0 0 0 0 rgba(22, 126, 168, 0);
    }
}

@media (max-width: 767.98px) {
    .topbar-sync-cluster {
        gap: 0.38rem;
    }

    .topbar-sync-indicator {
        min-width: 0;
        padding-inline: 0.72rem;
    }

    .topbar-sync-sub {
        display: none;
    }

    .topbar-sync-toggle {
        padding-inline: 0.44rem;
    }

    .topbar-sync-toggle-label {
        display: none;
    }
}
