/* ============================================================
   OPM Schedules — main stylesheet
   Palette: royal blue + gold on a clean, light ground
   ============================================================ */

:root {
  --blue: #2f6fed;
  --blue-dark: #1e4fc4;
  --blue-light: #eaf1ff;
  --navy: #14224d;
  --navy-2: #1f3a8f;
  --black: #16192b;
  --gold: #f4c20d;
  --gold-dark: #caa10a;
  --red: #c8102e;
  --ink: #1c2333;
  --muted: #6b7280;
  --line: #e6eaf3;
  --panel: #ffffff;
  --bg: #f4f6fb;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(20,34,77,.07), 0 1px 2px rgba(20,34,77,.05);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

a { color: var(--blue); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Frames a wide/press-shot photo so the circular crop centers on the face
   instead of showing the whole scene tiny. Tuned for a head-and-shoulders
   subject positioned slightly left-of-center, upper third of the source. */
.photo-fit {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(2.2);
  transform-origin: 43% 15%;
}

/* ---------- App shell: icon-rail sidebar + light topbar ---------- */
.app-shell { min-height: 100vh; }

.sidebar {
  width: 100px;
  background: linear-gradient(190deg, var(--navy) 0%, var(--navy-2) 75%, var(--blue) 130%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 22px 0 18px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 10;
}
.sidebar-logo {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.sidebar-logo-fallback {
  background: rgba(255,255,255,.1);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; width: 100%; align-items: center; }
.sidebar-nav a {
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 14px;
  color: rgba(255,255,255,.62);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a .icon { font-size: 19px; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: var(--navy); }
.sidebar-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sidebar-fab {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--navy);
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(244,194,13,.35);
  transition: transform .12s ease, background .12s ease;
}
.sidebar-fab:hover { background: var(--gold-dark); transform: translateY(-1px); }
.sidebar-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 16px;
  transition: background .12s ease, color .12s ease;
}
.sidebar-icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-alert .badge-alert { position: absolute; top: -4px; right: -4px; margin: 0; }

.app-main { margin-left: 100px; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar-brand { flex-shrink: 0; min-width: 0; }
.topbar-brand .ministry-name {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.topbar-brand h1 { margin: 1px 0 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  width: 260px;
  flex-shrink: 0;
}
.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  flex: 1;
  color: var(--ink);
  font-family: inherit;
}
.topbar-profile { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.topbar-profile .who-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.topbar-profile .who-role { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

.badge-alert {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
  display: inline-block;
}

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .app-main { margin-left: 68px; }
  .sidebar-nav a { width: 52px; font-size: 0; padding: 10px 2px; }
  .sidebar-nav a .icon { font-size: 20px; }
  .topbar-search { display: none; }
  .topbar-brand .ministry-name { max-width: 160px; }
}
@media (max-width: 560px) {
  .topbar-profile .who-role { display: none; }
}

/* ---------- Layout ---------- */
.page {
  max-width: 1100px;
  margin: 28px auto 60px;
  padding: 0 20px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.page-head .sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.count-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.toolbar-search { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 240px; align-items: center; }
.toolbar-search input[type=text] { flex: 1; min-width: 200px; }
.toolbar-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.toolbar-date input[type=date] { padding: 9px 10px; font-size: 13px; }
.toolbar-filters { display: flex; gap: 6px; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.filter-pill:hover { background: #f0f1f3; }
.filter-pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: #f0f1f3; }
.btn-danger { background: #fff; color: var(--red); border-color: #f1c3ca; }
.btn-danger:hover { background: #fdecee; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards / Panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-pad { padding: 20px; }

/* ---------- Dashboard hero (overview chart + quick actions) ---------- */
.dash-hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
  align-items: stretch;
}
.hero-card {
  border-radius: 20px;
  padding: 22px 24px;
  color: #fff;
  box-shadow: 0 10px 26px rgba(20,34,77,.22);
}
.hero-overview { background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 60%, var(--blue) 130%); }
.hero-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.hero-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.hero-title { font-size: 18px; font-weight: 800; margin-top: 3px; }
.hero-link { color: rgba(255,255,255,.85); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hero-link:hover { color: #fff; text-decoration: underline; }

.hero-chart { display: flex; gap: 14px; align-items: flex-end; height: 120px; margin-bottom: 18px; }
.hero-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.hero-bar-track { flex: 1; width: 100%; max-width: 30px; display: flex; align-items: flex-end; }
.hero-bar {
  width: 100%;
  background: rgba(255,255,255,.22);
  border-radius: 8px;
  min-height: 10px;
  position: relative;
  display: flex;
  justify-content: center;
  transition: height .2s ease;
}
.hero-bar.is-today { background: var(--gold); }
.hero-bar-val { position: absolute; top: -20px; font-size: 11px; font-weight: 800; color: #fff; }
.hero-bar-label { margin-top: 8px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.65); text-transform: uppercase; }

.hero-stats-mini { display: flex; gap: 10px; }
.hero-stat {
  flex: 1;
  background: rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-num { font-size: 19px; font-weight: 800; }
.hero-stat-label { font-size: 11px; color: rgba(255,255,255,.7); font-weight: 600; }

.hero-side { display: flex; flex-direction: column; gap: 18px; }
.action-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20,34,77,.18); }
.action-gold { background: linear-gradient(150deg, var(--gold) 0%, var(--gold-dark) 100%); color: var(--navy); }
.action-blue { background: linear-gradient(150deg, var(--blue) 0%, var(--navy) 100%); color: #fff; }
.action-blue.has-alert { box-shadow: 0 0 0 2px rgba(200,16,46,.4), var(--shadow); }
.action-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.action-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action-text strong { font-size: 14.5px; font-weight: 800; }
.action-text span { font-size: 12px; opacity: .85; font-weight: 600; }

/* ---------- Dashboard grid: main column + right rail ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.dash-main { min-width: 0; }
.dash-rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.rail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.rail-trip { background: linear-gradient(160deg, #fff8e1, #fdf0c0); border-color: #f1e0a3; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rail-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.rail-link { font-size: 12px; font-weight: 700; color: var(--blue); text-decoration: none; }
.rail-link:hover { text-decoration: underline; }
.rail-icon { font-size: 16px; }

.team-list { display: flex; flex-direction: column; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: none; }
.team-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
}
.team-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }

.next-trip-card { display: block; text-decoration: none; }
.next-trip-dest { font-size: 11.5px; font-weight: 800; color: var(--gold-dark); text-transform: uppercase; letter-spacing: .03em; }
.next-trip-title { font-size: 15px; font-weight: 800; color: var(--ink); margin: 5px 0 4px; }
.next-trip-date { font-size: 12.5px; color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-rail { position: static; }
}

/* ---------- Meeting list / cards ----------
   Color-coded by event type — deep indigo for an in-house meeting, gold for
   a trip — the same pairing used by the weekly PDF, print views, and the
   dashboard's month calendar, so every surface reads as one system. */
.meeting-card {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s ease, transform .15s ease;
}
.meeting-card:hover { box-shadow: 0 8px 20px rgba(16,17,18,.12); transform: translateY(-2px); }
.meeting-card.type-meeting { border-left: 4px solid #2b2467; }
.meeting-card.type-trip { border-left: 4px solid var(--gold-dark); }
.meeting-card.soon { box-shadow: 0 0 0 2px rgba(200,16,46,.3), var(--shadow); }
.meeting-card.soon:hover { box-shadow: 0 0 0 2px rgba(200,16,46,.35), 0 8px 20px rgba(16,17,18,.12); }
.meeting-card.is-done { opacity: .58; }
.meeting-card.is-done:hover { transform: none; }
.meeting-card.is-done .meeting-body h3 { text-decoration: line-through; text-decoration-color: var(--muted); }
.meeting-card.is-done .meeting-body h3 .pill { text-decoration: none; }
.meeting-card.card-past { opacity: .6; }

.mc-date {
  flex-shrink: 0;
  width: 66px;
  height: fit-content;
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  color: #fff;
}
.meeting-card.type-meeting .mc-date { background: linear-gradient(160deg, #342c78, #221d54); }
.meeting-card.type-trip .mc-date { background: linear-gradient(160deg, var(--gold), var(--gold-dark)); color: var(--black); }
.mc-day { display: block; font-size: 22px; font-weight: 800; line-height: 1; }
.mc-mon { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; margin-top: 3px; opacity: .85; }
.mc-span { display: block; font-size: 9px; font-weight: 700; margin-top: 5px; opacity: .8; line-height: 1.3; }

.meeting-body { flex: 1; min-width: 0; }
.mc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.meeting-body h3 { margin: 0 0 6px; font-size: 16.5px; }
.mc-time { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.mc-time .dur { font-weight: 500; color: var(--muted); }
.mc-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.meeting-body .meta { color: var(--muted); font-size: 13px; }
.meeting-body .meta strong { color: var(--ink); font-weight: 600; }
.meeting-body .agenda { margin-top: 10px; font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.meeting-body .notes { margin-top: 10px; padding: 8px 10px; font-size: 13px; color: var(--ink); white-space: pre-wrap; background: #fff8e1; border-left: 3px solid var(--gold); border-radius: 4px; }

.meeting-actions { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; flex-shrink: 0; width: 84px; }
.mc-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.mc-icon-btn:hover { background: #f0f1f3; transform: translateY(-1px); }
.mc-icon-btn.is-active { background: #eafaf0; border-color: #b9e8c9; }
.mc-icon-btn.danger:hover { background: #fdecee; border-color: #f1c3ca; }

.type-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 3px 10px;
  border-radius: 999px;
}
.type-tag.tag-meeting { background: #e8e7f4; color: #2b2467; }
.type-tag.tag-trip { background: #fdf6df; color: #8a6d00; }

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fdecee;
  color: var(--red);
}
.pill-trip { background: #eef2ff; color: #3730a3; }
.pill-day { background: #f0f1f3; color: var(--muted); }
.pill-active { background: #eafaf0; color: #135c2e; }
.pill-clash { background: #fdecee; color: #8a0d24; }
.pill-done { background: #eafaf0; color: #135c2e; }

.staff-table { width: 100%; border-collapse: collapse; }
.staff-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.staff-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.staff-table tr:last-child td { border-bottom: none; }
.staff-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

/* ---------- Weekly schedule ---------- */
.week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.week-nav .range { font-weight: 700; font-size: 16px; }

.day-block { margin-bottom: 18px; }
.day-block > .day-title {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px 8px 0 0;
  margin: 0;
  font-size: 15px;
  letter-spacing: .02em;
}
.day-block .day-body {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--panel);
}
.day-block .day-body .empty { padding: 16px; text-align: left; font-size: 13px; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field[hidden] { display: none; }
.team-picker { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; background: #f8f8f9; border: 1px solid var(--line); border-radius: 8px; }
.team-option { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; width: auto; }
.team-option input { width: auto; }

/* ---------- Meeting attachments ---------- */
.attachment-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.attachment-item { display: flex; flex-direction: column; gap: 4px; }
.attachment-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: #f8f8f9;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.attachment-link { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-link:hover { text-decoration: underline; }
.attachment-size { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.attachment-remove { flex-shrink: 0; color: var(--red); text-decoration: none; font-weight: 700; padding: 2px 4px; }
.attachment-remove:hover { text-decoration: underline; }
.ai-status { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 4px; min-height: 1em; }
.ai-status.ai-status-ok { color: #135c2e; }
.ai-status.ai-status-error { color: #8a0d24; }

.attachment-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #d3e2fb;
}
.attachment-chip:hover { background: #dce9ff; }

/* ---------- Attachment viewer modal (opens in-page, no new tab) ---------- */
.attachment-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.attachment-modal[hidden] { display: none; }
.attachment-modal-backdrop { position: absolute; inset: 0; background: rgba(16,17,18,.6); }
.attachment-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 900px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.attachment-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.attachment-modal-head span { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-modal-head > div { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.attachment-modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; }
.attachment-modal-close:hover { background: #f0f1f3; }
.attachment-modal-download { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.attachment-modal-download:hover { background: #f0f1f3; }
.attachment-modal-body { flex: 1; overflow: auto; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.attachment-modal-frame { width: 100%; height: 100%; border: none; }
.attachment-modal-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=date], input[type=time], input[type=email],
input[type=password], textarea, select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(244,194,13,.25);
}
textarea { resize: vertical; min-height: 80px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
}
.alert-error { background: #fdecee; color: #8a0d24; border: 1px solid #f1c3ca; }
.alert-success { background: #eafaf0; color: #135c2e; border: 1px solid #b9e8c9; }
.alert-info { background: #fff8e1; color: #6b5300; border: 1px solid #f1e0a3; }
.alert-warning { background: #fff8e1; color: #6b5300; border: 1px solid #f1e0a3; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 130%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(20,34,77,.35);
  overflow: hidden;
}
.login-head {
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
  padding: 28px 24px 20px;
  text-align: center;
}
.login-photo {
  display: inline-block;
  width: 128px; height: 128px; border-radius: 50%;
  overflow: hidden; border: 4px solid var(--gold);
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.flag-badge {
  width: 88px; height: 62px; margin: 0 auto 14px;
  border-radius: 6px; overflow: hidden; border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.login-head .ministry {
  color: var(--gold); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.login-head h1 { color: #fff; font-size: 18px; margin: 6px 0 0; }
.login-body { padding: 26px 24px 28px; }
.login-body .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-body .field { margin-bottom: 14px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 0 24px 22px; }
.landing-tagline { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 18px; line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 28px 20px 40px;
}

/* ---------- Month calendar (Dashboard) ----------
   Poster-calendar inspired: bold condensed title, chunky rounded day
   cards with real gaps, solid category-colored cells for event days
   (deep indigo = meeting, gold = trip) instead of small nested tags. */
.month-cal-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--black);
  margin: 0 0 2px;
  line-height: 1.1;
}
.month-cal-title .accent { color: var(--gold-dark); }

.month-cal {
  background: linear-gradient(135deg, #fdf6df, #fbe9b8);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 4px;
  box-shadow: var(--shadow);
}
.month-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.month-cal-head span {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--black);
  padding: 6px 0;
}
.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.month-cal-day {
  min-height: 108px;
  min-width: 0;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(16,17,18,.06);
  transition: transform .12s ease, box-shadow .12s ease;
  overflow: hidden;
}
.month-cal-day.is-outside { background: rgba(255,255,255,.45); opacity: .5; }
.month-cal-day.has-meeting { background: #2b2467; border-color: #2b2467; }
.month-cal-day.has-trip { background: var(--gold); border-color: var(--gold-dark); }
.month-cal-day.is-today { outline: 3px solid var(--blue); outline-offset: -3px; }
.month-cal-day.is-today.has-meeting { outline-color: var(--gold); }
.month-cal-day.is-today.has-trip { outline-color: var(--navy); outline-width: 4px; }
.month-cal-day:hover:not(.is-outside) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(16,17,18,.14); }
.mcd-num {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; font-size: 14px; color: var(--black); margin-bottom: 6px;
}
.mcd-num-link { color: inherit; text-decoration: none; }
.mcd-num-link:hover { text-decoration: underline; }
.month-cal-day.is-outside .mcd-num { color: #c3ad6a; }
.month-cal-day.has-meeting .mcd-num { color: #fff; }
.month-cal-day.has-trip .mcd-num { color: var(--black); }
.mcd-count {
  font-size: 9px; font-weight: 800; border-radius: 99px; padding: 1px 6px;
  background: rgba(16,17,18,.08); color: inherit;
}
.month-cal-day.has-meeting .mcd-count { background: rgba(255,255,255,.22); }
.month-cal-day.has-trip .mcd-count { background: rgba(16,17,18,.14); }
.mcd-events { display: flex; flex-direction: column; gap: 6px; }
.mcd-event-label {
  display: block;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}
.mcd-event-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
}
.mcd-event-venue {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.25;
  opacity: .75;
}
.mcd-event-label:hover .mcd-event-title { text-decoration: underline; }
.month-cal-day.has-meeting .mcd-event-label { color: #fff; }
.month-cal-day.has-trip .mcd-event-label { color: var(--black); }
.mcd-more { font-size: 9.5px; font-weight: 800; opacity: .8; }

.month-cal-legend {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 4px 22px; font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.mcl-item { display: flex; align-items: center; gap: 7px; }
.mcl-swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.mcl-swatch.mcl-meeting { background: #2b2467; }
.mcl-swatch.mcl-trip { background: var(--gold); border: 1px solid var(--gold-dark); }
.mcl-swatch.mcl-today { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }

.month-summary-day {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg);
  border-left: 3px solid var(--line);
}
.month-summary-day.is-today { background: #fffaf0; border-left-color: var(--gold); }
.msd-date {
  font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.msd-today-tag { background: var(--gold); color: var(--black); font-size: 10px; font-weight: 800; padding: 1px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.msd-items { display: flex; flex-direction: column; gap: 2px; }
.msd-item {
  font-size: 14px; color: var(--ink); text-decoration: none;
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  padding: 5px 6px; margin: 0 -6px; border-radius: 6px;
}
.msd-item:hover { background: rgba(16,17,18,.05); }
.msd-item:hover .msd-title { text-decoration: underline; }
.msd-time { font-weight: 700; color: var(--ink); flex-shrink: 0; min-width: 74px; font-size: 13px; }
.msd-title { font-weight: 600; }
.msd-venue { color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .month-cal-head span { font-size: 9px; padding: 8px 2px; }
  .month-cal-day { min-height: 68px; padding: 5px; }
  .mcd-event-title { font-size: 9px; }
  .mcd-event-venue { display: none; }
  .month-cal-title { font-size: 22px; }
  .month-cal-legend { display: none; }
}

/* ---------- Utility ---------- */
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.no-print { }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .meeting-card { flex-direction: column; }
  .mc-date { width: auto; display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 12px; }
  .mc-day { font-size: 18px; }
  .mc-mon, .mc-span { margin-top: 0; }
  .meeting-actions { width: auto; }
}
