:root {
    --green: #14532D;
    --green-light: #e3ede6;
    --green-dark: #0d3a1f;
    --gold: #C99A2E;
    --gold-light: #f5ecd6;
    --black: #171717;
    --white: #F5F5F0;
    --pure-white: #ffffff;
    --grey-100: #ececea;
    --grey-200: #ddddd9;
    --grey-400: #a3a39c;
    --grey-600: #6b6b62;
    --grey-800: #2e2e29;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --success: #15803d;
    --success-bg: #dcfce7;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(23,23,23,0.08), 0 1px 2px rgba(23,23,23,0.04);
    --shadow-lg: 0 8px 24px rgba(23,23,23,0.12);
}
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--white); margin: 0; color: var(--black); -webkit-font-smoothing: antialiased;
}
a { color: var(--green); }
h1, h2, h3, h4 { margin: 0 0 4px 0; letter-spacing: -0.01em; }

/* ===== Sidebar / App Shell ===== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: var(--black); color: var(--pure-white); flex-shrink: 0;
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
    overflow-y: auto; z-index: 200; transition: transform 0.25s ease;
}
.sidebar .sidebar-brand {
    padding: 20px 20px 14px; font-weight: 700; font-size: 16px; color: var(--pure-white);
    text-decoration: none; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #2a2a26;
}
.sidebar .sidebar-brand::before { content: ''; width: 9px; height: 9px; background: var(--gold); border-radius: 50%; display: inline-block; }
.sidebar-section-label { padding: 16px 20px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #8a8a80; font-weight: 700; }
.sidebar nav a, .sidebar nav form button {
    display: flex; align-items: center; gap: 11px; padding: 10px 20px; color: #d4d4c8;
    text-decoration: none; font-size: 14px; background: none; border: none; width: 100%;
    text-align: left; cursor: pointer; font-family: inherit;
}
.sidebar nav a svg, .sidebar nav form button svg { flex-shrink: 0; opacity: 0.85; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(201,154,46,0.14); color: var(--gold); }
.sidebar-footer { margin-top: auto; padding: 14px 20px 20px; border-top: 1px solid #2a2a26; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; text-decoration: none; color: var(--pure-white); }
.sidebar-user span { font-size: 13.5px; font-weight: 600; }
.sidebar-lang { display: flex; gap: 8px; font-size: 12.5px; margin-bottom: 10px; }
.sidebar-lang a { color: #8a8a80; text-decoration: none; }
.sidebar-lang a.lang-active { color: var(--gold); font-weight: 700; }
.main-area { flex: 1; margin-left: 240px; min-height: 100vh; background: var(--white); width: 100%; }
.topbar { display: none; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--pure-white); border-bottom: 1px solid var(--grey-100); position: sticky; top: 0; z-index: 100; }
.sidebar-hamburger { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--black); padding: 4px 8px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 150; }
.sidebar-overlay.open { display: block; }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .topbar { display: flex; }
}

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
h1 { font-size: 22px; }
@media (max-width: 600px) { .container { padding: 14px 12px 50px; } h1 { font-size: 19px; } }

/* ===== Buttons ===== */
.btn, button {
    background: var(--black); color: var(--pure-white); border: none; padding: 11px 18px;
    border-radius: 9px; cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover, button:hover { background: #000; }
.btn-green { background: var(--green); color: var(--pure-white); }
.btn-green:hover { background: var(--green-dark); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: #b3872a; }
.btn-outline { background: var(--pure-white); color: var(--black); border: 1.5px solid var(--grey-200); }
.btn-outline:hover { background: var(--grey-100); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Cards ===== */
.card { background: var(--pure-white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--grey-100); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== KPI stat cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--pure-white); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--grey-100); border-top: 3px solid var(--gold); }
.stat-card.accent-green { border-top-color: var(--green); }
.stat-card .stat-label { font-size: 12px; color: var(--grey-600); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; color: var(--black); }
.stat-card .stat-sub { font-size: 12px; color: var(--grey-400); margin-top: 4px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; background: var(--pure-white); min-width: 560px; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--grey-100); text-align: left; font-size: 13.5px; }
.data-table th { background: var(--grey-100); font-weight: 700; color: var(--grey-800); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tr:hover td { background: #faf9f5; }
.data-table td a { font-weight: 600; }

/* ===== Badges ===== */
.badge { color: var(--pure-white); padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 600; display: inline-block; }
.badge-planning { background: #6b6b62; }
.badge-prep { background: #a3762e; }
.badge-planted { background: var(--gold); color: var(--black); }
.badge-growing { background: var(--green); }
.badge-harvested { background: #0d3a1f; }
.badge-sold { background: var(--black); }
.badge-closed { background: #4b4b45; }

/* ===== Forms ===== */
.form-box { background: var(--pure-white); padding: 24px; border-radius: var(--radius); max-width: 560px; box-shadow: var(--shadow); border: 1px solid var(--grey-100); }
.form-box label, .field-label { display: block; margin-top: 14px; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--grey-800); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--grey-200); border-radius: 8px; font-size: 14.5px;
    font-family: inherit; background: var(--pure-white); color: var(--black);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-light); }
.form-box button { margin-top: 20px; width: 100%; justify-content: center; }
.inline-form { display: flex; gap: 10px; align-items: end; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form label { font-size: 12.5px; font-weight: 600; }
.inline-form input, .inline-form select { padding: 9px 10px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > div { flex: 1; min-width: 160px; }

.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; color: var(--grey-400); display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.password-toggle-icon:hover { background: var(--grey-100); color: var(--black); }

/* ===== Filters ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--pure-white); padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid var(--grey-100); }
.filter-bar select { width: auto; min-width: 140px; padding: 9px 12px; }

/* ===== Auth ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); padding: 20px; }
.auth-box { width: 100%; max-width: 380px; background: var(--pure-white); padding: 32px 28px; border-radius: 16px; box-shadow: var(--shadow-lg); }
.auth-box .auth-logo { text-align: center; margin-bottom: 6px; }
.auth-box .auth-logo .dot { width: 10px; height: 10px; background: var(--gold); border-radius: 50%; display: inline-block; margin-right: 6px; }
.auth-box h2 { text-align: center; margin-bottom: 22px; }
.auth-box button { width: 100%; margin-top: 20px; padding: 12px; }
.lang-switch-standalone { text-align: center; margin-top: 16px; font-size: 13px; }
.lang-switch-standalone a { color: #8a8a80; text-decoration: none; }
.lang-switch-standalone a.lang-active { color: var(--pure-white); font-weight: 700; }

/* ===== Alerts ===== */
.error { color: var(--danger); background: var(--danger-bg); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.notice { color: #8a6416; background: var(--gold-light); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.success-msg { color: var(--success); background: var(--success-bg); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }

/* ===== Avatars ===== */
.avatar-lg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.avatar-lg-fallback { width: 84px; height: 84px; border-radius: 50%; background: var(--black); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; border: 3px solid var(--gold); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; border: 1.5px solid var(--grey-200); }
.avatar-sm-fallback { width: 32px; height: 32px; border-radius: 50%; background: var(--grey-800); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; vertical-align: middle; margin-right: 8px; }

/* ===== Misc ===== */
.staff-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.staff-actions a { color: var(--green); text-decoration: none; font-size: 13px; font-weight: 600; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 13px; padding: 0; font-weight: 600; }
.link-danger:hover { background: none; color: #7f1d1d; }
.section-title { font-size: 15px; font-weight: 700; margin: 24px 0 12px; color: var(--grey-800); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--grey-100); color: var(--grey-800); }
hr { border: none; border-top: 1px solid var(--grey-100); margin: 16px 0; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-chart .bar { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; transition: height 0.3s; }
.bar-chart .bar.spend { background: var(--danger); }
.bar-chart .bar.revenue { background: var(--green); }
.bar-chart .bar-label { font-size: 10.5px; color: var(--grey-600); margin-top: 6px; text-align: center; }
.bar-chart .bar-value { font-size: 10px; color: var(--grey-800); font-weight: 700; margin-bottom: 3px; }
.timeline-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--grey-100); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-top: 5px; flex-shrink: 0; }
