:root {
  color-scheme: dark;
  --bg: #0b0d0b;
  --panel: #151a16;
  --panel-2: #1d241f;
  --paper: #f7f3e8;
  --ink: #151713;
  --text: #f8f5ec;
  --muted: rgba(248, 245, 236, 0.68);
  --line: rgba(248, 245, 236, 0.14);
  --lime: #c9ff3d;
  --green: #48d979;
  --amber: #f2b84b;
  --rust: #d86a45;
  --blue: #7dc8ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(201, 255, 61, 0.08), transparent 360px),
    radial-gradient(circle at 88% 0%, rgba(125, 200, 255, 0.12), transparent 28%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(201, 255, 61, 0.28);
  outline-offset: 3px;
}

.ops-shell {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.ops-top,
.ops-middle,
.ops-bottom {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 26, 22, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.ops-top {
  padding: 14px;
}

.ops-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
}

.ops-brand {
  display: inline-grid;
  grid-template-columns: 48px auto;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.ops-brand span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #10140d;
  background: var(--lime);
  font-weight: 950;
}

.ops-brand strong,
.ops-brand small {
  grid-column: 2;
}

.ops-brand small {
  color: var(--muted);
  font-weight: 850;
}

.ops-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ops-actions time,
.ops-actions a,
.ops-actions button,
.calendar-controls button,
.schedule-form button,
.client-form button,
.detail-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(248, 245, 236, 0.08);
  text-decoration: none;
  font-weight: 900;
}

.ops-actions button,
.schedule-form button,
.client-form button {
  color: #11140d;
  border-color: transparent;
  background: var(--lime);
}

.hero-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  padding: clamp(20px, 4vw, 54px) 6px 8px;
}

.eyebrow {
  margin: 0;
  color: var(--lime);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-board h1,
.section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-board p:not(.eyebrow),
.status-card small,
.client-detail p,
.feedback {
  color: var(--muted);
  line-height: 1.7;
}

.hero-board p:not(.eyebrow) {
  max-width: 780px;
  font-size: 18px;
}

.status-card {
  min-height: 188px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(201, 255, 61, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(201, 255, 61, 0.12), transparent 58%),
    rgba(248, 245, 236, 0.06);
}

.status-card span {
  color: var(--amber);
  font-weight: 950;
}

.status-card strong {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric-strip article {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 245, 236, 0.07);
}

.metric-strip span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.metric-strip strong {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.ops-middle,
.ops-bottom {
  margin-top: 18px;
  padding: clamp(16px, 2.4vw, 26px);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 56px);
}

.calendar-controls,
.crm-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.calendar-controls strong {
  min-width: 170px;
  text-align: center;
  font-size: 20px;
}

.calendar-controls button {
  width: 44px;
  padding: 0;
  color: #11140d;
  background: var(--lime);
}

.calendar-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
}

.calendar-panel,
.day-panel,
.client-list-panel,
.client-detail,
.client-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 245, 236, 0.06);
}

.calendar-panel {
  min-width: 0;
  padding: 14px;
}

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

.weekday-row {
  margin-bottom: 8px;
}

.weekday-row span {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.calendar-day {
  min-height: 118px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  border: 1px solid rgba(248, 245, 236, 0.12);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(248, 245, 236, 0.06);
  text-align: left;
}

.date-button {
  width: fit-content;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--text);
  background: transparent;
  font-weight: 950;
}

.calendar-day.is-muted {
  opacity: 0.38;
}

.calendar-day.is-selected {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px var(--lime);
}

.calendar-day.is-today {
  background: rgba(201, 255, 61, 0.1);
}

.calendar-day strong,
.date-button {
  font-size: 18px;
}

.day-events {
  display: grid;
  gap: 6px;
  align-content: start;
}

.event-chip {
  min-height: 30px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(201, 255, 61, 0.18);
  border-radius: 8px;
  padding: 6px 7px;
  color: var(--text);
  background: rgba(201, 255, 61, 0.08);
  text-align: left;
}

.event-chip:hover,
.event-chip.is-active {
  border-color: var(--lime);
  background: rgba(201, 255, 61, 0.16);
}

.event-chip b {
  color: var(--lime);
  font-size: 12px;
}

.event-chip span {
  overflow: hidden;
  color: rgba(248, 245, 236, 0.82);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day small {
  color: var(--muted);
  font-weight: 850;
}

.day-panel {
  min-width: 0;
  padding: 18px;
}

.day-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.day-heading h3,
.client-detail h3,
.client-form h3 {
  margin: 8px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
}

.day-heading span,
.client-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  color: #11140d;
  background: var(--lime);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.class-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.class-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(248, 245, 236, 0.08);
}

.class-item time {
  color: var(--lime);
  font-size: 18px;
  font-weight: 950;
}

.class-item strong {
  display: block;
}

.class-item small {
  color: var(--muted);
  font-weight: 850;
}

.class-item button,
.client-card button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(248, 245, 236, 0.08);
  font-weight: 900;
}

.class-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.class-actions [data-open-class] {
  color: #11140d;
  border-color: transparent;
  background: var(--lime);
}

.event-detail-panel {
  position: relative;
  display: none;
  margin-top: 16px;
  border: 1px solid rgba(201, 255, 61, 0.26);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(140deg, rgba(201, 255, 61, 0.1), transparent 42%),
    rgba(248, 245, 236, 0.07);
  box-shadow: var(--shadow);
}

.event-detail-panel.is-open {
  display: block;
}

.event-detail-panel h3 {
  margin: 8px 42px 14px 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.event-detail-panel dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.event-detail-panel dl div {
  min-height: 68px;
  padding: 12px;
  background: rgba(12, 14, 12, 0.72);
}

.event-detail-panel dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.event-detail-panel dd {
  margin: 7px 0 0;
  font-weight: 950;
}

.event-detail-panel p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(248, 245, 236, 0.08);
  font-size: 22px;
  font-weight: 900;
}

.schedule-form {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.2fr 1.1fr 0.9fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(248, 245, 236, 0.06);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(10, 12, 10, 0.74);
}

.crm-tools input {
  min-width: 260px;
}

.crm-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) minmax(280px, 340px);
  gap: 16px;
}

.client-list-panel,
.client-detail,
.client-form {
  min-width: 0;
  padding: 14px;
}

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

.client-card {
  display: grid;
  gap: 12px;
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: rgba(248, 245, 236, 0.07);
  text-align: left;
}

.client-card.is-selected {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px var(--lime);
}

.client-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.client-card h3 {
  margin: 0;
  font-size: 22px;
}

.client-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.client-status.is-active {
  background: var(--green);
}

.client-status.is-trial {
  background: var(--amber);
}

.client-status.is-follow {
  color: var(--text);
  background: var(--rust);
}

.client-detail dl {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.client-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 12px;
  background: rgba(248, 245, 236, 0.07);
}

.client-detail dt {
  color: var(--muted);
  font-weight: 900;
}

.client-detail dd {
  margin: 0;
  text-align: right;
  font-weight: 950;
}

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

.client-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

.client-form h3 {
  margin-bottom: 4px;
}

.feedback {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin: 0;
  border: 1px solid rgba(201, 255, 61, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--lime);
  background: rgba(201, 255, 61, 0.08);
  font-weight: 850;
}

button {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

button:hover,
a:hover {
  transform: translateY(-2px);
}

@media (max-width: 1240px) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calendar-board,
  .crm-board {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 760px) {
  .ops-shell {
    width: min(100% - 22px, 1560px);
    padding-top: 11px;
  }

  .ops-nav,
  .hero-board,
  .section-head {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .ops-actions,
  .calendar-controls,
  .crm-tools {
    justify-content: flex-start;
  }

  .metric-strip,
  .schedule-form,
  .client-list {
    grid-template-columns: 1fr;
  }

  .calendar-grid,
  .weekday-row {
    gap: 5px;
  }

  .calendar-day {
    min-height: 84px;
    padding: 7px;
  }

  .calendar-day strong,
  .date-button {
    font-size: 15px;
  }

  .event-chip {
    min-height: 26px;
    padding: 5px;
  }

  .event-chip span {
    display: none;
  }

  .calendar-day small {
    font-size: 11px;
  }

  .class-item {
    grid-template-columns: 1fr;
  }

  .event-detail-panel dl {
    grid-template-columns: 1fr;
  }

  .crm-tools input {
    min-width: 0;
  }
}
