/* ============================================================
   ADMIN.CSS — Admin portal styles
   ============================================================ */

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── STATS BAR ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: center;
}

.stat-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-num.pending  { color: var(--yellow); }
.stat-num.approved { color: #7BA3FF;       }
.stat-num.paid     { color: var(--green);  }
.stat-num.live     { color: var(--orange); }
.stat-num.rejected { color: var(--red);    }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── TOOLBAR ── */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 32px 8px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239B9DB0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s;
}

.filter-select:focus {
  border-color: var(--orange);
}

.btn-danger-sm {
  background: transparent;
  border: 1px solid rgba(224, 84, 84, 0.4);
  color: var(--red);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-danger-sm:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

/* ── TABLE ── */
.table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.requests-table {
  width: 100%;
  border-collapse: collapse;
}

.requests-table thead tr {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.requests-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.requests-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.requests-table tbody tr:last-child {
  border-bottom: none;
}

.requests-table tbody tr:hover {
  background: var(--bg-hover);
}

.requests-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.td-mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── ACTION BUTTONS ── */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-view {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-view:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.btn-approve {
  background: var(--green-bg);
  border: 1px solid rgba(76, 175, 125, 0.3);
  color: var(--green);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-approve:hover {
  background: rgba(76, 175, 125, 0.25);
  border-color: var(--green);
}

.btn-reject {
  background: var(--red-bg);
  border: 1px solid rgba(224, 84, 84, 0.3);
  color: var(--red);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-reject:hover {
  background: rgba(224, 84, 84, 0.25);
  border-color: var(--red);
}

/* ── EMPTY STATE ── */
.empty-state {
  padding: 64px 32px;
  text-align: center;
}

.empty-icon { font-size: 36px; margin-bottom: 12px; }

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
}

.modal-sm { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.btn-secondary-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary-sm:hover {
  border-color: var(--orange);
  color: var(--text-primary);
}

/* ── MODAL DETAIL GRID ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-item { display: flex; flex-direction: column; gap: 3px; }

.detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-value {
  font-size: 14px;
  color: var(--text-primary);
}

.detail-full {
  grid-column: 1 / -1;
}

.detail-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
  grid-column: 1 / -1;
}

.modal-image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.rejection-reason-box {
  background: var(--red-bg);
  border: 1px solid rgba(224, 84, 84, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  color: var(--red);
  margin-top: 8px;
}

/* ── CHANGE LOG ── */
.change-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
}

.change-entry-head {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.change-row {
  font-size: 13px;
  color: var(--text-primary);
  padding: 2px 0;
}

.change-field { color: var(--text-muted); font-weight: 600; }
.change-from  { color: var(--red); text-decoration: line-through; }
.change-to    { color: var(--green); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .requests-table { font-size: 12px; }
  .requests-table th,
  .requests-table td { padding: 10px 10px; }
  .main { padding: 24px 16px; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .admin-toolbar { flex-direction: column; align-items: flex-start; }
}
