/* =============================================================
   Van Wyk & Preller — Admin Portal Stylesheet
   ============================================================= */

:root {
  --navy:     #1A2B4A;
  --gold:     #C9A84C;
  --offwhite: #F8F7F4;
  --charcoal: #2C2C2C;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--charcoal);
  background: #f4f6f9;
}

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

/* =============================================================
   SIDEBAR — inline styles are primary; these are fallbacks
   ============================================================= */

#main-sidebar {
  background: #1A2B4A !important;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  text-decoration: none;
  color: #d1d5db;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.admin-nav-item.active-nav {
  color: #C9A84C !important;
  background: rgba(201,168,76,0.12) !important;
  font-weight: 500;
}

/* =============================================================
   TOP BAR
   ============================================================= */

#admin-content > header {
  background: #fff !important;
  border-bottom: 1px solid #e5e7eb;
}

/* =============================================================
   FLASH ALERTS
   ============================================================= */

.flash-success,
.flash-error {
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 500;
}
.flash-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.flash-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* =============================================================
   DASHBOARD STAT CARDS
   ============================================================= */

.stat-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.625rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: 0 4px 20px rgba(26,43,74,0.10);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(201,168,76,0.12);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.25rem;
}
.stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin: 0.5rem 0 0.125rem;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================
   ADMIN CARDS
   ============================================================= */

.admin-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.admin-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--offwhite);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-card-title i { color: var(--gold); font-size: 0.9rem; }

/* =============================================================
   ADMIN TABLES
   ============================================================= */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table thead {
  background: #f8f9fb;
  border-bottom: 2px solid #e5e7eb;
}
.admin-table thead th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.admin-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  color: var(--charcoal);
}

/* =============================================================
   BADGES
   ============================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gold   { background: rgba(201,168,76,0.15); color: #92720e; }

/* =============================================================
   ADMIN FORMS
   ============================================================= */

.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}
.form-hint {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}
.form-control {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--charcoal);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control   { cursor: pointer; }

/* =============================================================
   BUTTONS
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Source Sans 3', sans-serif;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-gold  { background: var(--gold);  color: #fff !important; }
.btn-gold:hover  { background: #b8902e; box-shadow: 0 4px 14px rgba(201,168,76,0.30); }

.btn-navy  { background: var(--navy);  color: #fff !important; }
.btn-navy:hover  { background: #0f1d35; }

.btn-danger { background: #dc2626; color: #fff !important; }
.btn-danger:hover { background: #b91c1c; }

.btn-ghost  { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }
.btn-ghost:hover  { background: rgba(201,168,76,0.08); }

.btn-light { background: #f3f4f6; color: #374151; }
.btn-light:hover { background: #e5e7eb; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 0.9375rem; }

/* =============================================================
   ACTION LINKS (table row actions)
   ============================================================= */

.action-link {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.action-edit   { color: var(--gold); }
.action-edit:hover   { background: rgba(201,168,76,0.10); }
.action-delete { color: #dc2626; }
.action-delete:hover { background: rgba(220,38,38,0.08); }
.action-view   { color: #3b82f6; }
.action-view:hover   { background: rgba(59,130,246,0.08); }
.action-toggle { color: #6b7280; }
.action-toggle:hover { background: rgba(107,114,128,0.08); }

/* =============================================================
   PHOTO / IMAGE PREVIEW
   ============================================================= */

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
}
.photo-preview-lg {
  width: 120px;
  height: 120px;
  border-radius: 0.5rem;
  object-fit: cover;
  object-position: top;
  border: 2px solid #e5e7eb;
}

/* =============================================================
   SUBMISSION UNREAD HIGHLIGHT
   ============================================================= */

.submission-unread { background: #fffbeb !important; }
.submission-unread td:first-child {
  border-left: 3px solid var(--gold);
  padding-left: calc(1rem - 3px);
}

/* =============================================================
   PAGE HEADER ROW (title + action button)
   ============================================================= */

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.admin-page-header h3 {
  font-family: 'Playfair Display', serif;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

/* =============================================================
   SECTION DIVIDER
   ============================================================= */

.admin-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 1.5rem 0;
}

/* =============================================================
   INLINE HELP TEXT
   ============================================================= */

.text-muted {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* =============================================================
   SCROLLBAR (webkit)
   ============================================================= */

#main-sidebar::-webkit-scrollbar { width: 4px; }
#main-sidebar::-webkit-scrollbar-track { background: transparent; }
#main-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 767px) {
  .admin-table          { font-size: 0.8rem; }
  .admin-table thead th,
  .admin-table tbody td { padding: 0.625rem 0.5rem; }
  .stat-card .stat-value { font-size: 1.625rem; }
}
