:root {
    --mf-yellow: #eab308;
    --mf-green: #0f766e;
    --mf-green-dark: #064e3b;
    --mf-bg-light: #f4f7f5;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --danger-red: #ef4444;
    --shadow-lg: 0 20px 25px -5px rgba(15, 118, 110, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background: var(--mf-bg-light); color: var(--text-main); min-height: 100vh; }
.hidden { display: none !important; }

/* Login Page Styling */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--mf-green-dark) 0%, var(--mf-green) 100%);
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-top: 5px solid var(--mf-yellow);
}

.login-card h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.25rem; color: var(--mf-green-dark); }
.error-msg { color: var(--danger-red); font-size: 0.85rem; margin-bottom: 1rem; display: none; text-align: center; font-weight: 600; }

/* Header & Logos */
header {
    background: #ffffff;
    border-bottom: 3px solid var(--mf-yellow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo-container { display: flex; align-items: center; gap: 12px; }
.brand-logo-container.centered { justify-content: center; margin-bottom: 1rem; }
.brand-icon { width: 42px; height: 42px; }
.brand-title { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title .kerala { color: var(--mf-yellow); font-size: 0.9rem; font-weight: 800; letter-spacing: 2px; }
.brand-title .marketfed { color: var(--mf-green); font-size: 1.6rem; font-weight: 800; }

.user-badge-container { display: flex; align-items: center; gap: 12px; }
.user-badge { background: #f0fdf4; color: var(--mf-green); font-weight: 700; padding: 0.4rem 0.8rem; border-radius: 20px; border: 1px solid #bbf7d0; font-size: 0.85rem; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--mf-green-dark) 0%, var(--mf-green) 100%);
    color: white;
    padding: 3.5rem 2rem 5rem;
    text-align: center;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.hero p { color: #e2e8f0; margin-bottom: 1.5rem; }

/* Dashboard Cards and Tables */
main { max-width: 1200px; margin: -3rem auto 3rem; padding: 0 1.5rem; }
.dashboard-card { background: white; border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-color); overflow: hidden; }
.dashboard-header { padding: 1.5rem 2rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.badge-count { background: #fef9c3; color: #854d0e; padding: 0.3rem 0.8rem; border-radius: 20px; font-weight: 700; font-size: 0.8rem; }

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f8fafc; padding: 1rem 1.2rem; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }

/* Status Badges */
.status-badge { padding: 0.3rem 0.75rem; border-radius: 20px; font-weight: 700; font-size: 0.8rem; display: inline-block; }
.status-pending { background-color: #fef9c3; color: #a16207; }
.status-approved { background-color: #dcfce7; color: #15803d; }
.status-rejected { background-color: #fee2e2; color: #b91c1c; }

.status-select { padding: 0.3rem 0.5rem; font-weight: 700; border-radius: 6px; font-size: 0.85rem; border: 1px solid var(--border-color); }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--mf-yellow) 0%, #ca8a04 100%);
    color: #000; border: none; padding: 0.75rem 1.5rem; font-weight: 700; border-radius: 8px; cursor: pointer;
}
.btn-primary.green-btn { background: linear-gradient(135deg, var(--mf-green) 0%, var(--mf-green-dark) 100%); color: white; }
.btn-primary.full-width { width: 100%; }
.btn-secondary { background: #e2e8f0; color: var(--text-main); border: none; padding: 0.65rem 1.25rem; font-weight: 600; border-radius: 6px; cursor: pointer; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-add-item { background: rgba(15, 118, 110, 0.1); color: var(--mf-green); border: 1px dashed var(--mf-green); padding: 0.5rem 1rem; font-weight: 600; border-radius: 6px; cursor: pointer; }
.btn-delete { background: none; border: none; color: var(--danger-red); cursor: pointer; font-size: 1.2rem; }
.btn-view { background: rgba(15, 118, 110, 0.1); color: var(--mf-green); border: none; padding: 0.4rem 0.8rem; font-weight: 700; border-radius: 6px; cursor: pointer; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(6, 78, 59, 0.65); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 100; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: white; border-radius: 16px; width: 95%; max-width: 850px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header, .modal-footer { padding: 1.25rem 1.75rem; background: #f8fafc; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-footer { border-top: 1px solid var(--border-color); border-bottom: none; }
.modal-body { padding: 1.75rem; overflow-y: auto; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group.full-width { grid-column: span 2; }
input, select { padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.95rem; outline: none; }
.readonly-input { background-color: #f8fafc; font-weight: 700; }

.items-table-container { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; margin-top: 0.75rem; }
.items-table th { background: #f1f5f9; padding: 0.75rem 0.5rem; font-size: 0.75rem; }
.items-table td { padding: 0.4rem; }
.items-table input, .items-table select { padding: 0.4rem; font-size: 0.85rem; width: 100%; }

.detail-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; background: #f8fafc; padding: 1.25rem; border-radius: 10px; margin-bottom: 1.5rem; }
.detail-item span { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.empty-state { padding: 3rem; text-align: center; color: var(--text-muted); }
.item-actions-header { display: flex; justify-content: space-between; align-items: center; }