/*
 * ShopApni Community Farming — Contributor Dashboard v2
 * File: assets/css/contributor-dashboard-v2.css
 *
 * ENQUEUE AFTER dashboard-core.css and dashboard-extra.css:
 *   wp_enqueue_style(
 *     'cf-contributor-v2',
 *     plugin_dir_url(__FILE__).'assets/css/contributor-dashboard-v2.css',
 *     ['cf-dashboard-core','cf-dashboard-extra'],
 *     '2.0'
 *   );
 *   Also enqueue the Google Fonts preconnect + Nunito/DM Sans.
 *
 * DESIGN INTENT
 * ─────────────────────────────────────────────────────────
 * Guardian  → warm earthy (terracotta, ochre, deep forest)
 * Contributor → clean, vibrant, fresh green (mint, emerald, crisp white)
 *
 * Where the guardian feels like a soil expert's field notebook,
 * the contributor should feel like a modern farm-to-table app.
 */

/* ══════════════════════════════════════════════════════════
   0. GOOGLE FONTS IMPORT
   ══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');


/* ══════════════════════════════════════════════════════════
   1. TOKENS — fresh green system
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap {
    /* Greens */
    --g1:   #0d6e35;   /* deep forest */
    --g2:   #1d9950;   /* mid emerald */
    --g3:   #3dba6f;   /* vibrant green */
    --g4:   #72d496;   /* soft mint */
    --g5:   #b8eecb;   /* pale mint */
    --g6:   #e4f7ec;   /* near-white green */
    --g7:   #f2fbf5;   /* background tint */

    /* Accent / status */
    --ac-gold:  #f7c034;
    --ac-blue:  #2196f3;
    --ac-red:   #e53935;
    --ac-amber: #ff9800;

    /* Text */
    --txt:   #0e2e1a;
    --txt-m: #3d6b4f;
    --txt-l: #7aaa8b;

    /* Surface */
    --white: #ffffff;
    --card:  #ffffff;
    --bg:    #f0faf3;

    /* Shadows */
    --sh-sm: 0 1px 8px rgba(13,110,53,.08);
    --sh-md: 0 4px 20px rgba(13,110,53,.12);
    --sh-lg: 0 8px 40px rgba(13,110,53,.16);

    /* Radii */
    --r:  16px;
    --rs:  10px;
    --rp:   6px;

    /* Fonts */
    --font-body:    'Nunito', 'Poppins', sans-serif;
    --font-display: 'DM Serif Display', 'Fraunces', Georgia, serif;

    font-family: var(--font-body);
    color: var(--txt);
    line-height: 1.65;
    background: var(--bg);
}

.cf-contributor-wrap *,
.cf-contributor-wrap *::before,
.cf-contributor-wrap *::after {
    box-sizing: border-box;
}


/* ══════════════════════════════════════════════════════════
   2. PAGE WRAPPER & BACKGROUND
   ══════════════════════════════════════════════════════════ */
body.woocommerce-account .woocommerce .cf-contributor-wrap,
.cf-contributor-wrap {
    background: var(--bg) !important;
    padding: 0 0 60px;
}

/* Subtle dotted grid texture behind cards */
.cf-contributor-wrap::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(61,186,111,.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.cf-contributor-wrap > * { position: relative; z-index: 1; }


/* ══════════════════════════════════════════════════════════
   3. HERO STRIP — gradient header with farm identity
   ══════════════════════════════════════════════════════════ */
.cf-hero-strip {
    background: linear-gradient(135deg, var(--g1) 0%, #196b3d 55%, #0f5a2d 100%);
    border-radius: 0 0 var(--r) var(--r);
    padding: 28px 24px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

/* Decorative leaf shapes */
.cf-hero-strip::before,
.cf-hero-strip::after {
    content: '';
    position: absolute;
    border-radius: 50% 0 50% 0;
    background: rgba(255,255,255,.04);
}
.cf-hero-strip::before {
    width: 200px; height: 200px;
    top: -60px; right: -40px;
}
.cf-hero-strip::after {
    width: 120px; height: 120px;
    bottom: -30px; left: 40px;
    background: rgba(255,255,255,.06);
}

.cf-hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.cf-hero-left {}

.cf-hero-greeting {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--g4);
    margin-bottom: 4px;
}

.cf-hero-name {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 10px;
}

.cf-hero-name em {
    font-style: italic;
    color: var(--g4);
}

/* Farm chips */
.cf-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cf-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    backdrop-filter: blur(4px);
}

.cf-hero-chip .chip-icon { font-size: 14px; }

/* FarmCoin in hero */
.cf-hero-coin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cf-hero-coin .cf-coin-flip-container {
    width: 72px;
    height: 72px;
}

.cf-hero-coin .cf-coin-flip-container .cf-coin-front img {
    width: 72px;
    height: 72px;
}

.cf-hero-coin-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--g5);
}


/* ══════════════════════════════════════════════════════════
   4. STAT PILLS — quick metrics
   ══════════════════════════════════════════════════════════ */
.cf-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 16px 24px;
}

.cf-stat-pill {
    background: var(--white);
    border: 1.5px solid var(--g5);
    border-radius: var(--rs);
    padding: 14px 14px 12px;
    text-align: center;
    box-shadow: var(--sh-sm);
    transition: transform .2s, box-shadow .2s;
}

.cf-stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
}

.cf-stat-pill.s-harvest { border-color: #a8d5b5; }
.cf-stat-pill.s-pool    { border-color: #a8cce0; background: #f4faff; }
.cf-stat-pill.s-coins   { border-color: #f5dfa0; background: #fffdf4; }

.cf-sp-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    color: var(--g1);
}

.cf-stat-pill.s-pool .cf-sp-value   { color: var(--ac-blue); }
.cf-stat-pill.s-coins .cf-sp-value  { color: #b07c10; }

.cf-sp-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--txt-l);
    margin-top: 4px;
}


/* ══════════════════════════════════════════════════════════
   5. SECTION CARDS
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-section-card {
    background: var(--white) !important;
    border: 1.5px solid var(--g5) !important;
    border-radius: var(--r) !important;
    margin: 0 16px 20px !important;
    overflow: hidden;
    box-shadow: var(--sh-sm) !important;
    padding: 0 !important;
}

.cf-section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(90deg, var(--g6) 0%, #f8fdf9 100%);
    border-bottom: 1.5px solid var(--g5);
}

.cf-section-card-title {
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--g1) !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-section-card-title .stc-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--g3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.cf-section-card-action {
    font-size: 12px;
    color: var(--g2);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--g4);
    border-radius: 20px;
    transition: background .2s;
}

.cf-section-card-action:hover {
    background: var(--g6);
    text-decoration: none;
}

.cf-section-card-body {
    padding: 20px !important;
}


/* ══════════════════════════════════════════════════════════
   6. GUARDIAN CARD — displayed prominently at top
   ══════════════════════════════════════════════════════════ */
.cf-guardian-card {
    margin: -8px 16px 24px !important;
    background: linear-gradient(135deg, #f0faf3 0%, #e8f7ec 100%) !important;
    border: 1.5px solid var(--g4) !important;
    border-radius: var(--r) !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: var(--sh-sm) !important;
    position: relative;
    z-index: 2;
}

.cf-guardian-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--g3), var(--g1));
}

.cf-guardian-card-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px 16px 22px;
}

.cf-gc-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--g3), var(--g1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(29,153,80,.3);
}

.cf-gc-info {}

.cf-gc-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--txt-l);
    margin-bottom: 2px;
}

.cf-gc-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--g1);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 4px;
}

.cf-gc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cf-gc-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--txt-m);
    display: flex;
    align-items: center;
    gap: 3px;
}

.cf-gc-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.cf-gc-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--g3);
    box-shadow: 0 0 0 3px rgba(61,186,111,.2);
    animation: cfPulseGreen 2.5s ease-in-out infinite;
}

@keyframes cfPulseGreen {
    0%, 100% { box-shadow: 0 0 0 3px rgba(61,186,111,.2); }
    50%       { box-shadow: 0 0 0 6px rgba(61,186,111,.1); }
}

.cf-gc-status-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--g2);
}

/* No guardian state */
.cf-guardian-missing {
    padding: 14px 18px 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--txt-m);
}

.cf-guardian-missing .gm-icon {
    font-size: 20px;
    opacity: .5;
}


/* ══════════════════════════════════════════════════════════
   7. HARVEST TABLE — modern card layout
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-harvest-table-wrap {
    overflow-x: auto;
    margin: 0;
}

.cf-contributor-wrap .cf-harvest-table-wrap table.widefat {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent;
    border: none !important;
    font-size: 14px;
}

/* Table head */
.cf-contributor-wrap .cf-harvest-table-wrap table.widefat thead th {
    background: transparent !important;
    color: var(--txt-l) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 0 14px 12px !important;
    border: none !important;
    white-space: nowrap;
}

/* Table rows */
.cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody tr {
    background: var(--white) !important;
    transition: box-shadow .2s, transform .15s;
}

.cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody tr:hover {
    box-shadow: var(--sh-md) !important;
    transform: translateY(-1px);
    position: relative;
}

.cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody td {
    padding: 14px 14px !important;
    border-top: 1.5px solid var(--g6) !important;
    border-bottom: none !important;
    vertical-align: middle;
    color: var(--txt);
}

.cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody td:first-child {
    border-left: 3px solid transparent;
    border-radius: var(--rp) 0 0 var(--rp);
    padding-left: 16px !important;
    font-weight: 700;
    color: var(--g1);
}

/* Status badges */
.cf-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}

.cf-status-badge.s-sowing {
    background: #e3f5e9;
    color: #1b6b35;
    border: 1px solid #a8dbb5;
}

.cf-status-badge.s-growing {
    background: #d4f0dc;
    color: #156030;
    border: 1px solid #80cc95;
}

.cf-status-badge.s-ready {
    background: #fff8e1;
    color: #8a6200;
    border: 1px solid #f5d77a;
}

.cf-status-badge.s-ready::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #f7c034;
    animation: cfBlink 1.5s ease-in-out infinite;
}

@keyframes cfBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.cf-status-badge.s-observation {
    background: #fff3e0;
    color: #8a4500;
    border: 1px solid #ffcc80;
}

.cf-status-badge.s-completed {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.cf-status-badge.s-delivered {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
}

.cf-status-badge.s-pending {
    background: #fafafa;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* Left accent on ready row */
.cf-row-ready td:first-child { border-left-color: var(--ac-gold) !important; }
.cf-row-completed td:first-child { border-left-color: var(--g3) !important; }
.cf-row-delivered td:first-child { border-left-color: var(--ac-blue) !important; }
.cf-row-observation td:first-child { border-left-color: var(--ac-amber) !important; }

/* Weight cell */
.cf-weight-display {
    font-size: 15px;
    font-weight: 700;
    color: var(--g2);
}

.cf-weight-display .cf-weight-unit {
    font-size: 11px;
    font-weight: 500;
    color: var(--txt-l);
}


/* ══════════════════════════════════════════════════════════
   8. ACTION BUTTONS — contributor actions
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-action-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Primary: Accept Delivery */
.cf-contributor-wrap .cf-btn-accept {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--g2) 0%, var(--g1) 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--rs) !important;
    padding: 9px 16px !important;
    font-family: var(--font-body) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(29,153,80,.3) !important;
    white-space: nowrap;
    text-decoration: none;
}

.cf-contributor-wrap .cf-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(29,153,80,.4) !important;
}

/* Secondary: Send to Pool */
.cf-contributor-wrap .cf-btn-pool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--white) !important;
    color: var(--g1) !important;
    border: 2px solid var(--g4) !important;
    border-radius: var(--rs) !important;
    padding: 8px 16px !important;
    font-family: var(--font-body) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
    white-space: nowrap;
}

.cf-contributor-wrap .cf-btn-pool:hover {
    border-color: var(--g2) !important;
    background: var(--g6) !important;
    transform: translateY(-1px);
}

/* Override v5 pool btn styles inside contributor */
.cf-contributor-wrap .cf-action-form [name="send_to_pool"] {
    background: var(--white) !important;
    color: var(--g1) !important;
    border: 2px solid var(--g4) !important;
    border-radius: var(--rs) !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: var(--font-body) !important;
    transition: border-color .2s, background .2s !important;
}

.cf-contributor-wrap .cf-action-form [name="send_to_pool"]:hover:not(.cf-pp-btn-locked) {
    border-color: var(--g2) !important;
    background: var(--g6) !important;
}

.cf-contributor-wrap .cf-action-form [name="accept_delivery"] {
    background: linear-gradient(135deg, var(--g2), var(--g1)) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--rs) !important;
    padding: 9px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: var(--font-body) !important;
    box-shadow: 0 2px 8px rgba(29,153,80,.25) !important;
    transition: transform .15s, box-shadow .2s !important;
}

.cf-contributor-wrap .cf-action-form [name="accept_delivery"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(29,153,80,.4) !important;
}

/* Status text for non-actable rows */
.cf-row-status-text {
    font-size: 12px;
    font-style: italic;
    color: var(--txt-l);
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════════════
   9. REFILL DROPDOWN — slot refill
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-refill-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.cf-contributor-wrap .cf-refill-form select {
    flex: 1;
    min-width: 140px;
    padding: 8px 10px;
    border: 1.5px solid var(--g4) !important;
    border-radius: var(--rp) !important;
    font-family: var(--font-body) !important;
    font-size: 12px !important;
    background: var(--white);
    color: var(--txt);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231d9950' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;
    cursor: pointer;
}

.cf-contributor-wrap .cf-refill-form select:focus {
    border-color: var(--g2) !important;
    box-shadow: 0 0 0 3px rgba(29,153,80,.12) !important;
}

.cf-contributor-wrap .cf-refill-form button[name="refill_slot"],
.cf-contributor-wrap .cf-refill-form .cf-btn-primary {
    background: var(--g3) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: var(--rp) !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: var(--font-body) !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}

.cf-contributor-wrap .cf-refill-form button[name="refill_slot"]:hover {
    background: var(--g2) !important;
}

/* Refill label */
.cf-refill-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--g2);
    margin-bottom: 6px;
    display: block;
}


/* ══════════════════════════════════════════════════════════
   10. CARBON IMPACT CARD
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .carbon-card,
.cf-contributor-wrap .cf-carbon-wrap {
    background: linear-gradient(135deg, #0d3d1f 0%, #155733 100%) !important;
    border: 1.5px solid #1d5e35 !important;
    border-radius: var(--r) !important;
    margin: 0 16px 20px !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(13,61,31,.3) !important;
}

.cf-carbon-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-carbon-title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--g4);
    margin: 0;
}

.cf-carbon-body {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cf-carbon-metric {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--rp);
    padding: 12px 14px;
}

.cf-cm-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    margin-bottom: 4px;
}

.cf-cm-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--g4);
    font-weight: 400;
    line-height: 1;
}

.cf-carbon-total-row {
    grid-column: 1 / -1;
    background: rgba(61,186,111,.12);
    border-color: rgba(61,186,111,.25);
}

.cf-carbon-total-row .cf-cm-label { color: var(--g4); }

.cf-carbon-total-row .cf-cm-value {
    font-size: 1.7rem;
    color: #ffffff;
}

.cf-carbon-btn-row {
    padding: 0 20px 18px;
}

.cf-carbon-btn-row button,
.cf-contributor-wrap #calculate-carbon {
    width: 100%;
    background: var(--g3) !important;
    color: var(--g1) !important;
    border: none !important;
    border-radius: var(--rs) !important;
    padding: 12px !important;
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cf-contributor-wrap #calculate-carbon:hover {
    background: #52d07f !important;
    transform: translateY(-1px);
}


/* ══════════════════════════════════════════════════════════
   11. FARM UPDATES — timeline view
   ══════════════════════════════════════════════════════════ */
.cf-updates-timeline {
    padding: 4px 0;
}

.cf-update-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    padding: 14px 20px 14px 16px;
    position: relative;
}

.cf-update-item:not(:last-child) {
    border-bottom: 1px solid var(--g6);
}

/* Timeline line */
.cf-update-item:not(:last-child) .cf-ui-dot::after {
    content: '';
    position: absolute;
    left: 34px;
    top: 52px;
    bottom: -14px;
    width: 1px;
    background: var(--g5);
}

.cf-ui-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--g6);
    border: 2px solid var(--g4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.cf-ui-content {}

.cf-ui-stage {
    font-size: 13px;
    font-weight: 700;
    color: var(--g1);
    margin-bottom: 2px;
}

.cf-ui-date {
    font-size: 11px;
    color: var(--txt-l);
    margin-bottom: 6px;
}

.cf-ui-notes {
    font-size: 13px;
    color: var(--txt-m);
    line-height: 1.6;
}

.cf-ui-image-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--g2);
    text-decoration: none;
    border: 1px solid var(--g4);
    padding: 4px 10px;
    border-radius: 20px;
    transition: background .2s;
}

.cf-ui-image-link:hover { background: var(--g6); }


/* ══════════════════════════════════════════════════════════
   12. NOTICES — styled alerts
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-notice,
.cf-contributor-wrap .notice {
    border-radius: var(--rp) !important;
    border-left: 4px solid !important;
    padding: 12px 16px !important;
    margin: 0 16px 16px !important;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-contributor-wrap .notice-success {
    background: var(--g6) !important;
    border-color: var(--g3) !important;
    color: var(--g1) !important;
}

.cf-contributor-wrap .notice-warning {
    background: #fffde7 !important;
    border-color: #f7c034 !important;
    color: #5d4200 !important;
}

.cf-contributor-wrap .notice-error {
    background: #ffebee !important;
    border-color: var(--ac-red) !important;
    color: #7f0000 !important;
}

.cf-contributor-wrap .notice-info {
    background: #e3f2fd !important;
    border-color: var(--ac-blue) !important;
    color: #0d47a1 !important;
}

/* Override .notice-success from dashboard-extra.css (it's green already but full-width) */
.cf-contributor-wrap .notice-success p { margin: 0; }


/* ══════════════════════════════════════════════════════════
   13. QUICK LINKS BAR
   ══════════════════════════════════════════════════════════ */
.cf-quick-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px;
    margin-bottom: 20px;
}

.cf-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1.5px solid var(--g5);
    border-radius: 30px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--g1);
    text-decoration: none;
    transition: border-color .2s, background .2s, transform .15s;
    box-shadow: var(--sh-sm);
}

.cf-quick-link:hover {
    border-color: var(--g3);
    background: var(--g6);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--g1);
}


/* ══════════════════════════════════════════════════════════
   14. FARM ID BADGE (override existing)
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-farm-id {
    display: none; /* Replaced by hero chip, hide the old one */
}


/* ══════════════════════════════════════════════════════════
   15. EMPTY & INACTIVE STATES
   ══════════════════════════════════════════════════════════ */
.cf-empty-harvest {
    text-align: center;
    padding: 32px 20px;
}

.cf-empty-harvest .eh-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
}

.cf-empty-harvest h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--g1);
    margin-bottom: 8px;
}

.cf-empty-harvest p {
    font-size: 13px;
    color: var(--txt-l);
    margin-bottom: 18px;
}

.cf-inactive-banner {
    background: linear-gradient(135deg, var(--g6), #f5fcf7);
    border: 1.5px solid var(--g5);
    border-radius: var(--r);
    margin: 0 16px 20px;
    padding: 28px 24px;
    text-align: center;
}

.cf-inactive-banner h4 {
    font-family: var(--font-display);
    color: var(--g1);
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.cf-inactive-banner p {
    color: var(--txt-m);
    font-size: 14px;
    margin-bottom: 16px;
}


/* ══════════════════════════════════════════════════════════
   16. HARVEST SUMMARY CARD
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-summary-card {
    margin: 0 16px 20px;
}

.cf-contributor-wrap .cf-summary-card h3 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--g1);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--g5);
}

.cf-contributor-wrap .cf-summary-card table.widefat {
    font-size: 13px;
    border: 1.5px solid var(--g5) !important;
    border-radius: var(--rs);
    overflow: hidden;
}

.cf-contributor-wrap .cf-summary-card table.widefat thead th {
    background: var(--g6) !important;
    color: var(--g1) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 10px 12px !important;
}

.cf-contributor-wrap .cf-summary-card table.widefat tbody td {
    padding: 10px 12px !important;
    border-top: 1px solid var(--g6) !important;
    color: var(--txt);
}


/* ══════════════════════════════════════════════════════════
   17. SUGGESTION / NOTICE CELLS
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-notice-text {
    font-size: 12px;
    background: #fff8e8;
    border-left: 3px solid var(--ac-amber);
    padding: 6px 10px;
    border-radius: 0 var(--rp) var(--rp) 0;
    color: #6b3d00;
    display: block;
    margin-bottom: 6px;
}


/* ══════════════════════════════════════════════════════════
   18. FRESHNESS BAR (product page, carry over style)
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-freshness-bar__track {
    background: #e6f4eb;
}


/* ══════════════════════════════════════════════════════════
   19. DOWNLOAD REPORT BUTTON
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap .cf-download-report {
    text-align: center;
    padding: 16px;
    margin: 0 16px 20px;
    background: var(--white);
    border: 1.5px dashed var(--g4);
    border-radius: var(--rs);
}

.cf-contributor-wrap .cf-download-report a,
.cf-contributor-wrap .cf-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white) !important;
    color: var(--g1) !important;
    border: 2px solid var(--g4) !important;
    border-radius: var(--rs) !important;
    padding: 10px 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: var(--font-body) !important;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

.cf-contributor-wrap .cf-download-report a:hover {
    background: var(--g6) !important;
    border-color: var(--g2) !important;
}


/* ══════════════════════════════════════════════════════════
   20. CANCEL BUTTON WRAPPER
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap + div[style*="text-align:center"],
.cf-contributor-wrap .cf-cancel-wrap {
    margin: 8px 16px 0;
}


/* ══════════════════════════════════════════════════════════
   21. RESPONSIVE — mobile
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .cf-hero-inner {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cf-hero-coin {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .cf-stat-row {
        grid-template-columns: 1fr 1fr;
    }

    .cf-stat-row .cf-stat-pill:last-child {
        grid-column: 1 / -1;
    }

    .cf-guardian-card-inner {
        grid-template-columns: auto 1fr;
    }

    .cf-gc-status { display: none; }

    .cf-carbon-body {
        grid-template-columns: 1fr;
    }

    .cf-contributor-wrap .cf-harvest-table-wrap table.widefat thead {
        display: none;
    }

    .cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1.5px solid var(--g5) !important;
        border-radius: var(--rs) !important;
        padding: 4px 0;
    }

    .cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--g6) !important;
        padding: 10px 14px !important;
        font-size: 13px;
    }

    .cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody td:first-child {
        border-top: none !important;
        border-left: 3px solid var(--g3) !important;
        border-radius: var(--rs) var(--rs) 0 0;
        font-size: 14px;
    }

    .cf-contributor-wrap .cf-harvest-table-wrap table.widefat tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--txt-l);
    }

    .cf-section-card {
        margin: 0 8px 16px !important;
    }

    .cf-guardian-card,
    .cf-stat-row,
    .cf-quick-links {
        margin-left: 8px !important;
        margin-right: 8px !important;
        padding-left: 0;
        padding-right: 0;
    }

    .cf-action-form {
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .cf-stat-row { grid-template-columns: 1fr; }
    .cf-hero-name { font-size: 1.3rem; }
}


/* ══════════════════════════════════════════════════════════
   22. ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes cfSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cf-contributor-wrap .cf-section-card { animation: cfSlideUp .3s ease both; }
.cf-contributor-wrap .cf-section-card:nth-child(2) { animation-delay: .05s; }
.cf-contributor-wrap .cf-section-card:nth-child(3) { animation-delay: .10s; }
.cf-contributor-wrap .cf-section-card:nth-child(4) { animation-delay: .15s; }
.cf-contributor-wrap .cf-guardian-card { animation: cfSlideUp .25s ease both; }


/* ══════════════════════════════════════════════════════════
   23. GLOBAL OVERRIDE CLEANUP
   (prevent dashboard-brand.css broad selectors bleeding in)
   ══════════════════════════════════════════════════════════ */
.cf-contributor-wrap h1,
.cf-contributor-wrap h2,
.cf-contributor-wrap h3,
.cf-contributor-wrap h4 {
    /* Reset brand override – we control colors per-component */
    color: inherit !important;
    font-family: inherit !important;
}

.cf-contributor-wrap .cf-card,
.cf-contributor-wrap .carbon-card,
.cf-contributor-wrap .carbon-interventions {
    /* These come from dashboard-brand.css – reset for contributor */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}