/* ── Volunteer Dashboard — App-Shell Layout ─────────────────────── */

/* Page fade transition overlay (shared with styles.css pages) */
.page-fade-overlay {
  position: fixed;
  inset: 0;
  background: #1b2d5a;
  z-index: 8888;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
.page-fade-overlay.active {
  opacity: 1;
  pointer-events: all;
}

:root {
  --navy:       #2a4080;   /* medium navy blue */
  --navy-dark:  #1b2d5a;   /* dark navy blue */
  --navy-mid:   #1f3868;   /* mid navy blue */
  --gold:       #c9a227;
  --gold-light: #e8c44a;
  --gold-dim:   rgba(201,162,39,.12);
  --red:        #b0242a;
  --bg:         #f0f4f1;   /* green-tinted off-white */
  --white:      #ffffff;
  --gray-100:   #edf3ef;
  --gray-200:   #d8e6dd;
  --gray-300:   #b8d0c4;
  --gray-500:   #8a9a90;
  --gray-700:   #3a4a40;
  --text:       #192b22;
  --sidebar-w:  230px;
  --topbar-h:   56px;
  --radius:     8px;
  --shadow:     0 1px 4px rgba(0,0,0,.08), 0 2px 12px rgba(0,0,0,.05);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.hidden { display: none !important; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOP BAR ──────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: var(--navy-dark);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 200;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-logo {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  font-family: 'Merriweather', serif;
  font-weight: 900;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
}

.topbar-brand-text {
  display: flex; flex-direction: column; gap: 0;
}
.topbar-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  font-family: 'Merriweather', serif;
}
.topbar-district {
  font-size: .68rem;
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-user {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
}
.topbar-user strong {
  color: var(--white);
  font-weight: 600;
}

/* hamburger (mobile) */
.hamburger-dash {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger-dash span {
  display: block;
  width: 22px; height: 2px;
  background: rgba(255,255,255,.7);
  border-radius: 2px;
  transition: background .2s;
}
.hamburger-dash:hover span { background: var(--white); }

/* ── APP SHELL ────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  margin-top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-mid);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 800;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.5px;
}

.sidebar-user-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .68rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sidebar-section {
  margin-top: .25rem;
  padding: .35rem 0;
}
.sidebar-section + .sidebar-section {
  border-top: 1px solid rgba(255,255,255,.05);
}

.sidebar-section-label {
  padding: .45rem 1rem .2rem;
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.28);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1rem;
  font-size: .83rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.sidebar-link:hover {
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.85);
  text-decoration: none;
}
.sidebar-link.active {
  border-left-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-light);
  font-weight: 600;
}

.sl-icon {
  font-size: .9rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sb-logout-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.45);
  font-size: .78rem;
  cursor: pointer;
  padding: .45rem .85rem;
  border-radius: 5px;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
}
.sb-logout-btn:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
}

/* ── MAIN CONTENT ─────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem 2.5rem;
  background: var(--bg);
}

/* ── PAGE HEADINGS ────────────────────────────────────────────────── */
.dash-title {
  font-family: 'Merriweather', serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--navy-dark);
  margin-bottom: .25rem;
  letter-spacing: -.02em;
}
.dash-subtitle {
  font-size: .88rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-500);
  margin-bottom: .6rem;
}

/* ── STATS GRID ───────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .85rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border-top: 3px solid var(--gold);
  padding: 1rem 1.1rem .9rem;
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1;
  margin-bottom: .25rem;
}

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── DASH BODY ────────────────────────────────────────────────────── */
.dash-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: start;
}

.right-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── SECTION CARDS ────────────────────────────────────────────────── */
.section-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700);
}
.section-card-header a {
  font-weight: 500;
  color: var(--gold);
  font-size: .75rem;
}
.section-card-header a:hover { text-decoration: underline; }

.section-card-footer {
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--gray-200);
  text-align: center;
}
.section-card-footer a {
  font-size: .78rem;
  color: var(--gold);
  font-weight: 600;
}
.section-card-footer a:hover { text-decoration: underline; }

/* ── ACTIVITY FEED ────────────────────────────────────────────────── */
.activity-feed {
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background .15s;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--gray-100); }

.feed-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: .78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.feed-info { flex: 1; min-width: 0; }
.feed-name {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-meta {
  font-size: .73rem;
  color: var(--gray-500);
  margin-top: 1px;
}

.feed-time {
  font-size: .7rem;
  color: var(--gray-500);
  flex-shrink: 0;
}

/* ── EVENT LIST (dashboard) ───────────────────────────────────────── */
.event-list-dash {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.ev-dash-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--gray-100);
}
.ev-dash-item:last-child { border-bottom: none; }

.ev-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 38px;
  background: var(--navy-dark);
  color: var(--white);
  border-radius: 5px;
  padding: .3rem .4rem;
  flex-shrink: 0;
}
.ev-date-month {
  font-size: .57rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold);
  text-transform: uppercase;
}
.ev-date-day {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.ev-info { flex: 1; min-width: 0; }
.ev-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-meta {
  font-size: .72rem;
  color: var(--gray-500);
}

.ev-type-pill {
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 3px;
}
.ev-type-pill.campaign { background: #d4dff0; color: #1b2d5a; }
.ev-type-pill.canvas   { background: #fff3cd; color: #7a5a00; }

/* ── INTEREST BREAKDOWN ───────────────────────────────────────────── */
.interest-list {
  list-style: none;
  padding: .5rem 0;
}

.interest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem 1.1rem;
  font-size: .8rem;
}

.interest-bar-wrap {
  flex: 1;
  margin: 0 .75rem;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.interest-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width .4s ease;
}
.interest-count {
  font-weight: 700;
  color: var(--navy);
  font-size: .78rem;
  min-width: 20px;
  text-align: right;
}

/* ── QUICK ACTIONS ────────────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1.75rem;
}

.quick-action-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--navy);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.quick-action-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(201,162,39,.18);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--navy-dark);
}

.qa-icon { font-size: 1.1rem; }

/* ── ROSTER TABLE ─────────────────────────────────────────────────── */
.roster-search {
  height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 5px;
  padding: 0 .65rem;
  font-size: .78rem;
  font-family: inherit;
  outline: none;
  width: 160px;
}
.roster-search:focus { border-color: var(--gold); }

.roster-filter {
  height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 5px;
  padding: 0 .5rem;
  font-size: .78rem;
  font-family: inherit;
  outline: none;
  background: var(--white);
}
.roster-filter:focus { border-color: var(--gold); }

.table-scroll { overflow-x: auto; }

.vol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.vol-table th {
  background: var(--gray-100);
  padding: .6rem .9rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.vol-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vol-table tr:hover td { background: var(--gray-100); }
.vol-table a { color: var(--gold); }

.btn-remove {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: .25rem .6rem;
  font-size: .73rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-remove:hover {
  background: #fee2e2;
  color: var(--red);
  border-color: var(--red);
}

/* ── VOLUNTEER PROFILE CARD ───────────────────────────────────────── */
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.1rem;
}

.profile-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }
.profile-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: .25rem;
}
.profile-detail {
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: .15rem;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .5rem;
}
.profile-tag {
  font-size: .68rem;
  font-weight: 600;
  background: var(--gold-dim);
  color: var(--navy);
  border: 1px solid rgba(201,162,39,.3);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
}

/* ── EMPTY STATE ──────────────────────────────────────────────────── */
.empty-state {
  padding: 1.25rem 1.1rem;
  font-size: .82rem;
  color: var(--gray-500);
  font-style: italic;
}

/* ── MODAL ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
  width: min(400px, 92vw);
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}

.modal-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: .95rem;
}

.modal-box-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
}
.modal-box-close:hover { color: var(--text); }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn-ghost {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 5px;
  padding: .5rem 1rem;
  font-size: .83rem;
  cursor: pointer;
  color: var(--gray-700);
  transition: background .15s;
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-danger {
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 5px;
  padding: .5rem 1rem;
  font-size: .83rem;
  cursor: pointer;
  color: var(--white);
  font-weight: 600;
  transition: opacity .15s;
}
.btn-danger:hover { opacity: .87; }

/* ── MODAL FORM HELPERS ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--gray-700); }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: .55rem .75rem;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green); }

.login-error {
  background: #fff3f3;
  border: 1px solid #f5c6cb;
  color: #842029;
  border-radius: 6px;
  padding: .6rem .9rem;
  font-size: .85rem;
}

/* ── INTEREST CHECKBOXES ──────────────────────────────────────────── */
.interest-check {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  cursor: pointer;
  color: var(--gray-700);
}
.interest-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

/* ── EVENTS MANAGER VOLUNTEER SEARCH DROPDOWN ────────────────────── */
.em-vol-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}
.em-vol-option {
  padding: .6rem 1rem;
  cursor: pointer;
  font-size: .9rem;
  transition: background .12s;
}
.em-vol-option:hover { background: var(--gray-100); }
.em-vol-none { color: var(--gray-500); cursor: default; }

/* Make the search row position:relative so dropdown is anchored */
#emDetailPanel > div:first-of-type { position: relative; }

/* ── MOBILE ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dash-body { grid-template-columns: 1fr; }
  .right-col { flex-direction: row; flex-wrap: wrap; }
  .right-col > div { flex: 1; min-width: 240px; }
}

@media (max-width: 680px) {
  html, body { overflow: auto; }

  .app-shell { flex-direction: column; overflow: auto; height: auto; }

  .sidebar {
    width: 100%;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content {
    height: auto;
    overflow: visible;
    padding: 1.25rem 1rem;
  }

  .hamburger-dash { display: flex; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .topbar-user { display: none; }
}
