/* ==========================================================================
   Color Fiesta - Robust Admin CMS Dashboard Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --admin-primary: #3c5809;
  --admin-primary-dark: #223304;
  --admin-accent: #7ac30e;
  --admin-bg: #f9fbf6;
  --admin-card: #ffffff;
  --admin-text: #1a2408;
  --admin-muted: #5e6b4e;
  --admin-border: #e2ecd0;
  --admin-sidebar: #172403;
  --admin-sidebar-text: #8d9a7f;
  --admin-sidebar-active: #283d06;
  --radius: 10px;
}

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

body {
  font-family: 'Hind Siliguri', 'Outfit', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
}

/* ================= Auth Screen ================= */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #223304 0%, #172403 100%);
  padding: 16px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 36px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}
.auth-brand {
  text-align: center;
  margin-bottom: 26px;
}
.auth-brand h2 {
  font-size: 26px;
  color: var(--admin-primary);
  font-weight: 800;
  font-family: 'Outfit';
}
.auth-brand h2 span { color: var(--admin-accent); }
.auth-brand p {
  font-size: 13px;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* ================= Admin Layout ================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #283d06;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-header h2 {
  color: #fff;
  font-size: 20px;
  font-family: 'Outfit';
}
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
  background: var(--admin-primary);
  color: #fff;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #283d06;
  font-size: 12px;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-title h3 {
  font-size: 18px;
  font-weight: 700;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* Page Containers */
.admin-content {
  padding: 28px;
  flex: 1;
}
.page-view {
  display: none;
}
.page-view.active {
  display: block;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--admin-text);
  font-family: 'Outfit';
  margin-top: 4px;
}
.stat-lbl {
  font-size: 12px;
  color: var(--admin-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Tables */
.card-table-wrapper {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 24px;
}
.card-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: #f8fafc;
  color: var(--admin-muted);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}
.admin-table tbody tr:hover {
  background: #f8fafc;
}

/* Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pending { background: #fef3c7; color: #d97706; }
.status-confirmed { background: #e0f2fe; color: #0284c7; }
.status-processing { background: #f3e8ff; color: #7e22ce; }
.status-shipped { background: #e0e7ff; color: #4338ca; }
.status-delivered { background: #d1fae5; color: #059669; }
.status-cancelled { background: #fee2e2; color: #dc2626; }

/* Buttons & Inputs */
.btn-primary {
  background: var(--admin-primary);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--admin-primary-dark); }
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--admin-border);
  background: #fff;
}
.btn-danger-sm {
  color: #ef4444;
  border-color: #fca5a5;
}
.btn-danger-sm:hover {
  background: #ef4444;
  color: #fff;
}

/* Modal */
.admin-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.admin-modal-overlay.active {
  display: flex;
}
.admin-modal-box {
  background: #fff;
  border-radius: var(--radius);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}
