/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #FAFAFA;
  color: #212121;
  line-height: 1.6;
  min-height: 100vh;
}

/* ========================================
   Container
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.header {
  background: #00A896;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.75rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.logo-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.logo-link:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.logo-link:active {
  transform: translateY(0);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* User chip */
.header-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #00A896;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-email {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.95;
}

/* Header nav divider */
.header-nav-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  margin: 0 2px;
}

/* Header nav button group */
.header-nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Compact nav buttons (shared base) */
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  text-decoration: none;
}

.btn-nav-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Environment switcher — outlined pill */
.btn-nav-env {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  gap: 7px;
}

.btn-nav-env:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Environment status dot */
.env-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.env-dot-prod {
  background: #69F0AE;
  box-shadow: 0 0 5px rgba(105, 240, 174, 0.8);
}

.env-dot-staging {
  background: #FFD740;
  box-shadow: 0 0 5px rgba(255, 215, 64, 0.8);
}

/* Sign out — muted, turns emphatic on hover */
.btn-nav-signout {
  color: rgba(255, 255, 255, 0.7);
}

.btn-nav-signout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* Compose Email — subtle accent pill */
.btn-nav-compose {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn-nav-compose:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #00A896;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #009886;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 137, 123, 0.3);
}

.btn-secondary {
  background: white;
  color: #00A896;
  border: 2px solid white;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
}

.btn-google {
  background: white;
  color: #757575;
  border: 1px solid #dadce0;
  width: 100%;
}

.btn-google:hover:not(:disabled) {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-icon {
  flex-shrink: 0;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* ========================================
   Auth Container
   ======================================== */
.auth-container {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  max-width: 400px;
  width: 100%;
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-title {
  font-size: 1.75rem;
  color: #212121;
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subtitle {
  color: #757575;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.input {
  padding: 14px 16px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: #00A896;
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}

.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: #757575;
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dadce0;
}

.divider span {
  padding: 0 16px;
}

.toggle-auth {
  text-align: center;
  margin-top: 20px;
  color: #757575;
  font-size: 0.9rem;
}

.toggle-auth a {
  color: #00A896;
  text-decoration: none;
  font-weight: 600;
}

.toggle-auth a:hover {
  text-decoration: underline;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 16px;
  border: 1px solid #ef9a9a;
}

/* ========================================
   Main App
   ======================================== */
.main-app {
  min-height: calc(100vh - 64px);
}

/* Compact Admin Header */
/* ========================================
   Admin Header - Unified Control Panel
   ======================================== */

.admin-header {
  background: white;
  border-bottom: 1px solid #E0E0E0;
  padding: 24px 0;
  margin-bottom: 24px;
}

/* Page Title */
.admin-page-title {
  margin-bottom: 20px;
}

.admin-page-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: #212121;
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}

.admin-page-title p {
  font-size: 14px;
  color: #757575;
  margin: 0;
}

/* Unified Control Panel */
.admin-control-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #F5F5F5;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid #E0E0E0;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.control-group-left {
  justify-content: flex-start;
}

.control-group-right {
  justify-content: flex-end;
  gap: 0;
}

.control-subgroup {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.control-panel-divider {
  width: 1px;
  height: 32px;
  background: #E0E0E0;
  flex-shrink: 0;
}

.control-spacer {
  flex: 1;
}

.control-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9E9E9E;
  font-weight: 600;
}

.button-group {
  display: flex;
  gap: 4px;
}

/* Unified Control Buttons */
.control-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: white;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  color: #424242;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.control-btn:hover {
  background: #FAFAFA;
  border-color: #00A896;
  color: #00897B;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 168, 150, 0.1);
}

.control-btn.active {
  background: #00A896;
  border-color: #00A896;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 168, 150, 0.25);
}

.control-btn .btn-icon {
  font-size: 16px;
  line-height: 1;
}

.control-btn .btn-text {
  line-height: 1;
}

/* Active Filters Bar */
.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  border-radius: 8px;
  margin-top: 16px;
}

.active-filters-bar .filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #E65100;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-clear-filters {
  background: #FF9800;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-clear-filters:hover {
  background: #F57C00;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(245, 124, 0, 0.3);
}

/* Partners Search Bar */
.partners-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #F5F5F5;
  border-radius: 8px;
  margin-top: 16px;
}

.search-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #9E9E9E;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #00A896;
  box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.1);
}

.search-input::placeholder {
  color: #BDBDBD;
}

/* Simple search input (no icon) */
.search-input-simple {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.2s ease;
}

.search-input-simple:focus {
  outline: none;
  border-color: #00A896;
  box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.1);
}

.search-input-simple::placeholder {
  color: #BDBDBD;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .admin-page-title h1 {
    font-size: 22px;
  }

  .admin-page-title p {
    font-size: 13px;
  }

  .admin-control-panel {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .control-group {
    width: 100%;
    justify-content: space-between;
    padding: 0;
  }

  .control-divider {
    display: none;
  }

  .button-group {
    flex: 1;
    justify-content: flex-end;
  }

  .control-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .control-btn .btn-text {
    display: none;
  }

  .control-btn .btn-icon {
    font-size: 18px;
  }

  .control-group-label {
    font-size: 10px;
  }

  .partners-search-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ========================================
   Loading & Error States
   ======================================== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #00A896;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  color: #757575;
  font-size: 1rem;
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.error-message-main {
  color: #c62828;
  font-size: 1.1rem;
  text-align: center;
}

/* Pagination Loading Indicator */
.pagination-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  margin: 20px 0;
  color: #757575;
  font-size: 0.95rem;
}

.pagination-loading .spinner-small {
  width: 24px;
  height: 24px;
  border: 3px solid #E3F2FD;
  border-top-color: #00A896;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ========================================
   Professional Items Grid
   ======================================== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0 0 3rem 0;
  min-height: 300px;
}

/* ========================================
   Professional Rich Item Card
   ======================================== */
.item-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 2px solid transparent;
}

.item-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: #00A896;
}

.item-card:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Ripple effect */
.item-card .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 168, 150, 0.3);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.item-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}

.item-placeholder {
  font-size: 4.5rem;
  color: #bdbdbd;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.item-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.item-description {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.item-category {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  color: #1976D2;
  padding: 0.4rem 0.85rem;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.15);
}

.item-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.item-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.15);
}

.star-icon {
  font-size: 1.1rem;
}

.rating-value {
  font-weight: 700;
  color: #F57C00;
  font-size: 0.95rem;
}

.rating-count {
  color: #795548;
  font-size: 0.85rem;
  font-weight: 500;
}

.no-rating {
  color: #9e9e9e;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  background: #f5f5f5;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  background: #f8f8f8;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
}

.item-meta > span {
  color: #666;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.contributors,
.time-ago {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

@media (min-width: 1024px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-header h1 {
    font-size: 1.75rem;
  }

  .admin-controls-compact {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .admin-header {
    padding: 0.75rem 0;
  }

  .admin-header h1 {
    font-size: 1.35rem;
  }

  .admin-header p {
    font-size: 0.85rem;
  }

  .admin-header-top {
    flex-direction: column;
    gap: 1rem;
  }

  .admin-controls-compact {
    width: 100%;
    justify-content: space-between;
  }

  .btn-control {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .btn-label {
    display: none;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .item-content {
    padding: 12px;
  }

  .user-info {
    gap: 4px;
  }

  .user-email {
    display: none;
  }

  .header-user-chip {
    padding: 4px;
  }

  .btn-nav span:not(.env-status-dot) {
    display: none;
  }

  .btn-nav {
    padding: 6px 8px;
  }

  .btn-nav-icon {
    display: block;
  }

  /* Table Responsive */
  .view-toggle {
    width: 100%;
  }

  .btn-view-toggle {
    flex: 1;
    justify-content: center;
  }

  .table-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .table-info {
    justify-content: space-between;
  }

  #batch-save-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.5rem;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .item-title {
    font-size: 0.95rem;
  }
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #757575;
}

.empty-state-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: #424242;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 1rem;
}

/* ========================================
   Admin Controls
   ======================================== */
.admin-controls {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.active-filters {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-chip {
  background: white;
  color: #00A896;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-clear-filters {
  background: rgba(255, 255, 255, 0.9);
  color: #c62828;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-filters:hover {
  background: white;
}

/* ========================================
   View Toggle
   ======================================== */
.view-toggle {
  display: flex;
  gap: 0;
  border: 2px solid white;
  border-radius: 8px;
  overflow: hidden;
}

.btn-view-toggle {
  padding: 10px 20px;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-view-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-view-toggle.active {
  background: white;
  color: #00A896;
}

.btn-view-toggle span {
  font-size: 1.1rem;
}

/* ========================================
   Table View
   ======================================== */
.items-table-container {
  padding-bottom: 3rem;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #e0e0e0;
}

.table-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modified-count {
  background: #FFF3E0;
  color: #E65100;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

#modified-number {
  background: #E65100;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

.table-wrapper {
  overflow-x: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

.items-table thead {
  background: linear-gradient(135deg, #1976D2 0%, #0D47A1 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.items-table th {
  padding: 10px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.items-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease;
}

.items-table tbody tr:hover {
  background: #f5f5f5;
}

.items-table tbody tr:nth-child(even) {
  background: #F8F9FA;
}

.items-table tbody tr:hover {
  background: #E3F2FD;
}

.items-table tbody tr.modified {
  background: #FFF3E0;
  border-left: 4px solid #FF9800;
}

.items-table tbody tr.modified:hover {
  background: #FFE0B2;
}

.items-table td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid #E0E0E0;
}

/* Column Widths */
.col-thumbnail {
  width: 70px;
  padding: 8px 6px;
}
.col-content {
  width: 400px;
  min-width: 350px;
  max-width: 500px;
}
.col-status {
  width: 80px;
  text-align: center;
  padding: 8px 6px;
}
.col-meta {
  width: 130px;
  font-size: 0.85rem;
}

/* Content Column Styling */
.content-group {
  margin-bottom: 8px;
}

.content-group:last-child {
  margin-bottom: 0;
}

.content-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.upc-group {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E0E0E0;
}

.upc-display {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1976D2;
  background: #E3F2FD;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.col-content .table-input {
  width: 100%;
  font-size: 0.85rem;
  padding: 6px 8px;
  border: 1px solid #DDD;
  border-radius: 4px;
}

.col-content .table-input:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.col-content .table-textarea {
  min-height: 50px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.4;
}

/* Actions Column */
.col-actions {
  width: 90px;
  text-align: center;
  padding: 8px 6px;
}

.btn-discard-row {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  background: #FFF3E0;
  color: #E65100;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-discard-row:hover {
  background: #FFE0B2;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(230, 81, 0, 0.3);
}

.discard-icon {
  font-size: 1.1rem;
  font-weight: bold;
}

/* Thumbnail Cell */
.table-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: #f5f5f5;
  display: block;
  border: 1px solid #E0E0E0;
}

.table-thumbnail-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #9E9E9E;
  border: 1px solid #E0E0E0;
}

/* Editable Inputs */
.table-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

.table-input:focus {
  outline: none;
  border-color: #00A896;
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}

.table-input.modified {
  border-color: #FF9800;
  background: #FFFBF5;
}

.table-textarea {
  min-height: 60px;
  resize: vertical;
  line-height: 1.4;
}

/* Checkbox Cells */
.table-checkbox-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.table-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1976D2;
}

/* Meta Column */
.table-meta {
  font-size: 0.75rem;
  color: #757575;
  line-height: 1.5;
}

.table-meta div {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  white-space: nowrap;
}

.table-meta div:last-child {
  margin-bottom: 0;
}

/* ========================================
   Modal Styles
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-large {
  max-width: 900px;
}

.modal-small {
  max-width: 450px;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-danger {
  background: #ffebee;
  border-bottom: 1px solid #ef5350;
}

.modal-header-danger h2 {
  color: #c62828;
}

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #757575;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: #f5f5f5;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.filter-option,
.sort-option {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.filter-option:last-child,
.sort-option:last-child {
  border-bottom: none;
}

.filter-option label,
.sort-option label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
}

.filter-checkbox,
.sort-radio {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Delete Confirmation Modal */
.delete-warning {
  text-align: center;
  padding: 12px 0;
}

.warning-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.warning-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #424242;
  margin: 12px 0;
}

.item-title-display {
  font-size: 1rem;
  color: #00A896;
  font-weight: 500;
  margin: 16px 0;
  padding: 12px;
  background: #E0F2F1;
  border-radius: 8px;
  word-wrap: break-word;
}

.warning-subtext {
  font-size: 0.9rem;
  color: #d32f2f;
  font-weight: 500;
  margin-top: 16px;
}

.btn-danger {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-danger:hover {
  background: #b71c1c;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-danger:disabled {
  background: #e57373;
  cursor: not-allowed;
  transform: none;
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: bottom 0.3s ease;
  z-index: 10000;
  max-width: 90%;
  text-align: center;
}

.notification-toast.show {
  bottom: 32px;
}

.notification-success {
  background: #2e7d32;
}

.notification-error {
  background: #c62828;
}

.notification-info {
  background: #1976d2;
}

/* ========================================
   Professional Status Badges
   ======================================== */
.item-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  z-index: 10;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.badge-complete {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(56, 142, 60, 0.95) 100%);
  color: white;
}

.badge-incomplete {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.95) 0%, rgba(230, 81, 0, 0.95) 100%);
  color: white;
}

.badge-partner {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.95) 0%, rgba(21, 101, 192, 0.95) 100%);
  color: white;
}

.badge-duplicate {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.95) 0%, rgba(106, 27, 154, 0.95) 100%);
  color: white;
}

.badge-reported {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(198, 40, 40, 0.95) 100%);
  color: white;
}

/* ========================================
   Admin Item Actions
   ======================================== */
.item-actions {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  flex-wrap: nowrap;
}

.btn-action {
  padding: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
}

.btn-view {
  background: #E3F2FD;
  color: #1565C0;
}

.btn-view:hover {
  background: #BBDEFB;
}

.btn-complete {
  background: #E8F5E9;
  color: #2E7D32;
}

.btn-complete:hover {
  background: #C8E6C9;
}

.btn-delete {
  background: #FFEBEE;
  color: #C62828;
}

.btn-delete:hover {
  background: #FFCDD2;
}

.btn-edit {
  background: #FFF8E1;
  color: #E65100;
}

.btn-edit:hover {
  background: #FFECB3;
}

/* ========================================
   Edit Item Modal — Status Flag Toggles
   ======================================== */

.edit-flags-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.flag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid #E0E0E0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.flag-toggle:hover {
  border-color: #BDBDBD;
  background: #FAFAFA;
}

.flag-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1976D2;
}

.flag-toggle input[type="checkbox"]:checked + .flag-label {
  font-weight: 600;
}

.flag-label {
  font-size: 0.875rem;
  color: #424242;
}

/* ========================================
   Edit Item Modal — OCR Section
   ======================================== */

.ocr-hint {
  font-size: 0.825rem;
  color: #757575;
  margin: 0 0 12px;
}

.ocr-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.ocr-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 110px;
}

.ocr-image-thumb {
  width: 110px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid #E0E0E0;
  background: #F5F5F5;
}

.btn-ocr-run {
  width: 100%;
  padding: 5px 0;
  font-size: 0.78rem;
  font-weight: 600;
  background: #E8EAF6;
  color: #3949AB;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-ocr-run:hover:not(:disabled) {
  background: #C5CAE9;
}

.btn-ocr-run:disabled {
  opacity: 0.55;
  cursor: default;
}

.ocr-result-box {
  border: 1.5px solid #E0E0E0;
  border-radius: 8px;
  padding: 12px;
  background: #FAFAFA;
}

.ocr-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ocr-result-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #424242;
}

.ocr-text-output {
  background: #F5F5F5;
  font-family: monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.ocr-apply-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ocr-upload-hint {
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.ocr-upload-hint p {
  margin: 0;
  font-size: 0.82rem;
  color: #E65100;
}

.ocr-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ocr-upload-note {
  font-size: 0.78rem;
  color: #9E9E9E;
}

.ocr-loading,
.ocr-no-images {
  font-size: 0.82rem;
  color: #9E9E9E;
  padding: 4px 0;
  margin: 0;
}

/* ── Saved OCR texts list ─────────────────────────────────────────────────── */

.saved-ocr-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e8e0f7;
  border-radius: 8px;
  background: #faf7ff;
  margin-bottom: 8px;
}

.saved-ocr-index {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7c3aed;
  min-width: 18px;
  padding-top: 2px;
}

.saved-ocr-text {
  flex: 1;
  font-size: 0.88rem;
  color: #212121;
  line-height: 1.45;
  word-break: break-word;
  user-select: text;
}

.saved-ocr-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* ========================================
   Professional Item Detail Modal Content
   ======================================== */
/* ========================================
   Elegant Item Detail View
   ======================================== */

.item-detail-elegant {
  padding: 0;
}

/* Hero Section */
.detail-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #E0E0E0;
}

.detail-hero-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #F5F5F5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.detail-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: linear-gradient(135deg, #F5F5F5 0%, #EEEEEE 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #BDBDBD;
}

.placeholder-icon {
  font-size: 80px;
  opacity: 0.3;
}

.detail-hero-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-upc {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #757575;
  font-weight: 600;
}

.upc-value {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  color: #212121;
  letter-spacing: 0.5px;
}

.detail-description {
  font-size: 15px;
  line-height: 1.7;
  color: #424242;
  margin: 0;
}

/* Stats Grid */
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid #E0E0E0;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #00A896;
  box-shadow: 0 4px 12px rgba(0, 168, 150, 0.1);
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #F5F5F5;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-complete .stat-icon {
  background: #E8F5E9;
  color: #4CAF50;
}

.stat-incomplete .stat-icon {
  background: #FFF3E0;
  color: #FF9800;
}

.stat-rating .stat-icon {
  background: #FFF9C4;
  color: #F57C00;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-label {
  font-size: 12px;
  color: #757575;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 22px;
  color: #212121;
  font-weight: 600;
  line-height: 1.2;
}

.stat-subtitle {
  font-size: 13px;
  color: #9E9E9E;
  font-weight: 400;
  margin-left: 4px;
}

/* Information Sections */
.detail-sections {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #E0E0E0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: white;
}

.info-row:first-child {
  border-radius: 12px 12px 0 0;
}

.info-row:last-child {
  border-radius: 0 0 12px 12px;
}

.info-label {
  font-size: 14px;
  color: #616161;
  font-weight: 500;
}

.info-value {
  font-size: 14px;
  color: #212121;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .detail-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .detail-hero-image,
  .detail-hero-placeholder {
    max-width: 300px;
    margin: 0 auto;
  }

  .upc-value {
    font-size: 22px;
  }

  .detail-stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 18px;
  }
}

.detail-section {
  grid-column: 1 / -1;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
  border-radius: 16px;
  border: 2px solid #ffb74d;
}

.detail-section h3 {
  margin: 0 0 1rem 0;
  color: #e65100;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-section h3::before {
  content: '⚠️';
  font-size: 1.5rem;
}

.report-card {
  background: white;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border-left: 4px solid #ff5722;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.report-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.report-card p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.report-card strong {
  color: #d84315;
  font-weight: 600;
}

.report-meta {
  font-size: 0.8rem;
  color: #757575;
  margin-top: 1rem !important;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-meta::before {
  content: '👤';
}

/* ========================================
   Environment Badges and Switcher
   ======================================== */
.env-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  vertical-align: middle;
}

.env-staging {
  background: #E3F2FD;
  color: #1565C0;
}

.env-prod {
  background: #FFEBEE;
  color: #C62828;
  animation: pulse-prod 2s ease-in-out infinite;
}

@keyframes pulse-prod {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0);
  }
}

.btn-env {
  background: #FFF3E0;
  color: #E65100;
  border: 2px solid #FFB74D;
  padding: 8px 16px;
  margin: 0 8px;
}

.btn-env:hover {
  background: #FFE0B2;
  border-color: #FF9800;
}

.env-warning {
  padding: 12px;
  background: #FFF3E0;
  border-left: 4px solid #FF9800;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #E65100;
}

.env-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.env-option {
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.env-option:hover {
  border-color: #00A896;
  background: #E0F2F1;
}

.env-option label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  width: 100%;
}

.env-option input[type="radio"] {
  margin-top: 4px;
  margin-right: 12px;
  cursor: pointer;
}

.env-option span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.env-option strong {
  font-size: 1rem;
  color: #212121;
}

.env-option small {
  font-size: 0.85rem;
  color: #757575;
}

.env-option input[type="radio"]:checked ~ span strong {
  color: #00A896;
}

/* ========================================
   Mark Complete Modal Styles
   ======================================== */
.modal-item-title {
  font-size: 1.25rem;
  color: #212121;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #00A896;
}

.form-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #424242;
  margin-bottom: 12px;
}

.required {
  color: #C62828;
  font-weight: 700;
}

.optional {
  color: #757575;
  font-weight: 400;
  font-size: 0.9rem;
}

/* ========================================
   Professional Form Inputs
   ======================================== */
.modal-item-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #E0E0E0;
}

.modal-item-code {
  display: inline-block;
  font-size: 0.85rem;
  color: #757575;
  font-family: 'Courier New', monospace;
  background: #F5F5F5;
  padding: 4px 12px;
  border-radius: 4px;
  margin-left: 12px;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #424242;
  margin-bottom: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #00A896;
  box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #BDBDBD;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Suggestions */
.suggestions-container {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #F5F5F5;
  border: 1px solid #E0E0E0;
  border-radius: 16px;
  font-size: 0.85rem;
  color: #616161;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-chip:hover {
  background: #E0F2F1;
  border-color: #00A896;
  color: #00897B;
}

.suggestion-chip .count {
  background: #E0E0E0;
  color: #616161;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.suggestion-chip.ai-suggestion {
  background: linear-gradient(135deg, #E8EAF6 0%, #E1BEE7 100%);
  border-color: #9575CD;
  color: #5E35B1;
}

.suggestion-chip.ai-suggestion .ai-badge {
  font-size: 0.75rem;
}

/* AI Assistance Section */
.ai-assist-header {
  margin-bottom: 12px;
}

.btn-toggle-section {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #424242;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.btn-toggle-section:hover {
  background: #F5F5F5;
  color: #00897B;
}

.toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.btn-toggle-section.expanded .toggle-icon {
  transform: rotate(90deg);
}

.ai-assist-content {
  padding: 16px;
  background: #F3E5F5;
  border-radius: 8px;
  border: 2px solid #CE93D8;
  margin-top: 8px;
}

.ai-assist-description {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  color: #6A1B9A;
}

.ai-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #E8F5E9;
  border: 1px solid #81C784;
  border-radius: 6px;
  color: #2E7D32;
  font-size: 0.9rem;
  margin-top: 12px;
}

.success-icon {
  font-size: 1.2rem;
  color: #4CAF50;
}

/* Images Section */
.images-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.no-content-message {
  text-align: center;
  padding: 40px 20px;
  color: #9E9E9E;
  font-style: italic;
  background: #FAFAFA;
  border-radius: 8px;
  border: 2px dashed #E0E0E0;
}

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
  background: #FAFAFA;
  border-radius: 8px;
}

.radio-option {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #E0E0E0;
  transition: all 0.2s ease;
}

.radio-option:hover {
  border-color: #00A896;
  background: #E0F2F1;
}

.radio-option label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  width: 100%;
}

.radio-option input[type="radio"] {
  margin-top: 4px;
  margin-right: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.radio-option span {
  flex: 1;
  line-height: 1.5;
}

.vote-count {
  color: #757575;
  font-size: 0.85rem;
  font-weight: 400;
}

.no-options {
  text-align: center;
  color: #757575;
  font-style: italic;
  padding: 20px;
}

/* ========================================
   Images Grid (Mark Complete Modal)
   ======================================== */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 12px;
  background: #FAFAFA;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.selectable-image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.selectable-image:hover {
  border-color: #00A896;
  transform: scale(1.05);
}

.selectable-image.selected {
  border-color: #00A896;
  box-shadow: 0 4px 12px rgba(0, 137, 123, 0.3);
}

.selectable-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-selection-number {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: #00A896;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.selectable-image:not(.selected) .image-selection-number {
  display: none;
}

/* ========================================
   Mark Complete — Card Selection UI (matches Flutter AdminCompletionModal)
   ======================================== */

/* Dark header */
.mc-dark-header {
  background: #111 !important;
  border-radius: 8px 8px 0 0;
}
.mc-dark-header h2 { color: #fff !important; }
.mc-dark-header .modal-close { color: #fff !important; }

/* Item info banner (UPC + submission count) */
.mc-item-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 20px;
}
.mc-upc-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.mc-sub-count {
  background: #fed7aa;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

/* Section headers */
.mc-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mc-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.mc-required-badge {
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  background: #fee2e2;
  padding: 1px 6px;
  border-radius: 4px;
}
.mc-optional-label {
  font-size: 13px;
  color: #6b7280;
  font-style: italic;
}

/* Options container */
.mc-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Selectable option card */
.mc-option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.mc-option-card:hover { border-color: #6ee7b7; background: #f0fdf4; }
.mc-option-card.selected {
  border: 2px solid #16a34a;
  background: #f0fdf4;
}
.mc-ai-card { border-style: dashed; border-color: #c4b5fd; }
.mc-ai-card:hover { border-color: #7c3aed; background: #faf5ff; }
.mc-ai-card.selected { border: 2px solid #7c3aed; background: #faf5ff; }

/* Radio dot */
.mc-radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  margin-top: 1px;
  position: relative;
}
.mc-radio.checked {
  border-color: #16a34a;
  background: #16a34a;
}
.mc-radio.checked::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  top: 4px;
  left: 4px;
}
.mc-ai-card .mc-radio.checked { border-color: #7c3aed; background: #7c3aed; }

/* Card text */
.mc-card-body { flex: 1; min-width: 0; }
.mc-card-label {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  word-break: break-word;
}
.mc-option-card.selected .mc-card-label { font-weight: 600; }
.mc-card-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Empty state */
.mc-empty-msg {
  padding: 14px;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* ========================================
   Mobile Responsive for Mark Complete Modal
   ======================================== */
@media (max-width: 767px) {
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .modal-item-title {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 0.95rem;
  }

  .radio-option {
    padding: 10px;
  }

  .image-selection-number {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    top: 4px;
    right: 4px;
  }
}

/* ========================================
   Perplexity AI Integration Styles
   ======================================== */

.ai-query-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #E3F2FD;
  border-radius: 8px;
  border: 2px solid #2196F3;
}

.btn-ai-query {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ai-query:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-ai-query:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-icon {
  font-size: 1.2rem;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1976D2;
  font-weight: 500;
  padding: 8px 0;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 3px solid #E3F2FD;
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #FFEBEE;
  border-radius: 6px;
  color: #C62828;
  font-size: 0.9rem;
  margin-top: 8px;
}

.error-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.btn-link {
  background: none;
  border: none;
  color: #2196F3;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  margin-left: auto;
}

.btn-link:hover {
  color: #1976D2;
}

.ai-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #E8F5E9;
  border-radius: 6px;
  color: #2E7D32;
  font-weight: 500;
  margin-top: 12px;
  animation: slideIn 0.3s ease;
}

.success-icon {
  font-size: 1.2rem;
  color: #4CAF50;
}

.ai-option {
  background: linear-gradient(to right, #E3F2FD 0%, white 100%);
  border-left: 4px solid #2196F3;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.ai-option:hover {
  border-left-color: #1976D2;
  background: linear-gradient(to right, #BBDEFB 0%, #E3F2FD 100%);
}

.ai-badge {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

.confidence-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 6px;
}

.confidence-high {
  background: #C8E6C9;
  color: #2E7D32;
}

.confidence-medium {
  background: #FFF9C4;
  color: #F57F17;
}

.confidence-low {
  background: #FFCCBC;
  color: #D84315;
}

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

/* Responsive styles for AI components */
@media (max-width: 768px) {
  .ai-query-section {
    padding: 12px;
  }

  .btn-ai-query {
    font-size: 0.9rem;
    padding: 10px 16px;
  }

  .ai-badge {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    width: fit-content;
  }

  .confidence-badge {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    width: fit-content;
  }
}

/* ========================================
   AI-Modified Table Cells
   ======================================== */

.ai-modified {
  background: linear-gradient(to right, #E3F2FD 0%, white 100%) !important;
  border-left: 3px solid #2196F3 !important;
}

.ai-indicator {
  display: inline-block;
  font-size: 1.2rem;
  margin-left: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Bulk AI button in table */
#bulk-ai-query-btn {
  margin-right: 12px;
}

/* Partners View Styles */
.partners-controls {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Partner Card */
.partner-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.partner-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.partner-avatar-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border-radius: 16px 16px 0 0;
}

.partner-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.partner-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.partner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.badge-partner {
  background-color: rgba(33, 150, 243, 0.1);
  color: #1976D2;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.partner-email {
  color: #757575;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.partner-stats {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #616161;
  margin-top: 12px;
}

/* Partner Detail Modal */
.partner-detail-header {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border-radius: 12px;
}

.partner-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.partner-avatar-large-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  border: 4px solid white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.partner-info h2 {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
}

.partner-stats-large {
  display: flex;
  gap: 32px;
  margin-top: 16px;
}

.partner-stats-large .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.partner-stats-large .stat strong {
  font-size: 1.75rem;
  color: #1976D2;
  font-weight: 700;
}

.partner-stats-large .stat span {
  font-size: 0.85rem;
  color: #757575;
}

.partner-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.partner-item-card {
  cursor: pointer;
}

.partner-item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.partner-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.partner-status-badge.active {
  background: #dcfce7;
  color: #15803d;
}

.partner-status-badge.paused {
  background: #fff7ed;
  color: #c2410c;
}

.partner-item-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.btn-sm {
  font-size: 11px;
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn-orange { background: #fb923c; color: #fff; }
.btn-green  { background: #22c55e; color: #fff; }
.btn-red    { background: #ef4444; color: #fff; }
.btn-gray   { background: #9ca3af; color: #fff; }

/* Partner section card (banner + status inside detail modal) */
.partner-section-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.partner-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.partner-section-icon { font-size: 15px; }
.partner-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
}

/* Banner preview */
.partner-banner-preview {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  margin-bottom: 10px;
}
.partner-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.partner-banner-overlay-topleft {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.partner-label-badge {
  background: rgba(0,0,0,0.54);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
}
.partner-banner-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}
.partner-banner-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #9ca3af;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid #fff;
}
.partner-banner-name {
  background: rgba(0,0,0,0.54);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-banner-overlay-bottomright {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.54);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
}
.partner-banner-placeholder {
  width: 100%;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  color: #9ca3af;
  margin-bottom: 10px;
  gap: 4px;
  font-size: 13px;
}
.partner-banner-placeholder span { font-size: 28px; }

/* Social tags */
.social-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.social-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: #f3f4f6;
  border-radius: 4px;
  color: #374151;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.social-tag-link:hover {
  background: #dbeafe;
  color: #1d4ed8;
  text-decoration: underline;
}
.social-tag-empty { font-size: 11px; color: #9ca3af; }

/* Banner status row */
.banner-status-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.banner-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.banner-status-label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}
.banner-status-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}
.banner-status-approved { background: #dcfce7; color: #15803d; }
.banner-status-denied   { background: #fee2e2; color: #b91c1c; }
.banner-status-inReview { background: #fff7ed; color: #c2410c; }
.banner-status-none     { background: #f3f4f6; color: #9ca3af; }
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.empty-state-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: #757575;
}

/* View toggle three buttons */
.view-toggle-compact .btn-view {
  min-width: 44px;
}

/* Responsive */
@media (max-width: 768px) {
  .partner-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .partner-items-grid {
    grid-template-columns: 1fr;
  }
  .partners-controls {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════
   REQUESTS VIEW
   ═══════════════════════════════════════════════════════════ */

/* View button badge (pending count) */
.requests-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  line-height: 1;
}

/* Container */
.requests-container {
  padding: 0 0 48px;
}

/* Toolbar: tabs + refresh button */
.requests-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 12px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0;
}

.requests-tabs {
  display: flex;
  gap: 4px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 3px;
}

.req-tab {
  padding: 6px 18px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #616161;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.req-tab:hover {
  background: #ececec;
  color: #212121;
}

.req-tab.active {
  background: #fff;
  color: #00897B;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* List of rows */
.requests-list {
  display: flex;
  flex-direction: column;
}

/* Individual request row */
.request-row {
  display: grid;
  grid-template-columns: 48px 1fr auto 24px;
  align-items: center;
  gap: 14px;
  padding: 14px 4px 14px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}

.request-row:hover {
  background: #f7fffe;
}

/* Avatar circle */
.req-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00897B, #26C6DA);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
}

/* Main content */
.req-main {
  min-width: 0;
}

.req-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.req-name {
  font-weight: 600;
  font-size: 15px;
  color: #212121;
}

.req-email {
  font-size: 13px;
  color: #757575;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.req-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #9e9e9e;
  margin-bottom: 6px;
}

.req-meta a.req-website {
  color: #00897B;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  display: inline-block;
}

.req-meta a.req-website:hover {
  text-decoration: underline;
}

.req-social {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Social platform pill */
.social-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Status badges for requests */
.badge-pending {
  background: #FFF8E1;
  color: #F9A825;
  border: 1px solid #FFE082;
}

.badge-approved {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.badge-rejected {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #EF9A9A;
}

/* Date column */
.req-date {
  font-size: 12px;
  color: #bdbdbd;
  white-space: nowrap;
}

/* Chevron */
.req-chevron {
  font-size: 20px;
  color: #bdbdbd;
  font-weight: 300;
  line-height: 1;
}

/* ── Request Detail Modal ── */

.req-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.req-banner-ok {
  background: #E8F5E9;
  border-color: #A5D6A7;
  color: #2E7D32;
}

.req-banner-warn {
  background: #FFEBEE;
  border-color: #EF9A9A;
  color: #C62828;
}

.req-banner span:first-child {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.req-detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.req-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00897B, #26C6DA);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.req-detail-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #212121;
}

.req-detail-email {
  font-size: 13px;
  color: #757575;
  margin: 0 0 8px;
}

.req-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #9e9e9e;
}

.req-detail-meta a {
  color: #00897B;
  text-decoration: none;
}

.req-detail-meta a:hover {
  text-decoration: underline;
}

/* Section heading */
.req-section {
  margin-bottom: 20px;
}

.req-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #9e9e9e;
  margin-bottom: 10px;
}

/* Social rows inside detail */
.req-social-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.req-social-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fafafa;
}

.req-social-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.req-social-info {
  flex: 1;
  min-width: 0;
}

.req-social-platform {
  font-size: 13px;
  font-weight: 600;
  color: #212121;
  display: block;
}

.req-social-handle {
  font-size: 12px;
  color: #757575;
}

.req-social-count {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.req-social-link {
  color: #9e9e9e;
  font-size: 14px;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}

.req-social-link:hover {
  color: #00897B;
}

/* Bio */
.req-bio {
  font-size: 14px;
  color: #424242;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

/* Status note in footer */
.req-status-note {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #9e9e9e;
  margin-left: auto;
}

/* ── Toast notification ── */
.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  pointer-events: none;
}

.admin-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.admin-toast-success { background: #2E7D32; }
.admin-toast-error   { background: #C62828; }
.admin-toast-info    { background: #1565C0; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .request-row {
    grid-template-columns: 40px 1fr auto;
  }
  .req-chevron { display: none; }
  .req-date { display: none; }
  .req-detail-header { flex-direction: column; align-items: center; text-align: center; }
  .req-detail-meta { justify-content: center; }
}

/* ========================================
   Send Email Composer Modal
   ======================================== */
.modal-email {
  max-width: 80vw;
  width: 80vw;
}

.modal-header-email {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  border-bottom: none !important;
  color: #fff;
  padding: 20px 24px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-email h2,
.modal-header-email p {
  color: #fff !important;
}

.email-composer-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff !important;
}

.email-composer-subtitle {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8) !important;
}

.modal-header-email-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-header-email-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.modal-close-white {
  color: rgba(255,255,255,0.85) !important;
}
.modal-close-white:hover {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}

.email-composer-body {
  padding: 0;
}

.email-field-row {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  margin-bottom: 0;
  gap: 16px;
}

.email-field-label {
  width: 64px;
  min-width: 64px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
}

.email-field-value {
  flex: 1;
}

.email-field-input {
  border: none !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  font-size: 0.95rem;
  background: transparent !important;
}
.email-field-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.email-from-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.88rem;
  color: #374151;
  font-weight: 500;
}

.email-from-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.email-composer-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 0 24px;
}

.form-section.email-body-section {
  padding: 16px 24px 0;
  margin-bottom: 0;
}

/* Override form-section margin for the body textarea row */
.email-composer-body .form-section:last-of-type {
  padding: 16px 24px 0;
  margin-bottom: 0;
}

.email-body-textarea {
  min-height: 660px;
  border-radius: 10px;
  font-size: 0.93rem;
  line-height: 1.6;
  resize: vertical;
}

.email-send-status {
  margin: 12px 24px 4px;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 500;
}

.email-composer-footer {
  padding: 16px 24px;
  border-top: 1px solid #f3f4f6;
}

.email-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.email-send-btn-icon {
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .modal-email {
    max-width: 92vw;
    width: 92vw;
  }
}
