/* ============================================================
   ހިޔާވެހި  –  Admin & Seller Portal Styles
   ============================================================ */

/* ── Auth pages (login) ─────────────────────────────────────── */
/* Seller login page body */
.auth-page-body {
  min-height: 100vh;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  background: var(--c-brand);
  padding: 28px 28px 24px;
  text-align: center;
}

/* Inner form wrapper — renamed from .auth-body to avoid conflict */
.auth-form-wrap {
  padding: 28px;
}

/* ── Admin Main layout ──────────────────────────────────────── */
.admin-main {
  padding: 32px 0 60px;
  min-height: calc(100vh - 62px);
}

/* ── Tab navigation ─────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition);
}
.tab-btn:hover  { color: var(--c-brand); }
.tab-btn.active { color: var(--c-brand); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0; left: 0;
  height: 2px;
  background: var(--c-brand);
  border-radius: 1px 1px 0 0;
}

.tab-pane          { display: none; }
.tab-pane.active   { display: block; }

/* ── Panel header ───────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.panel-header h2 { font-size: 1.2rem; font-weight: 700; }

/* ── Admin table ────────────────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  background: var(--c-surface);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  text-align: right;
}
.admin-table thead th {
  background: var(--c-brand-pale);
  color: var(--c-brand);
  font-weight: 700;
  padding: 12px 16px;
  white-space: nowrap;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.admin-table tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background var(--transition);
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--c-bg); }
.admin-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

/* ── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--c-brand-pale);
  color: var(--c-brand);
}
.status-badge.active  { background: #d1fae5; color: #065f46; }
.status-badge.inactive{ background: #fee2e2; color: #991b1b; }
.status-badge.pending { background: #fef3c7; color: #92400e; }

/* ── Icon buttons ───────────────────────────────────────────── */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 1.1rem;
  border-radius: var(--r-sm);
  transition: background var(--transition);
  line-height: 1;
}
.btn-icon:hover       { background: var(--c-bg); }
.btn-icon.btn-danger:hover { background: #fee2e2; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .9rem;
}
.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .9rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--c-muted);
  padding: 48px 20px;
  font-size: .95rem;
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  direction: rtl;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-body      { padding: 24px; }

/* ── Payment settings card ──────────────────────────────────── */
.pm-setting-card {
  background: var(--c-surface);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--c-border);
}

/* ── Toggle switch ──────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--c-border);
  border-radius: 999px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  right: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--c-brand); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(-24px);
}

/* ── Stats cards (dashboard) ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--c-surface);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid var(--c-brand);
}
.stat-card-label { font-size: .85rem; color: var(--c-muted); margin-bottom: 6px; }
.stat-card-value { font-size: 1.8rem; font-weight: 700; color: var(--c-text); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-table  { font-size: .82rem; }
  .admin-table td, .admin-table th { padding: 9px 10px; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .modal-card   { max-height: 95vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
                  position: fixed; bottom: 0; left: 0; right: 0; max-width: 100%; }
}
