/* ============================================================
   Urban Finds — Portal Styles (Vendor + Admin)
   Inherits design tokens from main.css
   ============================================================ */

/* --- Portal Layout --- */
.portal-body {
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sidebar + Main layout */
.portal-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 64px);
}

/* --- Sidebar --- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--cream-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--cream-border);
}

.sidebar-brand {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--green);
  font-weight: 600;
}

.sidebar-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 500;
}

.sidebar-nav { padding: 1rem 0.75rem; flex: 1; }

.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.5rem 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: all 0.18s;
  margin-bottom: 0.1rem;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--cream-dark);
  color: var(--green);
}

.sidebar-link.active {
  background: var(--green-light);
  color: var(--green);
  font-weight: 600;
}

.sidebar-link svg,
.sidebar-link .icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-link.active svg,
.sidebar-link.active .icon { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  background: var(--orange);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--cream-border);
}

/* --- Portal Top Bar --- */
.portal-topbar {
  background: var(--green);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-topbar .topbar-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--cream);
  font-weight: 600;
}

.portal-topbar .topbar-logo span {
  font-family: var(--font-script);
  font-style: italic;
  color: var(--orange);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: rgba(251,248,242,0.85);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* --- Portal Main Content --- */
.portal-main {
  flex: 1;
  overflow-x: hidden;
}

.portal-content {
  padding: 2rem;
  max-width: 1100px;
}

/* --- Portal Page Header --- */
.portal-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-page-header h1 {
  font-size: 1.75rem;
  color: var(--green);
}

.portal-page-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* --- Stat Cards (Dashboard) --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--green);
}

.stat-card.orange::before { background: var(--orange); }
.stat-card.gold::before { background: var(--gold); }
.stat-card.muted::before { background: var(--cream-border); }

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--green);
  line-height: 1;
}

.stat-card.orange .stat-value { color: var(--orange); }

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* --- Data Tables --- */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cream-border);
  gap: 1rem;
  flex-wrap: wrap;
}

.table-header h3 { font-size: 1rem; color: var(--green); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--cream-border);
  background: var(--cream);
  white-space: nowrap;
}

.data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--cream-border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--cream); }

.data-table .td-name { font-weight: 600; color: var(--green); }
.data-table .td-muted { color: var(--text-muted); font-size: 0.8rem; }

/* Table actions */
.table-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* --- Product Image Thumb --- */
.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--cream-border);
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--cream-dark);
  border: 1px solid var(--cream-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.product-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Panel (form container) --- */
.panel {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--cream-border);
  font-family: var(--font-serif);
}

/* --- Photo Upload --- */
.photo-upload-area {
  border: 2px dashed var(--cream-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--cream);
}

.photo-upload-area:hover {
  border-color: var(--green);
  background: var(--green-light);
}

.photo-upload-area p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }
.photo-upload-area .upload-icon { font-size: 2rem; color: var(--text-muted); }

/* --- Activity Feed --- */
.activity-feed { list-style: none; }
.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--cream-border);
  font-size: 0.83rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  margin-top: 0.35rem;
}
.activity-time { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }

/* --- Review Queue Card (Admin) --- */
.review-card {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.review-card-photos {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.review-card-photos img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-border);
}

.review-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--cream-border);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.85rem; max-width: 320px; margin: 0 auto 1.5rem; }

/* --- Auth Pages --- */
.auth-page {
  min-height: 100vh;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(28,28,26,0.2);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo .name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--green);
}

.auth-logo .script { color: var(--orange); }
.auth-logo .tagline { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; letter-spacing: 0.05em; }

.auth-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--green);
  margin-bottom: 0.35rem;
}
.auth-sub { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.auth-footer { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-footer a { color: var(--orange); font-weight: 600; }

/* --- Vendor status screen (pending) --- */
.status-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 2rem;
}

.status-card {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 480px;
  text-align: center;
}

.status-icon { font-size: 3.5rem; margin-bottom: 1.25rem; }
.status-card h2 { color: var(--green); margin-bottom: 0.75rem; }
.status-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* --- Responsive Portal --- */
@media (max-width: 900px) {
  .portal-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--cream-border);
  }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.75rem; }
  .sidebar-section-label { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-content { padding: 1.25rem; }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .portal-page-header { flex-direction: column; align-items: flex-start; }
}
