/* =============================================
   SMPFFPC - Green/Blue Agriculture Theme
   ============================================= */
:root {
  --primary: #1a7a4c;
  --primary-dark: #0f5c38;
  --primary-light: #e8f5e9;
  --secondary: #0288d1;
  --sidebar-bg: #0f5c38;
  --sidebar-text: #c8e6c9;
  --sidebar-hover: #1a7a4c;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f7f6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100vh;
  background: var(--sidebar-bg); color: #fff;
  z-index: 1000;
  overflow-y: auto;
  transition: width .3s ease;
}
.sidebar-header { padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h5 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.sidebar-header small { opacity: .7; font-size: .75rem; }
.sidebar .nav-link {
  color: var(--sidebar-text); padding: 10px 18px;
  font-size: .85rem; display: flex; align-items: center; gap: 10px;
  border-left: 3px solid transparent;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: var(--sidebar-hover); color: #fff; border-left-color: #fff;
}
.sidebar .nav-link i { width: 20px; flex-shrink: 0; }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar .nav-section {
  padding: 12px 18px 4px; font-size: .65rem;
  text-transform: uppercase; letter-spacing: 1px; opacity: .5;
}
/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
/* ===== TOPBAR ===== */
.topbar {
  background: #fff; padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  position: sticky; top: 0; z-index: 999;
  flex-shrink: 0;
}
.topbar .toggle-sidebar { cursor: pointer; font-size: 1.3rem; color: #555; background: none; border: none; padding: 4px 8px; }
.topbar .user-info { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.topbar .user-info .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.topbar .user-info .dropdown-toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: inherit; }
.topbar .user-info .dropdown-toggle::after { display: none; }
/* ===== PAGE CONTENT ===== */
.page-content { padding: 20px 24px; flex: 1; }
/* ===== FOOTER ===== */
.footer {
  background: #fff; padding: 12px 24px;
  border-top: 1px solid #e9ecef; font-size: .82rem; color: #777;
  flex-shrink: 0;
}
/* ===== CARDS ===== */
.card { border: none; border-radius: var(--radius); box-shadow: var(--card-shadow); margin-bottom: 1rem; }
.card-header {
  background: #fff; border-bottom: 1px solid #f0f0f0;
  font-weight: 600; padding: 12px 20px;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-body { padding: 18px 20px; }
.card.border-start { border-left: 4px solid var(--primary) !important; border-radius: 4px !important; }
/* ===== TABLES ===== */
.table { margin-bottom: 0; }
.table th { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: #777; border-top: none; }
.table td { vertical-align: middle; font-size: .88rem; }
.table-hover tbody tr:hover { background: var(--primary-light); }
/* ===== FORMS ===== */
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(26,122,76,0.15); }
.form-label { font-weight: 500; font-size: .85rem; color: #444; margin-bottom: .25rem; }
.form-section-title { font-weight: 700; color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 18px; margin-top: 24px; font-size: 1rem; }
/* ===== BUTTONS ===== */
.btn { border-radius: 6px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-success { background: #2e7d32; border-color: #2e7d32; }
.btn-info { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-info:hover { background: #0277bd; border-color: #0277bd; color: #fff; }
/* ===== BADGES ===== */
.badge { font-weight: 500; padding: .35em .7em; font-size: .75rem; }
.bg-primary { background: var(--primary) !important; }
.bg-info { background: var(--secondary) !important; }
/* ===== ALERTS ===== */
.alert { border-radius: 8px; border: none; }
/* ===== DROPDOWN ===== */
.dropdown-menu { border: none; box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-radius: 8px; }
.dropdown-item { padding: 8px 16px; font-size: .88rem; }
.dropdown-item i { margin-right: 8px; width: 16px; color: #888; }
/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 20px; }
.page-header h4 { font-weight: 700; margin: 0; color: #333; }
.page-header p { margin: 2px 0 0; color: #888; font-size: .85rem; }
/* ===== CERTIFICATE ===== */
.certificate-wrapper { border: 3px solid var(--primary); border-radius: 12px; padding: 30px; position: relative; background: #fff; }
.certificate-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 140px; color: rgba(26,122,76,0.04); font-weight: 900; pointer-events: none; z-index: 0; }
.certificate-content { position: relative; z-index: 1; }
/* ===== APPLICATION FORM ===== */
.application-form { background: #fff; border-radius: var(--radius); padding: 30px; box-shadow: var(--card-shadow); }
.application-header { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid var(--primary); }
.application-header h3 { color: var(--primary); font-weight: 700; }
.declaration-box { background: var(--primary-light); border-radius: 8px; padding: 20px; border: 1px solid #c8e6c9; margin: 20px 0; }
/* ===== COLLAPSED ===== */
.sidebar-collapsed .sidebar { width: 0; overflow: hidden; }
.sidebar-collapsed .main-content { margin-left: 0; }
/* ===== PUBLIC PAGE (no login) ===== */
body.public-page .sidebar { display: none !important; }
body.public-page .main-content { margin-left: 0; width: 100%; }
body.public-page .topbar { display: none; }
body.public-page .footer { display: none; }
/* ===== MISC ===== */
code { color: #d63384; font-size: .85em; }
.progress { border-radius: 8px; background: #e9ecef; }
.progress-bar { font-size: .7rem; font-weight: 600; }
/* ===== PRINT ===== */
@media print { .sidebar, .topbar, .footer, .no-print, .btn, .alert { display: none !important; } .main-content { margin-left: 0 !important; } }
/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .main-content { margin-left: 0; }
  .sidebar.mobile-show { width: 260px; }
  .page-content { padding: 12px; }
}
