/* =========================================
   ROOT VARIABLES & GLOBAL STYLES
========================================= */
:root {
  --bg: #f7f8fa;
  --panel: #fff;
  --muted: #6b7280;
  --text: #0f172a;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* =========================================
   LAYOUT CONTAINERS
========================================= */
.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 1.3rem;
  margin: 0;
}

/* =========================================
   CARDS & GRID
========================================= */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.card-pad {
  padding: 16px;
}

/*Duplicate card plus */
.card2 {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.card-pad2 {
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

/* =========================================
   TEXT & BADGES
========================================= */
.price {
  color: var(--primary);
  font-weight: 700;
}

.badge,
.cartbadge {
  background: #dbeafe;
  color: #1e3a8a;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.cartbadge {
  background: #e0f2fe;
  color: #075985;
}

/* =========================================
   BUTTONS
========================================= */
.btn,
.linkbtn {
  display: inline-block;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn:hover {
  background: var(--primary-600);
}

.linkbtn {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

/* =========================================
   TABLES
========================================= */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

/* --- Admin Table Layout Fix --- */
.table th,
.table td {
  writing-mode: horizontal-tb !important;
  white-space: normal !important;
  text-orientation: mixed !important;
  transform: none !important;
  vertical-align: top !important;
  word-break: break-word !important;
}

.table {
  table-layout: auto !important;
  width: 100% !important;
}

/* === Admin Table Width Fixes === */
.table th,
.table td {
  white-space: nowrap;
  padding: 10px 12px;
  vertical-align: middle;
}

.table th:nth-child(2),
.table td:nth-child(2) {
  min-width: 240px;
  white-space: normal;
}

.table th:nth-child(3),
.table td:nth-child(3) {
  min-width: 300px;
  white-space: normal;
}

.table th:nth-child(4),
.table td:nth-child(4),
.table th:nth-child(5),
.table td:nth-child(5) {
  text-align: center;
  min-width: 100px;
}

.table td:last-child {
  min-width: 160px;
}

/* Scroll on smaller screens */
@media (max-width: 1024px) {
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =========================================
   FORMS
========================================= */
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.formrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .formrow {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   OTHER COMPONENTS
========================================= */
.notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 12px;
  margin: 16px 0;
  color: #075985;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
}

.footer {
  opacity: 0.7;
  margin: 30px 0 20px;
  text-align: center;
}

.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.qty {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qty input {
  max-width: 90px;
}

.login {
  max-width: 380px;
  margin: 80px auto;
}

.statcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ==============================
   FIXED ADMIN SIDEBAR LAYOUT
============================== */
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: #f7f8fa;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 24px 18px;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.sidebar h2 {
  font-size: 1.1rem;
  color: #1e3a8a;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin-bottom: 10px;
}

.sidebar ul li a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: #111827;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
  background: #2563eb;
  color: #fff;
}

/* --- Main Content --- */
.main {
  margin-left: 250px; /* matches sidebar width */
  flex: 1;
  padding: 30px;
  background: #fff;
  min-height: 100vh;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

/* ==============================
   RESPONSIVE (MOBILE)
============================== */
@media (max-width: 768px) {
  .sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background-color: #fff;
  border-right: 1px solid var(--border);
  padding: 20px;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.15);
  transition: all 0.35s ease-in-out;
  transform: translateX(0);
  z-index: 1000;
}

.sidebar.open {
  left: 0;
  transform: translateX(100px);
}

.sidebar.open ~ .main {
  filter: blur(2px);
  transition: filter 0.3s ease;
}

/* Overlay effect when sidebar is open */
body.sidebar-open::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 900;
  transition: opacity 0.3s ease;
}

  .menu-toggle {
    display: block;
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
  }

  .main {
    margin-left: 0;
    padding: 20px;
  }
}

/* =========================================
   MOBILE SIDEBAR TOGGLE
========================================= */
.menu-toggle {
  display: none;
  background: #0073e6;
  color: #fff;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 220px;
    height: 100%;
    background-color: #f5f7fa;
    border-right: 1px solid #ddd;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.open {
    left: 0;
  }

  main {
    margin-left: 0 !important;
    padding: 15px;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

/* =========================================
   FIXES (Buttons, Text, Cards)
========================================= */
.product-name,
.category-name,
.table td,
.table th,
button,
.btn {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  white-space: normal !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.card,
.table td {
  overflow: visible !important;
}

button,
.btn {
  writing-mode: horizontal-tb !important;
  transform: none !important;
  display: inline-block !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.main table {
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

.main td,
.main th {
  padding: 8px 10px !important;
  word-break: break-word !important;
}

@media (max-width: 768px) {
  .main,
  main {
    margin-left: 0 !important;
    width: 100% !important;
    box-shadow: none;
    border-radius: 0;
  }
}

/* =========================================
   SIDEBAR STYLE FIX (RESTORE VISUALS)
========================================= */
.sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  width: 250px;
  min-height: 100vh;
  padding: 24px 18px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar h2 {
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: #1e3a8a;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin-bottom: 8px;
}

.sidebar ul li a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #111827;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar ul li a:hover {
  background-color: #2563eb;
  color: #fff;
}

.sidebar ul li a.active {
  background-color: #1d4ed8;
  color: #fff;
}

/* --- Sidebar spacing between logo and links --- */
.sidebar img {
  display: block;
  margin: 0 auto 10px auto;
  max-width: 80px;
}

.sidebar small {
  display: block;
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

/* --- Ensure main content aligns correctly --- */
.main {
  margin-left: 260px;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* --- Mobile Sidebar Adjustment --- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 220px;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.open {
    left: 0;
  }

  .main {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
    background: #2563eb;
    color: #fff;
    padding: 10px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
  }
}

/* ===============================
   DYNAMIC ADMIN SIDEBAR STYLING
================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  padding: 20px 18px;
  overflow-y: auto;
  z-index: 1000;
  transition: left 0.3s ease;
}

.sidebar .brand-block {
  text-align: center;
  margin-bottom: 25px;
}

.sidebar .brand-block img {
  display: block;
  margin: 0 auto 6px;
}

.sidebar .brand-block h2 {
  font-size: 1rem;
  line-height: 1.3;
  color: #1e3a8a;
  margin: 0;
  font-weight: 700;
}

.sidebar .brand-block .tagline {
  font-size: 12px;
  color: #6b7280;
  margin: 6px 0 0 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin-bottom: 10px;
}

.sidebar ul li a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: #111827;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.sidebar ul li a.active {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  box-shadow: inset 2px 0 0 #1e3a8a;
}
.sidebar ul li a:hover,
.sidebar ul li a.active {
  background: #2563eb;
  color: #fff;
}

/* --- Main Area beside Sidebar --- */
.main {
  margin-left: 260px;
  padding: 30px;
  background: #fff;
  min-height: 100vh;
}

/* --- Toggle button (mobile) --- */
.menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  .sidebar {
    left: -260px;
  }

  .sidebar.open {
    left: 0;
  }

  .main {
    margin-left: 0;
    padding: 20px;
  }
}
tr[style*="fff7ed"] {
  transition: background 0.3s;
}

/* Review styling */
body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background: #fafafa;
}
table {
  background: #fff;
  border-collapse: collapse;
  width: 100%;
}
th {
  background: #f0f0f0;
}
td, th {
  padding: 8px;
  text-align: left;
}
button {
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}
button[value="approve"] { background: #4CAF50; color: #fff; }
button[value="reject"] { background: #FF9800; color: #fff; }
button[value="delete"] { background: #f44336; color: #fff; }

.btn.danger-btn {
  background:#dc2626;
  color:#fff;
  border:none;
  border-radius:6px;
  padding:6px 10px;
  cursor:pointer;
  font-weight:600;
}
.btn.danger-btn:hover {
  background:#b91c1c;
}
