:root {
  --bg: #fdf3ea;
  --panel: #ffffff;
  --ink: #2c1420;
  --ink-soft: #5d4450;
  --muted: #93707e;
  --accent: #c9185f;
  --accent-dark: #9c1249;
  --accent-pop: #f0447f;
  --sunset-1: #f7b733;
  --sunset-2: #f37335;
  --sunset-3: #e63e8c;
  --gold: #dd7f0e;
  --gold-soft: #fef3c7;
  --header-from: #33102b;
  --header-to: #8e1e5a;
  --border: #f0dcd0;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --info: #7c3aed;
  --info-bg: #ede9fe;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(90, 30, 50, .1), 0 1px 2px rgba(90, 30, 50, .06);
  --shadow-lg: 0 8px 24px rgba(140, 30, 80, .16);
}

* { box-sizing: border-box; }
::selection { background: var(--sunset-1); color: #33102b; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

html, body { height: 100%; }
body { overflow: hidden; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- app shell: sidebar + topbar, fits the viewport ---------- */

.app-shell { display: flex; width: 100%; height: 100vh; height: 100dvh; }
.sidebar-toggle { display: none; }
.sidebar-scrim { display: none; }

.sidebar {
  width: 252px;
  flex: none;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, var(--header-from), var(--header-to));
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 60;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  text-decoration: none;
  letter-spacing: .01em;
  line-height: 1.25;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand small { font-weight: 500; font-size: .8rem; color: #f0c9a8; letter-spacing: .14em; text-transform: uppercase; }
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  flex: none;
}
.brand.on-light { color: var(--ink); padding: 0; border: none; }
.brand.on-light small { color: var(--muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-section {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #f0b46a;
  margin: 14px 8px 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e3e6ee;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .92rem;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 6px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.sidebar-who { min-width: 0; }
.sidebar-who strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-who span { font-size: .76rem; color: #f0c9a8; }
.sidebar-actions { display: flex; gap: 12px; padding: 4px 16px 14px; font-size: .82rem; }
.sidebar-actions a { color: #f3cfae; }
.sidebar-actions a:hover { color: #fff; }
.sidebar-actions .logout-form { margin: 0; }
.sidebar-actions button {
  background: none;
  border: none;
  padding: 0;
  color: #f3cfae;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.sidebar-actions button:hover { color: #fff; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}
.topbar.public { justify-content: space-between; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-search { display: flex; flex: 1; max-width: 440px; }
.topbar-search input {
  flex: 1;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: .9rem;
  background: var(--bg);
  min-width: 0;
}
.topbar-search input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.topbar-search button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 0 8px 8px 0;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
}
.topbar-search button:hover { background: var(--accent-dark); }
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-user .avatar { margin-right: 0; }

.nav-toggle-btn {
  display: none;
  color: var(--ink);
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: .9rem;
  user-select: none;
}

.content-scroll { flex: 1; overflow-y: auto; padding: 22px 0 8px; }

.welcome { color: var(--ink-soft); font-size: .88rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 16px 0 24px;
  margin-top: 24px;
  font-size: .85rem;
}

/* ---------- type & links ---------- */

h1 { font-size: 1.65rem; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 1.18rem; margin: 26px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(115deg, var(--sunset-1) 5%, var(--sunset-2) 48%, var(--sunset-3) 100%);
  color: #3a1428;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 65%);
}
.hero h1 { font-size: 2rem; margin: 0 0 10px; color: #33102b; }
.hero p { color: #5d2a3d; max-width: 640px; }
.hero .cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .btn { background: #33102b; }
.hero .btn:hover { background: #4c193f; filter: none; }
.hero .btn-ghost { background: rgba(255, 255, 255, .28); color: #33102b; border-color: rgba(51, 16, 43, .35); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .45); }
.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .85);
  box-shadow: var(--shadow-lg);
  margin-bottom: 14px;
  background: #fff;
}
.login-logo {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: #fff;
}

/* ---------- cards, stats ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card.tight { padding: 14px 16px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-editor { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) {
  .grid-editor { grid-template-columns: 1fr; }
}

/* ---------- gallery & profiles ---------- */

.profile-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  vertical-align: middle;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  background: #fff;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.gallery-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.gallery-item img, .gallery-item video {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: #111;
}
.gallery-caption { padding: 10px 12px; background: var(--panel); }
.gallery-caption .btn { margin-top: 6px; }

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.folder-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.folder-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.folder-thumb {
  height: 120px;
  background: linear-gradient(135deg, var(--sunset-1), var(--sunset-3));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.folder-thumb img, .folder-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.folder-icon { font-size: 2.4rem; color: rgba(255, 255, 255, .85); }
.folder-caption { padding: 10px 12px; }
.folder-caption strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- facebook-style profile ---------- */

.profile-cover {
  background: linear-gradient(120deg, var(--header-from), var(--header-to) 60%, #6d1a3c);
  background-size: 180% 180%;
  animation: heroPan 18s ease infinite;
  border-radius: 16px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  min-height: 190px;
}
.profile-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 10, 25, .72), rgba(20, 10, 25, .08) 60%);
}
.profile-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-top: 110px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow-lg);
  background: #fff;
  flex: none;
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--sunset-3), var(--sunset-1));
}
.avatar-fallback:hover { transform: none; }
.profile-id { flex: 1; min-width: 220px; }
.profile-id h1 { color: #fff; margin: 0 0 2px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }
.profile-actions .btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); }
.profile-actions .btn-ghost:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.stat { text-align: left; padding: 18px; border-top: 4px solid var(--accent); position: relative; }
.stat.gold { border-top-color: var(--gold); }
.stat.green { border-top-color: var(--ok); }
.stat.blue { border-top-color: var(--info); }
.stat .value { font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat .value.accent { color: var(--accent); }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.stat .sub { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.stat .icon-dot {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.stat.gold .icon-dot { background: var(--gold); }
.stat.green .icon-dot { background: var(--ok); }
.stat.blue .icon-dot { background: var(--info); }

/* ---------- avatars ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sunset-3), var(--sunset-2));
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
  vertical-align: middle;
  margin-right: 8px;
  flex: none;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; margin-right: 6px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
thead th {
  background: #faf0e6;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  position: sticky;
  top: 0;
}
tbody tr:hover td { background: #fdf3ea; }

/* ---------- badges & dots ---------- */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.neutral { background: #f3e4d8; color: var(--ink-soft); }
.badge.count { background: var(--sunset-1); color: #33102b; margin-left: 5px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.dot.rehearsal { background: var(--gold); }
.dot.performance { background: var(--accent); }
.dot.meeting { background: var(--sunset-2); }
.dot.social { background: var(--ok); }
.dot.other { background: var(--muted); }

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--sunset-3), var(--sunset-2));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.07); color: #fff; }
.btn.btn-small { padding: 5px 11px; font-size: .8rem; }
.btn.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn.btn-ok:hover { background: #166534; }
.btn.btn-warn { background: #fff; color: var(--warn); border-color: var(--warn); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

form .field { margin-bottom: 14px; }
form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
form input[type="text"], form input[type="email"], form input[type="password"],
form input[type="date"], form input[type="datetime-local"], form input[type="number"],
form input[type="search"], form select, form textarea {
  width: 100%;
  max-width: 560px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
form .helptext { color: var(--muted); font-size: .8rem; }
form .errorlist { color: var(--bad); font-size: .85rem; margin: 4px 0 0; padding-left: 18px; }

.pagination { margin: 20px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--ink); background: #fff; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

/* ---------- lists & rows ---------- */

.attendance-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.attendance-row:last-child { border-bottom: none; }
.attendance-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: .85rem; }
.feed-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-item.unread { background: #fffdf3; margin: 0 -20px; padding-left: 20px; padding-right: 20px; border-left: 4px solid var(--gold); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid transparent; }
.alert.warn { background: var(--warn-bg); border-color: #f5d48a; color: #78350f; }
.alert.bad { background: var(--bad-bg); border-color: #f3b4b4; color: #7f1d1d; }
.alert.info { background: var(--info-bg); border-color: #b6cdf5; color: #1e3a8a; }
.alert.ok { background: var(--ok-bg); border-color: #9be3b4; color: #14532d; }

.messages .message { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 10px; }
.message.success { background: var(--ok-bg); color: #14532d; }
.message.warning { background: var(--warn-bg); color: #78350f; }
.message.error { background: var(--bad-bg); color: #7f1d1d; }
.message.info { background: var(--info-bg); color: #1e3a8a; }

.meta { color: var(--muted); font-size: .85rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- charts ---------- */

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 52px; gap: 10px; align-items: center; font-size: .85rem; }
.bar-row .bar-label { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #f3e2d3; border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sunset-3), var(--sunset-2)); }
.bar-fill.green { background: linear-gradient(90deg, #15803d, #4ade80); }
.bar-fill.gold { background: linear-gradient(90deg, #b45309, var(--sunset-1)); }
.bar-fill.blue { background: linear-gradient(90deg, #7c3aed, var(--sunset-3)); }
.bar-row .bar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- executive dashboard ---------- */

.zone-title {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-dark);
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.zone-title:first-of-type { margin-top: 6px; }

.attention-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  animation: fadeUp .45s ease both;
}
.attention-row:last-child { border-bottom: none; }
.attention-row:nth-child(2) { animation-delay: .06s; }
.attention-row:nth-child(3) { animation-delay: .12s; }
.attention-row:nth-child(4) { animation-delay: .18s; }
.attention-row:nth-child(5) { animation-delay: .24s; }

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  animation: pulseGlow 2s infinite;
}

.ring { position: relative; width: 92px; height: 92px; margin: 2px auto 8px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #f3e2d3; stroke-width: 9; }
.ring-fg {
  fill: none;
  stroke: var(--muted);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 213.6;
  transition: stroke-dashoffset 1.2s cubic-bezier(.22, .8, .3, 1);
}
.ring.good .ring-fg { stroke: var(--ok); }
.ring.warn .ring-fg { stroke: var(--gold); }
.ring.bad .ring-fg { stroke: var(--bad); }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}

.vstack { display: flex; flex-direction: column; }
.hstack { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- month calendar ---------- */

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month-dow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; padding: 4px 0; }
.month-cell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 96px;
  padding: 6px;
  overflow: hidden;
}
.month-cell.dim { background: #f7ece2; color: #a08a96; }
.month-cell.today { border: 2px solid var(--accent); }
.month-daynum { font-weight: 700; font-size: .82rem; margin-bottom: 4px; }
.month-chip {
  display: block;
  font-size: .74rem;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 3px;
  text-decoration: none;
  color: #fff;
  background: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-chip.rehearsal { background: #b45309; }
.month-chip.performance { background: var(--accent); }
.month-chip.meeting { background: #ea5b0c; }
.month-chip.social { background: #15803d; }
.month-chip.cancelled { background: #a08a96; text-decoration: line-through; }
.month-chip:hover { color: #fff; filter: brightness(1.1); }

/* ---------- search ---------- */

.search-section { margin-bottom: 8px; }
.search-hit { padding: 10px 0; border-bottom: 1px solid var(--border); }
.search-hit:last-child { border-bottom: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .nav-toggle-btn { display: inline-block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-toggle:checked ~ .app-shell .sidebar { transform: none; }
  .sidebar-toggle:checked ~ .app-shell .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 12, 28, .5);
    z-index: 55;
  }
  .topbar-user .welcome { display: none; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 1.55rem; }
  .month-cell { min-height: 64px; }
  .month-chip { font-size: .68rem; }
  .bar-row { grid-template-columns: 92px 1fr 46px; }
}

@media (max-width: 560px) {
  .attendance-row { flex-wrap: wrap; }
  .month-grid { gap: 3px; }
  .month-cell { min-height: 52px; padding: 3px; }
  .month-daynum { font-size: .72rem; }
}

/* ---------- print ---------- */

@media print {
  .sidebar, .topbar,
  .site-footer, .page-head .actions, .btn, .pagination, .filters { display: none; }
  html, body { height: auto; }
  body { background: #fff; overflow: visible; }
  .app-shell, .main-col { display: block; height: auto; }
  .content-scroll { overflow: visible; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
}

/* ---------- motion & delight ---------- */

html { scroll-behavior: smooth; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroPan {
  0% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
  100% { background-position: 0% 40%; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 154, 46, .55); }
  50% { box-shadow: 0 0 0 7px rgba(201, 154, 46, 0); }
}
@keyframes growBar { from { width: 0; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

.animate-in { animation: fadeUp .55s ease both; }
.d1 { animation-delay: .06s; }
.d2 { animation-delay: .12s; }
.d3 { animation-delay: .18s; }
.d4 { animation-delay: .24s; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

.hero { background-size: 180% 180%; animation: heroPan 16s ease infinite; }
.hero-logo { animation: floatY 5s ease-in-out infinite; }

.stat { transition: transform .18s ease, box-shadow .18s ease; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn { transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(194, 16, 74, .35); }
.btn.btn-ghost:hover { box-shadow: var(--shadow); }

.main-nav > a.active { background: rgba(255, 255, 255, .14); color: #fff; }

.badge.count { animation: pulseGlow 2.2s infinite; }

.bar-fill { animation: growBar .9s ease both; }

.alert, .messages .message { animation: popIn .3s ease both; }

.month-chip { transition: transform .12s ease, filter .12s ease; }
.month-chip:hover { transform: translateY(-1px); }
.month-cell { transition: border-color .15s ease, box-shadow .15s ease; }
.month-cell:hover { border-color: var(--accent); }

.brand-logo { transition: transform .3s ease; }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }

.avatar { transition: transform .15s ease; }
.avatar:hover { transform: scale(1.08); }

tbody tr { transition: background-color .12s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
