/* admin.css */
body { margin:0; background:var(--bg-cream); }

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  background: var(--dark-green); color: rgba(255,255,255,0.8);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-brand {
  padding: 28px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-logo {
  font-family:'Outfit',sans-serif; font-weight:900; font-size:18px;
  color:#fff; letter-spacing:-0.3px;
}
.admin-role { font-size:11px; color:rgba(255,255,255,0.45); font-weight:700; letter-spacing:1px; margin-top:3px; }

.admin-nav { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.admin-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.65); text-decoration: none;
  transition: all 0.2s;
}
.admin-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-link.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 700; }

.admin-sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 2px;
}

/* MAIN */
.admin-main { padding: 32px 36px; overflow-y: auto; }

.admin-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.admin-page-title { font-size: 28px; font-weight: 800; color: var(--dark-green); margin-bottom: 4px; }
.admin-page-sub { font-size: 13px; color: var(--text-muted); }

/* TAB CONTENT */
.admin-tab-content { animation: fadeUp 0.3s ease both; }
.admin-tab-content.hidden { display: none !important; }

/* STAT CARDS */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; text-align: center;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sc-icon { font-size: 28px; margin-bottom: 10px; }
.sc-val {
  font-size: 32px; font-weight: 900; font-family: 'Outfit', sans-serif;
  color: var(--dark-green); line-height:1;
}
.sc-label { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 6px; }

/* ADMIN CARD */
.admin-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.admin-card-title { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 16px; }
.admin-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-card-header .admin-card-title { margin-bottom: 0; }
.admin-search-input {
  padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  font-size: 13px; outline: none; min-width: 200px; background: var(--bg-cream);
  transition: all 0.2s;
}
.admin-search-input:focus { border-color: var(--accent-green); }

/* TABLE */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); padding: 8px 14px;
  border-bottom: 1.5px solid var(--border);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-dark); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-cream); }

.tbl-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.tbl-img-placeholder { width:44px;height:44px;border-radius:10px;background:var(--pale-green);display:flex;align-items:center;justify-content:center;font-size:20px; }

.badge-avail   { background:#dcfce7; color:#15803d; padding:3px 10px; border-radius:20px; font-size:10px; font-weight:700; }
.badge-unavail { background:#fee2e2; color:#dc2626; padding:3px 10px; border-radius:20px; font-size:10px; font-weight:700; }
.badge-farmer  { background:var(--pale-green); color:var(--mid-green); padding:3px 10px; border-radius:20px; font-size:10px; font-weight:700; }

.tbl-action-btn {
  background: none; border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
  transition: all 0.2s; margin-right: 6px;
}
.tbl-action-btn.edit  { color: var(--accent-green); border-color: var(--accent-green); }
.tbl-action-btn.edit:hover  { background: var(--pale-green); }
.tbl-action-btn.del   { color: #dc2626; border-color: #fecaca; }
.tbl-action-btn.del:hover   { background: #fee2e2; }
.tbl-action-btn.toggle-btn  { color: var(--text-muted); }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,20,15,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.modal-box {
  background: var(--bg-white); border-radius: 22px;
  max-width: 640px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: fadeUp 0.3s ease;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 24px 0;
}
.modal-header h2 { font-size: 20px; font-weight: 800; color: var(--dark-green); }
.modal-close {
  background: var(--bg-cream); border: none; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer; font-size: 16px;
  color: var(--text-muted); transition: all 0.2s;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* TOGGLE */
.available-toggle { display: flex; align-items: center; }
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 500; }
.toggle-label input { display: none; }
.toggle-track {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--border); position: relative; transition: all 0.3s;
}
.toggle-label input:checked + .toggle-track { background: var(--dark-green); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}
.toggle-label input:checked + .toggle-track .toggle-thumb { left: 22px; }

/* SETUP LOG */
.setup-log {
  margin-top: 20px; padding: 16px; border-radius: 12px;
  background: #0d1117; color: #58a6ff;
  font-family: monospace; font-size: 13px;
  min-height: 80px; max-height: 400px; overflow-y: auto;
  display: none;
}
.setup-log.visible { display: block; }
.log-line { margin-bottom: 4px; }
.log-line.err { color: #f85149; }

/* TOAST */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  background: var(--dark-green); color: #fff;
  padding: 14px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  transform: translateY(0); opacity: 1; transition: all 0.3s ease;
}
.admin-toast.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* Empty state */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted); font-size: 14px;
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
