/* ================================================
   BOTANIVA BIO — Admin Styles
   ================================================ */

:root {
  --c-admin-bg: #f8f9fa;
  --c-admin-sidebar: #1a1a1a;
  --c-admin-primary: #611226; /* Botaniva Bordeaux */
  --c-admin-text: #333;
  --c-admin-border: #e0e0e0;
  --f-body: 'Poppins', sans-serif;
}

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

body {
  font-family: var(--f-body);
  background: var(--c-admin-bg);
  color: var(--c-admin-text);
  display: flex;
  min-height: 100vh;
}

/* --- Login Page --- */
.login-page {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(rgba(97, 18, 38, 0.8), rgba(61, 11, 24, 0.9)), url('./assets/images/hero.png');
  background-size: cover;
  background-position: center;
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 3.5rem;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 420px;
  text-align: center;
  z-index: 1;
  animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card h1 {
  font-family: 'Playfair Display', serif;
  color: var(--c-admin-primary);
  margin-bottom: 2rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--c-admin-border);
  border-radius: 8px;
  outline: none;
}

.btn-login {
  width: 100%;
  padding: 1rem;
  background: var(--c-admin-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.btn-login:hover {
  background: #7d2a3f;
}

/* --- Dashboard Layout --- */
#admin-dashboard {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--c-admin-sidebar);
  color: white;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 3rem;
  text-align: center;
  color: white;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
}

.sidebar-nav li {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-nav li:hover, .sidebar-nav li.active {
  background: rgba(255,255,255,0.1);
}

.sidebar-nav li.active {
  color: #fff;
  font-weight: 600;
  background: var(--c-admin-primary);
}

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- Content Sections --- */
.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  text-align: center;
}

.stat-card h3 {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.stat-card p {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--c-admin-primary);
}

/* --- Tables & Lists --- */
.card-table {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  overflow-x: auto;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

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

th {
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--c-admin-border);
  color: #666;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--c-admin-border);
}

.product-img-mini {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

.btn-edit { background: #2196F3; }
.btn-delete { background: #F44336; }
.btn-add {
  background: var(--c-admin-primary);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
}

.status-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-paid {
  background: #e3f9e5;
  color: #1a7f37;
}

.status-pending {
  background: #fff4e5;
  color: #b76e00;
}

.status-confirmed {
  background: #e5f1ff;
  color: #0056b3;
}

.status-select {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.status-select.status-paid { background: #e3f9e5; color: #1a7f37; }
.status-select.status-pending { background: #fff4e5; color: #b76e00; }
.status-select.status-confirmed { background: #e5f1ff; color: #0056b3; }

/* --- RESPONSIVE DASHBOARD --- */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  #admin-dashboard {
    flex-direction: column;
  }
  .card-table {
    overflow-x: auto;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    padding: 1.5rem 1rem;
    align-items: center;
  }
  .sidebar-logo {
    margin-bottom: 1.5rem;
  }
  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }
  .sidebar-nav li {
    padding: 0.6rem 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
  }
  .sidebar-nav li[onclick="logout()"] {
    margin-top: 0 !important;
  }
  .admin-main {
    padding: 1rem;
  }
  .admin-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    align-items: center;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .table-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .btn-add {
    width: 100%;
    text-align: center;
  }
}

