/* ═══════════════════════════════════════════════════════════════════════════
   Harvest Queue — Admin Panel Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Summary Cards Grid */
.harvest-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.harvest-summary .summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    animation: harvest-fadeIn 0.3s ease forwards;
    animation-delay: calc(var(--stagger) * 60ms);
    opacity: 0;
}

.summary-card-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.summary-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--card-accent, var(--text));
}

.summary-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ROI Card */
.harvest-roi-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    animation: harvest-fadeIn 0.3s ease forwards;
    animation-delay: calc(var(--stagger) * 60ms);
    opacity: 0;
}

.harvest-roi-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.harvest-roi-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}

.harvest-roi-gauge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.harvest-roi-gauge-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    overflow: hidden;
}

.harvest-roi-gauge-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.harvest-roi-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.harvest-roi-tick {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 14px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1px;
}

.harvest-roi-gauge-track {
    position: relative;
}

.harvest-roi-pct {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    min-width: 50px;
    text-align: right;
}

.harvest-roi-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.harvest-roi-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.harvest-roi-row span:last-child {
    font-weight: 600;
    color: var(--text);
}

.harvest-roi-positive span:last-child {
    color: #10b981;
}

.harvest-roi-negative span:last-child {
    color: var(--danger);
}

.harvest-roi-status {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

@keyframes harvest-fadeIn {
    to { opacity: 1; transform: translateY(0); }
    from { opacity: 0; transform: translateY(8px); }
}

/* Skeleton Cards */
.harvest-skeleton-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.harvest-skeleton-cards .skeleton-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    height: 80px;
}

/* Tabs */
.harvest-tabs {
    display: flex;
    gap: 6px;
}

/* Row-level Run Button */
.harvest-row-run {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #9333ea);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.harvest-row-run:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(124, 77, 255, 0.3);
}

.harvest-row-run:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.harvest-run-all {
    flex-shrink: 0;
    margin-left: auto;
}

/* Progress Bar */
.harvest-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(124, 77, 255, 0.15);
    border-radius: 12px;
}

.harvest-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.harvest-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #10b981);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.harvest-progress-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.harvest-tab {
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.harvest-tab:hover {
    border-color: var(--accent);
    color: var(--text);
}

.harvest-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Tables */
.harvest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.harvest-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

.harvest-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.harvest-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Expandable rows */
.harvest-row-expandable {
    cursor: pointer;
    transition: background 0.15s;
}

.harvest-row-expandable:hover {
    background: rgba(255, 255, 255, 0.04);
}

.harvest-chevron {
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.harvest-chevron--open {
    transform: rotate(90deg);
}

.harvest-detail-row td {
    padding: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.harvest-detail-urls {
    padding: 8px 16px 12px 46px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.harvest-url-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.82rem;
}

.harvest-url-row:hover {
    background: rgba(124, 77, 255, 0.08);
}

.harvest-url-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent);
}

.harvest-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* URL cells (double-click) */
.harvest-url-cell {
    cursor: pointer;
    color: var(--accent);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.harvest-url-cell:hover {
    text-decoration: underline;
}

/* Badges */
.harvest-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.harvest-badge--pending { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.harvest-badge--harvesting { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.harvest-badge--harvested { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.harvest-badge--processing { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.harvest-badge--completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.harvest-badge--failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.harvest-badge--orphaned { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.harvest-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
}

.harvest-domain-cell {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.harvest-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Pipeline */
.harvest-pipeline {
    display: flex;
    gap: 3px;
}

.harvest-pipe-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.harvest-pipe-step--done {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Filters */
.harvest-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.harvest-status-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.harvest-pill {
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: capitalize;
}

.harvest-pill:hover {
    border-color: var(--accent);
    color: var(--text);
}

.harvest-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.harvest-search {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.82rem;
    outline: none;
    width: 200px;
    transition: border-color 0.2s;
}

.harvest-search:focus {
    border-color: var(--accent);
}

/* Pagination */
.harvest-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.harvest-page-info {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Actions */
.harvest-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.harvest-retry:hover { color: var(--accent); }
.harvest-delete:hover { color: var(--danger); }

/* Month Chart */
.harvest-month-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 160px;
}

.harvest-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.harvest-bar {
    width: 32px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(to top, var(--accent), rgba(124, 77, 255, 0.5));
    transition: height 0.4s ease;
}

.harvest-bar-value {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
}

.harvest-bar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Empty state */
.harvest-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Loading */
.harvest-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

/* Confirm Modal */
.harvest-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: harvest-fadeIn 0.15s ease;
}

.harvest-modal {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.harvest-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(124, 77, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.harvest-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.harvest-modal-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.harvest-modal-cost {
    font-size: 0.75rem;
    color: var(--warning);
    margin: 0;
    font-weight: 600;
}

.harvest-modal-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.harvest-modal-cancel {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.harvest-modal-cancel:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.harvest-modal-confirm {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #9333ea);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.harvest-modal-confirm:hover {
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.3);
}

/* Mobile */
@media (max-width: 767px) {
    .harvest-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .harvest-roi-card {
        grid-column: span 2;
    }

    .harvest-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .harvest-table {
        font-size: 0.78rem;
    }

    .harvest-table thead th,
    .harvest-table tbody td {
        padding: 8px 10px;
    }

    .harvest-url-cell {
        max-width: 160px;
    }

    .harvest-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .harvest-search {
        width: 100%;
    }

    .harvest-month-chart {
        overflow-x: auto;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .harvest-summary {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .harvest-summary .summary-card {
        padding: 14px 16px;
    }

    .summary-value {
        font-size: 1.3rem;
    }
}
