/* ============================================================
   Admino.ro — Carbon Design System Custom Layer
   Built on top of @carbon/styles
   ============================================================ */

/* -----------------------------------------------------------
   1. Design Tokens
   ----------------------------------------------------------- */
:root {
  /* Contrast hierarchy (4 levels) */
  --app-text-foreground: var(--cds-text-primary, #161616);
  --app-text-secondary: var(--cds-text-secondary, #525252);
  --app-text-muted: var(--cds-text-placeholder, #a8a8a8);
  --app-text-faint: var(--cds-border-subtle-01, #e0e0e0);

  /* 4px grid spacing — aliases to Carbon spacing tokens */
  --space-1: var(--cds-spacing-02, 0.25rem);
  /* 4px */
  --space-2: var(--cds-spacing-03, 0.5rem);
  /* 8px */
  --space-3: var(--cds-spacing-04, 0.75rem);
  /* 12px */
  --space-4: var(--cds-spacing-05, 1rem);
  /* 16px */
  --space-5: 1.25rem;
  /* 20px — no Carbon equivalent */
  --space-6: var(--cds-spacing-06, 1.5rem);
  /* 24px */
  --space-7: var(--cds-spacing-07, 2rem);
  /* 32px */
  --space-8: var(--cds-spacing-08, 2.5rem);
  /* 40px */
  --space-9: var(--cds-spacing-09, 3rem);
  /* 48px */
  --space-10: 5rem;
  /* 80px */

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-micro: 150ms var(--ease-out);
  --transition-normal: 200ms var(--ease-out);
  --transition-slow: 250ms var(--ease-out);

  /* Border radius (sharp/technical) */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Depth */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 2px 6px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.04);

  /* Layout */
  --header-height: 48px;
  /* CDS header standard height */

  /* Form inputs: 16px minimum (prevents iOS auto-zoom, improves readability) */
  --cds-body-compact-01-font-size: 1rem;
}

/* Native form elements: override inline font-size declarations */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
  font-size: 1rem !important;
}

/* Explicit opt-out for compact inputs */
.input--compact {
  --cds-body-compact-01-font-size: 0.875rem;
  font-size: 0.875rem !important;
}

/* Dark mode token adjustments */
.cds--g100 {
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}


/* -----------------------------------------------------------
   2. Base & Typography
   ----------------------------------------------------------- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  color: var(--app-text-foreground);
  background-color: var(--cds-background, #f4f4f4);
  margin: 0;
  padding: 0;
}

/* Lock page scroll when a slide panel is open */
body.slide-panel-open {
  overflow: hidden;
}

body.slide-panel-open cds-side-nav {
  overflow: hidden !important;
}

/* Heading utilities */
.heading-01 {
  font-size: 2.285rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.heading-02 {
  font-size: 1.714rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.heading-03 {
  font-size: 1.285rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.heading-04 {
  font-size: 1.142rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.heading-05 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.heading-06 {
  font-size: 0.857rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

/* Body text */
.body-01 {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.body-02 {
  font-size: 0.928rem;
  font-weight: 400;
  line-height: 1.45;
}

.body-compact {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.285;
}

/* Labels */
.label-01 {
  font-size: 0.857rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--app-text-secondary);
}

.label-02 {
  font-size: 0.785rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.label-02 cds-icon {
  vertical-align: text-top;
}

/* Data / Monospace */
.data-text {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.data-large {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 1.714rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.data-xl {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 2.285rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Color utilities */
.text-primary {
  color: var(--app-text-foreground);
}

.text-secondary {
  color: var(--app-text-secondary);
}

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

.text-faint {
  color: var(--app-text-faint);
}

.text-success {
  color: var(--cds-support-success, #198038);
}

.text-error {
  color: var(--cds-support-error, #da1e28);
}

.text-warning {
  color: var(--cds-support-warning, #f1c21b);
}


.text-thin {
  font-weight: 300;
}

/* -----------------------------------------------------------
   3. CDS UI Shell Overrides
   ----------------------------------------------------------- */

/* Side nav — positioned below header */
cds-header~cds-side-nav {
  block-size: calc(100% - 3rem);
  margin-block-start: 3rem;
}

/* Force hamburger button visible at all viewport sizes */
cds-header-menu-button#sidenav-toggle {
  display: block !important;
}

cds-header-name span {
  font-weight: 300;
  color: var(--app-text-muted);
}

/* Fix cds-icon vertical centering inside header global actions */
cds-header-global-action cds-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}

/* --- Entity Switcher (US-100) --- */

/* Header pills — inline in the top bar */
.entity-switcher-header {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--space-4);
  height: 3rem;
}

.entity-switcher-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-3);
  height: 1.75rem;
  border: none;
  border-radius: 14px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition-micro), color var(--transition-micro);
  background: transparent;
  color: var(--cds-text-on-color-disabled, #8d8d8d);
}

.entity-switcher-pill:hover {
  background: var(--cds-layer-hover-01, rgba(141, 141, 141, 0.12));
  color: var(--cds-text-primary, #f4f4f4);
}

.entity-switcher-pill--active {
  background: var(--cds-background-active, rgba(141, 141, 141, 0.5));
  color: var(--cds-text-primary, #f4f4f4);
}

.entity-switcher-pill:disabled {
  cursor: wait;
  opacity: 0.5;
}

.entity-switcher-pill--all {
  border: 1px dashed var(--cds-text-on-color-disabled, #8d8d8d);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
}

.entity-switcher-pill--all.entity-switcher-pill--active {
  border-color: transparent;
  background: var(--cds-layer-accent-01, rgba(141, 141, 141, 0.5));
}



/* User panel — radio button list */
.entity-switcher-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entity-switcher-radio {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-micro);
}

.entity-switcher-radio:hover {
  background: var(--cds-layer-hover-01);
}

.entity-switcher-radio--active {
  background: var(--cds-layer-selected-01);
}

.entity-switcher-radio input[type="radio"] {
  display: none;
}

.entity-switcher-radio__label {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.entity-switcher-radio__abbr {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--app-text-muted);
}

.entity-switcher-radio__name {
  font-size: 0.875rem;
  color: var(--cds-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-switcher-radio__check {
  color: var(--cds-support-success);
  flex-shrink: 0;
}

/* Hide header pills on small screens */
@media (max-width: 40rem) {
  .entity-switcher-header {
    display: none;
  }
}

/* --- Side nav: desktop push layout --- */
@media (min-width: 66rem) {
  body.sidenav-expanded .app-main {
    margin-left: 16rem;
    /* 256px = Carbon side-nav width */
  }

  /* Transition only after initial state is set (prevents slide on page load) */
  body.sidenav-ready .app-main {
    transition: margin-left 0.11s cubic-bezier(0.2, 0, 1, 0.9);
  }
}

/* --- Side nav: mobile overlay backdrop --- */
#sidenav-overlay {
  display: none;
  position: fixed;
  top: 3rem;
  left: 0;
  width: 100%;
  height: calc(100% - 3rem);
  background: rgba(0, 0, 0, 0.5);
  z-index: 6000;
  transition: opacity 0.11s cubic-bezier(0.2, 0, 1, 0.9);
}

@media (max-width: 65.98rem) {
  #sidenav-overlay.sidenav-overlay--visible {
    display: block;
  }
}

/* Side nav — group title separators inside cds-side-nav-menu */
cds-side-nav-menu .sidenav-group-title {
  display: block;
  padding: 0.375rem 1rem 0.25rem 2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--cds-text-secondary);
  letter-spacing: 0.32px;
  text-transform: uppercase;
  border-top: 1px solid var(--cds-border-subtle-01);
  margin-top: 0.125rem;
  pointer-events: none;
  list-style: none;
}

cds-side-nav-menu .sidenav-group-title:first-child {
  border-top: none;
  margin-top: 0;
}

/* -----------------------------------------------------------
   3b. App Layout (authenticated pages)
   ----------------------------------------------------------- */
.app-main {
  padding-top: var(--header-height);
  min-height: 100vh;
  min-height: 100dvh;
}

.app-content {
  padding: var(--space-6);
  /* max-width: 1400px; */
}

/* Full-page layout (login, register — no sidebar) */
.app-fullpage {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}


/* -----------------------------------------------------------
   3b. Login / Full-page Layout
   ----------------------------------------------------------- */
.login-panel {
  width: 33.33%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cds-background, #f4f4f4);
  padding: var(--space-6);
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
}

.login-visual {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Full-width Carbon button (login) */
.login-form-wrapper cds-button {
  width: 100%;
}

/* Login separator (metode alternative) */
.login-separator {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.login-separator::before,
.login-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cds-border-subtle, #e0e0e0);
}

/* Progress indicator (register wizard) */
.login-form-wrapper cds-progress-indicator {
  margin-bottom: var(--space-6);
  width: 100%;
}

/* Carbon web components need explicit block display in grid contexts */
cds-toggle {
  display: block;
}

/* Two-column grid for form fields */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 41.98rem) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}


/* -----------------------------------------------------------
   4. Component Card (replaces Bootstrap .card)
   ----------------------------------------------------------- */
.component-card {
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-normal);
}

.component-card:hover {
  box-shadow: var(--shadow-hover);
}

.component-card--flat {
  box-shadow: none;
}

.component-card--flat:hover {
  box-shadow: none;
}

.component-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.component-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--app-text-foreground);
  margin: 0;
}

.component-card__description {
  font-size: 0.857rem;
  color: var(--app-text-secondary);
  margin: 0;
}


/* -----------------------------------------------------------
   5. Grid & Flex Utilities
   ----------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--space-6);
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}


/* -----------------------------------------------------------
   6. Metric Cards (KPI)
   ----------------------------------------------------------- */
.metric-card {
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.metric-card:hover {
  box-shadow: var(--shadow-hover);
}

.metric-card__label {
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--app-text-secondary);
  letter-spacing: 0.02em;
}

.metric-card__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--app-text-foreground);
  line-height: 1.1;
}

.metric-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
}

.metric-card__trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.857rem;
  font-weight: 500;
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.metric-card__trend--up {
  color: var(--cds-support-success, #198038);
}

.metric-card__trend--down {
  color: var(--cds-support-error, #da1e28);
}

.metric-card__period {
  font-size: 0.785rem;
  color: var(--app-text-muted);
}

.metric-card__sparkline {
  height: 32px;
  margin-top: var(--space-2);
  overflow: hidden;
}

.metric-card__sparkline svg {
  width: 100%;
  height: 100%;
}

.metric-card__value--warning {
  color: var(--cds-support-warning, #f1c21b);
}


/* -----------------------------------------------------------
   7. Dashboard Layout Grids
   ----------------------------------------------------------- */
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-6);
}


/* -----------------------------------------------------------
   8. Chart Cards
   ----------------------------------------------------------- */
.chart-card {
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.chart-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.chart-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--app-text-foreground);
  margin: 0;
}

.chart-card__body {
  padding: var(--space-6);
  min-height: 280px;
}


/* -----------------------------------------------------------
   9. Activity Feed
   ----------------------------------------------------------- */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  position: relative;
}

.activity-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: -4px;
  width: 1px;
  background: var(--cds-border-subtle-01, #e0e0e0);
}

.activity-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cds-border-strong-01, #8d8d8d);
  flex-shrink: 0;
  margin-top: 6px;
  margin-left: 12px;
}

.activity-item__dot--success {
  background: var(--cds-support-success, #198038);
}

.activity-item__dot--info {
  background: var(--cds-support-info, #0043ce);
}

.activity-item__dot--warning {
  background: var(--cds-support-warning, #f1c21b);
}

.activity-item__dot--error {
  background: var(--cds-support-error, #da1e28);
}

.activity-item__content {
  flex: 1;
  min-width: 0;
}

.activity-item__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 2px;
}

.activity-item__user {
  font-size: 0.857rem;
  font-weight: 600;
  color: var(--app-text-foreground);
}

.activity-item__action {
  font-size: 0.857rem;
  color: var(--app-text-secondary);
}

.activity-item__time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.785rem;
  color: var(--app-text-muted);
  font-variant-numeric: tabular-nums;
}


/* -----------------------------------------------------------
   10. Status Indicators
   ----------------------------------------------------------- */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--app-text-foreground);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--operational {
  background: var(--cds-support-success, #198038);
}

.status-dot--degraded {
  background: var(--cds-support-warning, #f1c21b);
}

.status-dot--outage {
  background: var(--cds-support-error, #da1e28);
}

.status-dot--maintenance {
  background: var(--cds-support-info, #0043ce);
}

/* Product status: active (pulsing green) / inactive (gray) */
.status-dot--active {
  background: var(--cds-support-success, #198038);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot--inactive {
  background: var(--app-text-muted, #a8a8a8);
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(25, 128, 56, 0.4);
  }

  50% {
    opacity: 0.85;
    box-shadow: 0 0 0 4px rgba(25, 128, 56, 0);
  }
}

.status-dot--deleted {
  background: var(--cds-support-error, #da1e28);
}

.cds--g100 .status-dot--active {
  background: #42be65;
}

.cds--g100 .status-dot--deleted {
  background: #ff8389;
}

/* Attendance week icons — Carbon status indicator icons per enrollment week */
.att-weeks {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  padding: var(--space-2) 0;
}

.att-week {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  cursor: default;
  line-height: 0;
}

.att-week--succeeded {
  color: var(--cds-support-success, #198038);
}

.att-week--normal {
  color: var(--cds-support-info, #0043ce);
}

.att-week--incomplete {
  color: var(--cds-support-info, #0043ce);
  opacity: 0.5;
}

.att-week--caution_minor {
  color: var(--cds-support-warning, #f1c21b);
}

.att-week--caution_major {
  color: #ff832b;
}

.att-week--failed {
  color: var(--cds-support-error, #da1e28);
}

.att-week--not_started {
  color: var(--cds-icon-disabled, #c6c6c6);
}

.att-week--pending {
  color: var(--cds-icon-disabled, #c6c6c6);
  opacity: 0.4;
}

/* Dark theme adjustments */
.cds--g100 .att-week--succeeded {
  color: #42be65;
}

.cds--g100 .att-week--normal {
  color: #4589ff;
}

.cds--g100 .att-week--caution_minor {
  color: #f1c21b;
}

.cds--g100 .att-week--caution_major {
  color: #ff832b;
}

.cds--g100 .att-week--failed {
  color: #ff8389;
}

.cds--g100 .att-week--not_started {
  color: #525252;
}

/* Group status indicators (icon + text) */
.group-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.group-status cds-icon { line-height: 0; }
.group-status--succeeded cds-icon { color: var(--cds-support-success, #198038); }
.group-status--normal cds-icon { color: var(--cds-support-info, #0043ce); }
.group-status--caution_minor cds-icon { color: var(--cds-support-warning, #f1c21b); }
.group-status--caution_major cds-icon { color: #ff832b; }
.group-status--failed cds-icon { color: var(--cds-support-error, #da1e28); }
.group-status--in_progress cds-icon { color: var(--cds-support-info, #0043ce); }
.group-status--not_started { color: var(--cds-text-secondary, #525252); }
.group-status--not_started cds-icon { color: var(--cds-icon-disabled, #c6c6c6); }

.cds--g100 .group-status--succeeded cds-icon { color: #42be65; }
.cds--g100 .group-status--normal cds-icon { color: #4589ff; }
.cds--g100 .group-status--caution_minor cds-icon { color: #f1c21b; }
.cds--g100 .group-status--caution_major cds-icon { color: #ff832b; }
.cds--g100 .group-status--failed cds-icon { color: #ff8389; }
.cds--g100 .group-status--in_progress cds-icon { color: #4589ff; }
.cds--g100 .group-status--not_started { color: #a8a8a8; }
.cds--g100 .group-status--not_started cds-icon { color: #525252; }

/* Allergen cards — visual display with icon + severity indicator + name */
.allergen-cards { display: flex; flex-wrap: wrap; gap: 12px; }

.allergen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  text-align: center;
}

.allergen-card__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.allergen-card__icon img { width: 48px; height: 48px; object-fit: contain; }

.allergen-card__icon--fallback {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--cds-layer-02, #e0e0e0);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 600;
  color: var(--cds-text-secondary, #525252);
}

.allergen-card__severity { line-height: 0; margin: 4px 0 2px; }
.allergen-card__severity--preference { color: var(--cds-support-success, #198038); }
.allergen-card__severity--intolerance { color: var(--cds-support-warning, #f1c21b); }
.allergen-card__severity--allergy { color: #ff832b; }
.allergen-card__severity--allergy { transform: rotate(180deg); }
.allergen-card__severity--severe_allergy { color: var(--cds-support-error, #da1e28); }

.allergen-card__name {
  font-size: 0.75rem; line-height: 1.2;
  color: var(--cds-text-secondary, #525252);
  word-break: break-word;
}

.cds--g100 .allergen-card__icon img { filter: invert(0.85); }
.cds--g100 .allergen-card__icon--fallback { background: var(--cds-layer-02, #393939); color: #c6c6c6; }
.cds--g100 .allergen-card__severity--preference { color: #42be65; }
.cds--g100 .allergen-card__severity--intolerance { color: #f1c21b; }
.cds--g100 .allergen-card__severity--allergy { color: #ff832b; }
.cds--g100 .allergen-card__severity--severe_allergy { color: #ff8389; }
.cds--g100 .allergen-card__name { color: #c6c6c6; }

.status-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.status-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  transition: background var(--transition-micro);
}

.status-list__item:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.status-list__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.status-list__name {
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--app-text-foreground);
}

.status-list__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.857rem;
  color: var(--app-text-secondary);
  font-variant-numeric: tabular-nums;
}


/* -----------------------------------------------------------
   11. Avatar System
   ----------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.857rem;
  color: var(--cds-text-on-color, #ffffff);
  background: var(--cds-interactive, #0f62fe);
  flex-shrink: 0;
  position: relative;
}

.avatar--sm {
  width: 24px;
  height: 24px;
  font-size: 0.714rem;
}

.avatar--md {
  width: 32px;
  height: 32px;
  font-size: 0.857rem;
}

.avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.avatar--purple {
  background: #8a3ffc;
}

.avatar--teal {
  background: #009d9a;
}

.avatar--magenta {
  background: #ee5396;
}

.avatar--cyan {
  background: #0072c3;
}

.avatar--green {
  background: #198038;
}

.avatar__status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--cds-layer-01, #ffffff);
}

.avatar__status--online {
  background: var(--cds-support-success, #198038);
}

.avatar__status--away {
  background: var(--cds-support-warning, #f1c21b);
}

.avatar__status--offline {
  background: var(--app-text-muted);
}


/* -----------------------------------------------------------
   12. Toast Notifications Container
   ----------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-4);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Inline notifications: title and description on separate lines */
.cds--inline-notification__text-wrapper {
  flex-direction: column;
}


/* -----------------------------------------------------------
   13. Scrollbar Styling
   ----------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--cds-border-subtle-01, #e0e0e0);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--app-text-muted);
}


/* -----------------------------------------------------------
   14. FOUC Prevention
   ----------------------------------------------------------- */
:not(:defined) {
  visibility: hidden;
}

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}


/* -----------------------------------------------------------
   15. Responsive
   ----------------------------------------------------------- */

/* Tablet */
@media (max-width: 65.98rem) {
  .login-panel {
    width: 50%;
  }

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

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

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

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

  .dashboard-bottom> :nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* Mobile */
@media (max-width: 41.98rem) {
  .login-panel {
    width: 100%;
  }

  .login-visual {
    display: none;
  }

  .app-content {
    padding: var(--space-4);
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-2-1 {
    grid-template-columns: 1fr;
  }

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

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

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

  .dashboard-bottom> :nth-child(3) {
    grid-column: auto;
  }

  .component-card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .metric-card {
    padding: var(--space-4);
  }

  .metric-card__value {
    font-size: 1.5rem;
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }

  .activity-feed {
    max-height: 300px;
  }

  .activity-item__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  /* Data table horizontal scroll on mobile */
  cds-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  cds-pagination {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* -----------------------------------------------------------
   16. (Reserved)
   ----------------------------------------------------------- */

/* -----------------------------------------------------------
   17. Loading State Utilities
   ----------------------------------------------------------- */

.loading-container {
  text-align: center;
  padding: var(--space-9) 0;
  /* 48px vertical */
}

.loading-container--compact {
  padding: var(--space-7) 0;
  /* 32px vertical */
}

/* Auth page skeleton — pure CSS, no JS dependency */
.login-skeleton .login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.skeleton-line {
  height: 1rem;
  background: var(--cds-skeleton-background, #e8e8e8);
  border-radius: 2px;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-line--heading {
  height: 1.75rem;
}

.skeleton-line--subheading {
  height: 0.875rem;
}

.skeleton-input {
  height: 2.5rem;
  background: var(--cds-skeleton-background, #e8e8e8);
  border-bottom: 1px solid var(--cds-border-strong-01, #8d8d8d);
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-input__label {
  height: 0.75rem;
  width: 30%;
  margin-bottom: var(--space-2);
  background: var(--cds-skeleton-background, #e8e8e8);
  border-radius: 2px;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-button {
  height: 3rem;
  width: 100%;
  background: var(--cds-skeleton-background, #e8e8e8);
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.skeleton-checkbox::before {
  content: '';
  width: 1rem;
  height: 1rem;
  background: var(--cds-skeleton-background, #e8e8e8);
  border-radius: 2px;
  flex-shrink: 0;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-checkbox::after {
  content: '';
  height: 0.75rem;
  width: 6rem;
  background: var(--cds-skeleton-background, #e8e8e8);
  border-radius: 2px;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.skeleton-progress {
  display: flex;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

.skeleton-progress__step {
  flex: 1;
  height: 2.5rem;
  background: var(--cds-skeleton-background, #e8e8e8);
  border-radius: 2px;
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* -----------------------------------------------------------
   18. Checklist Component
   ----------------------------------------------------------- */

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  /* 12px 16px */
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.checklist-item__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* 12px */
}

.checklist-item__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.checklist-item__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* 2px - too small for --space-1 (4px) */
}

/* -----------------------------------------------------------
   19. Card Padding Variants (standardized overrides)
   ----------------------------------------------------------- */

.component-card--tight {
  padding: var(--space-3);
  /* 12px - for list items */
}

.component-card--comfortable {
  padding: var(--space-7);
  /* 32px - for CTAs */
}

.component-card--centered {
  text-align: center;
}

/* -----------------------------------------------------------
   20. Slide Reveal (Advanced Settings)
   ----------------------------------------------------------- */

.slide-reveal {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.slide-reveal.is-open {
  max-height: 600px;
  /* Generous max-height for smooth animation */
}

.slide-reveal-inner {
  padding-top: var(--space-3);
  /* 12px */
}

/* Inside slide panels, allow taller slide-reveal for full forms */
.slide-panel .slide-reveal.is-open {
  max-height: 2000px;
}

/* Student search results dropdown (contact linking) */
.student-search-results {
  border: 1px solid var(--cds-border-subtle);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: var(--space-2);
  background: var(--cds-layer-01);
}

.student-search-item {
  padding: var(--space-3);
  border-bottom: 1px solid var(--cds-border-subtle);
  cursor: pointer;
}

.student-search-item:last-child {
  border-bottom: none;
}

.student-search-item:hover {
  background: var(--cds-layer-hover-01);
}

/* -----------------------------------------------------------
   21. Spacing Utilities
   ----------------------------------------------------------- */

/* Margin-bottom utilities */
.mb-2 {
  margin-bottom: var(--space-1);
}

/* 4px */
.mb-3 {
  margin-bottom: var(--space-2);
}

/* 8px */
.mb-4 {
  margin-bottom: var(--space-3);
}

/* 12px */
.mb-5 {
  margin-bottom: var(--space-4);
}

/* 16px */
.mb-6 {
  margin-bottom: var(--space-6);
}

/* 24px */
.mb-7 {
  margin-bottom: var(--space-7);
}

/* 32px */
.mb-8 {
  margin-bottom: var(--space-8);
}

/* 40px */
.mb-9 {
  margin-bottom: var(--space-9);
}

/* 48px */

/* Margin-top utilities */
.mt-4 {
  margin-top: var(--space-3);
}

.mt-5 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-7 {
  margin-top: var(--space-7);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mt-9 {
  margin-top: var(--space-9);
}

.mt-10 {
  margin-top: var(--space-10);
}

/* -----------------------------------------------------------
   22. Layout Utilities
   ----------------------------------------------------------- */

/* Text alignment */
.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--app-text-secondary);
}

/* Position utilities */
.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

/* Display utilities */
.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

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

/* Flex alignment */
.align-items-center {
  align-items: center;
}

.align-items-end {
  align-items: flex-end;
}

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

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

/* Responsive visibility */
.show-on-mobile {
  display: none;
}

@media (max-width: 48rem) {
  .hide-on-mobile {
    display: none;
  }

  .show-on-mobile {
    display: inline;
  }
}

/* -----------------------------------------------------------
   23. Responsive Form Grids
   ----------------------------------------------------------- */

/* Form grid utilities */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
.form-grid-2 > * { min-width: 0; }

.form-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-5);
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

/* Auto-collapse on mobile */
@media (max-width: 41.98rem) {

  .form-grid-2,
  .form-grid-2-1,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------
   23b. Native Form Element Styling
   ----------------------------------------------------------- */

/* Native <select> styled to match CDS inputs */
.cds-select-native {
  width: 100%;
  height: 2.5rem;
  padding: 0 var(--space-3);
  border: none;
  border-bottom: 1px solid var(--cds-border-strong-01);
  background: var(--cds-field-01);
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

.cds-select-native__label {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.32px;
  color: var(--cds-text-secondary);
  margin-bottom: 8px;
  display: block;
}

.cds-select-native:focus {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

/* Native <input> styled for inline use inside data tables */
.cds-input-inline {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: none;
  border-bottom: 1px solid var(--cds-border-strong-01);
  background: var(--cds-field-01);
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  line-height: 1.25rem;
  box-sizing: border-box;
}

/* Match CDS standard field height when used in forms (not data tables) */
.slide-panel .cds-input-inline {
  height: 2.5rem;
  padding: 0 var(--space-3);
}

.cds-input-inline:focus {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

.cds-input-inline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -----------------------------------------------------------
   24. Carbon Data Table Module
   ----------------------------------------------------------- */

/* Badges (shared across all table pages) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.785rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge--service {
  background: var(--cds-background-brand, #e8daff);
  color: #6929c4;
}

.badge--good {
  background: #d0e2ff;
  color: #0043ce;
}

.badge--active {
  background: #defbe6;
  color: #198038;
}

.badge--inactive {
  background: var(--cds-layer-02, #f4f4f4);
  color: var(--app-text-muted);
}

.badge--expired {
  background: #fff1f1;
  color: #da1e28;
}

.badge--full {
  background: #fff1f1;
  color: #da1e28;
}

.badge--bundle {
  background: #d0e2ff;
  color: #0043ce;
}

.badge--child {
  background: #e8daff;
  color: #6929c4;
}

/* Bundle child row in slide panel */
.bundle-child-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.bundle-child-row:last-child {
  border-bottom: none;
}

/* Invoice status badges */
.badge--draft {
  background: var(--cds-layer-02, #f4f4f4);
  color: var(--app-text-muted);
}

.badge--issued {
  background: #d0e2ff;
  color: #0043ce;
}

.badge--sent {
  background: #e8daff;
  color: #6929c4;
}

.badge--paid {
  background: #defbe6;
  color: #198038;
}

.badge--partial {
  background: #fff8e1;
  color: #8a6d3b;
}

.badge--overdue {
  background: #fff1f1;
  color: #da1e28;
}

.badge--cancelled {
  background: var(--cds-layer-02, #f4f4f4);
  color: var(--app-text-muted);
}

.badge--storno {
  background: #fff1f1;
  color: #da1e28;
}

.badge--converted {
  background: #e8daff;
  color: #6929c4;
}

/* Client type badges */
.badge--pj {
  background: #d0e2ff;
  color: #0043ce;
}

.badge--pf {
  background: #e8daff;
  color: #6929c4;
}

.badge--vat {
  background: #defbe6;
  color: #198038;
}

.badge--no-vat {
  background: var(--cds-layer-02, #f4f4f4);
  color: var(--app-text-muted);
}

.badge--deleted {
  background: #fff1f1;
  color: #da1e28;
}

/* Dark mode badge adjustments */
.cds--g100 .badge--service {
  background: #491d8b;
  color: #d4bbff;
}

.cds--g100 .badge--good {
  background: #002d6d;
  color: #a6c8ff;
}

.cds--g100 .badge--active {
  background: #044317;
  color: #6fdc8c;
}

.cds--g100 .badge--inactive {
  background: var(--cds-layer-02);
  color: var(--app-text-muted);
}

.cds--g100 .badge--expired {
  background: #520408;
  color: #ffb3b8;
}

.cds--g100 .badge--full {
  background: #520408;
  color: #ffb3b8;
}

.cds--g100 .badge--bundle {
  background: #002d9c;
  color: #a6c8ff;
}

.cds--g100 .badge--child {
  background: #491d8b;
  color: #d4bbff;
}

.cds--g100 .bundle-child-row {
  border-bottom-color: var(--cds-border-subtle-01, #393939);
}

.cds--g100 .badge--draft {
  background: var(--cds-layer-02);
  color: var(--app-text-muted);
}

.cds--g100 .badge--issued {
  background: #002d6d;
  color: #a6c8ff;
}

.cds--g100 .badge--sent {
  background: #491d8b;
  color: #d4bbff;
}

.cds--g100 .badge--paid {
  background: #044317;
  color: #6fdc8c;
}

.cds--g100 .badge--partial {
  background: #4a3c1a;
  color: #fdd835;
}

.cds--g100 .badge--overdue {
  background: #520408;
  color: #ffb3b8;
}

.cds--g100 .badge--cancelled {
  background: var(--cds-layer-02);
  color: var(--app-text-muted);
}

.cds--g100 .badge--storno {
  background: #520408;
  color: #ffb3b8;
}

.cds--g100 .badge--converted {
  background: #38146b;
  color: #d4bbff;
}

.cds--g100 .badge--pj {
  background: #002d6d;
  color: #a6c8ff;
}

.cds--g100 .badge--pf {
  background: #491d8b;
  color: #d4bbff;
}

.cds--g100 .badge--vat {
  background: #044317;
  color: #6fdc8c;
}

.cds--g100 .badge--no-vat {
  background: var(--cds-layer-02);
  color: var(--app-text-muted);
}

.cds--g100 .badge--deleted {
  background: #520408;
  color: #ff8389;
}

/* Toolbar settings popover (column visibility) */
.dt-settings-popover {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: var(--space-3);
  min-width: 200px;
  max-width: calc(100vw - 2rem);
  border-radius: var(--radius-sm, 2px);
}

.dt-settings-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: 0.857rem;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  color: var(--cds-text-primary);
}

.dt-settings-item:hover {
  color: var(--cds-link-primary, #0f62fe);
}

/* Column filter row */
.dt-filter-row cds-table-cell {
  padding: var(--space-2) !important;
  background: var(--cds-layer-01, #f4f4f4);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.dt-filter-input {
  width: 100%;
  height: 2rem;
  padding: 0 var(--space-3);
  font-size: 0.875rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--cds-text-primary);
  background: var(--cds-field-01, #ffffff);
  border: 1px solid var(--cds-border-strong-01, #8d8d8d);
  border-radius: 0;
  outline: none;
  box-sizing: border-box;
}

.dt-filter-input:focus {
  border-color: var(--cds-focus, #0f62fe);
  box-shadow: inset 0 0 0 1px var(--cds-focus, #0f62fe);
}

.dt-filter-input::placeholder {
  color: var(--cds-text-placeholder, #a8a8a8);
}

/* Active filter indicator dot on toolbar button */
.dt-filter-btn--active {
  position: relative !important;
}
.dt-filter-btn--active::after,
.dt-settings-btn--active::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cds-support-info, #0f62fe);
}

/* Active column settings indicator dot on toolbar button */
.dt-settings-btn--active {
  position: relative !important;
}

/* Clickable cell links */
.dt-link {
  color: var(--cds-link-primary, #0f62fe);
  cursor: pointer;
  font-weight: 500;
}

.dt-link:hover {
  text-decoration: underline;
}

/* Action menu (shared across table pages) */
.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu__trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  color: var(--cds-text-primary);
}

.action-menu__trigger:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
  border-radius: var(--radius-sm, 2px);
}

.action-menu__dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 180px;
  padding: var(--space-1) 0;
}

.action-menu__item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: none;
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.857rem;
  text-align: left;
  cursor: pointer;
  transition: background 70ms;
}

.action-menu__item:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.action-menu__item--danger {
  color: var(--cds-support-error, #da1e28);
}

/* Toolbar ghost button icon — match search icon color */
cds-table-toolbar-content cds-button[kind="ghost"] cds-icon {
  color: var(--cds-icon-secondary, #c6c6c6);
  align-self: center;
  height: 16px;

}

/* Animated add icon (scale bounce on hover) */
@keyframes icon-pulse {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

cds-button:hover cds-icon[slot="icon"],
cds-button:hover .btn-add-icon {
  animation: icon-pulse 400ms cubic-bezier(0.4, 0.14, 0.3, 1);
}
/* No pulse on icon-only ghost buttons (toolbar filter, settings, etc.) */
cds-button[kind="ghost"]:hover cds-icon[slot="icon"]:only-child {
  animation: none;
}

/* Clickable table rows */
cds-table-row[data-clickable] {
  cursor: pointer;
}

/* Pagination — lipit de tabel */
cds-pagination {
  margin-top: 0;
}

/* Overdue text */
.text-overdue {
  color: var(--cds-support-error, #da1e28);
  font-weight: 500;
}

/* Filters bar (shared across table pages) */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-md, 4px);
}

.filters-bar .filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filters-bar .filter-group label {
  font-size: 0.785rem;
  font-weight: 500;
  color: var(--app-text-secondary);
}

.filters-bar .filter-group select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--cds-border-strong-01);
  background: var(--cds-field-01);
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.857rem;
  min-width: 140px;
}

.filters-bar .filter-group select:focus {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

@media (max-width: 48rem) {
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-bar .filter-group select {
    min-width: auto;
    width: 100%;
  }
}

/* -----------------------------------------------------------
   24b. Slide Panels, Form Sections, Stat Items
   Reusable components for detail/edit side panels.
   Used across: products, clients, payments pages.
   ----------------------------------------------------------- */

/* ── Slide Panel ──────────────────────────────── */
.slide-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 600px;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  background: var(--cds-layer-01, #ffffff);
  border-left: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  transform: translateX(100%);
  transition: transform 300ms var(--ease-out);
  z-index: 8002;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.slide-panel__content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.slide-panel.is-open {
  transform: translateX(0);
}

.slide-panel--narrow {
  width: 420px;
}

.slide-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  flex-shrink: 0;
}

.slide-panel__header>cds-button:last-child {
  margin-right: calc(-1 * var(--space-6));
}

.slide-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}

/* Match dropdown/multi-select background to text-input field background */
.slide-panel__body cds-dropdown,
.slide-panel__body cds-multi-select {
  --cds-field: var(--cds-field-02, #f4f4f4);
}

.slide-panel__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  flex-shrink: 0;
}

/* Footer variant: full-width buttons flush to edges */
.slide-panel__footer--flush {
  padding: 0;
  gap: 0;
}

.slide-panel__footer--flush>cds-button,
.slide-panel__footer--flush>div>cds-button,
.slide-panel__footer--flush cds-modal-footer-button {
  flex: 1;
}

.slide-panel__footer--flush>div {
  display: flex;
  width: 100%;
}

/* Footer: double-width button (e.g. Save takes 2/4 width) */
.slide-panel__footer--flush>cds-button.flex-2 {
  flex: 2;
}

/* ── Modal footer: buttons side by side ──────── */
cds-modal-footer>div {
  display: flex;
  width: 100%;
}

cds-modal-footer>div>cds-modal-footer-button {
  flex: 1;
}

/* Prevent horizontal scroll inside modal body */
cds-modal-body {
  overflow-x: hidden;
}

/* Overlay backdrop */
.slide-panel-overlay {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 7999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}

.slide-panel-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Input shading inside panels (field-02 background) */
.slide-panel cds-text-input,
.slide-panel cds-textarea,
.slide-panel cds-number-input,
.slide-panel cds-combo-box,
.slide-panel cds-select {
  --cds-field: var(--cds-field-02, #e8e8e8);
}

.cds--g100 .slide-panel cds-text-input,
.cds--g100 .slide-panel cds-textarea,
.cds--g100 .slide-panel cds-number-input,
.cds--g100 .slide-panel cds-combo-box,
.cds--g100 .slide-panel cds-select {
  --cds-field: var(--cds-field-02, #525252);
}

.slide-panel .cds-select-native {
  background: var(--cds-field-02, #e8e8e8);
}

.cds--g100 .slide-panel .cds-select-native {
  background: var(--cds-field-02, #525252);
}

.slide-panel .cds-input-inline {
  background: var(--cds-field-02, #e8e8e8);
}

.cds--g100 .slide-panel .cds-input-inline {
  background: var(--cds-field-02, #525252);
}

/* Overflow menu inside slide panels needs high z-index */
.slide-panel cds-overflow-menu-body {
  z-index: 8100;
}

/* Enrollment timeline bar */
.enrollment-header {
  display: flex;
  align-items: center;
}
.enrollment-header .form-section__title {
  flex: 0 0 50%;
  margin-bottom: 0;
}
.enrollment-timeline {
  flex: 0 0 50%;
  min-width: 0;
}
.enrollment-timeline__bar {
  position: relative;
  height: 8px;
  background: var(--app-text-faint);
}
.enrollment-timeline__segment {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--cds-interactive, #0f62fe);
  cursor: pointer;
  transition: opacity 0.15s;
}
.enrollment-timeline__segment:hover {
  opacity: 0.8;
}

/* Segment tooltip */
.enrollment-timeline__segment .timeline-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--cds-background-inverse, #393939);
  color: var(--cds-text-inverse, #fff);
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.enrollment-timeline__segment:hover .timeline-tooltip {
  display: block;
}

/* Group memberships mini table */
.gm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
}
.gm-table td {
  padding: 5px 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.gm-table tr:nth-child(odd) {
  background: var(--cds-background, #ffffff);
}
.gm-table td:first-child {
  width: 12px;
  padding-right: 0;
}
.gm-table td:last-child {
  text-align: right;
  padding-left: 0;
}
.gm-table__code {
  display: block;
  font-size: 11px;
  color: var(--app-text-secondary, var(--cds-text-secondary));
}
.gm-bullet {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.gm-bullet--active {
  background: var(--cds-support-success, #198038);
}
.gm-bullet--ended {
  background: var(--cds-border-subtle, #c6c6c6);
}
.gm-actions {
  display: inline-flex;
  gap: 2px;
}
.gm-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  color: var(--cds-icon-secondary, #525252);
  cursor: pointer;
  border-radius: 2px;
}
.gm-action-btn:hover {
  background: var(--cds-layer-hover, rgba(0,0,0,.06));
  color: var(--cds-icon-primary, #161616);
}
.gm-action-btn--danger:hover {
  color: var(--cds-support-error, #da1e28);
}

/* ── Price Calculator (Orar panel) ── */
.price-calc {
  padding: var(--space-4);
  background: var(--cds-layer-01, #f4f4f4);
  border-radius: 4px;
  margin-bottom: var(--space-3);
}
.price-calc__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.price-calc__table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--cds-border-subtle, #e0e0e0);
}
.price-calc__label {
  color: var(--cds-text-secondary, #525252);
}
.price-calc__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price-calc__value--discount {
  color: var(--cds-support-error, #da1e28);
}
.price-calc__value--final {
  color: var(--cds-support-success, #198038);
  font-weight: 600;
  font-size: 0.9375rem;
}
.price-calc__discount-row td {
  padding: 4px 0;
}
.price-calc__promo {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--cds-border-subtle, #e0e0e0);
}
.price-calc__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0 0;
}

/* Enrollment price info (Orar panel per-enrollment) */
.enrollment-price-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: 0.8125rem;
  margin-bottom: var(--space-2);
}

/* Form-section spacing inside panels */
.slide-panel .form-section {
  margin-bottom: var(--space-10);
}

.slide-panel .form-section:first-child {
  margin-top: -10px;
}

/* Wide slide panel (template editor) */
.slide-panel--wide {
  width: 860px;
}

/* Responsive: full-width on mobile */
@media (max-width: 48rem) {

  .slide-panel,
  .slide-panel--narrow,
  .slide-panel--wide {
    width: 100%;
  }
}

/* ── Batch Action Bar (US-082) ──────────────────── */

cds-table-toolbar {
  position: relative;
}

.batch-action-bar {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--cds-background-brand);
  color: var(--cds-text-on-color);
}

.batch-action-bar .body-02 {
  color: var(--cds-text-on-color);
}

/* ── Sortable Table Headers ───────────────────────── */

.th-sortable {
  cursor: pointer;
  user-select: none;
}

.th-sort-icon {
  display: inline-block;
  margin-left: var(--space-1);
  font-size: 0.75rem;
  opacity: 0.5;
  vertical-align: middle;
}

.th-sortable:hover .th-sort-icon {
  opacity: 1;
}

/* ── Template Editor (US-301) ───────────────────── */

.template-card__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-card__info {
  flex: 1;
}

.template-card__meta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
}

.template-card__arrow {
  flex-shrink: 0;
  color: var(--app-text-muted, #a8a8a8);
}

.template-readonly-field {
  padding: var(--space-3);
  background: var(--cds-field-01, #f4f4f4);
  border-radius: 4px;
  font-family: var(--cds-code-01-font-family, monospace);
  font-size: 0.875rem;
  word-break: break-word;
}

.template-readonly-field--body {
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.template-editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 48rem) {
  .template-editor-layout {
    grid-template-columns: 1fr;
  }
}

.template-preview-content {
  padding: var(--space-4);
  background: var(--cds-field-01, #f4f4f4);
  border-radius: 4px;
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.template-preview-body {
  line-height: 1.6;
}

.template-placeholders {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── Form Sections ────────────────────────────── */
.form-section {
  margin-bottom: var(--space-6);
}

.form-section__title {
  font-size: var(--space-6);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
}

/* ── Stat Items (key-value pairs) ─────────────── */
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

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

.stat-item__label {
  font-size: 0.857rem;
  color: var(--app-text-secondary);
}

.stat-item__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.928rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--app-text-foreground);
}

/* ── Search Dropdown (autocomplete) ────────────────────────── */
.search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  box-shadow: var(--shadow-elevated);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.search-dropdown__item {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: none;
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.857rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-micro);
}

.search-dropdown__item:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.search-dropdown__empty {
  padding: var(--space-3) var(--space-4);
  font-size: 0.857rem;
  color: var(--app-text-muted);
}

/* ── Contact Preview (read-only card) ─────────────────────── */
.contact-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-preview__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-preview__row .label-01 {
  font-size: 0.75rem;
  color: var(--app-text-muted);
}

.contact-preview__row .body-02 {
  font-size: 0.875rem;
  color: var(--cds-text-primary);
}

.contact-preview__missing {
  font-size: 0.875rem;
  color: var(--cds-text-error, #da1e28);
  font-style: italic;
}

/* ── Add Type Card (PJ/PF selection in create panel) ──────── */
.add-type-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  background: var(--cds-layer-01, #ffffff);
  cursor: pointer;
  transition: background var(--transition-micro), border-color var(--transition-micro);
  width: 100%;
  text-align: left;
}

.add-type-card:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
  border-color: var(--cds-border-strong-01, #8d8d8d);
}

.add-type-card__title {
  font-size: 0.928rem;
  font-weight: 600;
  color: var(--cds-text-primary);
}

.add-type-card__desc {
  font-size: 0.857rem;
  color: var(--app-text-secondary);
  margin-top: 2px;
}

/* ============================================================
   25. Content Components (Gatsby Carbon Theme Recreations)
   Pure CSS/HTML implementations of gatsby-theme-carbon components.
   All classes prefixed with `app-` following project convention.
   ============================================================ */

/* --- Page Header --- */
.app-page-header {
  background-color: #161616;
  color: #ffffff;
  width: 100%;
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: var(--space-7);
}

.app-page-header__inner {
  max-width: 1400px;
  width: 100%;
  padding: 0 var(--space-6) var(--space-7);
}

.app-page-header__title {
  font-size: 2.625rem;
  font-weight: 300;
  line-height: 1.19;
  letter-spacing: 0;
  margin: 0;
  color: inherit;
}

.app-page-header--with-tabs {
  margin-bottom: 0;
}

/* Compact page header for settings/detail pages
   Uses double-class specificity (0,2,0) to override responsive rules (0,1,0)
   Light theme: --cds-background (#f4f4f4) = grey header on white content
   Dark theme:  --cds-layer-01  (#262626) = dark-grey header on #161616 page */
.app-page-header.app-page-header--compact {
  min-height: auto;
  background-color: var(--cds-background);
  color: var(--cds-text-primary);
}

.cds--g100 .app-page-header.app-page-header--compact {
  background-color: var(--cds-layer-01);
}

.app-page-header.app-page-header--compact .app-page-header__inner {
  padding: var(--space-5) var(--space-6) var(--space-3);
}

.app-page-header.app-page-header--compact .app-page-header__title {
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.25;
}

/* Tabs following a compact or with-tabs header inherit the grey background */
.app-page-header--compact+.app-page-tabs,
.app-page-header--with-tabs+.app-page-tabs {
  background-color: var(--cds-background);
  margin-bottom: 0;
}

.cds--g100 .app-page-header--compact+.app-page-tabs,
.cds--g100 .app-page-header--with-tabs+.app-page-tabs {
  background-color: var(--cds-layer-01);
  margin-bottom: 0;
}

/* Form element shading — inputs get grey fill on white backgrounds */
.form-shaded cds-text-input,
.form-shaded cds-textarea,
.form-shaded cds-number-input,
.form-shaded cds-select,
.form-shaded cds-combo-box {
  --cds-field: var(--cds-field-02);
}

/* --- Page Tabs (wraps native <cds-tabs>) --- */
.app-page-tabs {
  background-color: #161616;
  margin-bottom: var(--space-7);
}

.app-page-tabs__inner {
  max-width: 1400px;
  padding: 0 var(--space-6);
}

/* Restore Carbon's native tab font-size so border-bottom underlines are visible.
   The global --cds-body-compact-01-font-size: 1rem (line ~59) prevents iOS zoom on inputs
   but inflates cds-tab height beyond the 40px overflow:hidden boundary, clipping borders. */
cds-tabs {
  --cds-body-compact-01-font-size: 0.875rem;
  --cds-body-compact-01-line-height: 1.28572;
  --cds-body-compact-01-letter-spacing: 0.16px;
}

/* --- Landing-style content: white background, no cards --- */
.app-main:has(.app-content--landing) {
  background-color: var(--cds-layer-01, #ffffff);
}

.app-content--landing {
  background-color: var(--cds-layer-01, #ffffff);
  padding: var(--space-7) var(--space-6);
  min-height: calc(100vh - 10rem);
}

.app-content--landing .component-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0;
}

.app-content--landing .component-card:hover {
  box-shadow: none;
}

/* Section dividers inside landing content */
.app-content--landing .section-heading {
  font-size: 0.857rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--app-text-secondary);
  padding-top: var(--space-7);
  margin-top: var(--space-7);
  margin-bottom: var(--space-5);
  border-top: 1px solid var(--cds-border-subtle-01);
}

.app-content--landing .section-heading--first {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Save action row in landing layout */
.app-content--landing .form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-7);
  padding-top: var(--space-5);
}

/* --- CDS Pagination fix: eliminate double border with table --- */
cds-pagination {
  margin-top: -1px;
}

/* --- Page Title Block --- */
.app-page-title {
  margin-bottom: var(--space-9);
  margin-top: var(--space-7);
}

.app-page-title--with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --- Page Description --- */
.app-page-description {
  margin-bottom: var(--space-8);
}

.app-page-description p {
  margin-bottom: var(--space-2);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--app-text-secondary);
  /* max-width: 40%; */
  margin: 0;
}

/* --- Section Title --- */
.app-section-title {
  display: block;
  font-size: 1.714rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--app-text-foreground);
  margin-top: var(--space-9);
  margin-bottom: var(--space-4);
  padding-top: var(--space-4);
  position: relative;
}

.app-section-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--cds-border-strong-01, #8d8d8d);
}

/* --- Article Card --- */
.app-article-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--cds-layer-01, #f4f4f4);
  transition: background var(--transition-micro);
  height: 100%;
}

.app-article-card:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.app-article-card__img {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--cds-layer-02, #e0e0e0);
}

.app-article-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-article-card__content {
  position: relative;
  padding: var(--space-4);
  padding-right: 25%;
  padding-bottom: var(--space-9);
  min-height: 12rem;
}

.app-article-card__subtitle {
  font-size: 0.857rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--app-text-foreground);
  margin: 0 0 var(--space-1);
}

.app-article-card__title {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.375;
  color: var(--app-text-foreground);
  margin: 0;
}

.app-article-card__info {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--app-text-secondary);
  display: flex;
  gap: var(--space-3);
}

.app-article-card__info span {
  white-space: nowrap;
}

.app-article-card__action {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 20px;
  height: 20px;
  color: var(--app-text-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-article-card__action svg {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

/* Article Card: dark variant */
.app-article-card--dark {
  background: #262626;
}

.app-article-card--dark:hover {
  background: #353535;
}

.app-article-card--dark .app-article-card__subtitle,
.app-article-card--dark .app-article-card__title {
  color: var(--cds-text-inverse, #ffffff);
}

.app-article-card--dark .app-article-card__info {
  color: #c6c6c6;
}

.app-article-card--dark .app-article-card__action {
  color: var(--cds-text-inverse, #ffffff);
}

/* Article Card: disabled variant */
.app-article-card--disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.app-article-card--disabled .app-article-card__title,
.app-article-card--disabled .app-article-card__subtitle {
  color: var(--app-text-muted);
}

.app-article-card--disabled .app-article-card__info {
  color: var(--app-text-muted);
}

.app-article-card--disabled .app-article-card__action {
  color: var(--app-text-muted);
}

.app-article-card--disabled .app-article-card__img {
  filter: grayscale(100%);
  opacity: 0.5;
}

/* --- Resource Card --- */
.app-resource-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--cds-layer-01, #f4f4f4);
  position: relative;
  transition: background var(--transition-micro);
  padding: var(--space-4);
  padding-right: 25%;
  aspect-ratio: 1.5 / 1;
}

.app-resource-card:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.app-resource-card__subtitle {
  font-size: 0.857rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--app-text-foreground);
  margin: 0 0 var(--space-1);
}

.app-resource-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--app-text-foreground);
  margin: 0;
}

.app-resource-card__icon {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  width: 32px;
  height: 32px;
}

.app-resource-card__icon img {
  width: 100%;
  height: 100%;
}

.app-resource-card__action {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 20px;
  height: 20px;
  color: var(--app-text-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-resource-card__action svg {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

/* Resource Card: aspect ratio variants */
.app-resource-card--1x1 {
  aspect-ratio: 1 / 1;
}

.app-resource-card--16x9 {
  aspect-ratio: 16 / 9;
}

.app-resource-card--4x3 {
  aspect-ratio: 4 / 3;
}

/* Resource Card: dark variant */
.app-resource-card--dark {
  background: #262626;
  color: var(--cds-text-inverse, #ffffff);
}

.app-resource-card--dark:hover {
  background: #353535;
}

.app-resource-card--dark .app-resource-card__subtitle,
.app-resource-card--dark .app-resource-card__title {
  color: var(--cds-text-inverse, #ffffff);
}

.app-resource-card--dark .app-resource-card__action {
  color: var(--cds-text-inverse, #ffffff);
}

/* Resource Card: disabled variant */
.app-resource-card--disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.app-resource-card--disabled .app-resource-card__title,
.app-resource-card--disabled .app-resource-card__subtitle {
  color: var(--app-text-muted);
}

.app-resource-card--disabled .app-resource-card__action {
  color: var(--app-text-muted);
}

/* --- Feature Card --- */
.app-feature-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--cds-layer-01, #f4f4f4);
  transition: background var(--transition-micro);
}

.app-feature-card:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.app-feature-card__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cds-layer-02, #e0e0e0);
}

.app-feature-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-feature-card__content {
  position: relative;
  padding: var(--space-4);
  padding-right: 25%;
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.app-feature-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--app-text-foreground);
  margin: 0;
}

.app-feature-card__action {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 20px;
  height: 20px;
  color: var(--app-text-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-feature-card__action svg {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

@media (min-width: 42rem) {
  .app-feature-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .app-feature-card__img {
    aspect-ratio: auto;
    height: 100%;
  }
}

/* --- Aside --- */
.app-aside {
  display: none;
  position: relative;
  padding-top: var(--space-4);
  font-size: 0.928rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--app-text-secondary);
}

.app-aside::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 1px;
  background: var(--cds-border-strong-01, #8d8d8d);
}

.app-aside--no-rule::before {
  content: none;
}

.app-aside--always-visible {
  display: block;
}

.app-aside p {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0 0 var(--space-3);
}

@media (min-width: 42rem) {
  .app-aside {
    display: block;
  }
}

/* --- Anchor Links --- */
.app-anchor-links {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-7);
}

.app-anchor-links li {
  margin-bottom: var(--space-2);
}

.app-anchor-link {
  display: inline-block;
  position: relative;
  padding-left: var(--space-6);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.4;
  text-decoration: none;
  color: var(--app-text-foreground);
  transition: color var(--transition-micro);
}

.app-anchor-link::before {
  content: '\21B3';
  position: absolute;
  left: 0;
}

.app-anchor-link:hover {
  color: var(--cds-link-primary, #0f62fe);
}

/* Anchor Links: small variant */
.app-anchor-links--small .app-anchor-link {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Anchor Links: multi-column layout */
.app-anchor-links--multi-column {
  column-count: 1;
}

@media (min-width: 42rem) {
  .app-anchor-links--multi-column {
    column-count: 2;
    max-width: 66.667%;
  }
}

/* --- GIF Player --- */
.app-gif-player {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: var(--space-6);
}

.app-gif-player img,
.app-gif-player video {
  display: block;
  width: 100%;
}

.app-gif-player__toggle {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  padding: 0;
  transition: background var(--transition-micro);
}

.app-gif-player__toggle:hover {
  background: rgba(0, 0, 0, 0.9);
}

.app-gif-player__toggle:focus {
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: 2px;
}

.app-gif-player__toggle svg {
  fill: currentColor;
  width: 16px;
  height: 16px;
}

.app-gif-player__toggle--light {
  background: rgba(255, 255, 255, 0.7);
  color: #161616;
}

.app-gif-player__toggle--light:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* --- Video Player --- */
.app-video-player {
  position: relative;
  width: 100%;
  margin-bottom: var(--space-6);
  overflow: hidden;
  border: 1px solid var(--cds-border-subtle);
  border-radius: var(--radius-md);
  background: var(--cds-layer-01);
}

.app-video-player video {
  width: 100%;
  display: block;
}

.app-video-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Image Gallery --- */
.app-image-gallery {
  display: grid;
  gap: 1px;
  margin-bottom: var(--space-7);
}

.app-image-gallery--4 {
  grid-template-columns: repeat(4, 1fr);
}

.app-image-gallery--3 {
  grid-template-columns: repeat(3, 1fr);
}

.app-image-gallery__item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--cds-layer-02, #e0e0e0);
}

.app-image-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.app-image-gallery__item:hover img {
  transform: scale(1.05);
}

/* --- Lightbox --- */
.app-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-lightbox__image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.app-lightbox__close,
.app-lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: var(--space-4);
  font-size: 1.5rem;
  opacity: 0.7;
  transition: opacity var(--transition-micro);
}

.app-lightbox__close:hover,
.app-lightbox__nav:hover {
  opacity: 1;
}

.app-lightbox__close:focus,
.app-lightbox__nav:focus {
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: 2px;
}

.app-lightbox__close {
  top: var(--space-2);
  right: var(--space-2);
}

.app-lightbox__nav--prev {
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
}

.app-lightbox__nav--next {
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
}

.app-lightbox__counter {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.857rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.app-lightbox__title {
  position: absolute;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 400;
  white-space: nowrap;
}

/* --- Card Group Layouts --- */
.app-card-group {
  display: grid;
  gap: 1px;
  margin-bottom: var(--space-7);
}

.app-card-group.gap-1 {
  gap: var(--space-1);
}

.app-card-group.gap-2 {
  gap: var(--space-2);
}

.app-card-group.gap-3 {
  gap: var(--space-3);
}

.app-card-group.gap-4 {
  gap: var(--space-4);
}

.app-card-group.gap-5 {
  gap: var(--space-5);
}

.app-card-group.gap-6 {
  gap: var(--space-6);
}

.app-card-group.gap-8 {
  gap: var(--space-8);
}

.app-card-group--2 {
  grid-template-columns: 1fr 1fr;
}

.app-card-group--3 {
  grid-template-columns: repeat(3, 1fr);
}

.app-card-group--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 41.98rem) {

  .app-card-group--2,
  .app-card-group--3,
  .app-card-group--4 {
    grid-template-columns: 1fr;
  }

  .app-image-gallery--4,
  .app-image-gallery--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 42rem) and (max-width: 65.98rem) {

  .app-card-group--3,
  .app-card-group--4 {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Content Components: Responsive --- */
@media (max-width: 41.98rem) {
  .app-page-header {
    min-height: 12rem;
  }

  .app-page-header__title {
    font-size: 2rem;
  }

  .app-page-description p {
    max-width: 100%;
  }
}

@media (min-width: 42rem) and (max-width: 65.98rem) {
  .app-page-header {
    min-height: 16rem;
  }

  .app-page-header__title {
    font-size: 2.25rem;
  }
}

/* --- Content Components: Dark Theme Overrides --- */
.cds--g100 .app-article-card--dark {
  background: #525252;
}

.cds--g100 .app-article-card--dark:hover {
  background: #6f6f6f;
}

.cds--g100 .app-resource-card--dark {
  background: #525252;
}

.cds--g100 .app-resource-card--dark:hover {
  background: #6f6f6f;
}

/* ═══════════════════════════════════════════════════════════
   INVOICE FORM V2 — A4-style canvas layout
   ═══════════════════════════════════════════════════════════ */

/* ── Canvas Wrapper (full page, centered) ──────────────── */
.invoice-canvas-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-10);
  min-height: 100vh;
}

/* ── A4 Card ───────────────────────────────────────────── */
.invoice-canvas {
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-lg, 8px);
  padding: var(--space-7);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  min-height: 600px;
  position: relative;
}

/* ── Two-column grid (50/50) ───────────────────────────── */
.invoice-header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

/* ── Serie + Data emitere grid (1fr fixed) ──────────── */
.invoice-serie-date-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: var(--space-4);
  align-items: start;
}

.invoice-serie-date-grid cds-combo-box {
  display: block;
}

/* Align date picker label with combo-box label (combo has ~5.5px internal top padding) */
.invoice-serie-date-grid> :last-child {
  padding-top: 6px;
}

/* ── Form field shading (field-02 for contrast on white canvas) ── */
.invoice-canvas cds-text-input,
.invoice-canvas cds-textarea,
.invoice-canvas cds-number-input,
.invoice-canvas cds-select,
.invoice-canvas cds-combo-box,
.invoice-canvas cds-date-picker-input {
  --cds-field: var(--cds-field-02, #e8e8e8);
}

.cds--g100 .invoice-canvas cds-text-input,
.cds--g100 .invoice-canvas cds-textarea,
.cds--g100 .invoice-canvas cds-number-input,
.cds--g100 .invoice-canvas cds-select,
.cds--g100 .invoice-canvas cds-combo-box,
.cds--g100 .invoice-canvas cds-date-picker-input {
  --cds-field: var(--cds-field-02, #525252);
}

/* ── Logo Upload Area ──────────────────────────────────── */
.invoice-logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 2px dashed var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-md, 4px);
  cursor: pointer;
  transition: border-color 200ms, background-color 200ms;
  padding: var(--space-5);
}

.invoice-logo-area:hover {
  border-color: var(--cds-border-strong-01, #8d8d8d);
  background: var(--cds-layer-hover-01, rgba(0, 0, 0, 0.03));
}

.invoice-logo-area--has-image {
  border-style: solid;
  border-color: var(--cds-border-subtle-01, #e0e0e0);
}

.invoice-logo-area--has-image:hover {
  border-color: var(--cds-link-primary, #0f62fe);
}

/* ── Entity Data (read-only display, uniform color) ───────── */
.invoice-entity-data {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--cds-text-primary);
}

.invoice-entity-name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-2);
}

.invoice-entity-line,
.invoice-entity-name {
  /* margin-bottom: var(--space-1); */
  font-family: "IBM Plex Mono", sans-serif;
}

/* ── Edit links (muted small text under entity data) ──────── */
.invoice-edit-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 0.75rem;
  color: var(--app-text-muted);
  cursor: pointer;
}

.invoice-edit-link:hover {
  color: var(--cds-text-primary);
  text-decoration: underline;
}

/* ── Invoice Lines (grid-based table) ──────────────────── */
.invoice-lines {
  padding-top: var(--space-4);
}

/* ── Lines table header (Blue 30 background, no borders) ── */
.invoice-lines-header {
  display: grid;
  grid-template-columns: 1fr 150px 80px 100px 100px 48px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #a6c8ff;
  /* Carbon Blue 30 */
  border-radius: var(--radius-md, 4px) var(--radius-md, 4px) 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32px;
  color: var(--cds-text-primary, #161616);
}

.cds--g100 .invoice-lines-header {
  background: #002d9c;
  /* Carbon Blue 80 for dark theme */
  color: var(--cds-text-on-color, #ffffff);
}

/* ── Saved line rows (static text, read-only display) ───── */
.invoice-line-row {
  display: grid;
  grid-template-columns: 1fr 150px 80px 100px 100px 48px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  align-items: center;
}

.invoice-line-row--saved {
  min-height: 48px;
  align-items: start;
}

/* ── Add-form row (form controls, always at bottom) ──────── */
.invoice-line-row--add-form {
  align-items: start;
  border-bottom: none;
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  background: var(--cds-layer-02, #f4f4f4);
  border-radius: 0 0 var(--radius-md, 4px) var(--radius-md, 4px);
}

.invoice-line-cell--total {
  text-align: right;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
}

.invoice-line-cell--actions {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Product cell multi-line display ───────────────────────── */
.invoice-line-cell--product {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.invoice-line-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--app-text-muted);
}

.invoice-line-product-description {
  display: block;
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin-top: var(--space-1);
}

/* ── Overflow menu positioning (desktop only) ──────────────── */
@media (min-width: 48.01rem) {
  .invoice-line-cell--actions {
    margin-right: -25px;
  }
}

/* ── Compact inputs for add-form row ─────────────────────── */
.invoice-line-number {
  width: 100%;
  height: 2.5rem;
  padding: 0 var(--space-3);
  border: none;
  border-bottom: 1px solid var(--cds-border-strong-01, #8d8d8d);
  background: var(--cds-field-02, #e8e8e8);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.875rem;
  color: var(--cds-text-primary);
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.invoice-line-number::-webkit-inner-spin-button,
.invoice-line-number::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.invoice-line-number:focus {
  border-bottom: 2px solid var(--cds-focus, #0f62fe);
}

.cds--g100 .invoice-line-number {
  background: var(--cds-field-02, #525252);
}

.invoice-line-text {
  width: 100%;
  height: 2.5rem;
  padding: 0 var(--space-3);
  border: none;
  border-bottom: 1px solid var(--cds-border-strong-01, #8d8d8d);
  background: var(--cds-field-02, #e8e8e8);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.875rem;
  color: var(--cds-text-primary);
  outline: none;
}

.invoice-line-text:focus {
  border-bottom: 2px solid var(--cds-focus, #0f62fe);
}

.cds--g100 .invoice-line-text {
  background: var(--cds-field-02, #525252);
}

/* ── Add button in form row ──────────────────────────────── */
.invoice-line-cell--add-btn {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: var(--space-1);
}

/* ── Mobile card view for saved lines (structured-list) ── */
.invoice-line-card {
  display: none;
}

.invoice-line-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  position: relative;
}

.invoice-line-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cds-text-primary);
}

/* Tighter padding on structured-list cells inside line cards */
.invoice-line-card cds-structured-list-cell {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

/* ── Action Buttons (below canvas, right-aligned set) ──── */
.invoice-actions {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  margin-top: var(--space-5);
}

.invoice-actions__set {
  display: flex;
  gap: 1px;
}

/* ── Invoice Footer (totals + mentions) ───────────────── */
.invoice-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.invoice-totals {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--cds-layer-01, #f4f4f4);
  border-radius: var(--radius-md, 4px);
}

.invoice-totals__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  color: var(--cds-text-primary);
}

.invoice-totals__row--grand {
  font-weight: 700;
  font-size: var(--space-6);
}

.invoice-totals__divider {
  border-top: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

/* ── Slide panels: full height on no-header pages ──────── */
.invoice-canvas-wrapper .slide-panel {
  top: 0;
  height: 100vh;
  height: 100dvh;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 48rem) {
  .invoice-canvas-wrapper {
    padding: var(--space-3);
  }

  .invoice-canvas {
    padding: var(--space-5);
  }

  .invoice-header-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .invoice-serie-date-grid {
    grid-template-columns: 1fr;
  }

  .invoice-actions {
    flex-direction: column;
    gap: var(--space-3);
  }

  .invoice-actions__set {
    width: 100%;
  }

  .invoice-actions__set cds-button {
    flex: 1;
  }

  .invoice-actions>cds-button:first-child {
    width: 100%;
  }

  /* Lines: hide desktop grid header on mobile */
  .invoice-lines-header {
    display: none;
  }

  /* Hide grid-based saved rows on mobile (replaced by structured-list cards) */
  .invoice-line-row--saved {
    display: none !important;
  }

  /* Show structured-list cards on mobile */
  .invoice-line-card {
    display: block;
    border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
    border-radius: var(--radius-md, 4px);
    margin-bottom: var(--space-3);
    background: var(--cds-layer-01, #ffffff);
  }

  /* Add-form row: 2-col grid on mobile */
  .invoice-line-row--add-form,
  .invoice-line-row--add-form.invoice-line-row--with-vat {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
  }

  .invoice-line-cell--product {
    grid-column: 1 / -1;
  }

  .invoice-line-cell--add-btn {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .invoice-line-cell--add-btn cds-button {
    width: 100%;
  }

  /* Show data-label on mobile (add-form row only now) */
  .invoice-line-row--add-form .invoice-line-cell[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    color: var(--app-text-muted, #6f6f6f);
    margin-bottom: var(--space-1);
  }

  .invoice-footer-grid {
    grid-template-columns: 1fr;
  }

  .invoice-totals {
    order: -1;
  }
}

/* ── Dark theme overrides ──────────────────────────────── */
.cds--g100 .invoice-canvas {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cds--g100 .invoice-logo-area:hover {
  background: var(--cds-layer-hover-01, rgba(255, 255, 255, 0.05));
}

.cds--g100 .invoice-totals {
  background: var(--cds-layer-02, #393939);
}

/* ============================================================
   Invoice View / Preview Page (US-029)
   ============================================================ */

/* ── Layout: 2-column grid ──────────────────────────────── */
.invoice-view {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  align-items: start;
}

.invoice-view__preview {
  min-width: 0;
}

.invoice-view__sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

/* ── Preview card (A4-like) ─────────────────────────────── */
.invoice-preview-card {
  position: relative;
  background: var(--cds-layer-01, #fff);
  border: 1px solid var(--cds-border-subtle-01);
  box-shadow: var(--shadow-elevated);
  max-width: 800px;
  padding: var(--space-7);
  overflow: hidden;
}

/* ── Watermarks ─────────────────────────────────────────── */
.invoice-preview-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 5rem;
  font-weight: 700;
  color: rgba(218, 30, 40, 0.12);
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
  letter-spacing: 0.1em;
}

.invoice-preview-watermark--converted {
  color: rgba(0, 100, 200, 0.12);
}

/* ── Preview header: logo + doc number ──────────────────── */
.invoice-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 2px solid var(--cds-border-subtle-01);
}

.invoice-preview-header__left {
  flex-shrink: 0;
}

.invoice-preview-logo {
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}

.invoice-preview-logo-placeholder {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cds-layer-02, #e0e0e0);
  color: var(--cds-text-secondary);
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.invoice-preview-header__right {
  text-align: right;
}

.invoice-preview-doc-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  line-height: 1.2;
}

.invoice-preview-doc-type {
  font-size: 0.875rem;
  color: var(--cds-text-secondary);
  margin-top: var(--space-1);
}

.invoice-preview-draft-badge {
  display: inline-block;
  background: var(--cds-background-inverse, #393939);
  color: var(--cds-text-inverse, #fff);
  padding: 1px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-left: var(--space-2);
  vertical-align: middle;
}

/* ── Parties: Emitent + Client ──────────────────────────── */
.invoice-preview-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
}

.invoice-preview-party__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cds-text-secondary);
  margin-bottom: var(--space-2);
}

.invoice-preview-party__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  margin-bottom: var(--space-1);
}

.invoice-preview-party__detail {
  font-size: 0.8125rem;
  color: var(--cds-text-secondary);
  line-height: 1.6;
}

/* ── Dates row ──────────────────────────────────────────── */
.invoice-preview-dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-5);
  border-top: 1px solid var(--cds-border-subtle-01);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  font-size: 0.8125rem;
  color: var(--cds-text-secondary);
}

.invoice-preview-dates__label {
  font-weight: 600;
  color: var(--cds-text-primary);
}

/* ── Lines table ────────────────────────────────────────── */
.invoice-preview-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-5);
}

.invoice-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.invoice-preview-table thead {
  background: var(--cds-layer-02, #e0e0e0);
}

.invoice-preview-table th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--cds-text-primary);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invoice-preview-table td {
  padding: var(--space-2) var(--space-3);
  color: var(--cds-text-primary);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  vertical-align: top;
}

.invoice-preview-table .col-nr {
  width: 40px;
  text-align: center;
}

.invoice-preview-table .col-desc {
  min-width: 200px;
}

.invoice-preview-table .col-um {
  width: 60px;
  text-align: center;
}

.invoice-preview-table .col-qty {
  width: 60px;
  text-align: right;
}

.invoice-preview-table .col-price {
  width: 100px;
  text-align: right;
}

.invoice-preview-table .col-vat {
  width: 60px;
  text-align: right;
}

.invoice-preview-table .col-total {
  width: 100px;
  text-align: right;
  font-weight: 600;
}

/* ── Totals ─────────────────────────────────────────────── */
.invoice-preview-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: var(--space-5);
}

.invoice-preview-totals__row {
  display: flex;
  justify-content: space-between;
  width: 280px;
  max-width: 100%;
  padding: var(--space-1) 0;
  font-size: 0.875rem;
  color: var(--cds-text-secondary);
}

.invoice-preview-totals__row--total {
  border-top: 2px solid var(--cds-border-strong-01, #8d8d8d);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--cds-text-primary);
}

/* ── Footer: mentions + bank ────────────────────────────── */
.invoice-preview-footer {
  border-top: 1px solid var(--cds-border-subtle-01);
  padding-top: var(--space-4);
}

.invoice-preview-mentions,
.invoice-preview-bank {
  font-size: 0.8125rem;
  color: var(--cds-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-2);
}

.invoice-preview-mentions__label,
.invoice-preview-bank__label {
  font-weight: 600;
  color: var(--cds-text-primary);
}

/* ── Sidebar card ───────────────────────────────────────── */
.invoice-sidebar-card {
  background: var(--cds-layer-01, #fff);
  border: 1px solid var(--cds-border-subtle-01);
  box-shadow: var(--shadow-card);
}

.invoice-sidebar-section {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.invoice-sidebar-section:last-child {
  border-bottom: none;
}

.invoice-sidebar-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cds-text-secondary);
  margin: 0 0 var(--space-3) 0;
}

/* Status line */
.invoice-sidebar-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.invoice-sidebar-doc-type {
  font-size: 0.875rem;
  color: var(--cds-text-secondary);
}

/* Actions */
.invoice-sidebar-actions__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Links */
.invoice-sidebar-link {
  font-size: 0.875rem;
}

.invoice-sidebar-link a {
  color: var(--cds-link-primary, #0f62fe);
  text-decoration: none;
}

.invoice-sidebar-link a:hover {
  text-decoration: underline;
}

/* Details list */
.invoice-sidebar-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.invoice-sidebar-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.invoice-sidebar-detail__label {
  color: var(--cds-text-secondary);
  flex-shrink: 0;
  margin-right: var(--space-2);
}

/* ── History timeline ───────────────────────────────────── */
.invoice-history {
  display: flex;
  flex-direction: column;
}

.invoice-history__item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  position: relative;
}

.invoice-history__item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: calc(var(--space-2) + 12px);
  bottom: calc(-1 * var(--space-2));
  width: 1px;
  background: var(--cds-border-subtle-01);
}

.invoice-history__dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-radius: 50%;
  background: var(--cds-border-strong-01, #8d8d8d);
  margin-top: 3px;
}

.invoice-history__content {
  flex: 1;
  min-width: 0;
}

.invoice-history__action {
  font-size: 0.8125rem;
  color: var(--cds-text-primary);
  display: block;
  line-height: 1.4;
}

.invoice-history__meta {
  font-size: 0.6875rem;
  color: var(--cds-text-secondary);
  display: flex;
  gap: var(--space-2);
  margin-top: 2px;
}

/* ── Mobile responsive ──────────────────────────────────── */
@media (max-width: 767px) {
  .invoice-view {
    grid-template-columns: 1fr;
  }

  .invoice-view__sidebar {
    position: static;
  }

  .invoice-preview-card {
    padding: var(--space-5);
  }

  .invoice-preview-header {
    flex-direction: column;
    gap: var(--space-3);
  }

  .invoice-preview-header__right {
    text-align: left;
  }

  .invoice-preview-parties {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .invoice-preview-doc-number {
    font-size: 1.25rem;
  }
}

/* ── Dark theme overrides for preview ───────────────────── */
.cds--g100 .invoice-preview-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cds--g100 .invoice-sidebar-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cds--g100 .invoice-preview-watermark {
  color: rgba(218, 30, 40, 0.2);
}

.cds--g100 .invoice-preview-watermark--converted {
  color: rgba(0, 100, 200, 0.2);
}

/* -----------------------------------------------------------
   24. Atomic Utility Classes (new 1:1 scale)
   Only classes that DON'T conflict with existing Section 21.
   Full set lives in _work/demo/main.html for reference.
   ----------------------------------------------------------- */

/* Display */
.d-none {
  display: none;
}

.d-grid {
  display: grid;
}

/* Flex alignment (atomic — use WITH .d-flex) */
.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* Gap — missing values only (gap-1 through gap-4 and gap-6 exist) */
.gap-5 {
  gap: var(--space-5);
}

.gap-8 {
  gap: var(--space-8);
}

/* Margin — only values that DON'T exist yet */
.mt-3 {
  margin-top: var(--space-3);
}

.mb-1 {
  margin-bottom: var(--space-1);
}

.mr-2 {
  margin-right: var(--space-2);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Padding — missing values */
.pb-3 {
  padding-bottom: var(--space-3);
}

.py-9 {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}

/* Font weight */
.fw-600 {
  font-weight: 600;
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}

/* Cursor */
.cursor-pointer {
  cursor: pointer;
}

/* Border (atomic) */
.border {
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.rounded-md {
  border-radius: var(--radius-md);
}

/* Background */
.bg-background {
  background-color: var(--cds-background, #f4f4f4);
}

.bg-layer-01 {
  background-color: var(--cds-layer-01, #f4f4f4);
}

/* Color overrides — duplicated here so they win over component defaults (e.g. .app-page-header) */
.text-primary {
  color: var(--app-text-foreground);
}

.text-secondary {
  color: var(--app-text-secondary);
}

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


/* -----------------------------------------------------------
   25. Upload Box Component (settings/company branding)
   ----------------------------------------------------------- */

.upload-box {
  width: 120px;
  height: 120px;
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cds-layer-01);
  cursor: pointer;
  overflow: hidden;
}

.upload-box__preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Settings Company — two-column layout */
.settings-company-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-9);
  align-items: start;
}

@media (max-width: 55rem) {
  .settings-company-grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------
   Toolbar inline select (compact, for filters in CDS toolbar)
   ----------------------------------------------------------- */

.cds-select-native--toolbar {
  width: auto;
  min-width: 120px;
  padding: 0 var(--space-2);
  border: none;
  border-bottom: 1px solid var(--cds-border-strong-01);
  background: transparent;
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  height: 100%;
  cursor: pointer;
}

.cds-select-native--toolbar:focus {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

/* -----------------------------------------------------------
   Tooltip for student count popover (CRM contacts)
   ----------------------------------------------------------- */

.dt-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--cds-background-inverse);
  color: var(--cds-text-inverse);
  padding: var(--space-2) var(--space-3);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 300px;
  pointer-events: none;
  white-space: nowrap;
}

.dt-popover-trigger {
  cursor: default;
  border-bottom: 1px dotted var(--cds-text-secondary);
}

/* -----------------------------------------------------------
   Icon Buttons (table actions)
   ----------------------------------------------------------- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--cds-text-primary);
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  transition: background 70ms;
}

.btn-icon:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.btn-icon--sm {
  width: 28px;
  height: 28px;
}

.btn-icon--danger {
  color: var(--cds-support-error, #da1e28);
}

.btn-icon--danger:hover {
  background: rgba(218, 30, 40, 0.1);
}

/* -----------------------------------------------------------
   Back Link
   ----------------------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--cds-link-primary, #0f62fe);
  text-decoration: none;
  font-size: 0.928rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link svg {
  flex-shrink: 0;
}

/* -----------------------------------------------------------
   Attendance Marking (US-311)
   ----------------------------------------------------------- */

/* Stats bar */
.attendance-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* Attendance page header: title left, stats right */
.att-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
.att-page-header__title { flex: 1; min-width: 0; }
.att-page-header .attendance-stats {
  flex-shrink: 0;
  padding-top: var(--space-2);
}
@media (max-width: 671px) {
  .att-page-header { flex-direction: column; }
}

/* Concurrent sessions banner */
.att-concurrent-banner__body {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--cds-background-inverse, #e5f6ff);
  background: #d0e2ff;
  border-left: 3px solid var(--cds-support-info, #0043ce);
}
.att-concurrent-banner__icon {
  flex-shrink: 0;
  color: var(--cds-support-info, #0043ce);
  padding-top: 2px;
}
.att-concurrent-banner__content { flex: 1; min-width: 0; }
.att-concurrent-banner__title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--cds-text-primary);
}
.att-concurrent-banner__action {
  flex-shrink: 0;
  align-self: center;
}
.att-concurrent-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.att-concurrent-link {
  color: var(--cds-link-primary);
  text-decoration: none;
  font-weight: 600;
}
.att-concurrent-link:hover {
  text-decoration: underline;
}
@media (max-width: 671px) {
  .att-concurrent-banner__body { flex-direction: column; }
  .att-concurrent-banner__action { align-self: flex-start; }
}

/* Toolbar */
.attendance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  justify-content: space-between;
}

.attendance-toolbar cds-text-input {
  flex: 1;
  max-width: 320px;
}

/* Student list */
.attendance-list {
  display: flex;
  flex-direction: column;
}

.attendance-row {
  border-bottom: 1px solid var(--cds-border-subtle-01);
  padding: var(--space-3) 0;
}

.attendance-row:first-child {
  border-top: 1px solid var(--cds-border-subtle-01);
}

.attendance-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 40px;
}

.attendance-row__student {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.attendance-row__student .att-student-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendance-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* Status toggle buttons */
.att-status-btn {
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--cds-border-strong-01);
  background: transparent;
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.929rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: background 70ms, color 70ms, border-color 70ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.att-status-btn:hover:not(:disabled) {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.att-status-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Active states — semantic colors */
.att-status-btn--active.att-status-btn--present {
  background: var(--cds-support-success, #198038);
  color: #fff;
  border-color: var(--cds-support-success, #198038);
}

.att-status-btn--active.att-status-btn--absent {
  background: var(--cds-support-error, #da1e28);
  color: #fff;
  border-color: var(--cds-support-error, #da1e28);
}

.att-status-btn--active.att-status-btn--late {
  background: var(--cds-support-warning, #f1c21b);
  color: #161616;
  border-color: var(--cds-support-warning, #f1c21b);
}

.att-status-btn--active.att-status-btn--excused {
  background: var(--cds-layer-accent-01, #e0e0e0);
  color: var(--cds-text-primary);
  border-color: var(--cds-layer-accent-01, #e0e0e0);
}

/* Button group layout */
.att-status-group {
  display: inline-flex;
}

.att-status-group .att-status-btn {
  border-radius: 0;
  margin-left: -1px;
}

.att-status-group > .att-status-btn:first-of-type,
.att-status-group .att-status-btn--present {
  border-radius: 4px 0 0 4px;
  margin-left: 0;
}

.att-status-group > .att-status-btn:last-of-type,
.att-status-group .att-status-btn--excused {
  border-radius: 0 4px 4px 0;
}

.att-status-group .att-status-btn--active {
  position: relative;
  z-index: 1;
}

/* Refresh icon button */
.att-refresh-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--cds-icon-secondary, #525252);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 70ms, color 70ms;
}

.att-refresh-btn:hover:not(:disabled) {
  background: var(--cds-layer-hover-01, #e8e8e8);
  color: var(--cds-icon-primary, #161616);
}

.att-refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Notes toggle button */
.att-notes-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--app-text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 70ms;
}

.att-notes-btn:hover {
  color: var(--cds-text-primary);
}

.att-notes-btn--has-note {
  color: var(--cds-link-primary, #0f62fe);
}

/* Notes expanded area */
.attendance-row__notes {
  padding: var(--space-3) 0 var(--space-2) 0;
}

/* ─── Check-in / Check-out (US-313) ─── */

/* Check-in cell */
.att-checkin-cell,
.att-checkout-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 90px;
}

/* Check-in / Check-out buttons */
.att-checkin-btn,
.att-checkout-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 4px;
  background: transparent;
  color: var(--cds-text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.att-checkin-btn:hover:not(:disabled),
.att-checkout-btn:hover:not(:disabled) {
  background: var(--cds-layer-hover-01, #e8e8e8);
  border-color: var(--cds-border-strong-01);
}

.att-checkin-btn:disabled,
.att-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.att-checkin-btn svg,
.att-checkout-btn svg {
  flex-shrink: 0;
}

/* Time display (after check-in/out) */
.att-time-display {
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 3px;
}

.att-time-display--success {
  color: var(--cds-support-success, #24a148);
  background: rgba(36, 161, 72, 0.1);
}

.att-time-display--info {
  color: var(--cds-support-info, #4589ff);
  background: rgba(69, 137, 255, 0.1);
}

.att-time-display--disabled {
  color: var(--app-text-muted);
}

/* Check-in/out done containers */
.att-checkin-done,
.att-checkout-done {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  position: relative;
}

/* Pickup label */
.att-pickup-label {
  font-size: 0.6875rem;
  color: var(--app-text-secondary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-pickup-warning {
  color: var(--cds-support-warning, #f1c21b);
}

.att-pickup-warning::before {
  content: "\26A0\FE0F ";
}

/* Undo button */
.att-undo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--app-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.att-undo-btn:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
  color: var(--cds-text-primary);
}

/* Pickup dropdown */
.att-pickup-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  min-width: 260px;
  max-width: 340px;
  background: var(--cds-layer-01, #f4f4f4);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-top: 4px;
}

.att-pickup-dropdown__header {
  padding: var(--space-2) var(--space-3);
  color: var(--app-text-secondary);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  font-weight: 600;
}

.att-pickup-dropdown__item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--cds-text-primary);
  transition: background 0.15s;
}

.att-pickup-dropdown__item:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.att-pickup-dropdown__item--other {
  color: var(--cds-link-primary, #0f62fe);
  font-style: italic;
}

.att-pickup-dropdown__empty {
  padding: var(--space-2) var(--space-3);
}

.att-pickup-dropdown__divider {
  border-top: 1px solid var(--cds-border-subtle-01);
}

.att-pickup-dropdown__other {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  align-items: center;
}

.att-pickup-other-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--cds-border-strong-01);
  border-radius: 2px;
  background: var(--cds-field-01, #ffffff);
  color: var(--cds-text-primary);
  font-size: 0.8125rem;
}

.att-pickup-other-input:focus {
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: -2px;
}

.att-pickup-other-submit {
  padding: 4px 12px;
  border: none;
  border-radius: 2px;
  background: var(--cds-button-primary, #0f62fe);
  color: #ffffff;
  font-size: 0.8125rem;
  cursor: pointer;
}

.att-pickup-other-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 41.98rem) {
  .attendance-row__main {
    flex-direction: column;
    align-items: flex-start;
  }

  .attendance-row__actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .att-status-group {
    display: flex;
    width: 100%;
  }

  .att-status-group .att-status-btn {
    flex: 1;
    min-width: 0;
    padding: 0 var(--space-2);
    font-size: 0.8125rem;
    min-height: 36px;
    height: 36px;
  }

  .attendance-toolbar {
    flex-direction: column;
  }

  .attendance-toolbar cds-text-input {
    max-width: 100%;
    width: 100%;
  }

  .att-checkin-cell,
  .att-checkout-cell {
    min-width: auto;
  }

  .att-pickup-dropdown {
    right: auto;
    left: 0;
    min-width: 240px;
  }

  .att-pickup-label {
    max-width: 120px;
  }
}

/* Dark mode adjustments */
.cds--g100 .att-status-btn--active.att-status-btn--late {
  color: #161616;
}

.cds--g100 .att-pickup-dropdown {
  background: var(--cds-layer-01, #262626);
  border-color: var(--cds-border-subtle-01, #393939);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cds--g100 .att-pickup-other-input {
  background: var(--cds-field-01, #393939);
  border-color: var(--cds-border-strong-01, #6f6f6f);
}

.cds--g100 .att-time-display--success {
  background: rgba(36, 161, 72, 0.15);
}

.cds--g100 .att-time-display--info {
  background: rgba(69, 137, 255, 0.15);
}

.cds--g100 .att-status-btn--active.att-status-btn--excused {
  background: var(--cds-layer-accent-01, #525252);
  border-color: var(--cds-layer-accent-01, #525252);
}

.cds--g100 .btn-icon:hover {
  background: var(--cds-layer-hover-01, #353535);
}


/* ============================================================
   Inline Grades (US-708)
   ============================================================ */

.att-grade-cell {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.att-grade-input {
  width: 50px;
  height: 36px;
  text-align: center;
  border: 1px solid var(--cds-border-subtle, #e0e0e0);
  border-radius: 4px;
  background: var(--cds-field, #f4f4f4);
  color: var(--cds-text-primary, #161616);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 var(--space-1, 4px);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.att-grade-input::-webkit-inner-spin-button,
.att-grade-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.att-grade-input:focus {
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: -2px;
}

.att-grade-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.att-grade-input--below-passing {
  border-color: var(--cds-support-error, #da1e28);
  color: var(--cds-support-error, #da1e28);
}

.att-grade-select {
  width: 60px;
  height: 36px;
  border: 1px solid var(--cds-border-subtle, #e0e0e0);
  border-radius: 4px;
  background: var(--cds-field, #f4f4f4);
  color: var(--cds-text-primary, #161616);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0 var(--space-1, 4px);
}

.att-grade-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.att-grade-select--below-passing {
  border-color: var(--cds-support-error, #da1e28);
  color: var(--cds-support-error, #da1e28);
}

.att-competency-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 4px);
  height: 36px;
  padding: 0 var(--space-3, 12px);
  border: 1px solid var(--cds-border-subtle, #e0e0e0);
  border-radius: 4px;
  background: var(--cds-field, #f4f4f4);
  color: var(--cds-text-secondary, #525252);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.att-competency-btn:hover:not(:disabled) {
  background: var(--cds-layer-hover, #e8e8e8);
}

.att-competency-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.att-competency-btn--has-grades {
  border-color: var(--cds-interactive, #0f62fe);
  color: var(--cds-interactive, #0f62fe);
}

.att-competency-panel {
  padding: var(--space-4, 16px);
  background: var(--cds-layer-02, #e0e0e0);
  border-top: 1px solid var(--cds-border-subtle, #e0e0e0);
}

.att-competency-row {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-2, 8px);
}

.att-competency-row:last-child {
  margin-bottom: 0;
}

.att-competency-row__name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--cds-text-primary, #161616);
}

.att-competency-row__select {
  width: 60px;
}

@media (max-width: 640px) {
  .att-grade-cell {
    width: 100%;
    margin-top: var(--space-2, 8px);
  }
}

/* Dark mode — inline grades */
.cds--g100 .att-grade-input {
  background: var(--cds-field-01, #393939);
  border-color: var(--cds-border-subtle-01, #525252);
}

.cds--g100 .att-grade-select {
  background: var(--cds-field-01, #393939);
  border-color: var(--cds-border-subtle-01, #525252);
}

.cds--g100 .att-competency-btn {
  background: var(--cds-field-01, #393939);
  border-color: var(--cds-border-subtle-01, #525252);
}

.cds--g100 .att-competency-panel {
  background: var(--cds-layer-02, #393939);
}


/* ============================================================
   Portal Părinți (US-361)
   ============================================================ */

/* Portal Header */
.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--cds-layer-01, #f4f4f4);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  z-index: 8000;
  display: flex;
  align-items: center;
}

.portal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.portal-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--cds-text-primary);
}

.portal-header__logo-img {
  height: 24px;
  width: auto;
}

.portal-header__logo-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.portal-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.portal-header__user {
  color: var(--app-text-secondary);
}

/* Portal Main */
.portal-main {
  padding-top: 48px;
  /* header height */
  min-height: 100vh;
  background: var(--cds-background, #ffffff);
}

.portal-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}

.portal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-9) 0;
}

/* Portal Greeting */
.portal-greeting {
  margin-bottom: var(--space-7);
  color: var(--cds-text-primary);
}

/* Portal Sections */
.portal-section {
  margin-bottom: var(--space-7);
}

.portal-section__title {
  margin-bottom: var(--space-4);
  color: var(--cds-text-primary);
}

/* Portal Empty State */
.portal-empty-state {
  text-align: center;
  padding: var(--space-6);
  color: var(--app-text-secondary);
}

/* Portal Child Card */
.portal-child-card {
  margin-bottom: var(--space-4);
}

.portal-child-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.portal-child-card__info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.portal-child-card__enrollments {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.portal-enrollment-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

/* Portal Attendance Card */
.portal-attendance-card {
  margin-bottom: var(--space-4);
}

.portal-attendance-card__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.portal-attendance-grid {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.portal-attendance-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 36px;
  padding: var(--space-1);
}

.portal-attendance-day__name {
  color: var(--app-text-muted);
  font-size: 0.6875rem;
}

.portal-attendance-day__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--cds-layer-02, #e0e0e0);
  color: var(--app-text-muted);
}

.portal-attendance-day__icon--present {
  background: var(--cds-support-success, #24a148);
  color: #ffffff;
}

.portal-attendance-day__icon--absent {
  background: var(--cds-support-error, #da1e28);
  color: #ffffff;
}

.portal-attendance-day__icon--excused {
  background: var(--cds-support-info, #4589ff);
  color: #ffffff;
}

.portal-attendance-day__icon--none {
  background: var(--cds-layer-02, #e0e0e0);
  color: var(--app-text-muted);
}

/* Portal Report Card */
.portal-report-card {
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: box-shadow var(--transition-normal);
}

.portal-report-card:hover {
  box-shadow: var(--shadow-hover);
}

.portal-report-card__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.portal-report-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Portal Modal (report detail) */
.portal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.portal-modal {
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.portal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.portal-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cds-text-primary);
  font-size: 24px;
  padding: var(--space-1);
  line-height: 1;
}

.portal-modal__body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.portal-modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--cds-border-subtle-01);
}

/* Portal Report Sections */
.portal-report-section {
  margin-bottom: var(--space-5);
}

.portal-report-section h4 {
  margin-bottom: var(--space-3);
  color: var(--cds-text-primary);
}

.portal-competency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.portal-attendance-summary {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

/* Portal Responsive */
@media (max-width: 41.98rem) {
  .portal-container {
    padding: var(--space-5) var(--space-4);
  }

  .portal-header__user {
    display: none;
  }

  .portal-child-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-attendance-day {
    min-width: 30px;
    padding: 2px;
  }

  .portal-attendance-day__icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .portal-report-card__content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dark mode portal adjustments */
.cds--g100 .portal-header {
  background: var(--cds-layer-01, #262626);
  border-bottom-color: var(--cds-border-subtle-01, #393939);
}

.cds--g100 .portal-attendance-day__icon--none {
  background: var(--cds-layer-02, #393939);
}

/* -----------------------------------------------------------
   30. School Year Interval Badge (US-403)
   ----------------------------------------------------------- */
.badge--interval {
  background: #d0e2ff;
  color: #0043ce;
  font-size: 0.6875rem;
}

.cds--g100 .badge--interval {
  background: #002d9c;
  color: #a6c8ff;
}

/* -----------------------------------------------------------
   31. Session Calendar (US-406)
   ----------------------------------------------------------- */
.cal-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.cal-nav__title {
  font-weight: 600;
  font-size: 1rem;
  min-width: 200px;
}

.cal-view-toggle {
  display: flex;
  gap: 0;
  margin-left: auto;
}

.cal-view-toggle button {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--cds-border-strong-01, #8d8d8d);
  background: var(--cds-layer-01, #ffffff);
  color: var(--cds-text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 150ms;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 6px);
}

.cal-view-toggle button:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.cal-view-toggle button:not(:first-child) {
  border-left: 0;
}

.cal-view-toggle button:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.cal-view-toggle button.is-active {
  background: var(--cds-background-brand, #0f62fe);
  color: #fff;
  border-color: var(--cds-background-brand, #0f62fe);
}

/* ── Weekly calendar ────────────────────────── */
.cal-week {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  grid-template-rows: auto 1fr;
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 400px;
}

.cal-week__header {
  display: contents;
}

.cal-week__header-cell {
  padding: var(--space-2) var(--space-2);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--cds-layer-02, #f4f4f4);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-right: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.cal-week__header-cell:last-child {
  border-right: 0;
}

.cal-week__header-cell--time {
  font-size: 0.6875rem;
  color: var(--app-text-muted);
}

.cal-week__header-cell.is-today {
  background: var(--cds-background-brand, #0f62fe);
  color: #fff;
}

.cal-week__header-cell.is-weekend {
  background: var(--cds-layer-accent-01, #e8e8e8);
}

.cal-week__header-cell.is-non-working {
  background: #fff1f1;
}

.cds--g100 .cal-week__header-cell.is-non-working {
  background: #520408;
}

.cal-week__time-col {
  position: relative;
  border-right: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.cal-week__time-label {
  position: absolute;
  right: 4px;
  font-size: 0.6875rem;
  color: var(--app-text-muted);
  line-height: 1;
  transform: translateY(-50%);
}

.cal-week__day-col {
  position: relative;
  border-right: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  min-height: 100%;
}

.cal-week__day-col:last-child {
  border-right: 0;
}

.cal-week__day-col.is-weekend {
  background: var(--cds-layer-accent-01, #e8e8e8);
}

.cal-week__day-col.is-non-working {
  background: #fff8f8;
}

.cds--g100 .cal-week__day-col.is-non-working {
  background: rgba(82, 4, 8, 0.3);
}

.cal-week__hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.cal-week__session {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  transition: opacity 150ms;
  box-sizing: border-box;
}

.cal-week__session:hover {
  opacity: 0.85;
}

.cal-week__session-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-week__session-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

/* ── Monthly calendar ───────────────────────── */
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cal-month__header-cell {
  padding: var(--space-2);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--cds-layer-02, #f4f4f4);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-right: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.cal-month__header-cell:last-child {
  border-right: 0;
}

.cal-month__cell {
  min-height: 80px;
  padding: var(--space-1);
  border-right: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  background: var(--cds-layer-01, #ffffff);
  position: relative;
}

.cal-month__cell:nth-child(7n) {
  border-right: 0;
}

.cal-month__cell--empty {
  background: var(--cds-layer-02, #f4f4f4);
}

.cal-month__cell.is-today {
  outline: 2px solid var(--cds-background-brand, #0f62fe);
  outline-offset: -2px;
  z-index: 1;
}

.cal-month__cell.is-weekend {
  background: var(--cds-layer-accent-01, #e8e8e8);
}

.cal-month__cell.is-non-working {
  background: #fff8f8;
}

.cds--g100 .cal-month__cell.is-non-working {
  background: rgba(82, 4, 8, 0.3);
}

.cal-month__day-num {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  margin-bottom: 2px;
}

.cal-month__cell.is-today .cal-month__day-num {
  color: var(--cds-background-brand, #0f62fe);
}

.cal-month__session-dot {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.625rem;
  line-height: 1.4;
  padding: 0 3px;
  border-radius: 2px;
  margin-bottom: 1px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cal-month__session-dot:hover {
  opacity: 0.8;
}

.cal-month__more {
  font-size: 0.625rem;
  color: var(--app-text-secondary);
  cursor: pointer;
}

.cal-month__more:hover {
  text-decoration: underline;
}

/* ── Popover ────────────────────────────────── */
.cal-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9001;
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  padding: var(--space-5);
  min-width: 280px;
  max-width: 360px;
}

.cal-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.cal-popover__title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.cal-popover__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--app-text-muted);
  font-size: 1.125rem;
}

.cal-popover__row {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  font-size: 0.8125rem;
  margin-bottom: var(--space-2);
  color: var(--cds-text-secondary);
}

.cal-popover__row-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.cal-popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.25);
}

/* ── Non-working day label ──────────────────── */
.cal-nwd-label {
  font-size: 0.5625rem;
  color: var(--cds-support-error, #da1e28);
  font-weight: 500;
  position: absolute;
  bottom: 1px;
  left: 2px;
  right: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 48rem) {
  .cal-week {
    grid-template-columns: 40px repeat(7, 1fr);
    font-size: 0.75rem;
  }

  .cal-month__cell {
    min-height: 50px;
  }

  .cal-nav__title {
    min-width: auto;
    font-size: 0.875rem;
  }
}


/* ===============================================================
   Import Wizard (US-106)
   =============================================================== */

.import-mapping-grid {
  display: grid;
  gap: var(--space-4);
}

.import-mapping-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: var(--space-4);
  align-items: start;
}

.import-mapping-label {
  padding-top: var(--space-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.import-required {
  color: var(--cds-support-error);
  margin-left: 2px;
}

.import-field-error {
  display: block;
  color: var(--cds-support-error);
  font-size: 0.75rem;
  margin-top: 2px;
}

.import-row--invalid {
  background: color-mix(in srgb, var(--cds-support-error) 5%, transparent);
}

.import-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.import-result--success {
  border-left: 4px solid var(--cds-support-success);
}

.import-result--warning {
  border-left: 4px solid var(--cds-support-warning);
}

.import-result--error {
  border-left: 4px solid var(--cds-support-error);
}

/* Mobile: card preview shown, table hidden */
.import-preview-mobile {
  display: block;
}

.import-preview-desktop {
  display: none;
}

.app-text-success {
  color: var(--cds-support-success);
}

.app-text-error {
  color: var(--cds-support-error);
}

@media (min-width: 672px) {
  .import-preview-mobile {
    display: none;
  }

  .import-preview-desktop {
    display: block;
  }
}

@media (max-width: 671px) {
  .import-mapping-row {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------
   Student Search Autocomplete (Enrollments)
   ----------------------------------------------------------- */
.student-search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 200;
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  max-height: 240px;
  overflow-y: auto;
  border-radius: 0 0 2px 2px;
}

.student-search-item {
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--cds-text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--cds-border-subtle-00, #f4f4f4);
}

.student-search-item:last-child {
  border-bottom: none;
}

.student-search-item:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.student-search-item--empty {
  color: var(--app-text-muted);
  cursor: default;
  font-style: italic;
}

.student-search-item--empty:hover {
  background: transparent;
}

.student-search-clear {
  position: absolute;
  right: var(--space-3);
  top: 2.1rem;
  cursor: pointer;
  color: var(--app-text-muted);
  font-size: 0.875rem;
  line-height: 1;
  padding: var(--space-1);
  z-index: 10;
}

.student-search-clear:hover {
  color: var(--cds-text-primary);
}

/* -----------------------------------------------------------
   US-258: Group Capacity Fill Rate
   ----------------------------------------------------------- */
.fill-rate {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.fill-rate__bar {
  width: 60px;
  height: 6px;
  background: var(--cds-border-subtle-01, #e0e0e0);
  border-radius: 3px;
  overflow: hidden;
}

.fill-rate__bar-inner {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s ease;
}

.fill-rate--ok .fill-rate__bar-inner {
  background: var(--cds-support-success, #24a148);
}

.fill-rate--warning .fill-rate__bar-inner {
  background: var(--cds-support-warning, #f1c21b);
}

.fill-rate--full .fill-rate__bar-inner,
.fill-rate--exceeded .fill-rate__bar-inner {
  background: var(--cds-support-error, #da1e28);
}

.fill-rate__text {
  font-size: 0.875rem;
  white-space: nowrap;
}

.fill-rate--ok .fill-rate__text {
  color: var(--cds-text-secondary);
}

.fill-rate--warning .fill-rate__text {
  color: var(--cds-support-warning, #f1c21b);
}

.fill-rate--full .fill-rate__text,
.fill-rate--exceeded .fill-rate__text {
  color: var(--cds-support-error, #da1e28);
}

/* -----------------------------------------------------------
   US-257: Schedule Grid
   ----------------------------------------------------------- */
.schedule-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
}

.schedule-day {
  min-width: 0;
}

.schedule-day__header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32px;
  padding: var(--space-2) var(--space-2);
  background: var(--cds-layer-01);
  border-bottom: 2px solid var(--cds-border-subtle-01);
  text-align: center;
}

.schedule-slot {
  padding: var(--space-2);
  margin-top: var(--space-1);
  background: var(--cds-layer-01);
  border-radius: 4px;
  border-left: 3px solid var(--cds-interactive);
}

.schedule-slot--conflict {
  outline: 2px solid var(--cds-support-error, #da1e28);
  outline-offset: -1px;
}

.schedule-slot--empty {
  text-align: center;
  color: var(--app-text-muted);
  font-size: 0.8125rem;
  border-left: none;
}

.schedule-slot__time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cds-text-primary);
}

.schedule-slot__name {
  font-size: 0.8125rem;
  color: var(--cds-text-primary);
  margin-top: 2px;
  word-break: break-word;
}

.schedule-slot__detail {
  font-size: 0.6875rem;
  color: var(--app-text-muted);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .schedule-grid-container {
    grid-template-columns: 1fr;
  }

  .schedule-day__header {
    text-align: left;
  }
}

/* ============================================================
   Impersonation Toast (US-601)
   ============================================================ */

.impersonation-toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 9001;
}

/* ============================================================
   US-330: Conversations layout & chat bubbles
   ============================================================ */

.conv-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 2px;
  min-height: 500px;
  max-height: calc(100vh - 280px);
  overflow: hidden;
}

@media (max-width: 800px) {
  .conv-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .conv-messages {
    min-height: 400px;
  }
}

.conv-list {
  border-right: 1px solid var(--cds-border-subtle-01);
  overflow-y: auto;
  background: var(--cds-layer-01);
}

.conv-item {
  padding: var(--space-4);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  cursor: pointer;
  transition: background 0.15s;
}

.conv-item:hover {
  background: var(--cds-layer-hover-01);
}

.conv-item.is-active {
  background: var(--cds-layer-selected-01);
  border-left: 3px solid var(--cds-interactive);
}

.conv-item.is-unread {
  background: var(--cds-layer-02);
}

.conv-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.conv-item__contact {
  color: var(--cds-text-primary);
}

.conv-item__subject {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 2px;
}

.conv-item__preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.font-bold {
  font-weight: 600;
}

.conv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--cds-support-error, #da1e28);
  border-radius: 10px;
  flex-shrink: 0;
}

.conv-messages {
  display: flex;
  flex-direction: column;
  background: var(--cds-background);
  overflow: hidden;
}

.conv-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-7);
}

.conv-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.conv-chat__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  flex-shrink: 0;
}

.conv-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.conv-chat__compose {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  flex-shrink: 0;
}

.conv-compose-input {
  width: 100%;
  padding: var(--space-3);
  font-family: inherit;
  font-size: 14px;
  background: var(--cds-field-01);
  color: var(--cds-text-primary);
  border: 1px solid var(--cds-border-strong-01);
  resize: vertical;
  min-height: 60px;
}

.conv-compose-input:focus {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

/* Chat bubbles */
.chat-bubble {
  max-width: 75%;
  padding: var(--space-3) var(--space-4);
  border-radius: 8px;
  word-wrap: break-word;
}

.chat-bubble--staff {
  align-self: flex-end;
  background: var(--cds-interactive, #0f62fe);
  color: #fff;
}

.chat-bubble--staff .chat-bubble__sender,
.chat-bubble--staff .chat-bubble__time {
  color: rgba(255, 255, 255, 0.7);
}

.chat-bubble--parent {
  align-self: flex-start;
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
}

.chat-bubble__sender {
  margin-bottom: 2px;
  font-weight: 600;
}

.chat-bubble__body {
  white-space: pre-wrap;
  line-height: 1.4;
}

.chat-bubble__time {
  margin-top: var(--space-1);
  text-align: right;
  font-size: 11px;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autocomplete-item:hover {
  background: var(--cds-layer-hover-01);
}

/* US-331: Menu badge for unread conversations */
.menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--cds-support-error, #da1e28);
  border-radius: 9px;
  margin-left: var(--space-2);
}

/* --- Transfer Resources (US-107) --- */

.transfer-type-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-micro);
  font-size: 0.875rem;
  color: var(--cds-text-primary);
}

.transfer-type-option:hover {
  background: var(--cds-layer-hover-01);
}

.transfer-type-option--active {
  border-color: var(--cds-interactive);
  background: var(--cds-highlight);
  font-weight: 600;
}

.transfer-type-option input[type="radio"] {
  display: none;
}

.transfer-resource-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-micro);
}

.transfer-resource-item:hover {
  background: var(--cds-layer-hover-01);
}

.transfer-resource-item--selected {
  background: var(--cds-layer-selected-01);
}

.transfer-resource-item input[type="checkbox"] {
  flex-shrink: 0;
}

/* -----------------------------------------------------------
   Campaign Analytics (US-923)
   ----------------------------------------------------------- */

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  padding: 0 var(--space-6);
  flex-shrink: 0;
}

.panel-tab {
  padding: var(--space-3) var(--space-5);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--cds-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
}

.panel-tab:hover {
  color: var(--cds-text-primary);
}

.panel-tab--active {
  color: var(--cds-text-primary);
  border-bottom-color: var(--cds-interactive, #0f62fe);
}

.analytics-period {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.analytics-period__btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--cds-border-strong-01, #8d8d8d);
  border-radius: var(--radius-sm, 4px);
  background: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--cds-text-secondary);
  transition: all 150ms;
}

.analytics-period__btn:hover {
  background: var(--cds-layer-hover-01);
}

.analytics-period__btn--active {
  background: var(--cds-interactive, #0f62fe);
  border-color: var(--cds-interactive, #0f62fe);
  color: #fff;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.analytics-kpi {
  background: var(--cds-layer-02, #f4f4f4);
  border-radius: var(--radius-sm, 4px);
  padding: var(--space-4) var(--space-3);
  text-align: center;
}

.analytics-kpi__value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  line-height: 1.2;
}

.analytics-kpi__label {
  font-size: 0.6875rem;
  color: var(--cds-text-secondary);
  margin-top: var(--space-1);
  line-height: 1.3;
}

.analytics-kpi--success .analytics-kpi__value {
  color: var(--cds-support-success, #198038);
}

.analytics-kpi--warning .analytics-kpi__value {
  color: var(--cds-support-warning, #f1c21b);
}

.analytics-section {
  margin-bottom: var(--space-6);
}

.analytics-section__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  margin-bottom: var(--space-3);
}

.analytics-funnel-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.analytics-funnel-label {
  font-size: 0.75rem;
  color: var(--cds-text-secondary);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.analytics-funnel-bar {
  height: 22px;
  border-radius: 2px;
  min-width: 4px;
  transition: width 300ms ease;
}

.analytics-funnel-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  flex-shrink: 0;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.analytics-table th {
  text-align: left;
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid var(--cds-border-subtle-01, #e0e0e0);
  color: var(--cds-text-secondary);
  font-size: 0.75rem;
}

.analytics-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  color: var(--cds-text-primary);
}

.analytics-table td:not(:first-child) {
  text-align: right;
}

.analytics-table th:not(:first-child) {
  text-align: right;
}

@media (max-width: 672px) {
  .analytics-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-kpis .analytics-kpi:last-child {
    grid-column: span 2;
  }

  .analytics-funnel-label {
    width: 60px;
    font-size: 0.6875rem;
  }
}

/* ============================================================
   Discount Campaigns (US-DISC-022)
   ============================================================ */

.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.campaign-card {
  background: var(--cds-layer-01, #f4f4f4);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--transition-normal);
}

.campaign-card:hover {
  border-color: var(--cds-border-interactive, #0f62fe);
}

.campaign-card--deleted {
  opacity: 0.5;
}

.campaign-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.campaign-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--cds-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.campaign-card__badge {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--active {
  background: var(--cds-support-success, #24a148);
  color: #ffffff;
}

.badge--upcoming {
  background: var(--cds-support-info, #0f62fe);
  color: #ffffff;
}

.badge--expired {
  background: var(--cds-text-placeholder, #a8a8a8);
  color: #ffffff;
}

.badge--deleted {
  background: var(--cds-text-disabled, #c6c6c6);
  color: var(--cds-text-on-color-disabled, #8d8d8d);
}

.badge--info {
  background: var(--cds-background-brand, #0f62fe);
  color: #ffffff;
  padding: 2px var(--space-2);
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 500;
}

.campaign-card__actions {
  display: flex;
  gap: var(--space-2);
}

.campaign-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.campaign-card__field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.campaign-card__field .label-01 {
  color: var(--app-text-secondary);
  flex-shrink: 0;
}

.campaign-card__footer {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--cds-border-subtle-01, #e0e0e0);
}

.products-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 240px;
  overflow-y: auto;
  padding: var(--space-3);
  background: var(--cds-layer-01, #f4f4f4);
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0);
  border-radius: var(--radius-sm);
}

.product-checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-micro);
}

.product-checkbox-item:hover {
  background: var(--cds-layer-hover-01, #e8e8e8);
}

.product-checkbox-item input[type="checkbox"] {
  cursor: pointer;
}

.form-error {
  color: var(--cds-text-error, #da1e28);
  font-size: 0.75rem;
  margin-top: var(--space-2);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

@media (max-width: 672px) {
  .campaigns-grid {
    grid-template-columns: 1fr;
  }

  .campaign-card__header {
    flex-direction: column;
  }
}

/* -----------------------------------------------------------
   Expert Mode (US-126)
   ----------------------------------------------------------- */
.expert-only { display: none; }
body.expert-mode .expert-only { display: block; }
body.expert-mode .expert-only--flex { display: flex; }
body.expert-mode .expert-only--inline { display: inline; }
body.expert-mode .normal-only { display: none; }

/* -----------------------------------------------------------
   Knowledge Base / Help Pages
   ----------------------------------------------------------- */

/* Article layout: content + sidebar */
.help-article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-7);
  align-items: start;
}

@media (max-width: 900px) {
  .help-article-layout {
    grid-template-columns: 1fr;
  }
}

/* Prose styling for rendered Markdown */
.help-prose {
  line-height: 1.7;
  color: var(--cds-text-primary);
}

.help-prose h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.help-prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.help-prose h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.help-prose p {
  margin-bottom: var(--space-4);
}

.help-prose ul,
.help-prose ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.help-prose li {
  margin-bottom: var(--space-2);
}

.help-prose strong {
  font-weight: 600;
}

.help-prose code {
  background: var(--cds-layer-02, #e0e0e0);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875em;
}

.help-prose pre {
  background: var(--cds-layer-02, #f4f4f4);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-md, 4px);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.help-prose pre code {
  background: none;
  padding: 0;
}

.help-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
  font-size: 0.875rem;
}

.help-prose th,
.help-prose td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.help-prose th {
  font-weight: 600;
  background: var(--cds-layer-02, #f4f4f4);
}

.help-prose blockquote {
  border-left: 3px solid var(--cds-border-interactive, #0f62fe);
  padding-left: var(--space-4);
  margin: var(--space-4) 0;
  color: var(--app-text-secondary);
}

.help-prose hr {
  border: none;
  border-top: 1px solid var(--cds-border-subtle-01);
  margin: var(--space-6) 0;
}

/* Articles grid on index page */
.help-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.help-article-card {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: var(--space-5);
  transition: box-shadow var(--transition-normal, 200ms) ease,
              border-color var(--transition-normal, 200ms) ease;
}

.help-article-card:hover {
  box-shadow: var(--shadow-hover, 0 4px 12px rgba(0,0,0,0.08));
  border-color: var(--cds-border-interactive, #0f62fe);
}

/* Related articles sidebar */
.help-article-sidebar {
  position: sticky;
  top: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Table of Contents */
.help-toc {
  position: relative;
}

.help-toc__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.help-toc__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  padding-left: var(--space-4);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--app-text-secondary);
  text-decoration: none;
  border-left: 2px solid var(--cds-border-subtle-01);
  transition: color 150ms ease, border-color 150ms ease;
}

.help-toc__link--h3 {
  padding-left: calc(var(--space-4) + var(--space-3));
  font-size: 0.75rem;
}

.help-toc__link:hover {
  color: var(--cds-text-primary);
}

.help-toc__link--active {
  color: var(--cds-text-primary);
  font-weight: 500;
  border-left-color: var(--cds-border-interactive, #0f62fe);
}

/* Feedback section */
.help-feedback {
  margin: 80px 0 100px;
  padding: var(--space-5);
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-md, 4px);
  text-align: center;
}

.help-feedback__buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.help-feedback__btn {
  background: none;
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-md, 4px);
  padding: var(--space-2);
  cursor: pointer;
  color: var(--app-text-secondary);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-feedback__btn:hover {
  color: var(--cds-text-primary);
  border-color: var(--cds-border-interactive, #0f62fe);
  background: var(--cds-layer-02);
}

/* Scroll offset for anchored headings */
.help-prose h2[id],
.help-prose h3[id] {
  scroll-margin-top: calc(var(--header-height, 48px) + var(--space-5));
}

/* Feedback stats in article cards (owner only) */
.help-feedback-stats {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: 0.75rem;
  color: var(--app-text-secondary);
}

.help-feedback-stats__item {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 900px) {
  .help-toc { display: none; }
}

.help-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.help-related-link {
  color: var(--cds-link-primary, #0f62fe);
  text-decoration: none;
  font-weight: 500;
}

.help-related-link:hover {
  text-decoration: underline;
}

/* Help article images */
.help-img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-md, 4px);
  margin: var(--space-4) 0;
  box-shadow: var(--shadow-card);
}

/* Theme-aware screenshots: show light in light theme, dark in dark theme */
.help-img--dark  { display: none; }
.help-img--light { display: block; }

.cds--g90 .help-img--light,
.cds--g100 .help-img--light { display: none; }
.cds--g90 .help-img--dark,
.cds--g100 .help-img--dark  { display: block; }

/* External links with Launch icon */
.help-app-link {
  white-space: nowrap;
}

.help-launch-icon {
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.7;
}

.help-app-link:hover .help-launch-icon {
  opacity: 1;
}

/* FAQ section */
.help-faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.help-faq-item {
  padding: var(--space-4);
  background: var(--cds-layer-01, #ffffff);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: var(--radius-md, 4px);
}

.help-faq-q {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--cds-text-primary);
}

.help-faq-a {
  color: var(--app-text-secondary);
  line-height: 1.5;
}

#gen-modal select.cds-select-native {
  width: calc(100% - 30px);
}


/* ═══════════════════════════════════════════════════════════════════════════
   cds-date-flat: Flatpickr standalone cu look Carbon
   ═══════════════════════════════════════════════════════════════════════════ */

.cds-date-flat {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.cds-date-flat__label {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.34;
  letter-spacing: 0.32px;
  color: var(--cds-text-secondary, #525252);
  margin-bottom: var(--space-2, 8px);
}
.cds-date-flat__field {
  position: relative;
  width: 100%;
}
.cds-date-flat__input {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: 0.16px;
  color: var(--cds-text-primary, #161616);
  background-color: var(--cds-field-01, #f4f4f4);
  border: none;
  border-bottom: 1px solid var(--cds-border-strong-01, #8d8d8d);
  outline: none;
  padding: 0 2.5rem 0 1rem;
  height: 2.5rem;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}
.cds-date-flat__input:focus {
  outline: 2px solid var(--cds-focus, #620b5b);
  outline-offset: -2px;
  border-bottom-color: transparent;
}
.cds-date-flat__input::placeholder {
  color: var(--cds-text-placeholder, #a8a8a8);
}
.cds-date-flat__icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--cds-icon-primary, #161616);
}

/* ── Variant: size sm (32px height) ── */
.cds-date-flat--sm .cds-date-flat__input {
  height: 2rem;
  font-size: 0.75rem;
  padding: 0 2rem 0 0.75rem;
}
.cds-date-flat--sm .cds-date-flat__icon {
  right: 0.5rem;
}

/* ── Modifier: calendar aliniat dreapta ── */
.cds-date-flat--align-right .flatpickr-calendar {
  right: 0 !important;
  left: auto !important;
}

/* ── Modifier: field alb pe fundal gri (layer) ── */
.cds-date-flat--on-layer .cds-date-flat__input {
  background-color: var(--cds-field-02, #fff);
}

/* ── Flatpickr calendar override-uri Carbon ── */
.flatpickr-calendar {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif !important;
  background: var(--cds-layer-01, #f4f4f4) !important;
  border: 1px solid var(--cds-border-subtle-01, #e0e0e0) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
  border-radius: 0 !important;
  width: 224px !important;
  padding: 0 !important;
  height: auto !important;
  z-index: 9999 !important;
}
.flatpickr-calendar::before,
.flatpickr-calendar::after {
  display: none !important;
}
.flatpickr-months {
  background: var(--cds-layer-01, #f4f4f4) !important;
  display: flex !important;
  align-items: center !important;
}
.flatpickr-months .flatpickr-month {
  background: transparent !important;
  color: var(--cds-text-primary, #161616) !important;
  fill: var(--cds-text-primary, #161616) !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;
}
.flatpickr-current-month {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--cds-text-primary, #161616) !important;
  padding: 0 !important;
  /* width: 100% !important; */
  width: 160px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  height: 40px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  background: var(--cds-layer-01, #f4f4f4) !important;
  color: var(--cds-text-primary, #161616) !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.flatpickr-current-month input.cur-year {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--cds-text-primary, #161616) !important;
  margin: 0 !important;
  padding: 0 0 0 4px !important;
}
.flatpickr-current-month .numInputWrapper {
  width: 5ch !important;
  margin: 0 !important;
  padding: 0 !important;
}
.flatpickr-current-month .numInputWrapper span {
  display: none !important;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  fill: var(--cds-icon-primary, #161616) !important;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--cds-link-primary, #e85d26) !important;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: transparent !important;
}
span.flatpickr-weekday {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  color: var(--cds-text-secondary, #525252) !important;
  background: transparent !important;
  width: 33px !important;
  flex-basis: 32px !important;
  max-width: 32px !important;
}
.flatpickr-day {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 0.75rem !important;
  color: var(--cds-text-primary, #161616) !important;
  border-radius: 0 !important;
  border: none !important;
  width: 30px !important;
  flex-basis: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.flatpickr-day:hover {
  background: var(--cds-layer-hover-01, #e8e8e8) !important;
  border: none !important;
}
.flatpickr-day.today {
  border: none !important;
  color: var(--cds-link-primary, #e85d26) !important;
  font-weight: 600 !important;
  position: relative !important;
}
.flatpickr-day.today::after {
  inset-block-end: 0.2rem !important;
}
.flatpickr-day.today:hover {
  background: var(--cds-layer-hover-01, #e8e8e8) !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--cds-background-brand, #e8daff) !important;
  color: #fff !important;
  font-weight: 600 !important;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--cds-text-placeholder, #a8a8a8) !important;
}
.flatpickr-innerContainer {
  background: var(--cds-layer-01, #f4f4f4) !important;
  padding: 0 !important;
}
.flatpickr-weekdays {
  padding: 0 !important;
}
.dayContainer {
  width: 224px !important;
  min-width: 224px !important;
  max-width: 224px !important;
  block-size: auto !important;
}
.flatpickr-weekdaycontainer {
  width: 224px !important;
}
.flatpickr-rContainer {
  width: 224px !important;
}

/* ── IBAN AI toggletip badge ── */
.iban-ai-toggletip {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
}
.iban-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--cds-border-inverse, #161616);
  border-radius: 1px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cds-text-primary, #161616);
  cursor: pointer;
  line-height: 1;
}
.iban-ai-toggletip:focus-within .iban-ai-badge,
.iban-ai-badge:hover {
  border-color: var(--cds-focus, #0f62fe);
  color: var(--cds-focus, #0f62fe);
}
/* Hide empty toggletip actions area */
.iban-ai-toggletip .cds--toggletip-actions {
  display: none;
}