:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #5a6475;
  --line: #d9dfeb;
  --primary: #0d5bd7;
  --primary-dark: #0a47a8;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(19, 28, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 10% 10%, #eef3ff 0%, var(--bg) 45%, #eef2f8 100%);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", "Trebuchet MS", sans-serif;
}

.page {
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 16px;
}

.page-sm {
  max-width: 560px;
}

.account-church-edit-wrap {
  max-width: 980px;
}

.account-church-page {
  max-width: 1380px;
}

.admin-master-body .page {
  max-width: 1560px;
  padding: 0 20px;
}

.admin-master-body .page-sm {
  max-width: 1100px;
}

.admin-master-body .card {
  border-radius: 14px;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.kpi {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe5f5;
  border-radius: 12px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 8px 18px rgba(16, 38, 74, 0.08);
}

.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #4f81d8;
}

.kpi.kpi-members::before {
  background: #2563eb;
}

.kpi.kpi-birthday::before {
  background: #d97706;
}

.kpi.kpi-wedding::before {
  background: #7c3aed;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid #d9dfeb;
  background: #eef4ff;
}

.kpi.kpi-members .kpi-icon {
  background: #eaf2ff;
  color: #184ea6;
}

.kpi.kpi-birthday .kpi-icon {
  background: #fff3e6;
  color: #a84b0a;
}

.kpi.kpi-wedding .kpi-icon {
  background: #f2ecff;
  color: #5b21b6;
}

.kpi-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: #0f2e5f;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

form label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
}

form input,
form select,
form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 38px;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}

button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.1;
}

a.btn:hover {
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: #1f3e74;
  border-color: #b8c8e8;
}

.btn-secondary:hover {
  background: #f0f5ff;
  color: #18325c;
}

.btn-export {
  background: #f8fbff;
  color: #1f3e74;
  border-color: #c9d9f5;
  border-style: dashed;
}

.btn-export:hover {
  background: #eef5ff;
  color: #18325c;
  border-color: #9eb9ea;
}

.btn-danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.btn-danger:hover {
  background: #8f1c14;
  border-color: #8f1c14;
}

.btn-success {
  background: #166534;
  border-color: #166534;
  color: #fff;
}

.btn-success:hover {
  background: #14532d;
  border-color: #14532d;
}

.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 13px;
}

.table-action-btn {
  box-sizing: border-box;
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  margin-top: 0 !important;
  line-height: 1;
  font-size: 13px;
  font-weight: 700;
  border-width: 1px;
  vertical-align: middle;
}

a.table-action-btn,
button.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  appearance: none;
}

.btn-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  min-height: 0;
  font-weight: 600;
}

.btn-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.alert {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.alert-error {
  border-color: #efc6c6;
  color: #8f1f1f;
  background: #fff1f1;
}

.alert-success {
  border-color: #cfe7d2;
  color: #1a6b2d;
  background: #ecfff3;
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-master-body .filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filter-panel {
  margin: 12px 0 18px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafbff;
}

.filter-panel-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.filter-badge {
  display: inline-block;
  background: #e9f2ff;
  border: 1px solid #8eb7ff;
  color: #0a47a8;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-link {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d9dfeb;
  color: var(--text);
  text-decoration: none;
}

.tab-link:hover {
  text-decoration: none;
  background: #f5f8ff;
}

.tab-link.is-active {
  background: #e9f2ff;
  border-color: #8eb7ff;
  color: #0a47a8;
  font-weight: 700;
}

form > button[type="submit"]:not(.action-btn):not(.app-topbar-toggle):not(.table-action-btn),
form > button[type="button"]:not(.action-btn):not(.app-topbar-toggle):not(.table-action-btn) {
  margin-top: 12px;
}

.table-wrap {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

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

th:last-child,
td:last-child {
  border-right: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

thead th {
  background: #eef3ff;
  color: #1b2b4b;
  font-weight: 700;
}

tbody tr:nth-child(even) td {
  background: #fbfcff;
}

tbody tr:hover td {
  background: #f3f8ff;
}

.table-scroll {
  overflow: auto;
  border-radius: 10px;
}

.admin-master-body .table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 12px;
}

.admin-master-body table {
  min-width: 1240px;
}

.admin-master-body th,
.admin-master-body td {
  vertical-align: top;
  white-space: normal;
}

.table-min-680 table {
  min-width: 680px;
}

.table-empty {
  text-align: center;
  color: var(--muted);
}

.member-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid #cfd8e8;
  border-radius: 999px;
  background: #fff;
}

.member-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: #f6f8fc;
  font-size: 12px;
}

.inline-form {
  display: inline;
}

.inline-form-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-form-group select {
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
}

.subscription-toolbar {
  align-items: center;
}

.subscription-toolbar > .btn,
.subscription-toolbar > form > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  line-height: 1;
  padding: 0 12px;
}

.subscription-toolbar > form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pager-info {
  color: var(--muted);
}

.pager-disabled {
  color: #94a3b8;
}

.m-0 {
  margin: 0;
}

.mt-10 {
  margin-top: 10px;
}

.mt-12 {
  margin-top: 12px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-6 {
  margin-bottom: 6px;
}

.mb-14 {
  margin-bottom: 14px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-18 {
  margin-bottom: 18px;
}

.mt-0 {
  margin-top: 0;
}

.mt-n4 {
  margin-top: -4px;
}

.mt-6 {
  margin-top: 6px;
}

.mt-8 {
  margin-top: 8px;
}

.ml-8 {
  margin-left: 8px;
}

.mr-14 {
  margin-right: 14px;
}

.grid-gap-10 {
  display: grid;
  gap: 10px;
}

.item-card-row {
  border: 1px solid #d9dfeb;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.box-soft {
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
}

.text-uppercase {
  text-transform: uppercase;
}

.card-toolbar {
  padding: 10px 12px;
  margin: 14px 0;
}

.card-toolbar-sm {
  padding: 10px 12px;
  margin-bottom: 14px;
}

.divider-soft {
  margin: 18px 0;
  border: none;
  border-top: 1px solid #e5eaf3;
}

.logo-preview {
  max-height: 90px;
  max-width: 220px;
  border: 1px solid #d9dfeb;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.checkbox-inline {
  width: auto;
  margin-right: 6px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.label-muted-inline {
  font-weight: 400;
  margin: 0 0 6px;
}

.label-muted-inline + .label-muted-inline {
  margin-top: 6px;
}

.detail-cell {
  font-size: 12px;
  max-width: 520px;
  white-space: pre-wrap;
}

.text-muted-2 {
  color: #777;
}

.link-plain {
  text-decoration: none;
}

.link-inherit {
  color: inherit;
}

.list-indent {
  margin: 0 0 0 18px;
}

.list-indent-spaced {
  margin: 10px 0 0 18px;
}

.label-inline {
  margin: 0;
  font-weight: 600;
}

.card-pad-12-14 {
  padding: 12px 14px;
}

.input-grow {
  flex: 1 1 420px;
  min-width: 260px;
}

.copy-link-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid #d9e2f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7ff 100%);
}

.copy-link-input {
  flex: 1 1 420px;
  min-width: 260px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #c8d6ef;
  border-radius: 10px;
  background: #fff;
  color: #16325c;
  font-family: "Fira Code", "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
}

.copy-link-input:focus {
  outline: none;
  border-color: #8eb7ff;
  box-shadow: 0 0 0 3px rgba(13, 91, 215, 0.14);
}

.impersonation-banner {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid #f2cf85;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9ec 0%, #fff5dd 100%);
  color: #6f4c00;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.impersonation-banner strong {
  color: #5f3f00;
}

.impersonation-banner-actions {
  margin: 0;
}

.impersonation-banner-actions button {
  margin: 0;
}

.inline-block {
  display: inline-block;
}

.inline-block-gap {
  display: inline-block;
  margin: 0 6px;
}

.profile-photo-sm {
  width: 90px;
  height: 120px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.profile-photo-md {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #ddd;
}

.profile-photo-print {
  width: 110px;
  height: 150px;
  object-fit: cover;
  border: 1px solid #333;
  border-radius: 8px;
}

.photo-placeholder-md {
  width: 120px;
  height: 160px;
  border-radius: 14px;
  border: 1px dashed #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 12px;
}

.photo-placeholder-print {
  width: 110px;
  height: 150px;
  border: 1px solid #333;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #444;
}

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

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-master-body .action-row {
  gap: 6px;
  align-items: center;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid #cfd8ea;
  background: #eef3ff;
  color: #1f3e74;
}

.admin-badge.is-success {
  border-color: #b8e7c8;
  background: #ecfff3;
  color: #14532d;
}

.admin-badge.is-warning {
  border-color: #f5d7a8;
  background: #fff8ea;
  color: #8a4b00;
}

.admin-badge.is-danger {
  border-color: #f1c3c3;
  background: #fff1f1;
  color: #8f1f1f;
}

.admin-badge.is-neutral {
  border-color: #d9dfeb;
  background: #f6f8fc;
  color: #49566f;
}

.admin-truncate {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.admin-truncate.is-sm {
  max-width: 180px;
}

.admin-truncate.is-lg {
  max-width: 360px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid #d9dfeb;
  background: #f6f8fc;
  color: #49566f;
}

.status-badge.is-success {
  border-color: #b8e7c8;
  background: #ecfff3;
  color: #14532d;
}

.status-badge.is-danger {
  border-color: #f1c3c3;
  background: #fff1f1;
  color: #8f1f1f;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: #e2e8f0;
  color: #0f172a;
  text-decoration: none;
  line-height: 1;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
  transition: filter 0.12s ease;
}

.action-btn[title] {
  width: 34px;
  padding: 0;
}

.action-btn:hover {
  text-decoration: none;
  filter: brightness(0.95);
}

.action-btn:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
}

.action-form {
  display: inline-block;
  margin: 0;
}

.action-form button.action-btn {
  width: auto;
  margin: 0;
  min-height: 34px;
}

.action-btn.is-view {
  background: #09b8de;
  color: #ffffff;
}

.action-btn.is-edit {
  background: #f6c000;
  color: #111827;
}

.action-btn.is-clip {
  background: #d8e1ee;
  color: #3b4658;
}

.action-btn.is-delete {
  background: #e63946;
  color: #ffffff;
}

.action-btn.is-delete:hover {
  filter: brightness(0.9);
}

.action-btn.is-view:hover {
  filter: brightness(0.9);
}

.action-btn.is-edit:hover {
  filter: brightness(0.9);
}

.action-btn.is-clip:hover {
  filter: brightness(0.95);
}

.app-shell-body {
  min-height: 100vh;
  background: #f2f5fb;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, #0464aa 0%, #005792 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 56, 94, 0.28);
}

.app-topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.app-topbar-brand {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.app-topbar-brand strong {
  font-size: 22px;
  letter-spacing: 0.2px;
  font-weight: 800;
}

.app-topbar-brand small {
  font-size: 12px;
  opacity: 0.9;
}

.app-topbar-toggle {
  display: none;
  width: 42px;
  height: 38px;
  margin-top: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  cursor: pointer;
}

.app-topbar-toggle span {
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.app-topbar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-topbar-account select {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  min-width: 0;
  max-width: min(78vw, 560px);
  padding-right: 34px;
}

.app-topbar-account select option {
  color: #111827;
  background: #fff;
}

.app-topbar-user {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
}

.app-topbar-user small {
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  opacity: 0.9;
}

.app-topbar-account a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
}

.app-topbar-account a:hover {
  background: rgba(255, 255, 255, 0.16);
  text-decoration: none;
}

.app-topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
  padding: 8px 20px;
}

.app-nav-group summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #eff3ff;
  border: 1px solid transparent;
  font-weight: 700;
}

.app-nav-group summary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.app-nav-group[open] summary {
  background: rgba(8, 26, 81, 0.32);
  border-color: rgba(255, 255, 255, 0.22);
}

.app-nav-group {
  position: relative;
}

.app-subnav {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  min-width: 240px;
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #dce4f4;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.app-subnav-label {
  margin: 5px 4px 2px;
  padding: 8px 8px 5px;
  border-top: 1px solid #dbe4f5;
  color: #6b778e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.app-subnav-label:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 6px;
}

.app-nav-link,
.app-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #eff3ff;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1;
}

.app-subnav-link {
  color: #24324d;
  font-weight: 600;
}

.app-nav-link:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.15);
}

.app-subnav-link:hover {
  color: #111827;
  text-decoration: none;
  background: #eef4ff;
}

.app-nav-link.is-active {
  background: rgba(8, 26, 81, 0.32);
  border-color: rgba(255, 255, 255, 0.22);
}

.app-subnav-link.is-active {
  color: #10336f;
  background: #e9f2ff;
  border-color: #cfdffc;
}

.app-nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.app-nav-badge {
  margin-left: 6px;
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.app-workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

.app-main-content {
  padding: 8px 0;
}

.app-main-content .page {
  margin: 24px auto;
}

.app-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 20px;
  font-size: 13px;
  background: #fff;
}

.dashboard-section-title {
  margin: 10px 0;
}

.dashboard-subtitle {
  margin: 8px 0 4px;
}

.dashboard-calendar-month {
  margin: 8px 0 12px;
}

.dashboard-day-empty {
  margin: 6px 0 0;
  font-size: 12px;
}

.dashboard-next-title {
  margin: 4px 0 8px;
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.dashboard-chart-panel {
  border: 1px solid #e3e8f1;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.dashboard-chart-title {
  margin: 0 0 8px;
  font-size: 17px;
}

.dashboard-donut {
  --donut-bg: #eef2f8;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 8px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--donut-bg);
}

.dashboard-donut-hole {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e5eaf2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

.dashboard-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.dashboard-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.dashboard-legend-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dashboard-dot {
  --dot-color: #9ca3af;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--dot-color);
}

.dashboard-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-cash-section {
  padding-top: 6px;
}

.dashboard-cash-label {
  display: block;
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #5b6b84;
  text-transform: uppercase;
}

.dashboard-cash-value {
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  margin: 0 0 8px;
}

.dashboard-cash-value.is-in {
  color: #159947;
}

.dashboard-cash-value.is-out {
  color: #d12b3f;
}

.dashboard-cash-value.is-balance {
  color: #1995ad;
}

.dashboard-cash-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
  margin-bottom: 8px;
}

.dashboard-cash-fill {
  --fill-width: 0%;
  height: 10px;
  border-radius: 999px;
  width: var(--fill-width);
}

.dashboard-cash-fill.is-in {
  background: linear-gradient(90deg, #16a34a, #34d399);
}

.dashboard-cash-fill.is-out {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.dashboard-cash-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #4a5870;
}

.dashboard-cash-divider {
  border: none;
  border-top: 1px solid #e5eaf3;
  margin: 14px 0;
}

.dashboard-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-calendar-filter {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-calendar-filter label {
  margin: 0;
}

.dashboard-calendar-filter input,
.dashboard-calendar-filter button {
  margin: 0;
  width: auto;
}

.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-calendar-weekday {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 4px;
}

.dashboard-calendar-day {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.dashboard-calendar-day.is-today {
  border-color: #0d5bd7;
  box-shadow: inset 0 0 0 1px #0d5bd7;
  background: #f1f7ff;
}

.dashboard-calendar-day.is-empty {
  background: #f7f9fe;
}

.dashboard-calendar-daynum {
  font-weight: 700;
  margin-bottom: 6px;
}

.dashboard-calendar-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.dashboard-calendar-events li {
  display: grid;
  gap: 2px;
  border-left: 3px solid #d9dfeb;
  padding-left: 6px;
}

.dashboard-calendar-events li.is-planned {
  border-left-color: #d19b00;
}

.dashboard-calendar-events li.is-canceled {
  border-left-color: #c62828;
}

.dashboard-calendar-events li.is-done {
  border-left-color: #2e7d32;
}

.dashboard-calendar-events li.is-birthday {
  border-left-color: #6a1b9a;
}

.dashboard-calendar-events li.is-wedding {
  border-left-color: #ad1457;
}

.dashboard-calendar-events a {
  font-size: 13px;
  font-weight: 600;
}

.dashboard-calendar-events small {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-status-badge {
  display: inline-block;
  width: fit-content;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #d9dfeb;
  font-size: 11px;
}

.dashboard-status-badge.is-planned {
  color: #7f6000;
  background: #fff9e8;
  border-color: #f1d999;
}

.dashboard-status-badge.is-canceled {
  color: #8a1c1c;
  background: #ffefef;
  border-color: #f3b4b4;
}

.dashboard-status-badge.is-done {
  color: #1f6b2a;
  background: #edf9ef;
  border-color: #b9e0bf;
}

.dashboard-status-badge.is-birthday {
  color: #5d127f;
  background: #f7ecff;
  border-color: #dbbdf0;
}

.dashboard-status-badge.is-wedding {
  color: #8f1249;
  background: #ffeef6;
  border-color: #f4bfd8;
}

.dashboard-upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-upcoming-item {
  border: 1px solid #dfe6f3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
}

.dashboard-upcoming-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0f2e5f;
  text-decoration: none;
  margin-bottom: 6px;
}

.dashboard-upcoming-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-upcoming-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d9dfeb;
  font-size: 12px;
  background: #fff;
  color: #334155;
}

.dashboard-upcoming-badge.dashboard-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 2px 8px;
}

.dashboard-celebration-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-celebration-item {
  border: 1px solid #dfe6f3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
}

.dashboard-celebration-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f2e5f;
  margin-bottom: 6px;
}

.dashboard-celebration-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-celebration-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d9dfeb;
  font-size: 12px;
  background: #fff;
  color: #334155;
}

.dashboard-celebration-badge.is-birthday {
  background: #fff3f0;
  border-color: #ffd7cc;
  color: #b54708;
}

.dashboard-celebration-badge.is-wedding {
  background: #f4f1ff;
  border-color: #d9ccff;
  color: #5b21b6;
}

.dashboard-celebration-badge.is-tomorrow {
  background: #ecfdf3;
  border-color: #b7ebc8;
  color: #166534;
}

.public-dashboard-page {
  background: #f2f5fb;
}

.public-shell {
  max-width: 1080px;
  margin: 0 auto;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 2px;
}

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

.public-brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d9dfeb;
  background: #fff;
}

.public-brand-title {
  margin: 0;
  font-size: 22px;
  color: #0f2e5f;
}

.public-footer {
  margin-top: 18px;
  color: #60708a;
  font-size: 12px;
  text-align: center;
  padding: 8px 0;
}

.public-event-time {
  font-weight: 700;
}

.public-section-title {
  margin: 4px 0 10px;
}

.public-ann-list {
  display: grid;
  gap: 10px;
}

.public-ann-item {
  border: 1px solid #dfe6f1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.public-ann-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: #163760;
}

.public-ann-meta {
  font-size: 12px;
  color: #60708a;
  margin-bottom: 6px;
}

.public-ann-msg {
  margin: 0;
  white-space: pre-wrap;
  color: #1f2d3d;
}

.public-ann-card {
  border-color: #9fc2ff;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.public-ann-toggle {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0a47a8;
  text-decoration: none;
}

.public-ann-toggle:hover {
  text-decoration: underline;
}

.public-dashboard-page .dashboard-calendar-events a {
  pointer-events: none;
  text-decoration: none;
  white-space: normal;
  word-break: break-word;
}

.public-dashboard-page .dashboard-calendar-day {
  min-height: 124px;
}

.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  max-width: min(92vw, 360px);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #b7ebc8;
  background: #ecfdf3;
  color: #166534;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.is-error {
  border-color: #f3b6b6;
  background: #fff1f1;
  color: #b42318;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .app-topbar-main {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .app-topbar-account {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }

  .app-topbar-toggle {
    display: inline-flex;
  }

  .app-topbar-nav {
    display: none;
    padding: 8px 12px 10px;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .app-topbar.is-menu-open .app-topbar-nav {
    display: grid;
  }

  .app-nav-link,
  .app-nav-group summary {
    width: 100%;
  }

  .app-nav-group {
    width: 100%;
  }

  .app-subnav {
    position: static;
    margin-top: 6px;
    min-width: 0;
  }

  .app-main-content .page {
    margin: 16px auto;
  }

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

  .dashboard-calendar-weekday {
    display: none;
  }

  .dashboard-calendar-day {
    min-height: 96px;
  }
}
