/* Top-bar indicator for items queued by the offline aftercare workflow
   (CCE reports, status-change skips, task comments). Lives in
   SecureMainLayout alongside the UploadQueueBadge. */

/* Floats right so the trigger lands in the top-bar icon cluster
   (notification / tenant / burger) instead of in the inline flow under
   the breadcrumb. Top-margin matches .desktopBurgerBtn / .cssNotificationIcon. */
.duo-offline-sync {
    position: relative;
    float: right;
    margin-top: 8px;
    margin-right: 6px;
}

.duo-offline-sync__trigger {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 47px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #4B5563;
    transition: background 0.12s, color 0.12s;
}
.duo-offline-sync__trigger:hover { background: #F3F4F6; color: #003e7e; }
.duo-offline-sync__trigger--open { background: #DBEAFE; color: #1D4ED8; }
.duo-offline-sync__trigger--syncing svg { animation: duo-offline-sync-spin 1.4s linear infinite; }
@keyframes duo-offline-sync-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.duo-offline-sync__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #F59E0B;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.duo-offline-sync__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    z-index: 9998;
}

.duo-offline-sync__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    background: #fff;
    box-shadow: -8px 0 24px rgba(0,0,0,0.12);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
}

.duo-offline-sync__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #E5E7EB;
}
.duo-offline-sync__panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.duo-offline-sync__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #6B7280;
    padding: 0 6px;
}
.duo-offline-sync__close:hover { color: #111827; }

.duo-offline-sync__panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 14px;
}

.duo-offline-sync__empty {
    padding: 24px 8px;
    text-align: center;
    color: #6B7280;
    font-size: 13px;
    line-height: 1.5;
}

.duo-offline-sync__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #4B5563;
}

.duo-offline-sync__status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.duo-offline-sync__status-pill--offline { background: #FEF3C7; color: #92400E; }
.duo-offline-sync__status-pill--syncing { background: #DBEAFE; color: #1D4ED8; }
.duo-offline-sync__status-pill--ready { background: #DCFCE7; color: #166534; }

.duo-offline-sync__sync-now {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #003e7e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.duo-offline-sync__sync-now:hover { background: #00509e; }

/* Disabled state — shown while a sync is already in flight so the button
   stays visible (clear it exists) but obviously isn't clickable. */
.duo-offline-sync__sync-now:disabled,
.duo-offline-sync__sync-now--warn:disabled {
    background: #E5E7EB;
    color: #6B7280;
    cursor: not-allowed;
    opacity: 0.85;
}
.duo-offline-sync__sync-now:disabled:hover,
.duo-offline-sync__sync-now--warn:disabled:hover {
    background: #E5E7EB;
    color: #6B7280;
}

/* Slow-connection override variant — amber styling so the user spots that
   this is the "I know it's slow, push anyway" path, not the regular
   Sync now button. Confirms via a SweetAlert before actually firing. */
.duo-offline-sync__sync-now--warn {
    background: #F59E0B;
    color: #1F2937;
}
.duo-offline-sync__sync-now--warn:hover { background: #D97706; color: #fff; }

.duo-offline-sync__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.duo-offline-sync__item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FAFBFC;
    align-items: flex-start;
}

.duo-offline-sync__item-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1D4ED8;
}

.duo-offline-sync__item-meta {
    flex: 1 1 auto;
    min-width: 0;
}
.duo-offline-sync__item-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.duo-offline-sync__item-sub {
    margin-top: 2px;
    font-size: 11px;
    color: #6B7280;
}
.duo-offline-sync__item-error {
    margin-top: 4px;
    font-size: 11px;
    color: #B91C1C;
}
