:root {
  --brand-blue: #285aa0;
  --brand-blue-dark: #14315f;
  --brand-gold: #f2c15c;
  --brand-gold-soft: #fff1ca;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ee;
  --surface: #ffffff;
  --page: #f3f6fb;
  --success: #1f9d68;
  --warning: #c57f14;
  --danger: #bd3d44;
  --radius: 8px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: var(--brand-blue-dark);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  border: 0;
  width: 100%;
  padding: 12px;
  text-align: left;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.nav a {
  border: 0;
  width: 100%;
  padding: 12px;
  text-align: left;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.btn.primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.btn.gold {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: #2b210d;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.stat small {
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.content {
  grid-template-columns: 1.35fr 0.85fr;
  align-items: start;
  margin-top: 16px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: #eef4ff;
  color: var(--brand-blue-dark);
}

.status.ok {
  background: #e6f6ef;
  color: var(--success);
}

.status.warn {
  background: #fff5df;
  color: var(--warning);
}

.status.blocked {
  background: #fdebec;
  color: var(--danger);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #efc15b;
  border-radius: var(--radius);
  background: #fff8e8;
  color: #6e4b08;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.story-preview {
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(20, 49, 95, 0.15), rgba(20, 49, 95, 0.85)),
    var(--brand-blue);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

.story-preview img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.story-preview h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
}

.story-preview p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.story-panel {
  min-width: 0;
}

.story-panel-header,
.story-meta,
.story-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-counter {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.story-slide {
  display: none;
}

.story-slide.active {
  display: block;
}

.story-frame {
  width: min(100%, 330px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--brand-blue-dark);
  border: 1px solid var(--line);
}

.story-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.story-meta {
  margin-top: 14px;
  align-items: flex-start;
}

.story-meta strong,
.story-meta span {
  display: block;
}

.story-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.story-controls {
  justify-content: center;
  margin-top: 14px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-blue-dark);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--brand-gold-soft);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
}

.login-panel {
  background: #fff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel .brand {
  color: var(--ink);
  margin-bottom: 36px;
}

.login-redesign {
  grid-template-columns: minmax(360px, 0.76fr) minmax(520px, 1.24fr);
  background: #f7f9fd;
}

.login-panel-brand {
  min-height: 100vh;
  width: 100%;
  min-width: 0;
  padding: 36px clamp(28px, 4vw, 58px);
  background: linear-gradient(145deg, #082652, #0d3d7e);
  color: #fff;
  justify-content: space-between;
  border-right: 3px solid var(--brand-gold);
}

.login-back {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  font-size: 14px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.login-logo img {
  width: min(230px, 54vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--brand-gold);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.login-copy {
  width: 100%;
  max-width: 430px;
  min-width: 0;
  margin: 0 auto;
}

.login-form,
.login-form .field {
  min-width: 0;
}

.login-copy h1 {
  margin: 0;
  font-size: 27px;
  text-align: center;
}

.login-copy > p {
  margin: 7px 0 26px;
  color: var(--brand-gold);
  text-align: center;
}

.login-form .field label {
  color: #fff;
}

.login-form .field input {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(2, 22, 51, 0.42);
  color: #fff;
}

.login-form .field input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.login-submit {
  width: 100%;
  font-weight: 800;
}

.login-form small {
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.login-footer {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  text-align: center;
}

.login-showcase {
  min-height: 100vh;
  padding: clamp(34px, 6vw, 86px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f7f9fd;
}

.showcase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-blue-dark);
  font-size: 22px;
}

.showcase-header img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.showcase-copy {
  max-width: 720px;
}

.showcase-copy h2 {
  margin: 12px 0 18px;
  max-width: 660px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
}

.showcase-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.showcase-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.showcase-highlights span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand-blue-dark);
  font-weight: 700;
}

.form {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 16px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-gold);
  background: var(--brand-gold-soft);
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 14px;
}

.check-row input {
  margin-top: 4px;
}

.mini-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mini-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-list span {
  color: var(--muted);
}

.readonly-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8fafd;
  color: var(--muted);
}

.hero-panel {
  background:
    linear-gradient(135deg, rgba(20, 49, 95, 0.94), rgba(40, 90, 160, 0.76)),
    var(--brand-blue);
  color: #fff;
  padding: 42px;
  display: flex;
  align-items: center;
}

.hero-panel h1 {
  max-width: 720px;
  font-size: 46px;
  line-height: 1.05;
  margin: 0;
}

.hero-panel p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

.theme-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.swatch {
  min-height: 92px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.swatch span {
  display: block;
  height: 28px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.public-page {
  background: #fff;
  min-height: 100vh;
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 5;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 19px;
}

.public-brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.public-hero {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 5vw, 68px);
  background:
    linear-gradient(135deg, rgba(20, 49, 95, 0.96), rgba(40, 90, 160, 0.86)),
    var(--brand-blue);
  color: #fff;
  overflow: hidden;
}

.public-hero h1 {
  max-width: 720px;
  margin: 12px 0 18px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
}

.public-hero p {
  max-width: 680px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1.55;
}

.eyebrow {
  color: var(--brand-gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
}

.photo-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  transform: rotate(-2deg);
}

.photo-rail img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 3px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(9, 23, 48, 0.24);
}

.photo-rail img:nth-child(2n) {
  transform: translateY(28px);
}

.photo-rail img:nth-child(3n) {
  transform: translateY(-16px);
}

.public-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 54px);
  padding: clamp(34px, 5vw, 72px) clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}

.public-section h2 {
  margin: 8px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.public-section p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
}

.history-copy {
  display: grid;
  gap: 18px;
}

.history-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.history-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.history-card strong {
  display: block;
  font-size: 18px;
}

.history-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.split {
  background: var(--page);
}

.birthday-carousel {
  width: min(100%, 560px);
  min-height: 250px;
  padding: 18px 20px;
  align-self: start;
}

.birthday-carousel-header {
  min-height: 22px;
  display: flex;
  justify-content: flex-end;
}

.birthday-counter {
  color: var(--muted);
  font-size: 13px;
}

.birthday-person,
.birthday-empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.birthday-slide {
  display: none;
  min-height: 150px;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  border: 0;
  padding: 4px 10px;
}

.birthday-slide.active {
  display: grid;
}

.birthday-person img {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--brand-gold);
  display: block;
  margin: 0;
}

.birthday-person strong,
.birthday-empty strong {
  display: block;
  font-size: 18px;
}

.birthday-person small {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-gold);
  font-weight: 800;
  text-transform: uppercase;
}

.birthday-person span,
.birthday-empty span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.birthday-controls {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.birthday-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.birthday-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e4;
}

.birthday-dots span.active {
  background: var(--brand-blue);
}

.event-gallery-section {
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr);
  background: #fff;
}

.event-carousel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.event-carousel-stage {
  position: relative;
  min-height: min(58vw, 560px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #081f45;
  box-shadow: var(--shadow);
}

.event-slide {
  position: absolute;
  inset: 0;
  display: none;
  margin: 0;
}

.event-slide.active {
  display: block;
}

.event-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 31, 69, 0.04) 45%, rgba(8, 31, 69, 0.82));
  pointer-events: none;
}

.event-slide figcaption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
}

.event-slide figcaption strong {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
}

.event-slide figcaption span {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  white-space: nowrap;
}

.event-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.event-counter {
  min-width: 74px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.event-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.event-thumbs button {
  height: 76px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e8eef6;
  cursor: pointer;
}

.event-thumbs button.active {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 2px rgba(224, 166, 38, 0.18);
}

.event-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sponsor-band {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 24px clamp(18px, 5vw, 64px);
  background: var(--brand-blue-dark);
  color: #fff;
  overflow: hidden;
}

.sponsor-band > span {
  color: var(--brand-gold);
  font-weight: 800;
  white-space: nowrap;
}

.sponsor-track {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.sponsor-track img {
  width: 132px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius);
  padding: 8px;
  background: #fff;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 5vw, 64px);
  background: #081f45;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.public-footer span:last-child {
  color: var(--brand-gold);
}

.finance-main {
  min-width: 0;
}

.page-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.period-select {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.period-select span {
  color: var(--muted);
  font-size: 12px;
}

.period-select select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.finance-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.finance-stat {
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.finance-stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 900;
}

.balance-icon {
  background: #e8f0fc;
  color: var(--brand-blue-dark);
}

.income-icon {
  background: #e6f6ef;
  color: var(--success);
}

.expense-icon {
  background: #fdebec;
  color: var(--danger);
}

.pending-icon {
  background: var(--brand-gold-soft);
  color: #8a5d05;
}

.finance-stat small,
.finance-stat strong {
  display: block;
}

.finance-stat small {
  color: var(--muted);
}

.finance-stat strong {
  margin-top: 7px;
  font-size: 22px;
}

.finance-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.finance-chart-card,
.category-card {
  min-height: 300px;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-heading h2,
.import-progress h2 {
  margin: 0;
  font-size: 18px;
}

.card-heading p,
.import-progress p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 2px;
}

.income-dot::before {
  background: var(--brand-blue);
}

.expense-dot::before {
  background: var(--brand-gold);
}

.bar-chart {
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  padding: 16px 10px 0;
  border-bottom: 1px solid var(--line);
}

.bar-group {
  flex: 1;
  min-width: 44px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bar-pair {
  height: 160px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.bar {
  width: 14px;
  display: block;
  border-radius: 3px 3px 0 0;
}

.income-bar {
  background: var(--brand-blue);
}

.expense-bar {
  background: var(--brand-gold);
}

.bar-group small {
  color: var(--muted);
  font-size: 11px;
}

.category-list {
  display: grid;
  gap: 17px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}

.category-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-row strong {
  font-size: 13px;
}

.category-row > span,
.category-row small {
  color: var(--muted);
  font-size: 12px;
}

.category-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.category-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf1f7;
}

.category-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
}

.import-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 24px;
  margin-top: 16px;
  border-left: 4px solid var(--brand-gold);
}

.progress-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-track {
  height: 8px;
  flex: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f7;
}

.progress-track span {
  height: 100%;
  display: block;
  background: var(--brand-blue);
}

.finance-table-card {
  margin-top: 16px;
  min-width: 0;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.transaction-type {
  font-size: 12px;
  font-weight: 800;
}

.transaction-type.income,
.income-text {
  color: var(--success);
}

.transaction-type.expense,
.expense-text {
  color: var(--danger);
}

.money-cell {
  font-weight: 800;
  white-space: nowrap;
}

.finance-empty {
  min-height: 170px;
  display: grid;
  place-content: center;
  gap: 7px;
  text-align: center;
  color: var(--muted);
}

.finance-empty strong {
  color: var(--ink);
}

.compact-empty {
  min-height: 210px;
}

.upload-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.upload-copy,
.upload-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-copy h2,
.password-panel h2 {
  margin: 0;
  font-size: 18px;
}

.upload-copy p,
.password-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-actions input[type="file"] {
  max-width: 320px;
}

.password-panel {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 22px;
  align-items: center;
  border-left: 4px solid var(--brand-gold);
}

.password-panel[hidden],
.import-preview[hidden],
.split-editor[hidden] {
  display: none;
}

.import-message {
  margin: 16px 0;
  color: var(--muted);
}

.import-message.loading {
  color: var(--brand-blue);
}

.import-message.success {
  color: var(--success);
}

.import-message.error {
  color: var(--danger);
}

.import-preview-table input,
.import-preview-table select {
  min-width: 125px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.import-preview-table td:nth-child(2) input {
  min-width: 320px;
}

.import-preview-table td:nth-child(3) input {
  min-width: 95px;
}

.remove-row,
.remove-allocation {
  width: 34px;
  height: 34px;
  color: var(--danger);
  font-size: 21px;
}

.import-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.finance-form-card {
  margin-bottom: 16px;
}

.finance-inline-form,
.finance-grid-form {
  display: grid;
  gap: 14px;
  align-items: end;
}

.finance-inline-form {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) minmax(190px, 240px) 92px auto;
}

.season-form {
  grid-template-columns: 120px minmax(190px, 240px) minmax(180px, 220px) auto;
}

.finance-grid-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.finance-inline-form label,
.finance-grid-form label,
.editable-table label {
  display: grid;
  gap: 7px;
}

.finance-inline-form span,
.finance-grid-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.finance-inline-form input,
.finance-inline-form select,
.finance-grid-form input,
.finance-grid-form select,
.editable-table input,
.editable-table select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.finance-inline-form input[type="color"],
.editable-table input[type="color"] {
  min-width: 54px;
  height: 40px;
  padding: 4px;
}

.wide-field {
  grid-column: span 2;
}

.editable-table td {
  vertical-align: middle;
}

.editable-table .inline-check,
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.editable-table .inline-check input,
.inline-check input {
  width: auto;
}

.member-payment-card {
  margin: 16px 0;
  border-left: 4px solid var(--brand-blue);
}

.payment-remaining {
  color: var(--brand-blue-dark);
  white-space: nowrap;
}

.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payment-summary-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafd;
}

.payment-summary-grid span,
.payment-summary-grid strong {
  display: block;
}

.payment-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.payment-summary-grid strong {
  margin-top: 5px;
  font-size: 18px;
}

.compact-payment-table {
  margin-top: 10px;
}

.review-help {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.review-help span {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-transaction {
  padding: 0;
  overflow: hidden;
}

.transaction-summary {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}

.transaction-date {
  text-align: center;
}

.transaction-date strong,
.transaction-date span,
.transaction-description strong,
.transaction-description span {
  display: block;
}

.transaction-date strong {
  color: var(--brand-blue-dark);
  font-size: 22px;
}

.transaction-date span {
  color: var(--muted);
  font-size: 11px;
}

.transaction-description strong {
  margin-bottom: 5px;
}

.transaction-amount {
  font-size: 18px;
  white-space: nowrap;
}

.review-fields {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(190px, 1fr) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px 18px;
}

.review-fields label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.review-fields input,
.review-fields select,
.allocation-row input,
.allocation-row select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.review-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.ignore-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ignore-check input {
  width: auto;
}

.suggestion-label {
  display: block;
  margin-top: 5px;
  color: var(--success);
  font-size: 11px;
}

.suggestion-label[hidden] {
  display: none;
}

.split-editor {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #fffaf0;
}

.split-heading,
.split-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.split-heading strong,
.split-heading span {
  display: block;
}

.split-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.allocation-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 150px 38px;
  gap: 8px;
}

.split-footer {
  padding-top: 12px;
  border-top: 1px solid #efdcae;
}

@media (max-width: 960px) {
  .shell,
  .login-page,
  .content,
  .profile-layout,
  .public-hero,
  .public-section {
    grid-template-columns: 1fr;
  }

  .event-gallery-section {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .login-showcase {
    min-height: 480px;
  }

  .stats,
  .finance-stats,
  .theme-row,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-analytics {
    grid-template-columns: 1fr;
  }

  .review-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .main,
  .login-panel,
  .hero-panel {
    padding: 20px;
  }

  .stats,
  .finance-stats,
  .theme-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel h1 {
    font-size: 34px;
  }

  .public-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .birthday-carousel {
    min-height: 310px;
  }

  .birthday-slide,
  .birthday-slide.active {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .photo-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-carousel-stage {
    min-height: 360px;
  }

  .event-slide figcaption {
    align-items: flex-start;
    flex-direction: column;
  }

  .event-slide figcaption span {
    white-space: normal;
  }

  .event-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sponsor-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-redesign {
    display: block;
  }

  .login-panel-brand {
    min-height: 100vh;
    width: 100vw;
    max-width: 100vw;
    padding-left: 20px;
    padding-right: 20px;
    border-right: 0;
    overflow: hidden;
  }

  .login-copy {
    width: calc(100vw - 40px);
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .login-showcase {
    display: none;
  }

  .public-footer {
    flex-direction: column;
  }

  .import-progress {
    grid-template-columns: 1fr;
  }

  .progress-area {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-panel,
  .upload-copy,
  .upload-actions,
  .import-submit,
  .split-heading,
  .split-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .password-panel,
  .review-fields {
    grid-template-columns: 1fr;
  }

  .transaction-summary {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .transaction-amount {
    grid-column: 2;
  }

  .allocation-row {
    grid-template-columns: minmax(0, 1fr) 105px 36px;
  }
}
