* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --g-500: #12B357; --g-600: #0B7A3B; --g-700: #053B22; --bg: #F3F8F4;
  --c-red: #DC2626; --c-blue: #2563EB; --c-orange: #F97316; --c-yellow: #FACC15;
  --ink: #0A1622; --muted: #5B6B7C; --card: #FFFFFF; --line: #E1EAE3;
  --sh-sm: 0 2px 8px rgba(5,59,34,.06);
  --sh-md: 0 8px 24px rgba(5,59,34,.1);
  --r-md: 12px; --r-lg: 16px;
}
body {
  font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--ink);
  display: flex; height: 100vh; overflow: hidden;
}

/* SIDEBAR */
.sidebar { width: 260px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 100; }
.brand { height: 64px; display: flex; align-items: center; padding: 0 20px; gap: 10px; border-bottom: 1px solid var(--line); font-weight: 900; font-size: 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--g-700); color: #fff; display: grid; place-items: center; font-size: 16px; }
.nav-links { padding: 16px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; border-radius: var(--r-md); transition: all 0.2s; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--g-700); color: #fff; box-shadow: var(--sh-sm); }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--line); }

/* MAIN */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 72px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; justify-content: space-between; }
.topbar h1 { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
#viewContainer { padding: 24px; overflow-y: auto; flex: 1; }

/* BUTTONS (Enhanced Sizes) */
.btn { 
  padding: 12px 24px; 
  border-radius: 99px; 
  border: none; 
  font-weight: 800; 
  font-size: 15px; 
  cursor: pointer; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
  text-decoration: none; 
  transition: all 0.2s ease; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.btn:active { transform: translateY(0); }

/* Special Large Button for Top Bar */
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(18, 179, 87, 0.4);
}
.btn-lg:hover {
  box-shadow: 0 6px 20px rgba(18, 179, 87, 0.5);
}

.btn-primary { background: var(--g-500); color: #fff; }
.btn-primary:hover { background: var(--g-600); }
.btn-outline { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--muted); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: #fff; padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--sh-sm); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--kpi-color); }
.kpi b { display: block; font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.kpi span { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); }

/* Panels & Tables */
.panel { background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--sh-sm); margin-bottom: 24px; overflow: hidden; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { font-size: 18px; font-weight: 900; }
.panel-body { padding: 24px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 16px 24px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 800; background: #FAFCFB; }

/* Badges */
.badge { padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.bg-red { background: #FEF2F2; color: var(--c-red); }
.bg-green { background: #ECFDF5; color: var(--g-500); }
.bg-orange { background: #FFF7ED; color: var(--c-orange); }
.bg-blue { background: #EFF6FF; color: var(--c-blue); }
.bg-yellow { background: #FEFCE8; color: #854D0E; }

/* Inputs & Forms */
.field label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.field input, .field select, .field textarea { 
  width: 100%; padding: 14px; border-radius: 10px; border: 1.5px solid var(--line); 
  font-family: inherit; font-size: 15px; transition: border-color 0.2s; 
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--g-500); }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 14px 28px; border-radius: 99px; font-weight: 700; opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 1000; box-shadow: var(--sh-md); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modals */
.modal-back { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(3,36,22,0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 500px; margin: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); overflow: hidden; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 18px; font-weight: 900; }
.modal-head button { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 24px; }
.modal-foot { padding: 20px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; background: #FAFCFB; }

/* Mobile Bottom Nav */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 100; padding: 8px 12px 20px 12px; justify-content: space-around; }
.bnav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 10px; font-weight: 800; padding: 4px; border-radius: 8px; transition: all 0.2s; }
.bnav-item svg { width: 24px; height: 24px; }
.bnav-item.active { color: var(--g-700); }
.bnav-item.active svg { stroke: var(--g-500); }

@media(max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .topbar { padding: 0 16px; height: 64px; }
  #viewContainer { padding: 16px 16px 90px 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi b { font-size: 22px; }
  /* Mobile adjustments for buttons */
  .btn-lg { padding: 12px 20px; font-size: 14px; }
}
