:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --panel-soft: #f8fbfb;
  --ink: #1f2a2e;
  --muted: #66777d;
  --line: #dce5e6;
  --teal: #0d8f8a;
  --blue: #2f6fed;
  --amber: #c67912;
  --red: #b83b3b;
  --green: #237a45;
  --nav: #172326;
  --nav-active: #e9f7f4;
  --shadow: 0 12px 30px rgba(31, 42, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) 1.12fr;
  background: linear-gradient(120deg, #f6faf9, #e9f0f4);
}

.brand-panel {
  background:
    linear-gradient(145deg, rgba(13, 143, 138, 0.92), rgba(36, 66, 81, 0.88)),
    url("/rink-operations.png");
  background-size: cover;
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  font-weight: 800;
}

.brand-panel h1 {
  margin: 30px 0 14px;
  font-size: 42px;
  line-height: 1.08;
}

.brand-panel p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

.login-card {
  align-self: center;
  width: min(440px, calc(100vw - 40px));
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-stack {
  align-self: center;
  width: min(520px, calc(100vw - 40px));
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.login-stack .login-card {
  width: 100%;
  margin: 0;
  align-self: auto;
}

.trial-card {
  padding: 22px;
}

.login-card h2,
.view-head h2 {
  margin: 0;
  font-size: 24px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

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

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

.primary,
.secondary,
.danger,
.ghost {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 650;
}

.primary {
  background: var(--teal);
  color: #fff;
}

.secondary {
  background: #edf6f5;
  border-color: #b8dfdc;
  color: #095f5b;
}

.danger {
  background: #fff1f1;
  border-color: #f0c4c4;
  color: var(--red);
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.demo-list {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-list button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--muted);
}

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

.sidebar {
  background: var(--nav);
  color: #d9e5e4;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.side-brand strong {
  display: block;
  color: #fff;
}

.side-brand span {
  font-size: 12px;
  color: #9fb6b4;
}

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

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section + .nav-section {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section-title {
  padding: 0 10px 3px;
  color: #7f9b99;
  font-size: 12px;
  font-weight: 750;
}

.nav button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c9d8d7;
  min-height: 40px;
  text-align: left;
  padding: 8px 10px;
}

.nav button.active {
  background: var(--nav-active);
  color: #103b39;
  font-weight: 750;
}

.account {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 9px;
}

.main {
  min-width: 0;
  padding: 22px;
}

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

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

.pill,
.status,
.check-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf1f2;
  color: #496166;
  font-size: 12px;
  font-weight: 650;
}

.check-pill {
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.status.AVAILABLE,
.status.READY,
.status.PAID,
.status.ACTIVE,
.status.APPROVED,
.status.CONFIRMED,
.status.SUCCESS,
.status.DONE,
.status.SIGNED,
.status.PUBLIC_AUTHORIZED {
  background: #e8f6ee;
  color: var(--green);
}

.status.HELD,
.status.WARN,
.status.PENDING,
.status.FORMING,
.status.DRAFT,
.status.OPEN,
.status.DUE_SOON,
.status.P1,
.status.PENDING_SIGNATURE,
.status.RETRY_SCHEDULED,
.status.PAST_DUE {
  background: #fff6e8;
  color: var(--amber);
}

.status.BOOKED,
.status.BLOCKED,
.status.LOCKED,
.status.MAINTENANCE,
.status.REFUNDED,
.status.EXPIRED,
.status.VOIDED,
.status.FAILED,
.status.REVERSED,
.status.REVOKED,
.status.DEAD_LETTER,
.status.SIGNING_FAILED,
.status.COURSE_OCCUPIED,
.status.NEEDS_REVIEW,
.status.OVERDUE,
.status.BREACHED,
.status.P0,
.status.SUSPEND_REVIEW {
  background: #f3ecec;
  color: var(--red);
}

.status.ON_TRACK,
.status.P2 {
  background: #edf1f2;
  color: #496166;
}

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

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

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

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

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

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

.card,
.metric,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(31, 42, 46, 0.05);
}

.card {
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.notice {
  border: 1px solid #cfe0df;
  border-radius: 8px;
  background: #f7fbfb;
  padding: 12px 14px;
}

.notice p {
  margin: 8px 0;
}

.metric {
  padding: 16px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 26px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.table-wrap {
  overflow: hidden;
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.detail-panel summary {
  min-height: 48px;
  padding: 14px 16px;
  color: #304448;
  cursor: pointer;
  font-weight: 750;
}

.detail-panel[open] {
  padding-bottom: 16px;
}

.detail-panel > .grid,
.detail-panel > .split,
.detail-body {
  margin: 0 16px 14px;
}

.detail-panel > .grid:first-of-type {
  margin-top: 2px;
}

.detail-panel > .split:last-child,
.detail-body:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.compact-table table {
  font-size: 12px;
}

.compact-table th,
.compact-table td {
  padding: 8px 9px;
}

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

th {
  color: #52676b;
  background: var(--panel-soft);
  font-size: 12px;
}

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

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

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

.usage-line {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.usage-line > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.usage-line strong {
  color: var(--ink);
}

.usage-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eeee;
}

.usage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.usage-bar i.danger-fill {
  background: var(--red);
}

.split {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 14px;
}

.flow {
  display: grid;
  gap: 9px;
}

.flow-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f6ee;
  color: var(--green);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #1f2a2e;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  max-width: 360px;
  box-shadow: var(--shadow);
  z-index: 10;
}

@media (max-width: 980px) {
  .login-screen,
  .shell,
  .split,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .nav-section {
    min-width: 0;
  }

  .brand-panel {
    min-height: 360px;
    padding: 34px;
  }

  .section-title {
    display: grid;
  }

  .table-wrap {
    overflow-x: auto;
  }
}
