/**
 * FUGAZEE ADMIN CONSOLE STYLESHEET
 * Streetwear Raw Urban Monochrome Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* FUGAZEE Streetwear Monochrome Palette */
  --admin-bg: #F4F4F6;
  --admin-sidebar-bg: #09090B;
  --admin-sidebar-hover: #18181B;
  --admin-sidebar-active: #27272A;
  --admin-primary: #000000;
  --admin-primary-hover: #1E1E22;
  --admin-accent: #FFFFFF;
  --admin-surface: #FFFFFF;
  --admin-border: #E4E4E7;
  --admin-border-dark: #27272A;
  --admin-text: #09090B;
  --admin-muted: #71717A;
  --admin-subtle: #A1A1AA;
  --font-admin: 'Barlow', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-admin);
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Admin shell: fixed sidebar, scrollable main */
.admin-body {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

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

.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: 250px;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: var(--admin-sidebar-bg);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--admin-border-dark);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--admin-border-dark);
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #FFFFFF;
  text-transform: uppercase;
  line-height: 1.1;
}

.brand-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--admin-subtle);
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #A1A1AA;
  transition: all 0.2s ease;
}

.nav-icon {
  flex-shrink: 0;
  stroke: #A1A1AA;
  transition: stroke 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background-color: var(--admin-sidebar-hover);
  color: #FFFFFF;
}

.nav-item:hover .nav-icon, .nav-item.active .nav-icon {
  stroke: #FFFFFF;
}

.nav-item.active {
  font-weight: 700;
  background-color: var(--admin-sidebar-active);
  border-left: 3px solid #FFFFFF;
}

.storefront-link {
  border: 1px dashed #27272A;
  color: #D4D4D8;
}

.storefront-link:hover {
  border-color: #52525B;
  background: #18181B;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--admin-border-dark);
}

.admin-user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #A1A1AA;
}

/* Main Content */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.admin-topbar {
  height: 64px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-content {
  padding: 28px;
  flex: 1;
}

/* Alerts */
.alert-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 13px;
}

.alert-success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.alert-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-warning {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--admin-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--admin-muted);
  margin-top: 6px;
}

/* Tables */
.card-table {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 28px;
}

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

.table-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--admin-text);
  letter-spacing: -0.2px;
}

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

.admin-table th {
  background-color: #F8FAFC;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 800;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: #F8FAFC;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
}

.badge-paid { background: #DCFCE7; color: #166534; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-failed { background: #FEE2E2; color: #991B1B; }

.badge-confirmed { background: #E0E7FF; color: #3730A3; }
.badge-dispatched { background: #F3E8FF; color: #6B21A8; }
.badge-out { background: #FFEDD5; color: #9A3412; }
.badge-delivered { background: #DCFCE7; color: #166534; }
.badge-cancelled { background: #F1F5F9; color: #475569; }

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: var(--font-admin);
}

.btn-admin-primary {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

.btn-admin-primary:hover {
  background: #27272A;
  border-color: #27272A;
  color: #FFFFFF;
}

.btn-admin-outline {
  background: #FFFFFF;
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.btn-admin-outline:hover {
  background: #F4F4F5;
  border-color: #D4D4D8;
}

.btn-admin-danger {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #FECACA;
}

.btn-admin-danger:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--admin-text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background-color: var(--admin-surface);
  font-family: var(--font-admin);
  font-size: 13.5px;
  color: var(--admin-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

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

.form-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

/* Pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--admin-border);
  background: var(--admin-surface);
}

.pagination-links {
  display: flex;
  gap: 6px;
}

.page-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.page-btn.active {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

/* Toast Notification */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #09090B;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 860px) {
  .admin-body {
    height: auto;
    overflow: visible;
  }

  .admin-layout {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    overflow: visible;
    border-bottom: 1px solid var(--admin-border-dark);
  }

  .sidebar-brand {
    padding: 14px 18px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex: none;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
    padding: 9px 12px;
  }

  .nav-item.active {
    border-left: none;
    border-bottom: 2px solid #FFFFFF;
  }

  .sidebar-footer {
    padding: 10px 18px;
  }

  .admin-main {
    height: auto;
    overflow: visible;
  }

  .admin-topbar {
    position: static;
    height: auto;
    min-height: 60px;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-content {
    padding: 18px 16px;
  }

  .admin-detail-layout {
    grid-template-columns: 1fr !important;
  }
}
