/* ==========================================================================
   PRIME ECOMMERCE HUB — ADMIN PORTAL CSS
   Complete Fully Responsive Design System (320px – 1920px+)
   ========================================================================== */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  max-width: 100%;
  box-sizing: border-box;
}

img, svg, video, iframe, canvas {
  max-width: 100%;
  height: auto;
}

/* ── Admin Login Page ── */
.admin-login-body {
  display: block;
  padding: 0;
  background: #080d16;
  min-height: 100vh;
}

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.admin-login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #111827;
}

.admin-login-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8,13,22,.15), rgba(8,13,22,.86));
}

.admin-login-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: left center;
}

.admin-login-copy {
  position: absolute;
  z-index: 1;
  left: clamp(20px, 6vw, 96px);
  bottom: clamp(24px, 6vw, 100px);
  max-width: 470px;
  padding-right: 20px;
}

.admin-login-copy .admin-brand-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  object-fit: contain;
}

.admin-login-copy h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(1.75rem, 3.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.admin-login-copy p {
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(0.88rem, 1.8vw, 1rem);
}

.admin-login-panel {
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 36px);
  background: #111827;
}

.admin-card {
  width: min(100%, 440px);
  padding: clamp(20px, 4vw, 38px);
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.admin-logo {
  text-align: center;
  margin-bottom: 24px;
}

.admin-logo-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
}

.admin-logo-mark img,
.db-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-logo h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
}

.admin-logo p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.82rem;
}

.admin-group {
  margin-bottom: 18px;
}

.admin-group label,
.db-form label {
  display: block;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.admin-group input,
.db-form input,
.db-form select,
.db-form textarea,
.db-search,
.db-select {
  width: 100%;
  padding: 11px 13px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 9px;
  color: #fff;
  outline: 0;
  font-size: 0.88rem;
  transition: border-color 0.15s ease;
}

.admin-group input:focus,
.db-form input:focus,
.db-form select:focus,
.db-form textarea:focus,
.db-search:focus,
.db-select:focus {
  border-color: #f43f5e;
}

.admin-btn,
.db-btn-primary {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  background: #e11d48;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.admin-btn:hover,
.db-btn-primary:hover {
  background: #be123c;
}

.admin-btn:disabled,
.db-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.admin-error {
  display: none;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid #fb7185;
  border-radius: 8px;
  background: rgba(136, 19, 55, 0.4);
  color: #fecdd3;
  text-align: center;
  font-size: 0.82rem;
}

.admin-error.show {
  display: block;
}

/* ── Dashboard Layout ── */
.db-body {
  display: flex;
  min-height: 100vh;
  background: #0f172a;
  overflow-x: hidden;
  width: 100%;
}

.db-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-right: 1px solid #29364d;
  overflow-y: auto;
  z-index: 100;
}

.db-brand {
  padding: 18px 16px;
  border-bottom: 1px solid #29364d;
}

.db-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.db-logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.db-logo-text strong,
.db-logo-text span {
  display: block;
}

.db-logo-text strong {
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.db-logo-text span {
  font-size: 0.63rem;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.db-nav {
  padding: 14px 10px;
  display: grid;
  gap: 3px;
}

.db-nav-label {
  margin: 12px 8px 4px;
  color: #64748b;
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.db-nav-link {
  padding: 9px 12px;
  border-radius: 8px;
  color: #a8b5c8;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
}

.db-nav-link:hover,
.db-nav-link.active {
  background: rgba(225, 29, 72, 0.18);
  color: #fff;
  font-weight: 600;
}

.db-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  margin-right: 8px;
  flex-shrink: 0;
}

.db-icon svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.db-main {
  margin-left: 240px;
  min-width: 0;
  flex: 1;
  width: 100%;
}

.db-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 clamp(12px, 3vw, 26px);
  background: #1e293b;
  border-bottom: 1px solid #334155;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 12px;
}

.db-topbar-title {
  font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-topbar-right,
.db-user {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  flex-shrink: 0;
}

.db-back-btn {
  padding: 7px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.db-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mini-avatar,
.db-avatar-lg {
  display: grid;
  place-items: center;
  background: #e11d48;
  color: #fff;
  font-weight: 800;
}

.mini-avatar {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* ── Content Sections ── */
.db-content {
  padding: clamp(16px, 3vw, 28px);
  max-width: 100%;
}

.db-section {
  display: none;
}

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

.db-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.db-section-head h2 {
  margin: 0 0 3px;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  color: #fff;
}

.db-section-head p {
  margin: 0;
  color: #94a3b8;
  font-size: clamp(0.8rem, 2vw, 0.88rem);
}

.db-section-head .db-btn-primary {
  width: auto;
}

/* ── Stats Grid ── */
.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.db-stat-card,
.db-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 15px;
  padding: clamp(14px, 2.5vw, 20px);
  min-width: 0;
}

.db-stat-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.db-stat-card small {
  display: block;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
}

.db-stat-card strong {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  color: #fff;
  margin-top: 2px;
  display: block;
}

.db-stat-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.db-stat-clickable:hover {
  transform: translateY(-2px);
  border-color: #f43f5e;
}

.db-stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  flex-shrink: 0;
}

/* ── Cards & Tables ── */
.db-card {
  margin-bottom: 20px;
}

.db-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.db-card-head h3 {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.db-card-head .db-btn-primary {
  width: auto;
}

.db-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.db-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.db-table th,
.db-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
}

.db-table th {
  color: #94a3b8;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #182436;
}

.db-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 800;
}

.db-pill.green {
  background: #dcfce7;
  color: #15803d;
}

.db-pill.amber {
  background: #fef3c7;
  color: #a16207;
}

.db-pill.red {
  background: #fee2e2;
  color: #b91c1c;
}

.db-btn-sm {
  padding: 5px 10px;
  border: 1px solid #475569;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.db-btn-sm:hover {
  background: #e11d48;
  border-color: #e11d48;
}

.db-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.db-search,
.db-select {
  width: auto;
}

/* ── Review Tabs & Rows ── */
.db-rtab {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.db-rtab.active {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}

.db-row {
  display: flex;
  gap: 20px;
}

/* ── Modals & Forms ── */
.db-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  place-items: center;
  padding: clamp(10px, 3vw, 20px);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.db-modal.open {
  display: grid;
}

.db-modal-box {
  width: min(100%, 540px);
  max-width: calc(100vw - 24px);
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(16px, 4vw, 26px);
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 16px;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.db-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.db-modal-head h3 {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
}

.db-modal-close {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.db-form {
  display: grid;
  gap: 14px;
}

.db-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.db-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  z-index: 95;
  transition: opacity 0.25s ease;
}

.db-overlay.show {
  display: block;
}

/* ── Toast Notifications ── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.db-toast {
  padding: 12px 18px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toastFadeIn 0.25s ease;
}

.db-toast-success {
  background: #10b981;
}

.db-toast-error {
  background: #e11d48;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile, Tablet, Desktop)
   ========================================================================== */

/* ── Tablets & Laptops (<= 1024px) ── */
@media (max-width: 1024px) {
  .db-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Tablet / Mobile Navigation Breakpoint (<= 900px) ── */
@media (max-width: 900px) {
  .db-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
    width: min(260px, 80vw);
  }

  .db-sidebar.open {
    transform: translateX(0);
  }

  .db-main {
    margin-left: 0;
    width: 100%;
  }

  .db-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    margin-right: 6px;
    min-width: 38px;
    min-height: 38px;
  }

  .db-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #cbd5e1;
  border-radius: 2px;
}
}

@media (min-width: 901px) {
  .db-toggle {
    display: none;
  }
}

/* ── Medium Mobile & Phablet (<= 820px) ── */
@media (max-width: 820px) {
  .admin-login-shell {
    display: block;
  }

  .admin-login-visual {
    min-height: 240px;
    max-height: 36vh;
  }

  .admin-login-visual img {
    object-position: center 60%;
  }

  .admin-login-copy {
    left: 20px;
    bottom: 20px;
  }

  .admin-login-copy h1 {
    font-size: 1.85rem;
  }

  .admin-login-panel {
    min-height: 64vh;
    padding: 24px 16px;
  }

  .db-row {
    flex-direction: column !important;
  }
}

/* ── Small Tablet & Mobile Cards (<= 680px) ── */
@media (max-width: 680px) {
  .db-card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .db-card-head .db-filters {
    width: 100%;
  }

  .db-card-head .db-btn-primary {
    width: 100%;
  }

  .db-search,
  .db-select {
    flex: 1;
    min-width: 130px;
  }
}

/* ── Mobile Standard (<= 520px) ── */
@media (max-width: 520px) {
  .db-content {
    padding: 14px 10px;
  }

  .db-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .db-form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .db-topbar {
    padding: 0 10px;
  }

  .db-back-btn span {
    display: none;
  }

  .db-user span {
    display: none;
  }

  .db-filters {
    width: 100%;
    flex-direction: column;
  }

  .db-search,
  .db-select {
    width: 100%;
  }

  .admin-card {
    padding: 24px 18px;
  }

  .admin-logo h2 {
    font-size: 1.15rem;
  }
}

/* ── Extra Small Mobile (<= 360px) ── */
@media (max-width: 360px) {
  .db-topbar-title {
    font-size: 0.92rem;
  }

  .db-card {
    padding: 12px 8px;
    border-radius: 12px;
  }

  .db-modal-box {
    padding: 14px 10px;
    border-radius: 12px;
  }

  .admin-card {
    padding: 18px 12px;
    border-radius: 14px;
  }

  .db-stat-card {
    padding: 12px 10px;
  }

  .db-stat-card strong {
    font-size: 1.15rem;
  }
}