/* ============================================================
   PLAN UR EAT — Admin Panel CSS
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --admin-sidebar: 240px;
  --green: #228B22;
  --green-dark: #16A34A;
  --green-light: #E8F5E9;
  --orange: #F97316;
  --red: #DC2626;
  --blue: #3B82F6;
  --purple: #8B5CF6;
  --yellow: #F59E0B;
  --border: #E5E7EB;
  --text: #1F2937;
  --text-light: #6B7280;
  --bg: #F3F4F6;
  --white: #fff;
  --sidebar-bg: #1a1a2e;
  --sidebar-active: #228B22;
  --header-h: 64px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- LAYOUT ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.admin-sidebar {
  width: var(--admin-sidebar);
  background: var(--sidebar-bg);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--green);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.sidebar-logo .logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.sidebar-logo .logo-sub {
  color: rgba(255,255,255,.5);
  font-size: 11px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-section-label {
  color: rgba(255,255,255,.3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ---- MAIN CONTENT ---- */
.admin-main {
  margin-left: var(--admin-sidebar);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TOPBAR ---- */
.admin-topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-light);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 16px;
  position: relative;
  transition: background .2s;
}
.topbar-btn:hover { background: var(--border); }
.topbar-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid #fff; }

.admin-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  cursor: pointer;
}

/* ---- PAGE CONTENT ---- */
.admin-content {
  flex: 1;
  padding: 24px;
}

/* ---- STATS CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-value { font-family: 'Poppins', sans-serif; font-size: 28px; font-weight: 800; line-height: 1; color: var(--text); }
.stat-change { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ---- DATA TABLE ---- */
.admin-table-wrap {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
}

.table-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  background: #FAFAFA;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

/* ---- FORMS ---- */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full { grid-column: span 2; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-hint { font-size: 12px; color: var(--text-light); }

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #FEF2F2;
  color: var(--red);
  border: 1px solid #FECACA;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-orange { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-gray { background: #F3F4F6; color: #4B5563; }

/* ---- CARDS ---- */
.admin-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
}

.admin-card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- SEARCH ---- */
.search-wrap {
  position: relative;
}
.search-wrap input {
  padding-left: 36px;
}
.search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

/* ---- STATUS BADGE ---- */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

/* ---- MODALS ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- TOAST ---- */
#adminToast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1F2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s;
  max-width: 320px;
}
#adminToast.show { transform: translateY(0); opacity: 1; }

/* ---- CHART CONTAINER ---- */
.chart-container {
  position: relative;
  height: 260px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: span 1; }
}
