/* Shared sidebar + topbar shell for every admin page except the login
   screen. Loaded alongside style.css, which still owns tables, cards,
   forms, badges, etc. — this file only owns the shell/navigation chrome. */

:root {
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 64px;
  --admin-accent: #8e5fa8;
  --admin-accent-soft: #f3ecf7;
  --sidebar-border: #e6e6e6;
  --topbar-h: 56px;
}

body.shell-body {
  margin: 0;
  padding: 0;
  max-width: none;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
  background: #f7f7f8;
}

.admin-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.16s ease;
}
.admin-shell.sidebar-collapsed .admin-sidebar {
  width: var(--sidebar-width-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 56px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-brand-icon { font-size: 20px; }
.sidebar-brand-text { font-weight: 800; font-size: 15px; }
.admin-shell.sidebar-collapsed .sidebar-brand-text { display: none; }

/* Matches the mobile app's wordmark exactly — see GradientText.js
   (src/components/GradientText.js), which fills "Dealzwheelz" with this
   same lavender-to-yellow gradient instead of a solid color. */
.brand-gradient {
  background-image: linear-gradient(90deg, #8E5FA8, #F5C518);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: #777;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: #f2f2f2; }
.admin-shell.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

.sidebar-nav { flex: 1; padding: 12px 10px; }
.sidebar-group { margin-bottom: 18px; }
.sidebar-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  padding: 0 10px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.admin-shell.sidebar-collapsed .sidebar-group-label { visibility: hidden; height: 2px; margin-bottom: 4px; }

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  font-family: inherit;
}
.sidebar-link:hover { background: #f4f0f6; color: #222; }
.sidebar-link.active { background: var(--admin-accent-soft); color: var(--admin-accent); }
.sidebar-link-icon {
  flex-shrink: 0;
  width: 20px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-link-text { overflow: hidden; text-overflow: ellipsis; }
.admin-shell.sidebar-collapsed .sidebar-link-text { display: none; }
.admin-shell.sidebar-collapsed .sidebar-link { justify-content: center; }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--sidebar-border); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-menu-btn {
  background: transparent;
  border: none;
  color: #555;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
}
.topbar-menu-btn:hover { background: #f0f0f0; }
.admin-breadcrumb { font-size: 13px; color: #888; display: flex; align-items: center; gap: 6px; }
.admin-breadcrumb a { color: #888; text-decoration: none; }
.admin-breadcrumb a:hover { color: var(--admin-accent); }
.breadcrumb-sep { color: #ccc; }
.breadcrumb-current { color: #222; font-weight: 700; }

.admin-page {
  padding: 24px 28px 56px;
  max-width: 1100px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .admin-sidebar { position: fixed; z-index: 30; box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1); }
  .admin-shell.sidebar-collapsed .admin-sidebar { width: 0; border: none; overflow: hidden; }
  .admin-page { padding: 16px; }
}

/* Login page — no sidebar, just a centered card. */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f8;
  padding: 24px;
  box-sizing: border-box;
}
.login-card-wrap { width: 100%; max-width: 380px; }

/* ---------- Notification badges (see admin-notifications.js) ---------- */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #E53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.notif-badge-hidden { display: none; }

.notif-bell {
  position: relative;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  padding: 6px;
}
.notif-bell-icon { font-size: 19px; line-height: 1; }
.notif-bell .notif-badge { top: -2px; right: -2px; }

.notif-dropdown {
  display: none;
  position: absolute;
  top: 38px;
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  z-index: 60;
  cursor: default;
}
.notif-dropdown-open { display: block; }
.notif-dropdown-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #999;
  font-weight: 700;
  padding: 10px 14px 4px;
}
.notif-dropdown-item {
  padding: 8px 14px;
  border-top: 1px solid #f4f4f4;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.notif-dropdown-item:hover { background: #faf6fc; }
.notif-dropdown-empty { padding: 24px 14px; text-align: center; color: #999; font-size: 13px; }

/* ---------- Global admin search (see admin-search.js) ---------- */
.admin-search-wrap {
  position: relative;
  margin-left: 20px;
  width: 320px;
  max-width: 40vw;
}
.admin-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--sidebar-border, #e6e2ea);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #faf9fb;
}
.admin-search-input:focus {
  outline: none;
  border-color: var(--admin-accent, #8e5fa8);
  background: #fff;
}
.admin-search-dropdown {
  display: none;
  position: absolute;
  top: 38px;
  left: 0;
  width: 100%;
  min-width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  z-index: 60;
}
.admin-search-open { display: block; }
.admin-search-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #999;
  font-weight: 700;
  padding: 10px 14px 4px;
}
.admin-search-item {
  padding: 8px 14px;
  border-top: 1px solid #f4f4f4;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-search-item:hover { background: #faf6fc; }
.admin-search-item strong { font-size: 13px; color: #222; }
.admin-search-item-sub { font-size: 12px; color: #888; }
.admin-search-empty { padding: 20px 14px; text-align: center; color: #999; font-size: 13px; }

@media (max-width: 860px) {
  .admin-search-wrap { max-width: 55vw; }
}

/* ---------- Test Account system (test-accounts-ui.js) ---------- */
.test-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: #b36b00;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.5;
}
.test-total-note {
  font-size: 12px;
  font-weight: 600;
  color: #b36b00;
}
.hide-test-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.hide-test-toggle input { accent-color: var(--admin-accent); width: 15px; height: 15px; cursor: pointer; }
.test-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
}
.test-toggle input { accent-color: var(--admin-accent); width: 16px; height: 16px; cursor: pointer; }
.test-filter-select {
  width: auto !important;
  display: inline-block !important;
}
