/* ===================================================
   PATH4HER - SINGLE SITE THEME
   Every page pulls from these variables. Change here,
   it changes everywhere.
=================================================== */
:root {
  /* Brand palette - warm wood tones + purposeful accent */
  --color-primary: #7A3B12;      /* carpentry wood brown */
  --color-primary-dark: #5C2B0A;
  --color-accent: #D98E2B;       /* warm amber - hope/energy */
  --color-secondary: #2F6B4F;    /* growth green */
  --color-dark: #22201D;
  --color-nav: #4A2712;          /* warm coffee brown - admin header/sidebar/footer */
  --color-light: #FBF7F2;
  --color-muted: #8A7F73;
  --color-white: #FFFFFF;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius: 10px;
  --shadow: 0 4px 16px rgba(34, 32, 29, 0.08);
  --container-max: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--color-dark);
  background: var(--color-light);
  line-height: 1.6;
}

h1, h2, h3, h4, .heading {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary-dark);
  line-height: 1.25;
}

a { color: var(--color-primary); text-decoration: none; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--color-accent); color: var(--color-white); }
.btn-outline { background: transparent; border-color: var(--color-primary); color: var(--color-primary); }
.btn-secondary { background: var(--color-secondary); color: var(--color-white); }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--color-white);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 1.25rem;
}
.navbar .logo { font-family: var(--font-heading); font-size: 1.4rem; color: var(--color-primary-dark); font-weight: 700; flex-shrink: 0; }
.nav-collapse { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 1.5rem; min-width: 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; }
.nav-links a { color: var(--color-dark); font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--color-accent); }
.nav-actions { display: flex; align-items: center; gap: 1.1rem; flex-shrink: 0; }
.nav-actions a:not(.btn) { color: var(--color-dark); font-weight: 500; white-space: nowrap; }
.nav-actions a:not(.btn):hover, .nav-actions a.active:not(.btn) { color: var(--color-accent); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; flex-shrink: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex; align-items: center;
  background: linear-gradient(rgba(34,32,29,.55), rgba(34,32,29,.45)), var(--hero-image, none) center/cover no-repeat;
  color: var(--color-white);
  text-align: center;
}
.hero .container { max-width: 800px; }
.hero h1 { color: var(--color-white); font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; margin-bottom: 1.5rem; }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card img { width: 100%; height: 220px; object-fit: cover; }
.card-body { padding: 1.25rem; }

/* ---------- Stats ---------- */
.stats { background: var(--color-primary); color: var(--color-white); padding: 3rem 0; text-align: center; }
.stats .grid-4 { gap: 2rem; }
.stat-number { font-size: 2.5rem; font-weight: 700; font-family: var(--font-heading); color: var(--color-accent); }

/* ---------- Section spacing ---------- */
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title p { color: var(--color-muted); margin-top: .5rem; }

/* ---------- Footer ---------- */
.footer { background: var(--color-dark); color: var(--color-light); padding: 3rem 0 1.5rem; }
.footer .grid-4 { gap: 2rem; margin-bottom: 2rem; }
.footer h4 { color: var(--color-white); margin-bottom: 1rem; }
.footer a { color: var(--color-muted); }
.footer a:hover { color: var(--color-accent); }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .9rem; color: var(--color-muted); }

/* Slim credit bar, fixed to the bottom of the viewport on every page
   (public site and admin dashboard alike). Kept intentionally thin so it
   never blocks content; pages add bottom padding via .has-credit-bar so
   nothing sits underneath it. */
.credit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--color-dark);
  color: rgba(255,255,255,.7);
  font-size: .78rem;
  text-align: center;
  padding: .5rem 1rem;
  line-height: 1.4;
}
.credit-bar a { color: var(--color-accent); text-decoration: none; }
.credit-bar a:hover { text-decoration: underline; }
body.has-credit-bar { padding-bottom: 2.4rem; }

/* On admin pages, the bottom credit-bar picks up the same warm brown as the
   admin header/sidebar instead of the near-black used on the public site. */
body.admin-body .credit-bar { background: var(--color-nav); }

/* Submit buttons while a form is mid-submission - see public/js/site.js */
.btn.is-submitting, button.is-submitting, input.is-submitting {
  opacity: .7;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .credit-bar { font-size: .72rem; padding: .5rem .75rem; }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: .4rem; font-weight: 500; }
.form-control {
  width: 100%; padding: .7rem 1rem;
  border: 1px solid #ddd; border-radius: var(--radius);
  font-family: var(--font-body);
}
.form-control:focus { outline: none; border-color: var(--color-accent); }
.form-hint { display: block; margin-top: .35rem; font-size: .85rem; color: var(--color-muted); }

/* Multi-section application forms (e.g. training applications) */
.form-section { margin-bottom: 2rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-family: var(--font-heading); font-size: 1.05rem; color: var(--color-primary-dark);
  padding-bottom: .5rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--color-light);
}
.radio-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: .35rem; }
.radio-row label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; cursor: pointer; }
.radio-row input[type="radio"], .radio-row input[type="checkbox"] { width: auto; }
.form-check { display: flex; align-items: flex-start; gap: .6rem; }
.form-check input[type="checkbox"] { width: auto; margin-top: .25rem; }
.form-check label { font-weight: 400; }

/* Privacy / informational notice box */
.notice-box {
  background: var(--color-light); border: 1px solid #E7DFD4; border-left: 4px solid var(--color-accent);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1.5rem 0; font-size: .92rem; color: var(--color-dark);
}
.notice-box h4 { font-size: .95rem; margin-bottom: .5rem; color: var(--color-primary-dark); }
.notice-box p { margin-bottom: .6rem; }
.notice-box p:last-child { margin-bottom: 0; }
.notice-box ul { padding-left: 1.2rem; margin-bottom: .6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .nav-collapse {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--color-white); box-shadow: var(--shadow);
    max-height: calc(100vh - 100%); overflow-y: auto;
    display: none;
  }
  .nav-collapse.open { display: flex; }
  .nav-links { flex-direction: column; gap: 0; padding: 1rem 1.25rem 0; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: .6rem 0; }
  .nav-actions { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1.25rem 1.25rem; }
  .nav-actions a:not(.btn) { display: block; padding: .6rem 0; }
  .nav-actions .btn { margin-top: .75rem; text-align: center; }
  .nav-toggle { display: block; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { min-height: 56vh; }
  .section { padding: 2.75rem 0; }
  .page-header { padding: 2.5rem 0; }
  .actions-row { flex-wrap: wrap; justify-content: center; }
  .stats .grid-4 { gap: 1.5rem 1rem; }
  .stat-number { font-size: 2rem; }
}

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; margin: 1rem 0; }
.pagination-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
.pagination-item a, .pagination-item span {
  display: inline-block; min-width: 2.4rem; text-align: center;
  padding: .5rem .75rem; border-radius: var(--radius);
  background: var(--color-white); box-shadow: var(--shadow);
  color: var(--color-primary); font-weight: 500; font-size: .9rem;
}
.pagination-item a:hover { background: var(--color-accent); color: var(--color-white); }
.pagination-item.active span { background: var(--color-primary); color: var(--color-white); }
.pagination-item.disabled span { color: var(--color-muted); box-shadow: none; background: transparent; }

/* ---------- Alerts ---------- */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1.25rem 0; font-weight: 500; }
.alert-success { background: #E5F3EC; color: var(--color-secondary); border: 1px solid var(--color-secondary); }
.alert-error { background: #FBEAEA; color: #A33A2E; border: 1px solid #A33A2E; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-active { background: #E5F3EC; color: var(--color-secondary); }
.badge-inactive { background: #eee; color: var(--color-muted); }
.badge-new { background: #FDF1DC; color: var(--color-accent); }
.badge-warn { background: #FBE7E3; color: #A33A2E; }

/* Inline status-change dropdown used in admin inbox tables */
.status-select {
  font-size: .8rem; font-weight: 600; padding: .3rem .55rem; border-radius: 999px;
  border: 1px solid #E7DFD4; background: var(--color-light); color: var(--color-dark); cursor: pointer;
}
.status-select:focus { outline: none; border-color: var(--color-accent); }

/* Dashboard analytics section */
.dash-kpis { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.dash-kpis .stat-tile { display: flex; align-items: center; justify-content: space-between; }
.dash-kpis .stat-tile .icon { font-size: 1.6rem; opacity: .55; }
.chart-card { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.chart-card h3 { font-family: var(--font-heading); font-size: 1.05rem; color: var(--color-primary-dark); margin-bottom: 1rem; }
.chart-card canvas { max-height: 280px; }
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.chart-row-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) {
  .chart-row, .chart-row-3 { grid-template-columns: 1fr; }
}

/* ---------- Page header (inner pages) ---------- */
.page-header { background: var(--color-primary); color: var(--color-white); padding: 3.5rem 0; text-align: center; }
.page-header h1 { color: var(--color-white); }
.page-header p { color: rgba(255,255,255,.85); margin-top: .5rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid #eee; }
.data-table th { background: var(--color-light); font-family: var(--font-heading); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--color-muted); }
.data-table tr:last-child td { border-bottom: none; }

/* ---------- Admin layout ---------- */
/* Fixed header, mirroring the fixed .credit-bar at the bottom of the page. */
.admin-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 3.5rem;
  display: flex; align-items: center; gap: 1rem;
  background: var(--color-nav); color: var(--color-light);
  padding: 0 1.25rem;
}
.admin-header .logo { color: var(--color-white); font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.admin-header .nav-toggle { display: none; background: none; border: none; color: var(--color-white); font-size: 1.4rem; cursor: pointer; padding: 0; }
.admin-header-right { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; font-size: .85rem; }
.admin-header-right a { color: rgba(255,255,255,.75); }
.admin-header-right a:hover { color: var(--color-white); }
.admin-header-user { color: rgba(255,255,255,.75); }
.admin-header-user .role-tag { text-transform: capitalize; }
.admin-header-right form { display: inline-flex; }
.admin-header-right button {
  background: none; border: none; color: rgba(255,255,255,.75); cursor: pointer;
  font-size: .85rem; font-family: inherit; padding: 0;
}
.admin-header-right button:hover { color: var(--color-white); }

.admin-wrap { display: flex; margin-top: 3.5rem; min-height: calc(100vh - 3.5rem); }

/* Sidebar is fixed to the viewport below the header, so it never scrolls
   with the page content - only .admin-main scrolls. */
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  position: fixed; top: 3.5rem; left: 0; bottom: 0;
  overflow-y: auto;
  background: var(--color-nav); color: var(--color-light); padding: 1.5rem 0;
}
.admin-sidebar a { display: block; padding: .65rem 1.5rem; color: rgba(255,255,255,.75); font-size: .95rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: var(--color-white); border-left: 3px solid var(--color-accent); }
.admin-sidebar .group-label { padding: 1rem 1.5rem .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); }
.admin-main { flex: 1; margin-left: 240px; padding: 2rem; max-width: 100%; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem; }
.admin-card { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.stat-tile { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.stat-tile .num { font-size: 2rem; font-weight: 700; font-family: var(--font-heading); color: var(--color-primary); }
.stat-tile .label { color: var(--color-muted); font-size: .9rem; }
.actions-row { display: flex; gap: .5rem; align-items: center; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-danger { background: #A33A2E; color: var(--color-white); }

/* Community photo slots (About page): two fixed-size boxes. Admin can
   upload as many "community" gallery photos as they like — extras just
   rotate through these two slots rather than enlarging the layout. */
.community-photos-section { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.community-photo-grid {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: .75rem;
  max-width: 360px;
  margin: 0 auto;
}
.community-photo-slot {
  position: relative;
  width: 130px;
  height: 130px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #eee;
}
.community-photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease-in-out;
}
.community-photo-slot img.is-active { opacity: 1; }
@media (max-width: 640px) {
  .community-photo-slot { width: 110px; height: 110px; }
}

body.has-admin-header { padding-top: 0; } /* header is fixed and pages offset via .admin-wrap margin-top instead */

.admin-sidebar-overlay {
  display: none; position: fixed; inset: 3.5rem 0 0 0; background: rgba(0,0,0,.45); z-index: 90;
}
.admin-sidebar-overlay.open { display: block; }

@media (max-width: 900px) {
  .admin-header .nav-toggle { display: block; }
  .admin-header-user { display: none; }
  .admin-sidebar {
    z-index: 100;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 1.25rem; }
}