:root {
  --background: #f5f8f4;
  --background-soft: #eef5ee;
  --foreground: #16211b;
  --card: #ffffff;
  --card-soft: #f8fbf8;
  --primary: #15803d;
  --primary-deep: #166534;
  --primary-soft: #dcfce7;
  --accent: #22c55e;
  --muted: #5f6f67;
  --muted-soft: #7a8c83;
  --border: #dbe6dc;
  --border-strong: #c5d5c7;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warning-soft: #fffbeb;
  --white: #ffffff;
  --shadow-sm: 0 12px 30px rgba(19, 39, 24, 0.08);
  --shadow-lg: 0 28px 70px rgba(19, 39, 24, 0.12);
  --radius: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--foreground);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(21, 128, 61, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fbf7 0%, #eef5ee 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.88em;
}

.hidden {
  display: none !important;
}

.crm-login-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 420px);
  gap: 24px;
  align-items: stretch;
}

.crm-login-hero,
.crm-login-card,
.crm-card,
.crm-topbar,
.sheet {
  border: 1px solid rgba(22, 33, 27, 0.06);
  box-shadow: var(--shadow-sm);
}

.crm-login-hero {
  padding: 34px;
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(20, 83, 45, 0.98) 0%, rgba(21, 128, 61, 0.92) 52%, rgba(34, 197, 94, 0.82) 100%);
  color: var(--white);
}

.crm-login-hero__eyebrow,
.crm-topbar__eyebrow,
.crm-sidebar__eyebrow,
.crm-card__eyebrow,
.sheet-header .eyebrow,
.view-toolbar__label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.crm-login-hero__eyebrow,
.crm-sidebar__eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.crm-login-hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.crm-login-hero p {
  margin: 18px 0 0;
  max-width: 42rem;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.84);
}

.crm-login-hero__list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.crm-login-hero__list span,
.crm-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-login-hero__list span {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.crm-login-card {
  align-self: start;
  overflow: hidden;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.92);
}

.crm-login-card__head,
.crm-login-card__body,
.crm-card__head,
.crm-card__body,
.sheet-body {
  padding-left: 24px;
  padding-right: 24px;
}

.crm-login-card__head {
  padding-top: 26px;
}

.crm-login-card__head h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.crm-login-card__head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.crm-login-card__body {
  padding-top: 18px;
  padding-bottom: 26px;
}

.crm-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

.crm-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  gap: 24px;
  align-content: start;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.crm-sidebar__brand {
  padding: 10px 8px 0;
}

.crm-brand-mark { display: none; }

.atlas-wordmark {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.05em;
  user-select: none;
}
.atlas-wordmark__atlas {
  font-weight: 800;
  color: var(--primary);
}
.atlas-wordmark__crm {
  font-weight: 300;
  color: var(--primary);
  margin-left: 2px;
}

.crm-sidebar h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.nav-group-label {
  padding: 6px 14px 2px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 6px;
}
.nav-group-label:first-child { margin-top: 0; }

.crm-sidebar__brand p:last-child,
.crm-sidebar__callout p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.crm-sidebar__nav {
  display: grid;
  gap: 6px;
}

.adm-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--muted);
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.adm-nav-link:hover,
.adm-nav-link:focus-visible,
.adm-nav-link.is-active {
  color: var(--foreground);
  background: var(--background-soft);
  border-color: var(--border);
  transform: translateX(2px);
  outline: none;
}

.adm-nav-link.is-active {
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-color: rgba(21, 128, 61, 0.18);
}

.adm-nav-link small {
  color: var(--muted-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adm-nav-link--disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.crm-sidebar__callout {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbf8 0%, #f2f8f2 100%);
}

.crm-sidebar__callout h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.crm-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  padding: 0;
}

.crm-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
  margin: 24px 24px 0;
  padding: 22px 24px;
  border-radius: 28px;
  border: 1px solid rgba(22, 33, 27, 0.06);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.crm-topbar__copy {
  min-width: 0;
}

.crm-topbar__eyebrow,
.crm-card__eyebrow,
.sheet-header .eyebrow {
  color: var(--primary);
}

.adm-title,
.crm-section__head h2,
.crm-card h3,
.sheet-header h2,
.calendar-nav h2,
.adm-preview-title {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.adm-title--app {
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.adm-intro,
.crm-section__head p,
.crm-card__head p,
.crm-note,
.sheet-header .meta,
.muted,
.hint {
  color: var(--muted);
  line-height: 1.6;
}

.adm-intro--inline {
  margin: 10px 0 0;
  max-width: 52rem;
}

.crm-topbar__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-pill {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.crm-pill--soft,
.crm-user-chip {
  background: var(--background-soft);
  color: var(--foreground);
}

.crm-user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
}

.crm-status-stack,
.crm-stack {
  display: grid;
  gap: 12px;
}

.crm-status-stack {
  flex-shrink: 0;
  margin: 12px 24px 0;
}

.crm-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 24px 40px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 100px);
}

.crm-section {
  margin-top: 0;
}

.crm-section:not(.crm-section--active) {
  display: none !important;
}

.crm-section--unrouted {
  display: none !important;
}

.crm-viewport .crm-grid + .crm-grid,
.crm-viewport .crm-kpi-grid + .crm-grid,
.crm-viewport .crm-grid + .sheet {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.crm-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.crm-section__head p {
  max-width: 46rem;
  margin: 0;
}

.crm-grid,
.crm-kpi-grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

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

.crm-grid--schedule-edit {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.85fr);
  align-items: start;
}

.crm-grid--schedule-bottom {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
  margin-top: 20px;
}

.crm-section__head--tight {
  margin-bottom: 14px;
}

.crm-section__head--tight h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.crm-section__lede-muted {
  margin: 0;
  max-width: 40rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

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

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

.crm-kpi-grid--billing-detail {
  margin-bottom: 12px;
}

.crm-kpi-grid--billing-main {
  margin-top: 0;
}

.crm-hours-note {
  margin-top: 14px;
  font-size: 0.9rem;
}

.crm-costs-grid {
  margin-top: 16px;
}

.cost-receipt-cell {
  display: grid;
  gap: 4px;
}

.cost-receipt-link {
  font-weight: 700;
  color: var(--primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cost-receipt-name {
  font-size: 0.78rem;
  color: var(--muted-soft);
  line-height: 1.35;
  word-break: break-word;
}

.cost-delete-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.cost-notes-cell {
  min-width: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.cost-log-table {
  min-width: 1080px;
  table-layout: auto;
}

.cost-log-table .cost-notes-cell {
  min-width: 360px;
  max-width: 560px;
  white-space: pre-wrap;
  word-break: break-word;
}

.cost-form-status--ok {
  color: var(--primary-deep);
  font-weight: 700;
}

.cost-form-status--err {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 1024px) {
  .crm-kpi-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .crm-kpi-grid--three {
    grid-template-columns: 1fr;
  }
}

.crm-kpi-more {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.crm-kpi-more summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-deep);
  list-style: none;
}

.crm-kpi-more summary::-webkit-details-marker {
  display: none;
}

.crm-kpi-more[open] summary {
  margin-bottom: 14px;
}

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

.crm-kpi-more + .crm-grid {
  margin-top: 18px;
}

.crm-schedule-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 248, 0.75) 100%);
  box-shadow: var(--shadow-sm);
}

.crm-schedule-actions__label {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding-top: 10px;
}

.crm-schedule-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  flex: 1 1 280px;
}

.crm-schedule-closures-card {
  margin-bottom: 20px;
}

.crm-section > .crm-schedule-preview-full + .crm-schedule-closures-card {
  margin-top: 20px;
}

.crm-closures-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.crm-closures-table th,
.crm-closures-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.crm-closures-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-soft);
}

.csc-closure-strip {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #991b1b;
  background: rgba(254, 226, 226, 0.95);
  border: 1px solid rgba(185, 28, 28, 0.28);
  line-height: 1.35;
}

.csc-cell--closure {
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.12);
}

.crm-schedule-preview-full {
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.crm-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.crm-schedule-toolbar__period {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 220px;
}

.crm-schedule-period-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-align: center;
  color: var(--foreground);
}

.crm-schedule-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-seg {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-soft);
  overflow: hidden;
}

.crm-seg__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 9px 16px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.crm-seg__item:last-child {
  border-right: none;
}

.crm-seg__item input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  width: 100%;
  height: 100%;
}

.crm-seg__item span {
  pointer-events: none;
}

.crm-seg__item:has(input:checked) {
  background: var(--primary);
  color: var(--white);
}

.crm-seg__item:has(input:checked) span {
  color: var(--white);
}

.btn-ghost--icon {
  min-width: 42px;
  padding: 0 12px;
  font-size: 1.1rem;
  font-weight: 800;
}

.crm-schedule-drawer {
  border-bottom: 1px solid var(--border);
  background: rgba(248, 251, 248, 0.5);
}

.crm-schedule-drawer summary {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
  list-style: none;
}

.crm-schedule-drawer summary::-webkit-details-marker {
  display: none;
}

.crm-schedule-drawer[open] summary {
  color: var(--primary-deep);
  border-bottom: 1px solid var(--border);
}

.crm-schedule-drawer__summary {
  margin: 0 0 12px;
  padding: 0 20px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.crm-schedule-drawer .adm-preview-legend {
  margin: 0;
  padding: 0 20px 16px;
}

.adm-preview-legend--compact .csc-legend-items-row {
  gap: 8px 14px;
}

.adm-preview-legend--compact .csc-legend-items-row {
  font-size: 0.85rem;
}

.crm-schedule-preview-canvas {
  padding: 20px 24px 24px;
  min-height: 280px;
  max-height: min(82vh, 980px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.crm-schedule-preview-canvas .adm-preview-mount {
  min-height: 260px;
}

.crm-section > .crm-schedule-closures-card + .crm-grid--schedule-edit {
  margin-top: 4px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.crm-hero-band--compact {
  padding: 22px 24px 18px;
}

.crm-hero-band--compact h3 {
  margin: 0;
  font-size: 1.25rem;
}

.crm-hero-band__tight {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

.crm-schedule-preview-canvas .csc-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  gap: 10px;
}

.crm-schedule-preview-canvas .csc-grid-wrap {
  overflow-x: visible;
}

.crm-schedule-preview-canvas .csc-cell {
  min-height: 128px;
  padding: 14px 12px;
}

.crm-schedule-preview-canvas .csc-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px 16px;
  max-width: none;
  margin: 0;
}

@media (min-width: 1100px) {
  .crm-schedule-preview-canvas .csc-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  .crm-schedule-preview-canvas .csc-year-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.crm-schedule-preview-canvas .csc-mini-month {
  padding: 14px 12px 16px;
}

.crm-schedule-preview-canvas .csc-cell--mini {
  min-height: 82px;
  padding: 8px 8px 10px;
}

.crm-schedule-preview-canvas .csc-grid--mini {
  gap: 4px;
}

.crm-schedule-preview-canvas .csc-cell--mini .csc-line--sm {
  font-size: 0.64rem;
  line-height: 1.25;
  gap: 4px;
}

.crm-schedule-preview-canvas .csc-cell--mini .csc-line-txt strong {
  font-size: 0.64rem;
  line-height: 1.15;
}

.crm-schedule-preview-canvas .csc-cell--weekend:not(.csc-cell--class):not(.csc-cell--bridge) {
  background: #f7faf7;
}

.crm-schedule-preview-canvas .csc-cell--mini .csc-closure-strip {
  margin: 0 0 5px;
  padding: 3px 5px;
  font-size: 0.56rem;
}

@media (max-width: 1200px) {
  .crm-kpi-grid--primary,
  .crm-kpi-grid--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .crm-kpi-grid--primary,
  .crm-kpi-grid--secondary {
    grid-template-columns: 1fr;
  }
}

.crm-card,
.crm-kpi-card,
.calendar-panel {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
}

.crm-card {
  overflow: hidden;
}

.crm-card__head {
  padding-top: 22px;
}

.crm-card__head h3 {
  font-size: 1.35rem;
}

.crm-card__head p {
  margin: 8px 0 0;
}

.crm-card__head-lede {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.crm-card__body {
  padding-top: 18px;
  padding-bottom: 24px;
}

.crm-card--hero .crm-card__body {
  padding-top: 22px;
}

.crm-hero-band,
.sheet-header {
  padding: 28px 24px 24px;
  color: var(--white);
  background: linear-gradient(145deg, rgba(20, 83, 45, 0.98) 0%, rgba(21, 128, 61, 0.94) 55%, rgba(74, 222, 128, 0.84) 100%);
}

.crm-card__eyebrow--light {
  color: rgba(255, 255, 255, 0.76);
}

.crm-hero-band h3,
.sheet-header h2 {
  color: var(--white);
}

.crm-hero-band p,
.sheet-header .meta {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.crm-kpi-card {
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 158px;
}

.crm-kpi-card--soft {
  background: linear-gradient(180deg, #f8fbf8 0%, #f3f8f3 100%);
}

.crm-kpi-card span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.crm-kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.crm-kpi-card p,
.crm-note {
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.crm-kpi-card--highlight {
  border-color: rgba(21, 128, 61, 0.45);
  background: linear-gradient(170deg, #f3fff6 0%, #e9f8ee 100%);
}

.crm-kpi-card--highlight strong {
  font-size: clamp(1.95rem, 2.7vw, 2.4rem);
  color: var(--primary-deep);
}

.crm-note--muted {
  color: var(--muted-soft);
}

.crm-list {
  margin: 16px 0 0;
  padding-left: 1.2em;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.crm-list--ordered {
  padding-left: 1.35em;
}

.crm-empty-state,
.crm-empty-inline {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.crm-session-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfdfb 0%, #f5faf5 100%);
}

.crm-session-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.crm-session-item__top strong {
  font-size: 1rem;
  line-height: 1.35;
}

.crm-session-item p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.crm-session-item__meta {
  display: block;
  margin-top: 10px;
  color: var(--muted-soft);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
}

.crm-card--placeholder {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
}

.sheet {
  overflow: hidden;
  border-radius: 32px;
  background: var(--card);
}

.sheet-body {
  padding-top: 24px;
  padding-bottom: 28px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--foreground);
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--foreground);
  font: inherit;
  margin-bottom: 12px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input[type="color"] {
  height: 46px;
  padding: 4px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.check-row input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.check-row label {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.weekday-fieldset {
  margin: 0 0 12px;
  padding: 0;
  border: none;
}

.weekday-fieldset legend {
  margin-bottom: 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.weekday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.weekday-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.weekday-grid input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.hint {
  margin: -4px 0 0;
  font-size: 0.78rem;
}

button {
  font: inherit;
}

.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-primary:hover,
.btn-ghost:hover,
.btn-danger:hover,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-deep);
  box-shadow: 0 12px 24px rgba(21, 128, 61, 0.2);
}

.btn-primary--wide,
.btn-ghost--wide {
  width: 100%;
}

.btn-ghost {
  background: var(--white);
  border-color: var(--border);
  color: var(--foreground);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--background-soft);
}

.btn-ghost--accent {
  border-color: rgba(21, 128, 61, 0.42);
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.btn-ghost--accent:hover,
.btn-ghost--accent:focus-visible {
  background: #bbf7d0;
}

.btn-danger {
  background: #dc2626;
  color: var(--white);
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: #b91c1c;
}

.msg {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.msg-err {
  border: 1px solid #fecaca;
  background: var(--danger-soft);
  color: #991b1b;
}

.msg-ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.adm-form-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.adm-inline-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

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

.adm-form-stack--compact {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

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

.adm-inline-actions--spaced {
  margin-bottom: 14px;
}

.adm-advanced {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-soft);
}

.adm-advanced summary {
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.adm-advanced summary::-webkit-details-marker {
  display: none;
}

.adm-advanced__body {
  padding: 0 14px 14px;
}

.adm-preview-mode {
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-soft);
}

.adm-preview-mode-legend {
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.adm-preview-mode-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.adm-preview-mode-label input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.adm-preview-nav-hint,
.adm-preview-summary {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.adm-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.adm-preview-title {
  flex: 1 1 160px;
  font-size: 1.2rem;
}

.adm-preview-legend {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adm-preview-body-scroll {
  max-height: min(65vh, 760px);
  overflow-y: auto;
  padding-right: 6px;
}

.adm-preview-flex {
  margin-top: 24px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, #fbfdfb 0%, #f5faf5 100%);
}

.adm-flex-title,
.csc-flat-title,
.csc-flat-month-h {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.15;
}

.adm-flex-lede,
.adm-flex-meta,
.csc-no-days,
.csc-no-days--year {
  color: var(--muted);
  line-height: 1.55;
}

.adm-flex-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  display: grid;
  gap: 10px;
}

#sessionsTable,
#flexTable,
#timeLogMount {
  overflow-x: auto;
}

table,
.time-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td,
.time-log-table th,
.time-log-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th,
.time-log-table thead th {
  background: var(--card-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

tbody tr:hover {
  background: rgba(220, 252, 231, 0.45);
}

.adm-muted,
.time-log-manual,
.time-log-foot,
.portal-mono {
  color: var(--muted-soft);
}

.time-log-row--session {
  background: var(--warning-soft);
}

.time-log-row--clock-out {
  background: #f0fdf4;
}

.time-log-row--live {
  background: linear-gradient(90deg, rgba(220, 252, 231, 0.65) 0%, rgba(239, 246, 255, 0.75) 100%);
  outline: 1px solid rgba(21, 128, 61, 0.22);
}

.time-log-time,
.time-log-hrs,
.time-log-manual,
.csc-entry-code,
.csc-time,
.csc-flat-date,
.crm-session-item__meta {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.time-log-hrs {
  text-align: right;
  font-weight: 700;
}

.time-log-notes {
  max-width: 36em;
}

.time-log-client-synopsis__body {
  margin: 0;
  color: var(--primary-deep);
  line-height: 1.55;
}

.time-log-notes-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.time-log-notes-text {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.time-log-table--compact tbody tr[data-row-collapsed] {
  cursor: pointer;
}

.time-log-table--compact tbody tr[data-row-collapsed] td {
  padding-top: 6px;
  padding-bottom: 6px;
  vertical-align: middle;
  transition: background-color 0.15s;
}

.time-log-table--compact tbody tr[data-row-collapsed="0"]:not(.time-log-row--session):not(.time-log-row--clock-out):not(.time-log-row--live) {
  background: rgba(220, 252, 231, 0.28);
}

.time-log-table--compact tbody tr[data-row-collapsed="0"] td {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.time-log-table--compact tbody tr[data-row-collapsed="1"] .time-log-notes-inner {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 1.55em;
  color: var(--muted);
}

.time-log-table--compact tbody tr[data-row-collapsed="1"] .time-log-notes-inner p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-log-table--compact tbody tr[data-row-collapsed="0"] .time-log-notes-inner {
  display: block;
}

.time-log-date__cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.time-log-row-toggle {
  appearance: none;
  border: 1px solid rgba(21, 128, 61, 0.22);
  background: rgba(21, 128, 61, 0.10);
  padding: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  border-radius: 999px;
  flex: 0 0 auto;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.time-log-row-toggle:hover,
.time-log-row-toggle:focus-visible {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(21, 128, 61, 0.35);
  outline: none;
}

.time-log-row-caret {
  display: inline-block;
  line-height: 1;
  transition: transform 0.18s ease;
}

.time-log-row-caret--blank {
  width: 22px;
  height: 22px;
}

.time-log-table--compact tbody tr[data-row-collapsed="0"] .time-log-row-caret {
  transform: rotate(90deg);
}

.time-log-table--compact tbody tr[data-row-collapsed="1"]:hover .time-log-row-toggle {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(21, 128, 61, 0.35);
}

.time-log-notes-text--preview {
  color: inherit;
}

.time-log-notes-text--full {
  color: inherit;
}

.time-log-notes-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.time-log-notes-toggle:hover,
.time-log-notes-toggle:focus-visible {
  color: var(--primary-deep);
  outline: none;
}

.calendar-detail__notes .time-log-notes-wrap {
  gap: 4px;
}

.time-log-totals-bridge td {
  padding-top: 18px;
  border-top: 2px solid var(--border-strong);
  background: #f8faf8;
}

.time-log-totals-bridge__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.time-log-total td {
  background: var(--card-soft);
  border-bottom: none;
}

.time-log-total--paid td {
  background: #ecfdf5;
}

.time-log-total--unpaid td {
  background: var(--warning-soft);
}

.time-log-foot {
  margin-top: 16px;
  font-size: 0.82rem;
}

.time-log-pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-soft);
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.view-seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-soft);
}

.view-seg button {
  min-height: 38px;
  padding: 0 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.view-seg button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--white);
}

.calendar-panel {
  padding: 18px;
  border: 1px solid var(--border);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.calendar-nav h2,
.adm-preview-title {
  color: var(--primary-deep);
}

.calendar-nav__btns {
  display: flex;
  gap: 8px;
}

.calendar-nav button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--foreground);
  font-weight: 700;
  cursor: pointer;
}

.calendar-nav button:hover,
.calendar-nav button:focus-visible {
  background: var(--background-soft);
  outline: none;
}

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

.calendar-grid__wd {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.calendar-day {
  min-height: 74px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  text-align: left;
}

.calendar-day--empty {
  border-style: dashed;
  background: #fafcfa;
}

.calendar-day--has {
  cursor: pointer;
  border-color: rgba(21, 128, 61, 0.18);
  background: linear-gradient(180deg, #f8fbf8 0%, #eff7ef 100%);
}

.calendar-day--has:hover,
.calendar-day--has:focus-visible,
.calendar-day--selected {
  outline: 2px solid rgba(21, 128, 61, 0.18);
  outline-offset: 1px;
}

.calendar-day__num {
  font-size: 0.94rem;
  font-weight: 800;
}

.calendar-day__hrs {
  display: block;
  margin-top: 4px;
  color: var(--primary-deep);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
}

.calendar-detail {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-soft);
}

.calendar-detail[hidden],
.table-panel[hidden] {
  display: none !important;
}

.calendar-detail h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.calendar-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-detail li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.calendar-detail li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calendar-detail__clock,
.calendar-detail__meta,
.csc-legend-time {
  color: var(--muted);
}

.calendar-detail__clock {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.calendar-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.calendar-detail__cat {
  color: var(--primary-deep);
  font-weight: 800;
}

.calendar-detail__hrs {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
}

.calendar-detail__notes {
  line-height: 1.55;
  color: var(--muted);
}

.crm-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.crm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.crm-modal {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.crm-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.crm-modal__head h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.crm-modal__body {
  padding: 18px 20px 20px;
}

body.crm-modal-open {
  overflow: hidden;
}

.csc-legend-items-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.csc-legend-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.csc-legend-item i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-top: 3px;
}

.csc-legend-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.csc-legend-code {
  font-weight: 800;
}

.csc-grid-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
}

.csc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(102px, 1fr));
  gap: 8px;
  min-width: 714px;
}

.csc-dow {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.csc-cell {
  min-height: 120px;
  padding: 12px 11px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.csc-cell--pad {
  border: none;
  background: transparent;
  min-height: 0;
}

.csc-day-num {
  font-size: 0.95rem;
  font-weight: 800;
}

.csc-stack,
.csc-stack--sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.csc-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.csc-line--sm {
  font-size: 0.72rem;
}

.csc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.csc-dot--dash {
  background: transparent !important;
  border-style: dashed;
  border-width: 2px;
}

.csc-line-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.csc-line-txt strong {
  font-weight: 800;
}

.csc-time,
.csc-muted {
  color: var(--muted);
}

.csc-bridge-compact {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  justify-content: center;
}

.csc-bridge-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.csc-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 18px 14px;
  margin-bottom: 8px;
}

.csc-mini-month {
  padding: 12px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-soft);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.csc-mini-month:hover {
  border-color: rgba(22, 101, 52, 0.35);
  box-shadow: 0 10px 22px rgba(19, 39, 24, 0.11);
  transform: translateY(-1px);
  background: var(--white);
}

.csc-mini-month:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.csc-mini-month--past {
  opacity: 0.86;
}

.csc-mini-month-head {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.csc-mini-month-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.csc-mini-month-title {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-deep);
}

.csc-mini-month-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
  background: var(--background-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 6px;
  line-height: 1;
  white-space: nowrap;
}

.csc-mini-month-hint {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-deep);
  border: 1px solid rgba(21, 128, 61, 0.3);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(34, 197, 94, 0.1);
}

.csc-grid-wrap--mini {
  overflow-x: visible;
}

.csc-grid--mini {
  min-width: 0;
  width: 100%;
  gap: 4px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.csc-dow--mini {
  font-size: 0.58rem;
  padding: 4px 2px;
}

.csc-cell--mini {
  min-height: 84px;
  padding: 8px 6px 10px;
  border-radius: 12px;
  gap: 6px;
}

.csc-cell-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.1;
  text-align: center;
}

.csc-cell-code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csc-cell-code--multi {
  font-size: 0.58rem;
}

.csc-cell-time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.54rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.csc-cell-off {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #b91c1c;
  text-transform: uppercase;
}

.csc-cell-tag-closed {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #991b1b;
  text-transform: uppercase;
}

.csc-cell-closure-note {
  font-size: 0.55rem;
  font-weight: 600;
  color: #7f1d1d;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.csc-cell--past {
  background: var(--card-soft);
  border-color: var(--border);
  opacity: 0.58;
  filter: saturate(0.4);
}

.csc-cell--past .csc-day-num {
  color: var(--muted-soft);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.csc-cell--today {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.16), 0 8px 18px rgba(21, 128, 61, 0.08);
}

.csc-cell--today .csc-day-num {
  color: var(--primary-deep);
  font-weight: 800;
}

.csc-cell--overflow {
  opacity: 0.7;
  filter: saturate(0.85);
}

.csc-cell--overflow .csc-day-num {
  color: var(--muted-soft);
  opacity: 0.7;
  font-weight: 600;
}

.csc-month-legend {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.csc-month-legend--empty {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--background-soft);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  text-align: center;
  text-transform: uppercase;
}

.csc-month-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  line-height: 1.25;
  padding: 5px 8px;
  background: var(--background-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.csc-month-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.csc-month-legend-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.csc-month-legend-code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 0.76rem;
}

.csc-month-legend-name {
  font-weight: 600;
  color: var(--foreground);
}

.csc-month-legend-time {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  color: var(--muted);
}

.schedule-modal[hidden] { display: none !important; }
.schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
}
.schedule-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  border: none;
}
.schedule-modal__dialog {
  position: relative;
  max-width: 640px;
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 18px 18px 16px;
  max-height: 82vh;
  overflow: auto;
}
.schedule-modal__dialog--month {
  max-width: 980px;
  margin: 5vh auto 0;
}
.schedule-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.schedule-modal__title {
  margin: 0;
  color: var(--primary-deep);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}
.schedule-modal__sub {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.csc-month-detail-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.csc-month-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--background-soft);
}
.csc-month-chip strong {
  color: var(--primary-deep);
  margin-right: 6px;
  font-weight: 800;
}
.csc-month-detail-grid { margin-bottom: 14px; }
.csc-month-detail-list { display: grid; gap: 10px; }
.csc-month-detail-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  background: #fff;
}
.csc-month-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.csc-month-detail-title {
  margin: 0;
  color: var(--primary-deep);
  font-size: 0.96rem;
  font-weight: 800;
}
.csc-month-detail-code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.csc-month-detail-meta {
  margin: 0;
  color: var(--foreground);
  font-size: 0.84rem;
  line-height: 1.45;
}
.csc-month-detail-meta + .csc-month-detail-meta { margin-top: 4px; }
.csc-month-closure-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
  color: #7f1d1d;
  font-size: 0.84rem;
  line-height: 1.45;
}

.schedule-class-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid transparent;
}
.schedule-class-status--open { background:#ecfdf3; color:#166534; border-color:#86efac; }
.schedule-class-status--completed { background:#f1f5f9; color:#64748b; border-color:#cbd5e1; }

.csc-month-details {
  margin-top: 20px;
}

.csc-month-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
  list-style: none;
}

.csc-month-details summary::-webkit-details-marker {
  display: none;
}

.csc-month-details[open] summary {
  margin-bottom: 8px;
  color: var(--primary-deep);
}

.csc-month-details .csc-flat {
  margin-top: 0;
  padding-top: 12px;
  border-top: none;
}

.csc-flat {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.csc-flat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.csc-flat-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.csc-flat-item:last-child {
  border-bottom: none;
}

.csc-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.csc-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.csc-entry:first-child {
  padding-top: 0;
}

.csc-entry-line1,
.csc-entry-line2,
.csc-entry-line3 {
  margin: 0;
}

.csc-entry-line1 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  line-height: 1.5;
}

.csc-entry-line2 {
  margin-top: 8px;
  color: var(--primary-deep);
  font-weight: 700;
}

.csc-entry-line3 {
  margin-top: 8px;
  color: var(--muted);
}

.csc-entry-code {
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 18%, var(--white));
  border: 1px solid color-mix(in srgb, var(--chip) 36%, var(--border));
  font-size: 0.74rem;
  font-weight: 800;
}

@media (max-width: 1240px) {
  .crm-kpi-grid,
  .crm-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .crm-login-shell,
  .crm-shell,
  .crm-grid--three,
  .crm-grid--two,
  .crm-grid--schedule-edit,
  .crm-grid--schedule-bottom {
    grid-template-columns: 1fr;
  }

  .crm-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 820px) {
  .crm-main,
  .crm-login-shell {
    width: calc(100% - 24px);
  }

  .crm-main {
    padding: 0;
  }

  .crm-topbar {
    margin: 12px 12px 0;
  }

  .crm-status-stack {
    margin: 10px 12px 0;
  }

  .crm-viewport {
    padding: 16px 12px 28px;
  }

  .crm-kpi-grid,
  .crm-kpi-grid--inner {
    grid-template-columns: 1fr;
  }

  .crm-topbar {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .crm-login-shell {
    margin: 12px auto;
    width: calc(100% - 20px);
  }

  .crm-main {
    padding: 0;
  }

  .crm-topbar {
    margin: 10px 10px 0;
  }

  .crm-status-stack {
    margin: 8px 10px 0;
  }

  .crm-viewport {
    padding: 14px 10px 24px;
  }

  .crm-login-hero,
  .crm-login-card__head,
  .crm-login-card__body,
  .crm-topbar,
  .crm-card__head,
  .crm-card__body,
  .crm-hero-band,
  .sheet-header,
  .sheet-body {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .adm-inline-actions,
  .adm-form-status {
    align-items: stretch;
  }
}

/* Templates panel ---------------------------------------------------------- */
.crm-list--clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.crm-template-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  background: var(--card-soft, #f8fbf8);
  color: var(--foreground, #16211b);
  cursor: pointer;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.crm-template-row:hover { background: #ecf8ee; border-color: rgba(21, 128, 61, 0.34); }
.crm-template-row:focus-visible { outline: 2px solid var(--primary, #15803d); outline-offset: 2px; }
.crm-template-row.is-active {
  background: var(--primary-soft, #dcfce7);
  border-color: rgba(21, 128, 61, 0.55);
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.18);
}
.crm-template-row__title { font-weight: 700; font-size: 0.97rem; }
.crm-template-row__desc { font-size: 0.84rem; color: rgba(22, 33, 27, 0.72); line-height: 1.45; }

.crm-template-viewer { margin-top: 18px; }
.crm-template-body {
  margin: 14px 0 0;
  padding: 16px 18px;
  background: #0f172a;
  color: #e6edf3;
  border-radius: 12px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  max-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.crm-template-body code { background: transparent; color: inherit; padding: 0; font: inherit; }

.adm-inline-note--ok { color: var(--primary-deep, #166534); font-weight: 700; }
.adm-inline-note--err { color: #b91c1c; font-weight: 700; }

/* ─────────────────────────────────────────────────────────────────────────
 * Comms icons (registrations + students pages)
 *
 * One small pill per email type. Three states:
 *   .is-sent   filled brand orange - last attempt for this type was sent OK
 *   .is-failed filled red          - last attempt failed (so admin can retry)
 *   default    ghost gray          - never attempted
 *
 * Markup: <button class="comm-icon is-sent" data-type="..." title="...">RC</button>
 * Always render all three positions even when empty, so columns line up.
 * ───────────────────────────────────────────────────────────────────────── */
.comm-strip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.comm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1.5px solid #d1d5db;
  background: transparent;
  color: #9ca3af;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
  line-height: 1;
}
.comm-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}
.comm-icon:focus-visible {
  outline: 2px solid #1e3a5f;
  outline-offset: 2px;
}
.comm-icon.is-sent {
  background: #e87a2e;
  border-color: #e87a2e;
  color: #ffffff;
}
.comm-icon.is-failed {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
.comm-icon[disabled] {
  cursor: default;
  opacity: 0.45;
}
.comm-icon[disabled]:hover {
  transform: none;
  box-shadow: none;
}

/* "Why" badge - small inline label shown above a comm strip in the rich
 * student detail view, e.g. "Receipt", "School", "Reminder". */
.comm-strip-labelled {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.comm-strip-labelled small {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft, #94a3b8);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Shared modal primitives (.reg-modal*) used by registrations.html AND
 * students.html. Originally lived inline in registrations.html - moved here
 * so additional pages can reuse without duplicating styles.
 * ───────────────────────────────────────────────────────────────────────── */
.reg-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.reg-modal {
  background: white;
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0,0,0,.24);
}
.reg-modal__head {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.reg-modal__head h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--primary-deep); }
.reg-modal__head p  { margin: 6px 0 0; font-size: 0.86rem; color: var(--muted); }
.reg-modal__body { padding: 18px 24px; }
.reg-modal__body label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.reg-modal__body input,
.reg-modal__body select,
.reg-modal__body textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
}
.reg-modal__body textarea { min-height: 70px; resize: vertical; }
.reg-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.reg-modal__foot {
  padding: 14px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.reg-modal__foot button { padding: 10px 16px; }
.reg-modal__err { color: #b91c1c; font-size: 0.85rem; margin-top: 10px; min-height: 1.2em; }
.reg-history-row { padding: 8px 0; border-top: 1px dashed var(--border); font-size: 0.85rem; color: var(--muted); }
.reg-history-row:first-child { border-top: none; }
.reg-history-row strong { color: var(--ink); }
.reg-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.reg-pill--deposit { background: #eef6ff; color: #1e3a5f; }
.reg-pill--full    { background: var(--primary-soft); color: var(--primary-deep); }
.reg-pill--manual  { background: #ede9fe; color: #5b21b6; }
.reg-pill--active  { background: var(--primary-soft); color: var(--primary-deep); }
.reg-pill--partial { background: #fef3c7; color: #92400e; }
.reg-pill--refunded { background: #fee2e2; color: #991b1b; }
.reg-pill--cancelled { background: #f3f4f6; color: #6b7280; }
.reg-mono {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--muted-soft);
}

/* ─────────────────────────────────────────────────────────────────────────
 * Client v1 CRM (new simplified surface)
 * ───────────────────────────────────────────────────────────────────────── */
.clientv1-tabs-card {
  margin-bottom: 16px;
}
.clientv1-nav {
  display: grid;
  gap: 8px;
}
.clientv1-nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.clientv1-nav-link:hover {
  background: var(--background-soft);
  border-color: var(--border);
  color: var(--foreground);
}
.clientv1-nav-link.is-active {
  background: var(--primary-soft);
  border-color: rgba(21, 128, 61, 0.25);
  color: var(--primary-deep);
}
.clientv1-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.clientv1-tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--foreground);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}
.clientv1-tab.is-active {
  border-color: rgba(21, 128, 61, 0.35);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.clientv1-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.clientv1-toolbar__left,
.clientv1-toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.clientv1-search {
  display: grid;
  gap: 4px;
  min-width: 260px;
}
.clientv1-search > span {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.clientv1-search input {
  margin-bottom: 0;
}
.clientv1-section-head {
  margin-bottom: 10px;
}
.clientv1-section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.clientv1-class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.clientv1-class-card .crm-card__head h3 {
  font-size: 1.1rem;
}
.clientv1-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}
.clientv1-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.clientv1-table-wrap th,
.clientv1-table-wrap td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.clientv1-table-wrap th {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
  background: var(--card-soft);
}
.clientv1-empty-cell {
  color: var(--muted);
  font-style: italic;
}
.clientv1-row-active {
  background: rgba(220, 252, 231, 0.45);
}
.clientv1-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.clientv1-weekday {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.clientv1-weekday input {
  width: auto;
  margin: 0;
}
.clientv1-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.clientv1-pill--sent {
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.clientv1-pill--pending {
  background: #fef3c7;
  color: #92400e;
}
.clientv1-pill--failed {
  background: #fee2e2;
  color: #991b1b;
}
.clientv1-pill--muted {
  background: #f3f4f6;
  color: #6b7280;
}
.class-detail-history.is-active {
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-color: transparent;
}
.adm-history-row > td {
  padding: 0 !important;
  background: var(--card-soft);
  border-bottom: 1px solid var(--border);
}
.adm-history-panel {
  padding: 14px 18px 16px;
  background: var(--card-soft);
}
.adm-history-loading,
.adm-history-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}
.adm-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.adm-history-item {
  display: grid;
  grid-template-columns: 130px 1fr auto auto;
  gap: 10px 14px;
  align-items: baseline;
  font-size: 0.83rem;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.adm-history-item .clientv1-pill {
  justify-self: start;
}
.adm-history-body {
  color: var(--text);
  word-break: break-word;
}
.adm-history-detail {
  font-weight: 600;
}
.adm-history-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.adm-history-error {
  color: #991b1b;
  font-weight: 600;
}
.adm-history-at {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.adm-history-by {
  font-size: 0.78rem;
  color: var(--muted-soft);
  font-style: italic;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .adm-history-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.clientv1-profile .students-meta-line {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.clientv1-class-kpis {
  margin: 10px 0 14px;
}
.clientv1-progress {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.clientv1-progress > span {
  display: block;
  height: 100%;
  background: var(--primary);
}

@media (max-width: 1080px) {
  .clientv1-class-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast Notifications */
#crm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.crm-toast {
  background: #333;
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  font-size: 0.95rem;
  font-weight: 500;
  max-width: 380px;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}
.crm-toast--error {
  background: #b91c1c;
  color: #fff;
}
.crm-toast--success {
  background: #15803d;
  color: #fff;
}
.crm-toast.is-hiding {
  animation: toast-out 0.25s ease-in forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}
