:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #25324a;
  --muted: #6f7a8d;
  --line: #e2e8f0;
  --primary: #5a8dff;
  --danger: #ff5e7a;
  --ok: #22b07d;
  --shadow: 0 4px 14px rgba(35, 52, 84, 0.06);
  font-family: "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  padding-bottom: 0;
  background: var(--bg);
}

.hidden {
  display: none !important;
}

.hidden-app {
  display: none;
}

html.has-auth-token #auth-screen {
  display: none;
}

.bg-shape {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(120, 193, 255, 0.55) 0%, rgba(120, 193, 255, 0) 42%),
    radial-gradient(circle at 82% 88%, rgba(130, 236, 196, 0.48) 0%, rgba(130, 236, 196, 0) 40%),
    linear-gradient(145deg, #eef5ff 0%, #f2fbff 52%, #edf7ff 100%);
}

.auth-screen::before,
.auth-screen::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
  z-index: 0;
}

.auth-screen::before {
  width: 300px;
  height: 300px;
  left: -90px;
  top: -60px;
  background: radial-gradient(circle, rgba(90, 141, 255, 0.3) 0%, rgba(90, 141, 255, 0) 70%);
}

.auth-screen::after {
  width: 260px;
  height: 260px;
  right: -70px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(102, 203, 95, 0.26) 0%, rgba(102, 203, 95, 0) 72%);
}

.auth-yoga-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image: url("../assets/yoga-pattern.svg");
  background-size: 220px 220px;
}

.auth-yoga-pattern::before,
.auth-yoga-pattern::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  background: url("../assets/yoga-lotus.svg") no-repeat center / contain;
  opacity: 0.2;
}

.auth-yoga-pattern::before {
  left: 3%;
  top: 6%;
}

.auth-yoga-pattern::after {
  right: 4%;
  bottom: 8%;
  transform: rotate(10deg);
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(420px, 92vw);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #d4e5fb;
  border-radius: 18px;
  box-shadow: 0 18px 32px rgba(58, 108, 185, 0.16);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.auth-card h2 {
  margin: 0 0 6px;
  color: #2d4f85;
}

.auth-card p {
  margin: 0 0 12px;
  color: #6f7f99;
  font-size: 0.92rem;
}

.auth-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.auth-tab {
  flex: 1;
  border: 1px solid var(--line);
  background: #f7fbff;
  color: #4b5f7f;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.auth-tab.active {
  border-color: #8cb2ff;
  background: #ebf2ff;
  color: #2f67d8;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow: hidden;
}

.admin-topbar {
  height: 64px;
  background: #202847;
  color: #d9e5ff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-logo {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo-top {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  opacity: 0.98;
}

.admin-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.admin-brand span {
  font-size: 0.85rem;
  color: #a9b8dd;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.top-user-name {
  color: #dfe8ff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0 4px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-wrap {
  position: relative;
}

.user-menu-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.user-menu-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid #d9e5f5;
  border-radius: 12px;
  box-shadow: 0 14px 26px rgba(28, 53, 96, 0.18);
  overflow: hidden;
  z-index: 30;
}

.user-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #d9e5f5;
  border-top: 1px solid #d9e5f5;
  transform: rotate(45deg);
}

.user-menu-name {
  padding: 14px 14px 10px;
  font-size: 1.05rem;
  color: #2c3f62;
  border-bottom: 1px solid #e6edf9;
}

.user-menu-item {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 12px 14px;
  font-size: 1rem;
  color: #324b74;
  cursor: pointer;
}

.user-menu-item:hover {
  background: #f2f7ff;
}

.user-menu-item.danger {
  color: #d8506f;
}

.user-menu-item + .user-menu-item {
  border-top: 1px solid #edf2fb;
}

.admin-shell {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  height: calc(100vh - 64px);
  overflow: hidden;
}

.admin-sidebar {
  border-right: 1px solid #e7ebf2;
  background: #ffffff;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 0;
  height: 100%;
  overflow-y: auto;
}

.sidebar-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  position: relative;
}

.sidebar-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #e9edf3;
}

.sidebar-toggle-desktop {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4f7fe0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-toggle-desktop:hover {
  background: #edf2fc;
}

.sidebar-toggle-desktop svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.admin-main {
  padding: 14px 16px 54px;
  background: var(--bg);
  min-height: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e6ecff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.sidebar-menu {
  display: grid;
  gap: 0;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 960px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden;
  }

  .app {
    height: auto !important;
    min-height: 100%;
    overflow-y: visible !important;
    overflow-x: hidden !important;
  }

  .sidebar-head,
  .sidebar-toggle-desktop {
    display: none;
  }

  .sidebar-toggle {
    display: flex;
  }

  .admin-topbar {
    height: 56px;
    min-height: 56px;
    padding: 0 10px;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .sidebar-toggle {
    width: 36px;
    height: 36px;
  }

  .admin-brand h1 {
    font-size: 1rem;
  }

  .admin-brand span,
  .top-user-name {
    display: none;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    height: auto !important;
    min-height: auto;
    overflow-y: visible !important;
    overflow-x: hidden !important;
  }

  .admin-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: min(68vw, 240px);
    border-right: 1px solid #d9e5f5;
    border-bottom: 0;
    z-index: 120;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }

  .app.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(15, 22, 36, 0.34);
    z-index: 110;
    display: block;
  }

  .admin-sidebar .tab-btn,
  .side-group-toggle {
    text-align: left;
    padding: 0 14px;
    font-size: 0.94rem;
    min-height: 72px;
  }

  .side-submenu {
    padding-left: 0;
  }

  .app.sidebar-collapsed .side-label,
  .app.sidebar-collapsed .side-caret,
  .app.sidebar-collapsed .side-submenu {
    display: inherit;
  }

  .admin-main {
    padding: 10px 10px 72px;
    height: auto !important;
    min-height: auto !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: auto;
  }
}

.global-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 13000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.78);
  border-top: 1px solid #d9e5f5;
  backdrop-filter: blur(6px);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f678f;
  font-weight: 600;
}

.brand-logo-footer {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.global-footer a {
  color: #6f7f99;
  text-decoration: none;
}

.global-footer a:hover {
  color: #2f67d8;
}

.header h1 {
  margin-bottom: 8px;
  color: #34527d;
}

.header p {
  margin-top: 0;
  color: var(--muted);
}

.header {
  margin-bottom: 10px;
}

.tab-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(40, 73, 126, 0.08);
}

.tab-left,
.tab-center,
.tab-right {
  display: flex;
  align-items: center;
}

.tab-left {
  gap: 10px;
  flex: 0 0 auto;
}

.tab-center {
  gap: 4px;
  flex: 1 1 auto;
}

.tab-right {
  flex: 0 0 auto;
  gap: 8px;
}

.nav-menu-btn {
  border: 0;
  background: transparent;
  color: #506480;
  font-size: 1.35rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-menu-btn:hover {
  background: #f0f5ff;
}

.tab-btn {
  border: 0;
  background: transparent;
  color: #334865;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 700;
  text-align: center;
  font-size: 0.98rem;
}

.tab-btn:hover {
  background: #f1f6ff;
  color: #2b4f88;
}

.tab-btn.active {
  color: #2f67d8;
  background: #ebf2ff;
}

.admin-sidebar .tab-btn {
  width: 100%;
  border-radius: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  color: #5a6476;
  font-weight: 400;
  padding: 0 14px;
  min-height: 64px;
}

.admin-sidebar .tab-btn:hover {
  background: #f3f5f8;
  color: #4d77d9;
}

.admin-sidebar .tab-btn.active {
  background: #eef2f7;
  color: #4f7fe0;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-icon {
  width: 22px;
  height: 22px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 1;
  color: currentColor;
}

.side-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-label {
  white-space: nowrap;
  font-size: 0.88rem;
}

.side-group {
  border-bottom: 1px solid #edf1f6;
  position: relative;
}

.side-group-toggle {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  border-radius: 0;
  background: transparent;
  color: #5a6476;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 64px;
  cursor: pointer;
}

.side-group-toggle:hover {
  background: #f3f5f8;
  color: #4d77d9;
}

.side-caret {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: #2d3440;
  transition: transform 0.2s ease;
  display: inline-flex;
}

.side-caret svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-group-toggle[aria-expanded="true"] .side-caret {
  transform: rotate(180deg);
}

.side-submenu {
  padding: 0;
  background: #f4f6f9;
}

.side-sub-item {
  width: 100%;
  border: 0;
  border-top: 1px solid #e7ebf2;
  border-radius: 0;
  background: transparent;
  color: #2f3440;
  text-align: left;
  padding: 0 44px;
  min-height: 50px;
  font-size: 0.84rem;
  cursor: pointer;
}

.side-sub-item:hover {
  background: #eceff4;
}

.app.sidebar-collapsed .admin-shell {
  grid-template-columns: 68px minmax(0, 1fr);
}

.app.sidebar-collapsed .sidebar-head {
  min-height: 68px;
}

.app.sidebar-collapsed .side-label,
.app.sidebar-collapsed .side-caret,
.app.sidebar-collapsed .side-submenu {
  display: none;
}

.app.sidebar-collapsed .side-submenu.popup-open {
  display: block;
  position: absolute;
  left: calc(100% + 8px);
  top: 8px;
  min-width: 180px;
  border: 1px solid #e2e7f0;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(30, 46, 77, 0.16);
  background: #ffffff;
  z-index: 40;
  overflow: hidden;
}

.app.sidebar-collapsed .side-submenu.popup-open .side-sub-item {
  min-height: 52px;
  padding: 0 18px;
  border-top: 0;
  border-bottom: 1px solid #edf1f6;
  background: #ffffff;
}

.app.sidebar-collapsed .side-submenu.popup-open .side-sub-item:last-child {
  border-bottom: 0;
}

.app.sidebar-collapsed .side-item,
.app.sidebar-collapsed .side-group-toggle {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
}

.app.sidebar-collapsed .sidebar-toggle {
  height: 64px;
}

.view-panel {
  display: none;
  min-width: 0;
}

.view-panel.active {
  display: block;
}

.current-user {
  font-size: 0.88rem;
  color: #5f7598;
  background: #f4f8ff;
  border: 1px solid #d8e4f4;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

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

.dashboard-grid > .panel {
  padding: 12px 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-top: 0;
}

.dashboard-list {
  display: grid;
  gap: 8px;
}

.dashboard-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

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

.dashboard-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-item-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.overdue-item {
  border-color: #ffd8b2 !important;
  background: linear-gradient(180deg, #fffdf8 0%, #fffaf3 100%) !important;
}

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

.stat-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

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

.stat-card b {
  display: block;
  font-size: 1.35rem;
  margin-top: 6px;
  color: #37517a;
}

.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 0;
  box-shadow: none;
  margin-top: 10px;
}

.analytics-page-panel {
  display: grid;
  gap: 12px;
}

.analytics-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.analytics-page-head h2,
.member-toolbar-v2 h2,
.schedule-toolbar-title {
  margin: 0;
  line-height: 1.1;
  font-size: 1.8rem;
  color: #23385f;
  font-weight: 800;
}

.analytics-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.analytics-filter .btn {
  min-width: 84px;
}

.analytics-filter .btn.is-active {
  background: #4f84fb;
  border-color: #4f84fb;
  color: #fff;
}

.analytics-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.analytics-stat-card {
  border: 1px solid #dbe7fb;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}

.analytics-stat-card h4 {
  margin: 0;
  font-size: 0.9rem;
  color: #6a7f9f;
  font-weight: 600;
}

.analytics-stat-value {
  margin-top: 8px;
  font-size: 1.42rem;
  line-height: 1;
  font-weight: 800;
  color: #2d4f80;
}

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

.analytics-card {
  margin-top: 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

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

.analytics-card-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #34527d;
}

.analytics-card-head span {
  font-size: 0.82rem;
  color: #7a8da9;
}

.analytics-card canvas {
  width: 100% !important;
  height: 230px !important;
}

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

.analytics-table-wrap {
  overflow: auto;
  border: 1px solid #e1eaf8;
  border-radius: 10px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  background: #fbfdff;
  font-size: 0.86rem;
}

.analytics-table th,
.analytics-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #e6eefb;
  text-align: left;
  color: #4c6282;
  white-space: nowrap;
}

.analytics-table th {
  background: #eef4ff;
  color: #3e5a84;
  font-weight: 700;
}

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

.analytics-table .inline-action {
  border: 1px solid #c6d9f7;
  background: #f1f6ff;
  color: #3e6eb7;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}

.analytics-table .muted {
  text-align: center;
  color: #8a9bb8;
}

.finance-page-panel {
  display: grid;
  gap: 12px;
}

.config-page-panel {
  display: grid;
  gap: 12px;
}

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

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

.config-item h3 {
  margin: 0;
  color: #34527d;
  font-size: 1rem;
}

.config-item p {
  margin: 6px 0 0;
  color: #6f83a5;
  font-size: 0.9rem;
}

.finance-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#finance-date,
#analytics-date {
  width: 164px;
  min-width: 164px;
  height: 43px;
  padding: 8px 12px;
  box-sizing: border-box;
  line-height: 25px;
  text-align: center;
}

#finance-date.week-range-input,
#analytics-date.week-range-input,
.week-range-input {
  width: 236px;
  min-width: 236px;
  height: 43px;
  padding: 8px 12px;
  box-sizing: border-box;
  line-height: 25px;
  text-align: center;
}

.picker-source-input {
  position: absolute !important;
  width: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.finance-range-label {
  margin: 0;
  color: #6f83a5;
  font-size: 0.9rem;
}

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

.warn-text {
  color: #b47718 !important;
}

.danger-text {
  color: #c64c69 !important;
}

.panel > h2 {
  margin: 0 0 12px;
  padding: 0 2px;
  font-size: 1.85rem;
  color: #243b61;
}

#overdue-signin-panel,
#today-schedule-panel {
  padding: 12px 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-top: 12px;
}

#today-schedule-panel {
  margin-bottom: 14px;
}

#overdue-signin-panel > h2,
#today-schedule-panel > h2 {
  margin: 0 0 12px;
  padding: 0;
  font-size: 2rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.93rem;
  color: var(--muted);
}

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

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #8cb2ff;
  box-shadow: 0 0 0 3px rgba(90, 141, 255, 0.16);
}

textarea {
  resize: vertical;
}

.address-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.address-input-wrap .btn.small {
  white-space: nowrap;
}

.toolbar,
.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.toolbar-actions {
  min-width: 280px;
  flex: 1;
  justify-content: flex-end;
}

.member-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-toolbar #search {
  width: 210px;
  flex: 0 1 210px;
}

.member-toolbar #filter {
  width: 150px;
  flex: 0 0 150px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23506280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: right 12px center;
  padding-right: 34px;
  padding-left: 18px;
  text-align: center;
  text-align-last: center;
}

.member-toolbar #filter::-ms-expand {
  display: none;
}

.member-toolbar #toggle-money-visibility {
  flex: 0 0 auto;
}

.member-toolbar #open-member-create {
  flex: 0 0 auto;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 12px;
  cursor: pointer;
  color: #4c6282;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #eef5ff;
  border-color: #c5d8f7;
}

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

.btn.small {
  padding: 6px 8px;
  font-size: 0.84rem;
}

.btn.danger {
  background: #fff3f6;
  color: var(--danger);
  border-color: #ffc6d2;
}

.btn.success {
  background: #eaf9f2;
  color: #1f8f63;
  border-color: #bfead7;
}

.calendar-nav .btn.is-active {
  background: #4f84fb;
  color: #fff;
  border-color: #4f84fb;
  box-shadow: 0 6px 14px rgba(79, 132, 251, 0.3);
}

.calendar-nav {
  flex: 0 0 auto;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.calendar-nav .btn:not(.range-trigger) {
  flex: 0 0 84px;
  width: 84px;
  height: 40px;
  padding: 0;
  font-size: 0.88rem;
}

.calendar-nav #toggle-schedule-member-name,
.calendar-nav #download-schedule-image {
  flex: 0 0 auto;
  width: auto;
}

#download-schedule-image {
  min-width: 112px;
  border-color: #26a78a;
  background: linear-gradient(180deg, #35c7a5 0%, #28ac8f 100%);
  color: #ffffff;
  position: relative;
  padding-right: 24px !important;
}

#download-schedule-image::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

#download-schedule-image:hover {
  border-color: #1f9f82;
  background: linear-gradient(180deg, #2fbc9d 0%, #219c80 100%);
}

#download-schedule-image:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.range-trigger {
  width: min(320px, 30vw);
  min-width: 240px;
  max-width: 320px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}

#view-schedule .panel {
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.schedule-toolbar-title {
  margin: 0;
  line-height: 1.1;
  font-size: 1.8rem;
  color: #23385f;
  font-weight: 800;
}

#toggle-schedule-member-name.name-switch-btn,
#toggle-money-visibility.name-switch-btn,
#finance-toggle-money-visibility.name-switch-btn {
  min-width: 122px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #d7e1f2;
  background: #f7f9fc;
  color: #4d6488;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
}

#toggle-schedule-member-name.name-switch-btn .switch-label,
#toggle-money-visibility.name-switch-btn .switch-label,
#finance-toggle-money-visibility.name-switch-btn .switch-label {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

#toggle-schedule-member-name.name-switch-btn .switch-pill,
#toggle-money-visibility.name-switch-btn .switch-pill,
#finance-toggle-money-visibility.name-switch-btn .switch-pill {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c9d4e6;
  position: relative;
  transition: background-color 0.2s ease;
  margin-left: 2px;
}

#toggle-schedule-member-name.name-switch-btn .switch-pill::before,
#toggle-money-visibility.name-switch-btn .switch-pill::before,
#finance-toggle-money-visibility.name-switch-btn .switch-pill::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(38, 51, 73, 0.2);
  transition: transform 0.2s ease;
}

#toggle-schedule-member-name.name-switch-btn.is-on .switch-pill,
#toggle-money-visibility.name-switch-btn.is-on .switch-pill,
#finance-toggle-money-visibility.name-switch-btn.is-on .switch-pill {
  background: #5ccbb0;
}

#toggle-schedule-member-name.name-switch-btn.is-on .switch-pill::before,
#toggle-money-visibility.name-switch-btn.is-on .switch-pill::before,
#finance-toggle-money-visibility.name-switch-btn.is-on .switch-pill::before {
  transform: translateX(14px);
}

.date-range-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d7e3f6;
  border-radius: 10px;
  background: #f7fbff;
  padding: 6px 8px;
  color: #5d7396;
  font-size: 0.84rem;
}

.date-range-inline input {
  border: 1px solid #d3e1f7;
  border-radius: 8px;
  background: #fff;
  color: #395680;
  padding: 4px 6px;
}


.member-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.member-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  border: 1px solid #d8e6f8;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  box-shadow: 0 8px 18px rgba(42, 84, 146, 0.08);
}

.member-name {
  margin: 0;
  font-size: 1.08rem;
  color: #2f4c78;
}

.member-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.member-name-stats {
  display: inline-flex;
  gap: 6px;
  color: #355a92;
  font-size: 0.84rem;
  margin-left: 2px;
}

.member-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eaf2ff;
  border: 1px solid #c9dcfb;
  border-radius: 8px;
  padding: 2px 7px;
  white-space: nowrap;
}

.member-stat-item.annual-active {
  background: #e9faf2;
  border-color: #bde8d2;
  color: #1d7d56;
  font-weight: 700;
}

.member-stat-item.annual-period {
  background: #f4f8ff;
  border-color: #d7e3f6;
  color: #4b6690;
}

.member-stat-item b {
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #1e4f96;
  font-size: 0.97rem;
  font-weight: 800;
}

.member-sub,
.member-address,
.member-meta,
.member-photo-summary,
.member-annual-validity,
.member-notes {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.member-annual-validity {
  color: #2f7d5a;
}

.member-recharge-summary {
  margin: 2px 0 0;
  color: #49678f;
  font-size: 0.92rem;
}

.member-notes {
  margin-top: 2px;
  color: #5e7190;
}

.member-photo-summary {
  color: #4e678f;
}

.member-side {
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  justify-content: center;
}

.member-main {
  display: grid;
  gap: 6px;
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  text-align: center;
  border: 1px solid;
  font-size: 0.85rem;
}

.badge.ok {
  color: var(--ok);
  border-color: #8be0c0;
  background: #ecfbf4;
}

.badge.warn {
  color: #a86f0f;
  border-color: #ffd58a;
  background: #fff8e8;
}

.badge.danger {
  color: var(--danger);
  border-color: #ffc6d2;
  background: #fff3f6;
}

.quick-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 8px;
}

.action-group {
  display: contents;
}

.action-group.action-group-admin {
  display: contents;
}

.quick-actions .btn.small {
  width: 100%;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 9px;
}

.quick-actions .use-session,
.quick-actions .add-session {
  border-color: transparent;
}

.quick-actions .use-session {
  background: linear-gradient(180deg, #e8f4ff 0%, #dfeeff 100%);
  border-color: #c5dcfb;
  color: #315f98;
}

.quick-actions .add-session {
  background: linear-gradient(180deg, #e9fbf2 0%, #def8ea 100%);
  border-color: #bfeacb;
  color: #247a57;
}

.quick-actions .view-class-log {
  background: linear-gradient(180deg, #f7f3ff 0%, #efe7ff 100%);
  border-color: #d9cdfc;
  color: #6a45a1;
}

.quick-actions .photo-gallery {
  background: linear-gradient(180deg, #fff8ef 0%, #ffefdb 100%);
  border-color: #f5d9ad;
  color: #a06a18;
}

.quick-actions .view-op-log {
  background: linear-gradient(180deg, #eef8ff 0%, #e2f2ff 100%);
  border-color: #c6e1f8;
  color: #2f6f98;
}

.quick-actions .edit {
  background: linear-gradient(180deg, #f2f5ff 0%, #e8eeff 100%);
  border-color: #cdd7f6;
  color: #4d5f9c;
}

.quick-actions .danger {
  background: linear-gradient(180deg, #fff3f7 0%, #ffe7ef 100%);
  border-color: #f7c7d8;
  color: #d44b78;
}

.quick-actions .btn.small:hover {
  filter: saturate(1.06) brightness(0.99);
}

.history {
  grid-column: 1 / -1;
}

.history-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.history-section + .history-section {
  margin-top: 10px;
}

.history-section strong {
  font-size: 0.88rem;
  color: #4a6183;
}

input[readonly] {
  background: #f3f7fd;
  color: #5d6f8a;
}

.recharge-table-wrap {
  margin-top: 6px;
  border: 1px solid #d9e5f5;
  border-radius: 10px;
  overflow: auto;
  background: #f9fcff;
}

.recharge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.recharge-table th,
.recharge-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e4edf8;
  text-align: left;
  color: #5d6f8a;
}

.recharge-table th {
  background: #eff5ff;
  color: #3f5a84;
  font-weight: 700;
}

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

#recharge-session-fields,
#recharge-annual-fields {
  display: grid;
  gap: 8px;
}

.calendar-wrap {
  margin-top: 10px;
}

.calendar-board {
  min-width: 0;
}

.mobile-schedule-tabs {
  display: none;
}

.mobile-schedule-list {
  display: none;
}

.calendar-title {
  display: none;
}

.week-table {
  border: 1px solid #cfddf2;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px #e8f0fc;
  width: 100%;
}

.week-header {
  width: 100%;
  display: grid;
  grid-template-columns: 126px repeat(7, minmax(0, 1fr));
}

.week-head-cell {
  border-right: 1px solid #d8e4f4;
  border-bottom: 1px solid #d8e4f4;
}

.week-head-cell:last-child {
  border-right: 0;
}

.week-head-cell {
  padding: 10px 6px;
  text-align: center;
  background: #edf4ff;
  font-size: 0.84rem;
  color: #6a7d99;
  overflow: hidden;
}

.week-head-cell strong {
  display: block;
  color: #3f5a84;
  font-size: 0.92rem;
}

.week-head-cell:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #edf4ff;
}

.week-board {
  width: 100%;
  display: grid;
  grid-template-columns: 126px repeat(7, minmax(0, 1fr));
}

.time-axis {
  position: relative;
  background: #edf4ff;
  border-right: 1px solid #d8e4f4;
  overflow: hidden;
  position: sticky;
  left: 0;
  z-index: 3;
}

.time-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.time-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #cfdcf0;
}

.time-point {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  text-align: center;
  color: #6580a2;
  font-size: 0.74rem;
  line-height: 1;
  pointer-events: none;
}

.day-columns {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-column {
  position: relative;
  border-right: 1px solid #d8e4f4;
  background: #fafdff;
  overflow: visible;
}

.day-column:last-child {
  border-right: 0;
}

.day-track {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  background: #fafdff;
}

.day-track.drag-source-track {
  overflow: visible;
  z-index: 6;
}

.row-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.row-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #cfdcf0;
}

.past-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 0;
  background: rgba(144, 156, 174, 0.06);
  pointer-events: none;
}

.slot-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.slot-layer:hover {
  background: rgba(90, 141, 255, 0.08);
}

.day-track.drag-target-track .slot-layer {
  background: rgba(79, 132, 251, 0.12);
}

.event-block {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 2;
  border: 0;
  border-radius: 4px;
  color: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 4px 7px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  touch-action: none;
}
.event-block.checked-in {
  background: #a8b1bf;
  color: #f7f9fc;
  cursor: not-allowed;
}

.event-block.is-draggable {
  cursor: grab;
}

.event-block.is-dragging {
  opacity: 0.92;
  box-shadow: 0 10px 24px rgba(31, 63, 116, 0.24);
  cursor: grabbing;
  z-index: 8;
}

.event-block.checked-in .event-time {
  color: rgba(247, 249, 252, 0.9);
}

.event-main {
  display: block;
  font-size: 0.69rem;
  line-height: 1.15;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.event-time {
  display: block;
  font-size: 0.66rem;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  padding-right: 30px;
}

.event-mode-corner {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
}

.event-block.color-0 {
  background: #36cfc1;
}

.event-block.color-1 {
  background: #5a8dff;
}

.event-block.color-2 {
  background: #ffb84d;
  color: #5a3f06;
}

.event-block.color-2 .event-time {
  color: #6f510f;
}

.event-block.color-3 {
  background: #66cb5f;
}

.event-block.color-4 {
  background: #c97ef5;
}

.event-block.color-5 {
  background: #ff8fa3;
}

.schedule-color-picker-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px #c5d8f6;
  cursor: pointer;
}

.schedule-color-dot.active {
  box-shadow: 0 0 0 2px #2f67d8;
}

.schedule-color-dot.color-0 {
  background: #36cfc1;
}

.schedule-color-dot.color-1 {
  background: #5a8dff;
}

.schedule-color-dot.color-2 {
  background: #ffb84d;
}

.schedule-color-dot.color-3 {
  background: #66cb5f;
}

.schedule-color-dot.color-4 {
  background: #c97ef5;
}

.schedule-color-dot.color-5 {
  background: #ff8fa3;
}

.day-schedule-list {
  display: grid;
  gap: 8px;
}

.schedule-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px;
}

.schedule-item.is-unchecked {
  border-color: #dbe7fb;
  background: #fafdff;
}

.schedule-item.is-checked-in {
  border-color: #bfe5cf;
  background: linear-gradient(180deg, #f2fbf6 0%, #ecf8f1 100%);
}

.schedule-item p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

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

.schedule-main {
  flex: 1 1 auto;
  min-width: 0;
}

.schedule-main strong {
  display: block;
  line-height: 1.35;
}

.schedule-main p {
  margin: 4px 0 0;
}

.schedule-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.schedule-checkin-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  border: 1px solid;
}

.schedule-checkin-tag.pending {
  color: #476694;
  border-color: #c8dbf6;
  background: #eef5ff;
}

.schedule-checkin-tag.done {
  color: #207652;
  border-color: #b8e0c9;
  background: #e8f7ef;
}

.class-mode-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #cfdcf3;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: #44608d;
  background: #eef4ff;
}

.class-mode-tag.online {
  color: #0c7a70;
  border-color: #95ddd6;
  background: #e6f9f6;
}

.class-mode-tag.offline {
  color: #4b648d;
  border-color: #c6d7f6;
  background: #eff4ff;
}

.event-main .class-mode-tag {
  font-size: 0.58rem;
  padding: 0 5px;
  border-color: rgba(255, 255, 255, 0.52);
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.15);
}

.event-mode-corner .class-mode-tag {
  font-size: 0.56rem;
  min-width: 20px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px 0 4px 0;
  border-right: 0;
  border-bottom: 0;
  line-height: 1;
  font-weight: 700;
}

.event-mode-corner .class-mode-tag.online {
  color: #9a5600;
  border-color: #ffc980;
  background: #fff3e2;
}

.event-block.checked-in .event-mode-corner .class-mode-tag.online {
  color: #fff4e8;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 193, 120, 0.26);
}

.event-block.checked-in .event-main .class-mode-tag {
  border-color: rgba(255, 255, 255, 0.38);
  color: rgba(247, 249, 252, 0.94);
  background: rgba(255, 255, 255, 0.08);
}

.checkin-today.done {
  background: #eaf6ef;
  border-color: #bde2cc;
  color: #2e815d;
  cursor: default;
}

.member-modal {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(460px, 92vw);
}

.member-modal::backdrop {
  background: rgba(37, 50, 74, 0.32);
}

.address-map-modal {
  width: min(760px, 94vw);
  max-height: calc(100vh - 40px);
}

.address-map-panel {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.schedule-modal {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  width: auto;
  border: 0;
  border-radius: 0;
  z-index: 16000;
}

.schedule-modal.hidden {
  display: none;
}

.schedule-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 50, 74, 0.32);
}

.schedule-modal-card {
  position: relative;
  width: min(460px, 92vw);
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.schedule-modal-card > .schedule-form {
  overflow-y: auto;
  max-height: calc(100dvh - 28px);
  -webkit-overflow-scrolling: touch;
}

#class-log-modal .schedule-modal-card {
  width: min(560px, 92vw);
}

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

.address-map-canvas {
  width: 100%;
  height: 360px;
  border: 1px solid #d9e5f5;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f7ff;
}

.address-map-picked {
  margin: 0;
  color: #5a7092;
  font-size: 0.9rem;
  line-height: 1.4;
}

.photo-modal-card {
  width: min(860px, 96vw);
  background: linear-gradient(160deg, #f8fcff 0%, #eef5ff 45%, #f4f8ff 100%);
}

.album-panel {
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  min-height: min(82vh, 760px);
}

.album-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.album-head h3 {
  margin: 0;
}

.album-sub {
  margin: 2px 0 0;
  color: #7088a8;
  font-size: 0.84rem;
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-upload-tip {
  margin: 0;
  color: #6b7e98;
  font-size: 0.84rem;
}

.photo-upload-status {
  margin: 0;
  font-size: 0.84rem;
  color: #4b6894;
}

.photo-grid-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d5e3f8;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px;
  padding: 4px;
}

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #dbe7fa;
}

.photo-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #edf3ff;
  cursor: zoom-in;
  transition: transform 0.18s ease;
}

.photo-item:hover img {
  transform: scale(1.02);
}

.photo-item .photo-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transform: translateY(-2px);
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.94);
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 999px;
}

.photo-item:hover .photo-delete {
  opacity: 1;
  transform: translateY(0);
}

.album-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d5e3f8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.photo-preview-card {
  width: min(860px, 96vw);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.photo-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe7f8;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
}

.photo-preview-meta p {
  margin: 0;
  font-size: 0.95rem;
  color: #3d5d8a;
}

.photo-preview-meta span {
  font-size: 0.82rem;
  color: #6e86a8;
}

.photo-preview-actions {
  display: flex;
  gap: 8px;
}

.photo-preview-body {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #0f1624;
}

#photo-preview-image {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: 8px;
}

.class-log-panel {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.class-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.class-log-head h3 {
  margin: 0;
}

.class-log-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
}

.class-log-item {
  border: 1px solid #d9e5f5;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
}

.class-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.class-log-row strong {
  color: #3b5883;
}

.class-log-row span {
  font-size: 0.84rem;
  color: #6a7e9d;
}

.class-log-item p {
  margin: 4px 0 0;
  color: #4f6484;
  font-size: 0.9rem;
}

.class-log-item p.muted {
  color: #7890b3;
  font-size: 0.84rem;
}

#backup-modal .backup-modal-card {
  width: min(920px, 96vw);
  max-height: calc(100vh - 36px);
  background: linear-gradient(165deg, #f9fcff 0%, #f4f8ff 40%, #eef4ff 100%);
}

.backup-page-panel {
  background: linear-gradient(165deg, #f9fcff 0%, #f4f8ff 40%, #eef4ff 100%);
  padding: 0;
  overflow: hidden;
}

.backup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
  border-bottom: 1px solid #dce8fb;
}

.backup-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #233c63;
}

.backup-header p {
  margin: 6px 0 0;
  color: #6b7f9e;
  font-size: 0.92rem;
}

.backup-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px 18px 8px;
}

.backup-panel {
  border: 1px solid #d6e4fa;
  border-radius: 14px;
  background: #ffffffcc;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.backup-panel h4,
.backup-list-head h4 {
  margin: 0;
  font-size: 1rem;
  color: #345680;
}

.backup-auto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f6484;
  font-size: 0.95rem;
}

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

.backup-import {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

#backup-import-file {
  width: 100%;
  border: 1px dashed #bfd5f8;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  color: #4f6484;
}

.backup-status {
  margin: 0;
  color: #647b9f;
  font-size: 0.9rem;
}

.backup-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.backup-list-head span {
  color: #7b8fac;
  font-size: 0.82rem;
}

.backup-list {
  margin: 0 18px 16px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.backup-item {
  border: 1px solid #d8e5fa;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.backup-item-main strong {
  color: #2f4f82;
}

.backup-item-main p {
  margin: 4px 0 0;
  color: #5f7598;
  word-break: break-all;
}

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

.profile-modal-card {
  width: min(520px, 94vw);
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.profile-head h3 {
  margin: 0;
}

.profile-avatar-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #d8e5f9;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
}

.profile-avatar {
  width: clamp(108px, 24vw, 188px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 999px;
  border: 3px solid #d4e1f7;
  object-fit: cover;
  background: #e9f2ff;
}

.profile-avatar-actions {
  display: grid;
  gap: 8px;
}

.profile-avatar-form {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 10px 0 0;
}

.profile-avatar-trigger {
  border: none;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  width: 100%;
}

.profile-avatar-trigger .profile-avatar {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 10px 24px rgba(55, 106, 177, 0.16);
}

.profile-avatar-trigger:hover .profile-avatar {
  transform: translateY(-2px) scale(1.02);
  border-color: #8fb3ef;
  box-shadow: 0 16px 28px rgba(55, 106, 177, 0.22);
}

.profile-avatar-row-compact {
  display: flex;
  justify-content: center;
  width: 100%;
  border: none;
  background: transparent;
  padding: 2px 0 8px;
}

.member-form,
.schedule-form {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.member-form h3,
.schedule-form h3 {
  margin: 0 0 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.modal-actions.between {
  justify-content: space-between;
}

.modal-right-actions {
  display: flex;
  gap: 8px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

@media (max-width: 900px) {
  .tab-nav {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 10px;
  }

  .tab-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    padding-top: 4px;
  }

  .tab-right {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .current-user {
    max-width: 150px;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .analytics-chart-grid,
  .analytics-table-grid {
    grid-template-columns: 1fr;
  }

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

  .config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #view-schedule .toolbar {
    display: block;
  }

  #view-schedule .calendar-nav {
    display: none !important;
  }

  .admin-topbar {
    height: 54px;
    min-height: 54px;
    padding: 0 8px;
    gap: 6px;
  }

  .admin-brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-logo-top {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .admin-brand h1 {
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-menu-toggle {
    width: 38px;
    height: 38px;
  }

  .admin-main {
    padding: 8px 8px 72px;
  }

  .admin-shell {
    height: auto !important;
  }

  .schedule-modal {
    align-items: flex-start;
    padding: 10px 8px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }

  .schedule-modal-card {
    width: min(92vw, 420px);
    max-height: calc(100dvh - 28px - env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
  }

  .schedule-modal-card > .schedule-form {
    max-height: calc(100dvh - 28px - env(safe-area-inset-bottom, 0px));
  }

  .member-modal,
  .profile-modal-card {
    width: min(92vw, 420px);
    border-radius: 16px;
  }

  .address-map-modal {
    width: min(94vw, 520px);
    max-height: calc(100dvh - 28px);
  }

  .address-map-panel {
    padding: 12px;
  }

  .address-map-canvas {
    height: 260px;
  }

  #class-log-modal .schedule-modal-card,
  .photo-preview-card,
  .photo-modal-card,
  #backup-modal .backup-modal-card {
    width: min(94vw, 560px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }

  .member-form,
  .schedule-form {
    padding: 12px;
    gap: 10px;
  }

  .member-form h3,
  .schedule-form h3 {
    margin-bottom: 2px;
    font-size: 1.06rem;
    line-height: 1.3;
  }

  .schedule-form label,
  .member-form label {
    gap: 5px;
    font-size: 0.92rem;
  }

  .schedule-form input,
  .schedule-form select,
  .schedule-form textarea,
  .member-form input,
  .member-form select,
  .member-form textarea {
    min-height: 42px;
    font-size: 16px;
  }

  .schedule-form textarea,
  .member-form textarea {
    min-height: 88px;
  }

  .modal-actions,
  .modal-right-actions,
  .photo-preview-actions,
  .photo-upload-row,
  .album-head,
  .class-log-head,
  .profile-head {
    flex-wrap: wrap;
  }

  .modal-actions {
    margin-top: 6px;
  }

  .modal-actions .btn,
  .modal-right-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .modal-actions.between {
    justify-content: stretch;
  }

  .album-panel,
  .class-log-panel {
    padding: 12px;
  }

  .album-panel {
    min-height: min(78vh, 680px);
  }

  .album-footer {
    padding: 10px;
    flex-wrap: wrap;
  }

  .album-footer .btn,
  .photo-upload-row .btn,
  .photo-preview-actions .btn {
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

  .photo-preview-head,
  .backup-header {
    padding: 10px 12px;
  }

  .photo-preview-body {
    padding: 8px;
  }

  .backup-toolbar {
    padding: 10px 12px 8px;
  }

  .backup-list {
    margin: 0 12px 12px;
  }

  .profile-avatar {
    width: min(104px, 30vw);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin: 8px 0 12px;
  }

  .stat-card {
    padding: 10px;
  }

  .stat-card b {
    font-size: 1.08rem;
    margin-top: 4px;
  }

  .panel {
    padding: 12px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #view-schedule .panel {
    padding: 12px 10px;
    width: 100%;
    max-width: 100%;
    border-radius: 18px;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  .analytics-page-head h2,
  .member-toolbar-v2 h2,
  .schedule-toolbar-title {
    font-size: 1.4rem;
  }

  .toolbar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mobile-schedule-tabs.is-visible {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 2px 2px 0;
  }

  .mobile-schedule-tabs.is-visible::-webkit-scrollbar {
    display: none;
  }

  .mobile-schedule-tab {
    flex: 0 0 auto;
    min-width: 76px;
    border: 1px solid #d7e2f5;
    border-radius: 16px;
    background: #fff;
    color: #7b879b;
    padding: 10px 8px 8px;
    text-align: center;
    display: grid;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(45, 75, 126, 0.04);
  }

  .mobile-schedule-tab strong {
    font-size: 0.78rem;
    line-height: 1.1;
    color: currentColor;
    font-weight: 700;
  }

  .mobile-schedule-tab span {
    font-size: 0.66rem;
    line-height: 1.05;
    color: currentColor;
  }

  .mobile-schedule-tab em {
    font-style: normal;
    font-size: 0.62rem;
    line-height: 1.1;
    color: currentColor;
    opacity: 0.82;
  }

  .mobile-schedule-tab.is-active {
    border-color: #ff5d73;
    background: #fff;
    color: #ff4c65;
    box-shadow: inset 0 0 0 1px rgba(255, 76, 101, 0.12);
  }

  .mobile-schedule-tab-picker {
    border-style: dashed;
    color: #4f6fa1;
    background: #f8fbff;
  }

  .mobile-schedule-tab-picker strong {
    font-size: 1rem;
  }

  .mobile-schedule-list.is-visible {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
  }

  .mobile-schedule-card {
    border: 1px solid #d7e3f6;
    border-radius: 20px;
    background: #ffffff;
    padding: 16px;
    box-shadow: 0 10px 22px rgba(42, 84, 146, 0.06);
    width: 100%;
    max-width: 100%;
  }

  .mobile-schedule-card.is-checked-in {
    background: linear-gradient(180deg, #f9fcfa 0%, #f1f8f4 100%);
    border-color: #cfe6da;
  }

  .mobile-schedule-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .mobile-schedule-top > div {
    min-width: 0;
  }

  .mobile-schedule-time {
    margin: 0 0 8px;
    color: #5676a5;
    font-size: 0.84rem;
    font-weight: 700;
  }

  .mobile-schedule-top h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    color: #27406c;
  }

  .mobile-schedule-meta,
  .mobile-schedule-note {
    margin: 6px 0 0;
    color: #617898;
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .mobile-schedule-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    width: 100%;
    max-width: 100%;
  }

  .mobile-schedule-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 16px;
    font-size: 1rem;
  }

  .tab-left {
    min-width: 0;
  }

  .tab-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .current-user {
    max-width: none;
  }

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

  .member-side {
    min-width: 0;
    align-items: flex-start;
  }

  .quick-actions {
    width: 100%;
  }

  .action-group {
    display: contents;
  }

  .toolbar-actions {
    justify-content: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .member-toolbar {
    justify-content: flex-start;
  }

  .member-toolbar #search {
    flex: 1 1 100%;
    width: 100%;
  }

  .member-toolbar #filter,
  .member-toolbar #toggle-money-visibility,
  .member-toolbar #open-member-create {
    flex: 1 1 calc(33.333% - 6px);
    width: 100%;
  }

  .week-header,
  .week-board {
    grid-template-columns: 86px repeat(1, minmax(228px, 1fr));
  }

  .week-head-cell {
    font-size: 0.78rem;
    padding: 8px 4px;
  }

  .week-head-cell strong {
    font-size: 0.86rem;
  }

  .time-point {
    font-size: 0.72rem;
  }

  .calendar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .range-trigger {
    grid-column: 1 / span 2;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 46px;
    border-radius: 14px;
    font-size: 1rem;
  }

  .calendar-nav #prev-week,
  .calendar-nav #today-week,
  .calendar-nav #next-week {
    grid-column: span 1;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border-radius: 14px;
    font-size: 1rem;
  }

  .calendar-nav #toggle-schedule-member-name,
  .calendar-nav #download-schedule-image {
    grid-column: span 1;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    border-radius: 16px;
  }

  #toggle-schedule-member-name.name-switch-btn,
  #toggle-money-visibility.name-switch-btn,
  #finance-toggle-money-visibility.name-switch-btn {
    min-width: 0;
    justify-content: center;
    padding: 0 14px;
    background: #f7f9fc;
  }

  #toggle-schedule-member-name.name-switch-btn .switch-label,
  #toggle-money-visibility.name-switch-btn .switch-label,
  #finance-toggle-money-visibility.name-switch-btn .switch-label {
    font-size: 0.96rem;
    color: #496381;
  }

  .calendar-wrap {
    display: none;
  }

  .calendar-board {
    display: block;
    min-width: 100%;
  }

  .week-table {
    display: block;
    width: 100%;
    min-width: 100%;
  }

  .week-header,
  .week-board {
    display: grid;
    width: 100%;
    min-width: 100%;
  }

  .event-block {
    left: 4px;
    right: 4px;
    border-radius: 8px;
    padding: 5px 6px;
  }

  .event-main {
    font-size: 0.72rem;
  }

  .event-time {
    font-size: 0.64rem;
    padding-right: 20px;
  }

  .calendar-nav #download-schedule-image {
    font-size: 1rem;
    padding-right: 18px !important;
    box-shadow: 0 10px 20px rgba(38, 176, 143, 0.18);
  }

  .calendar-nav #download-schedule-image::after {
    right: 16px;
  }

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

  .backup-actions,
  .backup-item-actions {
    width: 100%;
  }

  .backup-actions .btn,
  .backup-item-actions .btn,
  #backup-import-btn {
    width: 100%;
  }

  .backup-list {
    margin: 0 14px 14px;
  }

  .backup-item {
    flex-direction: column;
  }

  .profile-avatar-form {
    min-height: 0;
  }

  .analytics-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-filter {
    width: 100%;
  }

  .analytics-filter .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .finance-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .config-item {
    flex-direction: column;
    align-items: stretch;
  }

  #finance-date,
  #analytics-date {
    width: 100%;
    min-width: 0;
  }

  .analytics-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .analytics-stat-card {
    padding: 10px;
  }

  .analytics-stat-value {
    font-size: 1.2rem;
  }

  .analytics-card canvas {
    height: 210px !important;
  }
}

@media (max-width: 430px) {
  .admin-brand h1 {
    font-size: 0.86rem;
  }

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

/* Final override: sidebar toggle only appears on mobile */
.sidebar-toggle {
  display: none !important;
}

@media (max-width: 960px) {
  .sidebar-toggle {
    display: flex !important;
  }
}

/* member-management v2 */
.member-page-panel {
  display: flex;
  flex-direction: column;
  padding: 10px 6px 8px;
  min-height: calc(100vh - 170px);
}

.member-toolbar-v2 {
  margin-bottom: 12px;
}

.member-toolbar-controls {
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.member-toolbar-controls #search {
  width: 260px;
}

.member-toolbar-controls #filter {
  width: 140px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23506280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: right 12px center;
  padding-right: 34px;
  padding-left: 18px;
  text-align: center;
  text-align-last: center;
}

.member-toolbar-controls #filter::-ms-expand {
  display: none;
}

.btn.subtle {
  background: #f8fbff;
  color: #5874a6;
  border-color: #d6e2f7;
}

.member-list-v2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
  min-height: 0;
}

.member-list-v2.is-empty {
  display: flex;
  flex: 1;
  min-height: clamp(300px, calc(100vh - 280px), 640px);
}

.member-card-v2 {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #dbe6f7;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(58, 95, 158, 0.08);
  padding: 14px;
  display: grid;
  gap: 12px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.member-card-v2:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(58, 95, 158, 0.12);
}

.member-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.member-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid #d5e1f6;
  object-fit: cover;
  background: #eaf2ff;
  flex: 0 0 auto;
}

.member-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.member-card-v2 .member-name {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  color: #1f3359;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 600;
  border: 1px solid transparent;
  padding: 4px 8px;
}

.member-type-tag.type-annual {
  background: #e8f8f2;
  color: #1f8e68;
  border-color: #bde8d7;
}

.member-type-tag.type-session {
  background: #f4f6fb;
  color: #7c6844;
  border-color: #eadfc8;
}

.member-status-tag.status-ok {
  background: #edf8f1;
  color: #2f865f;
  border-color: #c7ebd8;
}

.member-status-tag.status-warn {
  background: #fff5ea;
  color: #b26920;
  border-color: #ffd7ae;
}

.member-status-tag.status-danger {
  background: #fff1f3;
  color: #c24862;
  border-color: #ffc6d2;
}

.member-basic {
  display: grid;
  gap: 4px;
  border-top: 1px solid #e8effb;
  border-bottom: 1px solid #e8effb;
  padding: 10px 0;
}

.member-basic p {
  margin: 0;
  color: #5f7395;
  font-size: 0.96rem;
}

.member-basic p span {
  color: #3e5478;
}

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

.member-stats-v2 div {
  background: #f7faff;
  border: 1px solid #dce8f9;
  border-radius: 10px;
  text-align: center;
  padding: 8px 6px;
}

.member-stats-v2 span {
  display: block;
  font-size: 0.82rem;
  color: #7a8dad;
}

.member-stats-v2 b {
  display: block;
  margin-top: 4px;
  color: #253d68;
  font-size: 1.24rem;
  font-weight: 800;
}

.member-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-validity {
  margin: 0;
  color: #667da0;
  font-size: 0.9rem;
}

.member-actions-primary {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-actions-primary .btn {
  min-width: 76px;
}

.member-actions-primary .icon-btn,
.member-top .icon-btn {
  min-width: 42px;
  width: 42px;
  padding: 0;
}

.member-more-menu {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 10;
  min-width: 132px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d8e5f7;
  box-shadow: 0 10px 24px rgba(44, 73, 123, 0.15);
  padding: 4px;
  display: grid;
  gap: 2px;
}

.member-more-menu button {
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #3d5478;
  text-align: left;
  font-size: 0.9rem;
  padding: 8px 10px;
  cursor: pointer;
}

.member-more-menu button:hover {
  background: #f2f7ff;
}

.member-more-menu button.danger {
  color: #ca4963;
}

.member-empty {
  width: 100%;
  height: 100%;
  border: 1px dashed #c9d8ef;
  border-radius: 14px;
  padding: 24px 14px;
  text-align: center;
  background: #fafdff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.member-empty p {
  margin: 0;
  font-size: 1.05rem;
  color: #3a557f;
  font-weight: 700;
}

.member-empty span {
  display: block;
  margin-top: 8px;
  color: #7188ac;
  font-size: 0.9rem;
}

.member-card-skeleton {
  pointer-events: none;
}

.skeleton-line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf3ff 0%, #f7faff 50%, #edf3ff 100%);
  background-size: 200% 100%;
  animation: member-skeleton 1.1s infinite linear;
}

.skeleton-line.w40 {
  width: 40%;
}

.skeleton-line.w90 {
  width: 90%;
}

.skeleton-line.w75 {
  width: 75%;
}

.skeleton-line.w60 {
  width: 60%;
}

.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.skeleton-stats span {
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(90deg, #edf3ff 0%, #f7faff 50%, #edf3ff 100%);
  background-size: 200% 100%;
  animation: member-skeleton 1.1s infinite linear;
}

@keyframes member-skeleton {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.member-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10200;
}

.member-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 35, 63, 0.48);
}

.member-detail-card {
  position: relative;
  margin: 8vh auto 0;
  width: min(680px, calc(100vw - 28px));
  background: #fff;
  border-radius: 16px;
  border: 1px solid #d9e6f8;
  box-shadow: 0 18px 34px rgba(32, 56, 95, 0.24);
  overflow: hidden;
}

.member-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5eefb;
}

.member-detail-head h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #283f66;
}

.member-detail-content {
  padding: 14px 16px 18px;
}

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

.member-detail-grid .col-2 {
  grid-column: span 2;
}

.member-detail-grid label {
  display: block;
  font-size: 0.82rem;
  color: #7b90b2;
}

.member-detail-grid p {
  margin: 4px 0 0;
  color: #2f466f;
  background: #f7faff;
  border: 1px solid #dce8f9;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 38px;
}

.member-detail-records label {
  margin-bottom: 6px;
}

.member-record-table-wrap {
  border: 1px solid #dbe7f8;
  border-radius: 10px;
  overflow: auto;
  background: #fbfdff;
}

.member-record-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.member-record-table th,
.member-record-table td {
  border-bottom: 1px solid #e8effb;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.86rem;
  color: #446186;
}

.member-record-table th {
  color: #607ea6;
  background: #f1f6ff;
  font-weight: 700;
  white-space: nowrap;
}

.member-record-table tbody tr:last-child td {
  border-bottom: 0;
}

.member-record-table .muted {
  color: #8ca1bf;
  text-align: center;
}

@media (max-width: 1180px) {
  .member-list-v2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .member-page-panel {
    min-height: auto;
  }

  .member-list-v2.is-empty {
    min-height: clamp(240px, calc(100vh - 300px), 420px);
  }

  .member-toolbar-v2 {
    gap: 8px;
  }

  .member-toolbar-controls {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }

  .member-toolbar-controls #search {
    width: 100%;
    flex: 1 1 100%;
  }

  .member-toolbar-controls #filter,
  .member-toolbar-controls #toggle-money-visibility,
  .member-toolbar-controls #open-member-create {
    width: 100%;
    flex: 1 1 calc(33.333% - 6px);
  }

  .member-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .member-actions-primary {
    width: 100%;
  }

  .member-actions-primary .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .member-detail-grid {
    grid-template-columns: 1fr;
  }

  .member-detail-grid .col-2 {
    grid-column: auto;
  }
}
