/* ============================================================
  OnsiteBadge Admin – site.css
  Bootstrap 5.3.3 overrides and admin chrome
  ============================================================ */

/* ── Custom properties ──────────────────────────────────────── */
:root {
  --ps-sidebar-width: 240px;
  --ps-sidebar-bg: #E55A00;
  --ps-sidebar-text: #ffffff;
  --ps-sidebar-muted: #a3b8a8;
  --ps-sidebar-active-bg: rgba(255,255,255,0.12);
  --ps-sidebar-active-text: #ffffff;
  --ps-topbar-height: 56px;
  --ps-topbar-bg: #ffffff;
  --ps-topbar-border: #e5e7eb;
  --ps-content-bg: #f9fafb;
  --ps-accent: #E55A00;
  --ps-accent-hover: #cf4c00;
}

/* ── Base ────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-size: 15px;
}

body.admin-layout {
  background: var(--ps-content-bg);
  color: #111827;
}

/* ── Admin wrapper ───────────────────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--ps-sidebar-width);
  background: var(--ps-sidebar-bg);
  color: var(--ps-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

/* Mobile: hide sidebar off-screen by default */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.sidebar-open {
    transform: translateX(0);
  }
}

/* Desktop: always visible */
@media (min-width: 992px) {
  .admin-sidebar {
    position: sticky;
    transform: none !important;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand a {
  text-decoration: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-logo {
  height: 30px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.sidebar-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 0.35rem 0.55rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--ps-sidebar-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  flex: 1;
}

.sidebar-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ps-sidebar-muted);
  padding: 0.5rem 1rem 0.25rem;
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  color: var(--ps-sidebar-text);
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 0.5rem;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: var(--ps-sidebar-active-bg);
  color: #fff;
}

.sidebar-link.active {
  background: var(--ps-sidebar-active-bg);
  color: var(--ps-sidebar-active-text);
  font-weight: 500;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1039;
}

/* ── Main area ───────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 0;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.admin-topbar {
  height: var(--ps-topbar-height);
  background: var(--ps-topbar-bg);
  border-bottom: 1px solid var(--ps-topbar-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  gap: 0.75rem;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

/* ── Content ─────────────────────────────────────────────────── */
.admin-content {
  flex: 1;
  padding: 1.25rem 1.25rem 1.75rem;
}

/* ── Footer ──────────────────────────────────────────────────── */
.admin-footer {
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: #9ca3af;
  border-top: 1px solid var(--ps-topbar-border);
}

/* ── Bootstrap tweaks ────────────────────────────────────────── */
.btn-primary {
  --bs-btn-bg: var(--ps-accent);
  --bs-btn-border-color: var(--ps-accent);
  --bs-btn-hover-bg: var(--ps-accent-hover);
  --bs-btn-hover-border-color: var(--ps-accent-hover);
  --bs-btn-active-bg: var(--ps-accent-hover);
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(18, 46, 23, 0.25);
  border-color: var(--ps-accent);
  outline: none;
}

.card {
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.table > :not(caption) > * > * {
  padding: 0.65rem 0.75rem;
}

/* ── Utility helpers ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ps-accent);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Auth pages ──────────────────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
}

.auth-brand-logo {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

/* ── Import wizard ────────────────────────────────────────────── */

.import-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.import-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #9ca3af;
  font-size: 0.85rem;
  white-space: nowrap;
}

.import-step.active {
  color: #059669;
  font-weight: 600;
}

.import-step.done {
  color: var(--ps-accent);
}

.import-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.import-step.active .import-step__num {
  background: #059669;
  color: #fff;
}

.import-step.done .import-step__num {
  background: var(--ps-accent);
  color: #fff;
}

.import-step__connector {
  flex: 1;
  min-width: 1.5rem;
  height: 2px;
  background: #e5e7eb;
  margin: 0 0.4rem;
}

.import-step__connector.done {
  background: #059669;
}

/* ── File drop zone ───────────────────────────────────────────── */

.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafa;
}

.drop-zone:hover,
.drop-zone--over {
  border-color: var(--ps-accent);
  background: rgba(18, 46, 23, 0.04);
}

.drop-zone--selected {
  border-color: #059669;
  background: rgba(5, 150, 105, 0.04);
}

.drop-zone__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.drop-zone__text {
  font-size: 0.95rem;
  color: #374151;
}

/* ── SuperAdmin platform chrome ─────────────────────────────────────────── */
.platform-layout .sidebar-platform-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ps-sidebar-muted);
  margin-top: 0.35rem;
}

.platform-layout .nav-pills .nav-link.active {
  background-color: var(--ps-accent);
}
