/* =============================================================
   style.css — 2014 KV Raiders
   Version: v23
   Colors: Kelly Green #4CBB17 | Navy Blue #001F3F | White #ffffff
   ============================================================= */

/* --- Custom Properties --- */
:root {
  --kelly-green:        #4CBB17;
  --navy-blue:          #001F3F;
  --white:              #ffffff;
  --text-dark:          #0b2340;
  --border-color:       #001F3F;
  --bg-photobox:        #f4f8fc;

  --max-width:          1200px;
  --logo-height:        170px;
  --left-col-width:     220px;
  --photobox-width:     300px;
  --footer-height:      60px;
  --header-gap:         24px;
  --slot-gap:           6px;

  --base-font-size:     16px;
  --base-line-height:   1.4;
  --line-h:             calc(var(--base-font-size) * var(--base-line-height));
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--white);
  color: var(--text-dark);
  font-size: var(--base-font-size);
  line-height: var(--base-line-height);
}
a { color: var(--navy-blue); text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   HEADER
   Logo left | Title centered | Logo right
   ============================================================ */
.site-header {
  height: var(--logo-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  padding-bottom: 3px;
  position: relative;
  z-index: 10;
  background: var(--white);
  border-bottom: 3px solid var(--kelly-green);
  /* v19: changed from overflow:hidden to overflow:visible so that the admin
     header username dropdown (position:absolute) can appear below the header
     band without being clipped. Logos are safe — they have explicit height
     constraints (height: calc(--logo-height - 6px)) added in v18, so
     defensive overflow:hidden on the header is no longer required. */
  overflow: visible;
}

.header-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.header-logo img {
  height: calc(var(--logo-height) - 6px);
  width: auto;
}
.header-logo .logo-placeholder {
  height: calc(var(--logo-height) - 6px);
  width: calc(var(--logo-height) - 6px);
  background: var(--kelly-green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border-radius: 6px;
}

.header-logo-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* FIX v18: right logo was missing a height constraint. */
.header-logo-right img {
  height: calc(var(--logo-height) - 6px);
  width: auto;
}

.header-title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-title h1 {
  font-size: 60px;
  color: var(--navy-blue);
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.1;
}

/* ============================================================
   MAIN LAYOUT — three columns
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 18px;
  padding: 16px 12px;
  align-items: flex-start;
}

/* ============================================================
   LEFT COLUMN — menu
   ============================================================ */
.left-menu {
  width: var(--left-col-width);
  flex: 0 0 var(--left-col-width);
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: calc(100vh - var(--logo-height) - var(--footer-height) - 60px);
}

/* Bubble nav */
.left-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.left-nav a {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--kelly-green);
  color: var(--navy-blue);
  font-weight: 800;
  font-size: 15px;
  width: 100%;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease,
              box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.left-nav a > span { display: inline-block; vertical-align: middle; }
.left-nav a:hover,
.left-nav a:active {
  background: var(--navy-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 31, 63, 0.18);
}
.left-nav a:focus-visible {
  outline: 3px solid rgba(0, 31, 63, 0.25);
  outline-offset: 3px;
}

/* Home button */
.left-nav-home {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--kelly-green);
  color: var(--navy-blue);
  font-weight: 800;
  font-size: 15px;
  width: 100%;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease,
              box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.left-nav-home > span { display: inline-block; vertical-align: middle; }
.left-nav-home:hover,
.left-nav-home:active {
  background: var(--navy-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 31, 63, 0.18);
}
.left-nav-home:focus-visible {
  outline: 3px solid rgba(0, 31, 63, 0.25);
  outline-offset: 3px;
}

/* ============================================================
   CENTER COLUMN
   ============================================================ */
.center-column {
  flex: 1;
  min-width: 0;
}

/* Content boxes */
.box {
  background: var(--white);
  border: 2px solid var(--navy-blue);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 14px;
}
.box:last-child { margin-bottom: 0; }
.box h2 {
  color: var(--navy-blue);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--kelly-green);
}

/* About */
.about-content {
  white-space: pre-wrap;
  max-height: calc(var(--line-h) * 5);
  overflow-y: auto;
  padding-right: 4px;
}

/* News */
.news-list {
  max-height: calc(var(--line-h) * 5);
  overflow-y: auto;
  padding-right: 4px;
}
.news-item {
  padding: 5px 0;
  border-bottom: 1px dashed #dce4ef;
  font-size: 15px;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-weight: 700;
  color: var(--navy-blue);
  margin-right: 4px;
}

/* Schedule */
.schedule-list {
  max-height: calc(var(--line-h) * 5);
  overflow-y: auto;
  padding-right: 4px;
}
.event-item {
  display: block;
  padding: 5px 0 5px 6px;
  border-bottom: 1px dashed #dce4ef;
  font-size: 15px;
  text-decoration: none;
  color: inherit;
  transition: filter 150ms ease;
}
.event-item:hover { filter: brightness(0.93); }
.event-item:last-child { border-bottom: none; }
.event-date { font-weight: 700; color: var(--navy-blue); }

/* ============================================================
   RIGHT COLUMN — PHOTOBOX
   ============================================================ */
.right-photobox {
  width: var(--photobox-width);
  flex: 0 0 var(--photobox-width);
}

.photo-viewport {
  border: 2px solid var(--navy-blue);
  border-radius: 6px;
  padding: 6px;
  background: var(--bg-photobox);
  width: 100%;
  height: calc(100vh - var(--logo-height) - var(--footer-height) - var(--header-gap) - 32px);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.photobox {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--slot-gap);
  overflow-y: auto;
  padding-right: 4px;
}

.pb-slot {
  width: 100%;
  min-height: calc((100% - 2 * var(--slot-gap)) / 3);
  border-radius: 4px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 3px;
  flex-shrink: 0;
}

.pb-slot img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  border-radius: 3px;
  transition: opacity 300ms ease;
}
.pb-slot img:hover { opacity: 0.88; }

.no-photos {
  color: #666;
  font-size: 14px;
  text-align: center;
  padding: 12px;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}
.lb-stage {
  width: calc(100vw - 100px);
  height: calc(100vh - 120px);
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.lb-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 100ms ease-out;
  will-change: transform;
  cursor: grab;
  display: block;
}
.lb-stage img:active { cursor: grabbing; }

.lb-close,
.lb-prev,
.lb-next,
.lb-download {
  position: fixed;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10010;
  border-radius: 6px;
  line-height: 1;
  transition: background 150ms ease;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover,
.lb-download:hover {
  background: rgba(255, 255, 255, 0.20);
}
.lb-close {
  top: 16px; right: 20px;
  font-size: 30px; padding: 6px 10px;
}
.lb-prev {
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 36px; padding: 10px 14px;
}
.lb-next {
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 36px; padding: 10px 14px;
}
.lb-download {
  right: 20px; bottom: 20px;
  font-size: 18px; padding: 8px 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lb-caption {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  z-index: 10005;
  white-space: nowrap;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 20px;
  padding: 14px;
  text-align: center;
  color: #555;
  font-size: 14px;
  border-top: 2px solid var(--kelly-green);
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-footer a { color: var(--navy-blue); font-weight: 700; }
.site-footer a:hover { color: var(--kelly-green); }

/* ============================================================
   SCROLLBAR styling (Webkit)
   ============================================================ */
.about-content::-webkit-scrollbar,
.news-list::-webkit-scrollbar,
.schedule-list::-webkit-scrollbar,
.photobox::-webkit-scrollbar { width: 5px; }
.about-content::-webkit-scrollbar-track,
.news-list::-webkit-scrollbar-track,
.schedule-list::-webkit-scrollbar-track,
.photobox::-webkit-scrollbar-track { background: #eef2f7; border-radius: 3px; }
.about-content::-webkit-scrollbar-thumb,
.news-list::-webkit-scrollbar-thumb,
.schedule-list::-webkit-scrollbar-thumb,
.photobox::-webkit-scrollbar-thumb { background: var(--kelly-green); border-radius: 3px; }

/* ============================================================
   FORMS PAGE
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(221px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.form-card,
.link-card {
  border: 2px solid var(--navy-blue);
  border-radius: 8px;
  padding: 14px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.form-card:hover,
.link-card:hover {
  box-shadow: 0 4px 16px rgba(0, 31, 63, 0.12);
  transform: translateY(-2px);
}

.form-card-top { display: flex; align-items: center; gap: 10px; }
.form-card-icon { font-size: 27px; line-height: 1; flex-shrink: 0; }
.form-card-name { font-weight: 800; color: var(--navy-blue); font-size: 13px; line-height: 1.3; }
.form-card-type { font-size: 11px; color: #666; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.link-card-label { font-weight: 800; color: var(--navy-blue); font-size: 13px; }
.link-card-desc  { font-size: 12px; color: #555; line-height: 1.4; flex: 1; }

.btn-download,
.btn-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 18px;
  background: var(--kelly-green);
  color: var(--navy-blue);
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-download:hover,
.btn-visit:hover {
  background: var(--navy-blue);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-download.unavailable {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  pointer-events: none;
}
.form-card.unavailable-card { opacity: 0.6; }

.empty-notice { color: #666; font-style: italic; font-size: 15px; padding: 8px 0; }

/* ============================================================
   ROSTER PAGE
   ============================================================ */
.roster-table { width: auto; margin: 8px auto 0; border-collapse: collapse; }
.roster-table th,
.roster-table td { padding: 8px 20px; border-bottom: 1px solid #dce4ef; }
.roster-table th { color: var(--navy-blue); font-weight: 800; background: #f0f6ff; }
.roster-table tr:last-child td { border-bottom: none; }
.roster-table .col-num  { text-align: center; width: 60px; font-weight: 700; color: var(--navy-blue); }
.roster-table .col-name { text-align: left; }
.roster-table .col-pos  { text-align: left; }

/* ============================================================
   TEAM PHOTOS PAGE
   ============================================================ */
.tp-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tp-btn-back {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 18px;
  background: var(--kelly-green);
  color: var(--navy-blue);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.tp-btn-back:hover { background: var(--navy-blue); color: var(--white); }

.tp-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.tp-crumb-link { color: var(--kelly-green); font-weight: 700; text-decoration: none; }
.tp-crumb-link:hover { text-decoration: underline; }
.tp-crumb-sep { color: #aaa; }
.tp-crumb-current { color: var(--navy-blue); font-weight: 700; }

.tp-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.tp-folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--navy-blue);
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.tp-folder-card:hover { box-shadow: 0 4px 16px rgba(0, 31, 63, 0.12); transform: translateY(-2px); }
.tp-folder-icon { font-size: 36px; line-height: 1; }
.tp-folder-name { font-weight: 800; color: var(--navy-blue); text-align: center; line-height: 1.3; }
.tp-folder-meta { font-size: 12px; color: #666; text-align: center; }

.tp-photos-divider { border: none; border-top: 1px dashed #dce4ef; margin: 18px 0; }

.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.tp-thumb { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; cursor: pointer; background: #e8eef5; }
.tp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 200ms ease, opacity 200ms ease; }
.tp-thumb:hover img { transform: scale(1.05); opacity: 0.88; }
.tp-thumb:focus-visible { outline: 3px solid var(--kelly-green); outline-offset: 2px; }

.tp-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.93); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 18px; }
.tp-lb-stage { width: calc(100vw - 100px); height: calc(100vh - 120px); max-width: calc(100vw - 100px); max-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; }
.tp-lb-stage img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; transition: transform 100ms ease-out; will-change: transform; cursor: grab; display: block; }
.tp-lb-stage img:active { cursor: grabbing; }
.tp-lb-close, .tp-lb-prev, .tp-lb-next, .tp-lb-download { position: fixed; background: rgba(255,255,255,0.08); border: none; color: #fff; cursor: pointer; z-index: 10010; border-radius: 6px; line-height: 1; transition: background 150ms ease; }
.tp-lb-close:hover, .tp-lb-prev:hover, .tp-lb-next:hover, .tp-lb-download:hover { background: rgba(255,255,255,0.20); }
.tp-lb-close  { top: 16px; right: 20px; font-size: 30px; padding: 6px 10px; }
.tp-lb-prev   { left: 12px; top: 50%; transform: translateY(-50%); font-size: 32px; padding: 12px 14px; }
.tp-lb-next   { right: 12px; top: 50%; transform: translateY(-50%); font-size: 32px; padding: 12px 14px; }
.tp-lb-download { bottom: 20px; right: 20px; font-size: 22px; padding: 8px 12px; text-decoration: none; }
.tp-lb-caption { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; color: rgba(255,255,255,0.75); font-size: 13px; z-index: 10005; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   CALENDAR PAGE
   ============================================================ */
.cal-ev--game     { background: #d4edda; border-left: 3px solid #28a745; }
.cal-ev--practice { background: #d1ecf1; border-left: 3px solid #17a2b8; }
.cal-ev--other    { background: #f8f9fa; border-left: 3px solid #adb5bd; }

.cal-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cal-view-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-tab { padding: 6px 14px; border-radius: 18px; background: #eef2f7; color: var(--navy-blue); font-weight: 700; font-size: 13px; text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.cal-tab:hover  { background: var(--kelly-green); color: var(--navy-blue); }
.cal-tab.active { background: var(--navy-blue);   color: var(--white); }

.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #eef2f7; color: var(--navy-blue); font-size: 20px; font-weight: 700; text-decoration: none; transition: background 150ms ease; }
.cal-nav-btn:hover { background: var(--kelly-green); }
.cal-nav-today { padding: 5px 12px; border-radius: 18px; background: var(--kelly-green); color: var(--navy-blue); font-weight: 700; font-size: 13px; text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.cal-nav-today:hover { background: var(--navy-blue); color: var(--white); }

.cal-period-title { font-size: 16px; font-weight: 800; color: var(--navy-blue); margin-bottom: 10px; border-bottom: none; padding-bottom: 0; }

.cal-grid--month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 12px; width: 100%; overflow: hidden; }
.cal-grid-header { text-align: center; font-weight: 800; font-size: 11px; color: var(--navy-blue); padding: 4px 2px; background: #eef2f7; min-width: 0; overflow: hidden; }
.cal-cell { min-height: 80px; min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid #dce4ef; padding: 3px; background: var(--white); font-size: 11px; }
.cal-cell--empty  { background: #f8f9fa; border: 1px solid #eef2f7; }
.cal-cell--today  { background: #fffbea; border-color: var(--kelly-green); }
.cal-cell-num { display: block; font-weight: 800; font-size: 12px; color: var(--navy-blue); text-decoration: none; margin-bottom: 2px; }
.cal-cell-num:hover { color: var(--kelly-green); }

.cal-ev { display: block; min-width: 0; max-width: 100%; box-sizing: border-box; font-size: 10px; padding: 2px 3px; border-radius: 3px; margin-bottom: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; line-height: 1.3; text-decoration: none; color: inherit; }
.cal-ev:hover { filter: brightness(0.92); }
.cal-ev-time { font-weight: 700; margin-right: 2px; }
.cal-ev-loc  { display: block; font-size: 9px; opacity: 0.75; }

.cal-grid--week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; width: 100%; overflow: hidden; }
.cal-week-col { border: 1px solid #dce4ef; border-radius: 4px; padding: 4px; background: var(--white); min-height: 100px; min-width: 0; max-width: 100%; overflow: hidden; font-size: 12px; }
.cal-week-header { font-weight: 800; font-size: 11px; color: var(--navy-blue); margin-bottom: 4px; padding-bottom: 3px; border-bottom: 1px solid #eef2f7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-week-header a { color: var(--navy-blue); text-decoration: none; }
.cal-week-header a:hover { color: var(--kelly-green); }
.cal-no-events { min-height: 40px; }

.cal-day-list { display: flex; flex-direction: column; gap: 8px; }
.cal-day-row { display: flex; gap: 14px; padding: 10px 12px; border-radius: 6px; align-items: flex-start; }
.cal-day-time { flex: 0 0 80px; font-weight: 700; font-size: 13px; color: var(--navy-blue); padding-top: 2px; }
.cal-day-detail { flex: 1; }
.cal-day-title  { font-weight: 800; font-size: 15px; color: var(--navy-blue); }
.cal-day-loc    { font-size: 13px; color: #555; margin-top: 3px; }
.cal-day-desc   { font-size: 13px; color: #444; margin-top: 4px; line-height: 1.4; }
.cal-desc-link  { color: var(--navy-blue); font-weight: 700; word-break: break-all; text-decoration: underline; }
.cal-desc-link:hover { color: var(--kelly-green); }

.cal-list { display: flex; flex-direction: column; }
.cal-upcoming-scroll { display: block; height: 148px; overflow-y: scroll; padding-right: 4px; border: 1px solid #eef2f7; border-radius: 4px; }
.cal-upcoming-scroll::-webkit-scrollbar       { width: 5px; }
.cal-upcoming-scroll::-webkit-scrollbar-track { background: #eef2f7; border-radius: 3px; }
.cal-upcoming-scroll::-webkit-scrollbar-thumb { background: var(--kelly-green); border-radius: 3px; }
.cal-list-month { font-weight: 800; font-size: 13px; color: var(--navy-blue); background: #eef2f7; padding: 5px 10px; margin-top: 8px; border-radius: 4px; }
.cal-list-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 7px 10px; border-bottom: 1px dashed #dce4ef; font-size: 14px; align-items: baseline; text-decoration: none; color: inherit; transition: filter 150ms ease; }
.cal-list-row:hover { filter: brightness(0.93); }
.cal-list-row:last-child { border-bottom: none; }
.cal-list-date  { font-weight: 700; color: var(--navy-blue); flex: 0 0 100px; }
.cal-list-time  { color: #555; flex: 0 0 75px; }
.cal-list-title { font-weight: 700; flex: 1; min-width: 120px; }
.cal-list-loc   { color: #666; font-size: 13px; width: 100%; padding-left: 189px; }

.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef2f7; }
.cal-legend-item { padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; }

/* ============================================================
   ADMIN — Shared admin UI components
   ============================================================ */

/* Logout button */
.admin-logout-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 18px;
  background: var(--navy-blue);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-logout-btn:hover,
.admin-logout-btn:active { background: var(--kelly-green); color: var(--navy-blue); }
.admin-logout-btn:focus-visible { outline: 3px solid rgba(0, 31, 63, 0.25); outline-offset: 3px; }

/* Button element resets */
button.btn-download,
button.admin-logout-btn { border: none; cursor: pointer; font-family: inherit; }

/* Admin action buttons bar */
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }

/* Flash messages */
.admin-flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.admin-flash-ok    { background: #e6f9e6; border: 1px solid #5aaa5a; color: #1a6b1a; }
.admin-flash-error { background: #fde8e8; border: 1px solid #cc5555; color: #aa0000; }

/* Small action buttons for archive table */
.btn-view-small,
.btn-download-small {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.btn-view-small {
  background: #e8f4ff;
  color: var(--navy-blue);
  border: 1px solid #b3d9ff;
}
.btn-view-small:hover {
  background: var(--navy-blue);
  color: var(--white);
}
.btn-download-small {
  background: #e6f9e6;
  color: #1a6b1a;
  border: 1px solid #5aaa5a;
}
.btn-download-small:hover {
  background: var(--kelly-green);
  color: var(--navy-blue);
}

/* Archive table actions column */
.col-actions {
  white-space: nowrap;
}
.col-actions a {
  margin-right: 6px;
}
.col-actions a:last-child {
  margin-right: 0;
}

/* Back link for archive viewer */
.admin-link-back {
  color: var(--navy-blue);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
}
.admin-link-back:hover {
  color: var(--kelly-green);
  text-decoration: underline;
}

/* Admin data table */
.admin-table-wrap { overflow-x: auto; margin-top: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th,
.admin-table td { padding: 7px 12px; border-bottom: 1px solid #dce4ef; text-align: left; vertical-align: top; }
.admin-table th { color: var(--navy-blue); font-weight: 800; background: #f0f6ff; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .col-ts     { white-space: nowrap; font-family: monospace; font-size: 12px; }
.admin-table .col-action { font-weight: 700; white-space: nowrap; font-size: 12px; }
.admin-table .col-mono   { font-family: monospace; font-size: 12px; }
.admin-table .col-result-ok   { font-weight: 700; color: #1a6b1a; }
.admin-table .col-result-fail { font-weight: 700; color: #aa0000; }

/* Admin log meta text */
.admin-log-meta { font-size: 13px; color: #555; margin-bottom: 8px; }

/* Audit log scrollable container (shows ~10 rows with sticky header) */
.audit-log-scroll-container {
  position: relative;
  overflow-y: auto;
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid #dce4ef;
  border-radius: 4px;
  background: var(--white);
}

/* Sticky table header */
.audit-log-scroll-container thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f0f6ff;
}

/* Scroll shadow indicators */
.audit-log-scroll-container.has-scroll-top::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to bottom, rgba(0, 31, 63, 0.08), transparent);
  pointer-events: none;
  z-index: 9;
  display: block;
}

.audit-log-scroll-container.has-scroll-bottom::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to top, rgba(0, 31, 63, 0.08), transparent);
  pointer-events: none;
  z-index: 9;
  display: block;
}

/* Remove border from last row in scrollable table */
.audit-log-scroll-container .admin-table tr:last-child td {
  border-bottom: 1px solid #dce4ef;
}

/* Admin header username dropdown (v19) */
.admin-user-menu { position: relative; display: inline-flex; align-items: center; }
.admin-user-menu-trigger { cursor: default; user-select: none; color: var(--text-dark); font-size: 14px; white-space: nowrap; }
.admin-user-menu-trigger .admin-user-caret { font-size: 10px; margin-left: 4px; opacity: 0.6; vertical-align: middle; }
.admin-user-menu-dropdown { display: none; position: absolute; top: calc(100% + 10px); right: 0; background: var(--white); border: 1px solid #dce4ef; border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 31, 63, 0.14); min-width: 175px; z-index: 200; overflow: hidden; }
.admin-user-menu:hover .admin-user-menu-dropdown { display: block; }
.admin-user-menu-dropdown a { display: block; padding: 10px 16px; color: var(--text-dark); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 1px solid #eef2f7; transition: background 120ms ease; }
.admin-user-menu-dropdown a:last-child { border-bottom: none; }
.admin-user-menu-dropdown a:hover { background: #f0f6ff; color: var(--navy-blue); }

/* ============================================================
   STANDALONE PAGES — login.php, change_password.php
   These pages cannot use the full admin layout because they
   are pre-authentication or run during forced-change state.
   They render a centered card on a full-viewport background.
   ============================================================ */

/* Full-viewport flex wrapper — centers the card both axes */
.admin-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  padding: 24px 16px;
}

/* Centered card */
.admin-login-box {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 2px solid var(--navy-blue);
  border-radius: 8px;
  padding: 32px 32px 28px;
  box-shadow: 0 4px 24px rgba(0, 31, 63, 0.12);
  /* Override .box margin-bottom — card is the only element */
  margin-bottom: 0 !important;
}

/* Branding header inside card */
.admin-login-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--kelly-green);
}
.admin-login-logo {
  height: 90px;
  width: auto;
  margin: 0 auto 10px;
  display: block;
}
.admin-login-header h1 {
  font-size: 22px;
  color: var(--navy-blue);
  font-weight: 800;
  margin-bottom: 3px;
  line-height: 1.2;
  /* Override .box h2 border if h1 is inside box */
  border-bottom: none;
  padding-bottom: 0;
}
.admin-login-header p {
  color: #666;
  font-size: 13px;
  margin: 0;
}

/* h2 inside the standalone card (e.g. "Change Password") */
.admin-login-box h2 {
  font-size: 17px;
  color: var(--navy-blue);
  font-weight: 800;
  margin-bottom: 16px;
  /* No green underline — header already has the green separator */
  border-bottom: none;
  padding-bottom: 0;
}

/* Form field rows */
.admin-field {
  margin-bottom: 16px;
}
.admin-field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy-blue);
  margin-bottom: 5px;
}
.admin-field input[type="text"],
.admin-field input[type="password"],
.admin-field input[type="email"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  color: var(--text-dark);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.admin-field input:focus {
  outline: none;
  border-color: var(--navy-blue);
  box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.08);
}

/* Password requirements hint box */
.admin-field--hint {
  background: #f8f9fb;
  border: 1px solid #dce4ef;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  color: #555;
}
.admin-field--hint p {
  font-weight: 700;
  color: var(--navy-blue);
  margin-bottom: 4px;
  font-size: 13px;
}
.admin-field--hint ul {
  margin: 0 0 0 16px;
  line-height: 1.8;
}

/* Primary submit button — full width, navy pill */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--navy-blue);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover,
.btn:active { background: var(--kelly-green); color: var(--navy-blue); }
.btn:focus-visible { outline: 3px solid rgba(0, 31, 63, 0.25); outline-offset: 3px; }

/* Inline alert messages */
.admin-msg {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.admin-msg--error { background: #fde8e8; border: 1px solid #cc5555; color: #aa0000; }
.admin-msg--info  { background: #e8f0fe; border: 1px solid #4a7fd4; color: #1a4a9e; }

/* Back / secondary link below the form */
.admin-back-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}
.admin-back-link a { color: var(--navy-blue); font-weight: 600; text-decoration: none; }
.admin-back-link a:hover { color: var(--kelly-green); }

/* ============================================================
   RESPONSIVE — max-width 900px
   ============================================================ */
@media (max-width: 900px) {
  :root {
    --logo-height:       110px;
    --footer-height:     56px;
    --photobox-width:    100%;
    --left-col-width:    100%;
  }

  .container { flex-direction: column; gap: 14px; padding: 12px; }

  .left-menu,
  .right-photobox { width: 100%; flex: none; min-height: unset; }

  .left-nav ul { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .left-nav li { flex: 0 0 auto; }
  .left-nav a { width: auto; font-size: 14px; padding: 8px 12px; }

  .left-nav-home { margin-top: 6px; width: auto; font-size: 14px; padding: 8px 12px; display: inline-flex; }

  .header-title h1 { font-size: 26px; }

  .pb-slot { min-height: 160px; }
  .photo-viewport { height: 420px; }

  .lb-stage { max-width: 100vw; max-height: calc(100vh - 100px); }
  .lb-prev, .lb-next { font-size: 28px; padding: 8px 10px; }

  .cal-grid--month,
  .cal-grid--week   { display: none; }
  .cal-toolbar      { flex-direction: column; align-items: flex-start; }
  .cal-list-loc     { padding-left: 0; }
  .cal-day-row      { flex-direction: column; gap: 4px; }
  .cal-day-time     { flex: none; }

  /* Standalone pages — card goes full width on small screens */
  .admin-login-box { padding: 24px 20px 20px; }
}
