/* ==========================================================================
   ZINGOBUY - PORTAL (ADMIN, SELLER, DELIVERY) STYLES
   ========================================================================== */

.portal-wrapper {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

.portal-sidebar {
  width: 260px;
  background: var(--color-primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 2px solid #ED1C24;
}

.portal-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-brand-logo {
  height: 48px;
  max-width: 160px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: contain;
  background: #000000;
  padding: 2px 6px;
}

.portal-brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 700;
}

.portal-role-badge {
  font-size: 0.65rem;
  background: linear-gradient(135deg, #FF2B33 0%, #ED1C24 100%);
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portal-nav {
  list-style: none;
  padding: 1rem 0;
  flex: 1;
}

.portal-nav-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.portal-nav-item.active a, .portal-nav-item a:hover {
  background: rgba(237, 28, 36, 0.12);
  color: #00A8F3;
  border-left: 4px solid #ED1C24;
}

.portal-nav-item a i {
  font-size: 1.1rem;
  width: 24px;
  color: #ED1C24;
}

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.portal-topbar {
  background: #ffffff;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-bottom: 1px solid #e2e8f0;
}

.portal-content {
  padding: 2rem;
  flex: 1;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* Portal Tables */
.portal-table-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.portal-table-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.portal-table th {
  background: #f8fafc;
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid #e2e8f0;
}

.portal-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.portal-table tr:hover td {
  background: #f8fafc;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-badge.completed, .status-badge.delivered, .status-badge.verified {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.pending, .status-badge.ordered {
  background: #fef9c3;
  color: #a16207;
}

.status-badge.shipped, .status-badge.out_for_delivery {
  background: #e0f2fe;
  color: #0369a1;
}

.status-badge.cancelled, .status-badge.rejected {
  background: #fee2e2;
  color: #b91c1c;
}

/* Responsive Portal Styles (Tablet & Mobile) */
@media (max-width: 992px) {
  .portal-wrapper {
    flex-direction: column;
  }

  .portal-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--color-gold);
  }

  .portal-brand {
    padding: 1rem 1.25rem;
    justify-content: space-between;
  }

  .portal-nav {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0.5rem;
    white-space: nowrap;
  }

  .portal-nav-item a {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px;
  }

  .portal-nav-item.active a {
    border-left: none;
    border-bottom: 3px solid var(--color-gold);
    background: rgba(245, 158, 11, 0.2);
  }

  .portal-content {
    padding: 1.25rem;
  }

  .portal-topbar {
    padding: 0.75rem 1.25rem;
  }

  .portal-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portal-table {
    min-width: 650px;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-val {
    font-size: 1.35rem;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
  }
}
