/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary: #10b981;       /* Agri Green */
    --midnight: #0f172a;      /* Deep Navy (Primary Actions) */
    --bg-body: #f8fafc;       /* Light Slate */
    --surface: #ffffff;       /* Pure White */
    --text-main: #0f172a;     /* Darkest Black */
    --text-muted: #64748b;    /* Gray */
    --border: #e2e8f0;        /* Subtle Border */
    --radius: 16px;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    margin: 0;
}

.page-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

/* =========================================
   2. HEADER (Title + Back Button)
   ========================================= */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligns top */
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.title-group h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.subtitle {
    margin: 8px 0 0 0;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* Back Button (Top Right) */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50px; /* Pill Shape */
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-back:hover {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: var(--primary);
    transform: translateX(-3px);
}

/* =========================================
   3. TOOLBAR (Search + New Harvest)
   ========================================= */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

/* Integrated Search Bar */
.search-form {
    flex-grow: 1;
    max-width: 450px;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.search-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.search-icon {
    padding-left: 15px;
    color: #94a3b8;
    font-size: 1rem;
}

.search-input {
    border: none;
    background: transparent;
    flex-grow: 1;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
}

.search-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.search-btn:hover { background-color: #059669; }

/* New Harvest Button (Midnight) */
.btn-primary {
    background-color: var(--midnight);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.3);
}

/* =========================================
   4. TABLE CARD
   ========================================= */
.table-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 30px;
}

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

.styled-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 18px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.styled-table td {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    vertical-align: middle;
    font-size: 0.95rem;
}

/* Amount Badge */
.amount-badge {
    background: #ecfdf5;
    color: #047857;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-block;
}

/* View Button */
.details-btn {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background-color: #f1f5f9;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.details-btn:hover {
    background-color: var(--primary);
    color: white;
}

/* =========================================
   5. FOOTER (Pagination Only)
   ========================================= */
.footer-actions {
    display: flex;
    justify-content: center; /* Center pagination */
    margin-top: 20px;
}

.pagination-wrapper nav { display: flex; gap: 5px; }
.pagination-wrapper a, .pagination-wrapper span {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    text-decoration: none;
}
.pagination-wrapper .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-section { flex-direction: column-reverse; align-items: flex-start; }
    .toolbar { flex-direction: column-reverse; align-items: stretch; }
    .search-form { max-width: 100%; }
    .btn-primary, .btn-back { justify-content: center; width: 100%; box-sizing: border-box; }

    .styled-table thead { display: none; }
    .styled-table tr { display: block; border-bottom: 10px solid var(--bg-body); }
    .styled-table td { display: flex; justify-content: space-between; padding: 12px 20px; border: none; }
    .styled-table td::before {
        content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase;
    }
}