/* Volunteer Page Container: Prevent overflow and keep content contained */
.admin-volunteer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

@media (max-width: 1400px) {
  .admin-volunteer-container {
    max-width: 100%;
    padding: 1.25rem 0.5rem 2rem;
  }
}
/* ==========================================================
   HOLY CIRCLE ADMIN LAYOUT — COMPLETE CLEAN REWRITE
   Author: ChatGPT (2025)
   Purpose: Sidebar + Header + Dropdown + Mobile Drawer
   ========================================================== */

/* ----------------------------------------------------------
   CORE COLORS + RESETS
---------------------------------------------------------- */

:root {
    --hc-navy: #002e6b;
    --hc-gold: #bf9745;
    --hc-gold-light: #f0e990;
    --hc-white: white;
    --hc-light-bg: #f5f7fb;
  
    --transition: 0.25s ease;
    --transition-med: 0.35s ease;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body.with-sidebar {
    background: var(--hc-light-bg);
  }
  
  /* ----------------------------------------------------------
     SIDEBAR LAYOUT
  ---------------------------------------------------------- */
  
  .admin-sidebar {
    width: 240px;
    height: 100vh;
    background: var(--hc-navy);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    overflow-y: auto;
    transition: width var(--transition-med), transform var(--transition-med);
    z-index: 9999;
  }
  
  /* Collapsed (desktop) */
  .admin-sidebar.collapsed {
    width: 72px;
  }
  
  /* Sidebar Header */
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
  
  .sidebar-header h2 {
    color: var(--hc-gold-light);
    font-size: 1.2rem;
    font-weight: 700;
  }
  
  .sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--hc-gold-light);
    cursor: pointer;
  }
  
  /* Sidebar Menu */
  .sidebar-menu {
    padding: 1rem 0;
    list-style: none;
    flex-grow: 1;
  }
  
  .sidebar-menu li { margin-bottom: 0.25rem; }
  
  .sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    color: #ffffffcc;
    text-decoration: none;
    font-size: 0.96rem;
    border-radius: 8px;
    transition: var(--transition);
  }
  
  .sidebar-menu a:hover {
    background: rgba(255,255,255,0.18);
    color: white;
  }
  
  .sidebar-menu a.active {
    background: var(--hc-gold);
    color: white;
  }
  
  /* Sidebar Icons */
  .icon {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    font-size: 1.25rem;
  }
  
  /* Collapse behavior */
  .admin-sidebar.collapsed .sidebar-header h2,
  .admin-sidebar.collapsed .sidebar-menu a span {
    display: none;
  }
  
  .admin-sidebar.collapsed .icon {
    margin-right: 0;
  }
  
  /* Footer */
  .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
  }
  
  .logout-link {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--hc-gold-light);
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
  }
  .logout-link:hover {
    background: rgba(255,255,255,0.18);
  }
  
  /* ----------------------------------------------------------
     HEADER (TOP BAR)
  ---------------------------------------------------------- */
  
  .admin-header {
    background: var(--hc-navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 2rem;
    border-bottom: 3px solid var(--hc-gold);
    box-shadow: 0 2px 20px rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 9000;
    transition: margin-left var(--transition-med);
  }
  
  /* Left Section */
  .header-left {
    display: flex;
    align-items: center;
    flex: 1;
  }
  
  .sidebar-toggle-btn {
    height: 38px;
    width: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.18);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
  }
  .sidebar-toggle-btn:hover {
    background: var(--hc-gold);
  }
  
  /* Center Title */
  .header-center {
    flex: 2;
    text-align: center;
  }
  .header-center h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 2px;
  }
  .admin-header-tag {
    font-size: 0.78rem;
    opacity: 0.85;
  }

  .mobile-header-title {
    display: none;
  }
  
 
  
  /* Right Section */
  .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
    position: relative;
  }

  .admin-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hc-gold);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
  }

  .admin-icon-btn:hover {
    background: var(--hc-gold-light);
    color: var(--hc-navy);
  }
  
  /* Notification button */
  .header-icon-btn {
    height: 38px;
    width: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }
  .header-icon-btn:hover {
    background: var(--hc-gold);
  }
  
  .notif-dot {
    position: absolute;
    top: 7px;
    right: 5px;
    height: 9px;
    width: 9px;
    background: #ff4444;
    border-radius: 50%;
    display: none;
  }
  
  /* ----------------------------------------------------------
     PROFILE BUBBLE (TOP RIGHT)
  ---------------------------------------------------------- */
  
  .profile-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255,255,255,0.18);
    padding: 0.45rem 0.9rem;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .profile-wrapper:hover {
    background: rgba(255,255,255,0.25);
  }
  
  .profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: none;
  }
  
  .profile-initials {
    width: 32px;
    height: 32px;
    background: var(--hc-gold);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .profile-caret {
    font-size: 0.85rem;
    opacity: 0.8;
  }
  /* MOBILE TITLE — HOLY CIRCLE ADMIN */
.mobile-header-title {
    display: none; /* desktop hidden */
  }
  
  .mobile-nav-dropdown {
    display:none;
  }
  /* ----------------------------------------------------------
     DROPDOWN MENU (TOP RIGHT)
  ---------------------------------------------------------- */
  
  .header-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    width: 240px;
    background: white;
    color: var(--hc-navy);
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.25);
    animation: fadeDown var(--transition);
    z-index: 9999;
  }
  
  .header-dropdown.open {
    display: block;
  }
  
  @keyframes fadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  .dropdown-user {
    padding: 1rem;
    border-bottom: 1px solid #eee;
  }
  
  .dropdown-links a,
  .dropdown-logout {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--hc-navy);
    border-radius: 8px;
    font-size: 0.94rem;
  }
  
  .dropdown-links a:hover {
    background: var(--hc-gold);
    color: white;
  }
  
  .dropdown-logout {
    color: #a00000;
    border-top: 1px solid #eee;
  }
  .dropdown-logout:hover {
    background: #ffeaea;
  }
  
  /* ----------------------------------------------------------
     PAGE SHIFTING (DESKTOP)
  ---------------------------------------------------------- */
  
  body.with-sidebar .admin-header,
  body.with-sidebar .admin-main {
    margin-left: 240px;
  }
  
  body.with-sidebar.sidebar-collapsed .admin-header,
  body.with-sidebar.sidebar-collapsed .admin-main {
    margin-left: 72px;
  }
  
  /* ----------------------------------------------------------
     MOBILE DRAWER & OVERLAY
  ---------------------------------------------------------- */

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
    z-index: 9500;
  }

  body.sidebar-open .mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  @media (min-width: 961px) {
    .mobile-overlay {
      display: none;
    }
  }

  
  .simple-user-info {
    display: flex;
    align-items: center;
  }
  
  .simple-user-text {
    text-align: right;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
  }
  
  .simple-user-text strong {
    font-size: 0.95rem;
    color: white;
  }
  
  .simple-user-text small {
    font-size: 0.8rem;
    color: #bf9745;
    opacity: 0.9;
  }
  

  /* MOBILE HEADER DROPDOWN */
.mobile-menu-trigger {
    display: none;
    font-size: 1.35rem;
    color: white;
    cursor: pointer;
  }
  
  @media (max-width: 960px) {
    .mobile-menu-trigger {
      display: block;
    }
    .admin-sidebar {
        transform: translateX(-100%);
      }
    
      body.sidebar-open .admin-sidebar {
        transform: translateX(0);
      }
    
      /* Prevent desktop margin shift on mobile */
      body.with-sidebar .admin-header,
      body.with-sidebar .admin-main {
        margin-left: 0 !important;
      }
    
   .header-right{
       align-items: right;
      }
    
  
  .mobile-nav-dropdown {
    position: absolute;
    top: 70px;
    right: 0;
    width: 100%;
    background: white;
    display: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  }
  
  .mobile-nav-dropdown.open {
    display: block;
  }
  
  .mobile-nav-dropdown a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--hc-navy);
    font-size: 0.95rem;
  }
  
  .mobile-nav-dropdown a:hover {
    background: var(--hc-gold);
    color: white;
  }
}

/* ==========================================================
   PEOPLE PAGE — ALIGN WITH DONORS PAGE (CSS ONLY)
   Scope carefully to avoid impacting other admin pages.
   ========================================================== */

/* Main spacing and structure (safe: People-only classes) */
.people-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.people-summary-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.people-summary-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.people-summary-card p {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #002e6b;
}

/* People top bar: only when it follows summary (avoids other pages using .people-top-bar) */
.people-summary + .people-top-bar {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.people-top-bar .people-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.people-top-bar .people-filters input,
.people-top-bar .people-filters select {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.85rem;
  background: #ffffff;
}

.people-top-bar .people-filters input::placeholder {
  color: #9ca3af;
}

.people-top-bar #peopleSearch {
  min-width: 240px;
}

.people-top-bar #newPersonBtn {
  background: #002e6b;
  color: #ffffff;
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.people-top-bar #newPersonBtn:hover {
  filter: brightness(0.95);
}

/* Two-column layout like donors */
.people-main-layout {
  display: grid;
  grid-template-columns: 2fr 1.3fr;
  gap: 1.5rem;
}

.people-table-panel,
.person-detail-panel,
.person-form-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.people-table-panel .panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: #111827;
}

.people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.people-table th,
.people-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.people-table th {
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: normal;
  background: transparent;
}

.people-table tbody tr.table-row {
  cursor: pointer;
}

.people-table tbody tr.table-row:hover {
  background: #f3f4ff;
}

.people-right-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Match donors' pill buttons/controls without changing global button styles */
.people-main-layout .primary-btn,
.people-main-layout .secondary-btn {
  border-radius: 999px;
}

.people-main-layout .primary-btn {
  background: #002e6b;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.people-main-layout .primary-btn:hover {
  filter: brightness(0.95);
}

.people-main-layout .secondary-btn {
  background: #f3f4f6;
  color: #111827;
  border: none;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.people-main-layout .secondary-btn:hover {
  filter: brightness(0.98);
}

/* Responsive parity with donors page */
@media (max-width: 960px) {
  .people-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-main-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .people-summary + .people-top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .people-top-bar #peopleSearch {
    min-width: 0;
    width: 100%;
  }
}

/* Layout-level overrides: only on the People page (uses :has for scoping) */
@supports selector(body:has(#peopleTable)) {
  body:has(#peopleTable) .admin-main {
    padding: 1.5rem 2rem;
  }

  body:has(#peopleTable) .admin-container {
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* ----------------------------------------------------------
   ADMIN UI PRIMITIVES (BUTTONS, FORMS, TABLES)
   Used heavily by the Email pages.
---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  background: #e5e7eb;
  color: #111827;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 3px solid var(--hc-gold-light);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: var(--hc-navy);
  color: #ffffff;
}

.btn.primary:hover {
  filter: brightness(0.98);
}

.btn.gold-btn,
.btn.gold {
  background: var(--hc-gold);
  color: #ffffff;
}

.btn.gold-btn:hover,
.btn.gold:hover {
  filter: brightness(1.02);
}

.btn.small {
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
}

.btn.large {
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
}

/* Modifier class sometimes used without .btn */
.gold-btn {
  background: var(--hc-gold);
  color: #ffffff;
}

.gold-btn:not(.btn):not(.small-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.gold-btn:not(.btn):not(.small-btn):hover {
  transform: translateY(-1px);
}

/* Extend existing small pill buttons */
.small-btn.gold-btn {
  background: var(--hc-gold);
  color: #ffffff;
}

.small-btn.danger {
  background: #cc0000;
  color: #ffffff;
}

.small-btn:focus-visible {
  outline: 3px solid var(--hc-gold-light);
  outline-offset: 2px;
}

/* Email page headers */
.email-page-header,
.email-templates-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.email-page-header h1,
.email-templates-page-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--hc-navy);
}

.email-templates-page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Forms */
.stacked-form,
.simple-form {
  display: grid;
  gap: 1rem;
}

.stacked-form label,
.simple-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hc-navy);
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea,
.simple-form input,
.simple-form select,
.simple-form textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  color: #111827;
}

.stacked-form textarea,
.simple-form textarea {
  line-height: 1.45;
  resize: vertical;
}

.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus,
.simple-form input:focus,
.simple-form select:focus,
.simple-form textarea:focus {
  outline: none;
  border-color: var(--hc-gold);
  box-shadow: 0 0 0 3px rgba(191, 151, 69, 0.25);
}

.template-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.template-row select {
  flex: 1;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.small-note {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}

.admin-table thead th {
  background: #f2f6ff;
  color: var(--hc-navy);
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-table tbody tr:hover {
  background: #fffef8;
}

/* Email pages: spacing + reduce forced panel height (scoped via :has) */
@supports selector(body:has(.email-page-header)) {
  body:has(.email-page-header) .admin-main {
    padding: 1.75rem 1.5rem 3rem;
  }

  body:has(.email-page-header) .panel-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  body:has(.email-page-header) .admin-container {
    display: grid;
    gap: 1.5rem;
  }

  body:has(.email-page-header) .admin-container > .panel.tall-panel {
    margin-top: 0 !important;
  }

  body:has(.email-page-header) .tall-panel {
    min-height: 0;
  }
}

@supports selector(body:has(.email-templates-page-header)) {
  body:has(.email-templates-page-header) .admin-main {
    padding: 1.75rem 1.5rem 3rem;
  }

  body:has(.email-templates-page-header) .panel-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  body:has(.email-templates-page-header) .admin-container {
    display: grid;
    gap: 1.5rem;
  }

  body:has(.email-templates-page-header) .tall-panel {
    min-height: 0;
  }
}

@supports selector(body:has(#sequencesList)) {
  body:has(#sequencesList) .admin-main {
    padding: 1.75rem 1.5rem 3rem;
  }

  body:has(#sequencesList) .panel-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  body:has(#sequencesList) .admin-container {
    display: grid;
    gap: 1.5rem;
  }

  body:has(#sequencesList) .tall-panel {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .email-page-header,
  .email-templates-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .template-row {
    flex-direction: column;
    align-items: stretch;
  }
}
