/* ============================================================
   Vector Velocity — Components
   Reusable UI components: buttons, forms, cards, badges,
   tables, modals, toasts, nav items, and empty states.
   All colours reference tokens from tokens.css only.
   ============================================================ */


/* ----------------------------------------------------------
   ANNOUNCEMENT BAR
   ---------------------------------------------------------- */

  .announcement-bar {
    background-color: var(--brand-primary); /* Or a hardcoded alert color like #ef4444 */
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 1000;
    width: 100%;
  }

  .marquee {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-block;
    overflow: hidden;
    animation: scroll-marquee 32s linear infinite;
  }

  .announcement-bar__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 var(--space-4);
  }

  @keyframes scroll-marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
  }

body.has-global-announcement {
  --announcement-bar-height: 44px;
}

/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */

   .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast);
  user-select: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn--primary {
  background: var(--brand-primary);
  color: var(--text-inverse);
  border-color: var(--brand-primary);
}

.btn--primary:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  text-decoration: none;
}

/* Secondary */
.btn--secondary {
  background: var(--color-white);
  color: var(--text-primary);
  border-color: var(--border-color-dark);
}

.btn--secondary:hover {
  background: var(--color-grey-50);
  border-color: var(--color-grey-400);
  text-decoration: none;
}

/* Danger */
.btn--danger {
  background: var(--color-error);
  color: var(--text-inverse);
  border-color: var(--color-error);
}

.btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  text-decoration: none;
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--color-grey-100);
  color: var(--text-primary);
  text-decoration: none;
}

/* Accent */
.btn--accent {
  background: var(--brand-accent);
  color: var(--text-inverse);
  border-color: var(--brand-accent);
}

.btn--accent:hover {
  background: var(--brand-accent-dark);
  border-color: var(--brand-accent-dark);
  text-decoration: none;
}

/* Sizes */
.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
}

.btn--full {
  width: 100%;
}

/* Icon-only button */
.btn--icon {
  padding: var(--space-2);
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}


/* ----------------------------------------------------------
   FORMS
   ---------------------------------------------------------- */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.form-label--required::after {
  content: ' *';
  color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--color-white);
  border: 1px solid var(--border-color-dark);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-grey-400);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--color-grey-100);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: var(--leading-normal);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
  cursor: pointer;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
}

/* Inline two-column form row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* Checkbox / toggle */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check__label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}


/* ----------------------------------------------------------
   AUTH FORM  (login page specific)
   ---------------------------------------------------------- */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-error {
  padding: var(--space-3) var(--space-4);
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--color-error);
}


/* ----------------------------------------------------------
   CARDS
   ---------------------------------------------------------- */

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

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

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

.card__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Stats card */
.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}

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

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__icon--green { background: #dcfce7; color: #16a34a; }
.stat-card__icon--blue  { background: #dbeafe; color: #2563eb; }
.stat-card__icon--amber { background: #fef3c7; color: #d97706; }
.stat-card__icon--red   { background: #fee2e2; color: #dc2626; }

.stat-card__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.stat-card__sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}


/* ----------------------------------------------------------
   BADGES
   ---------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge--primary {
  background: var(--brand-primary-bg);
  color: var(--brand-primary-dark);
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge--error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge--neutral {
  background: var(--color-grey-100);
  color: var(--color-grey-600);
}

/* Notification dot on nav items */
.badge--dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--color-error);
}

/* Count badge (number in a circle) */
.badge--count {
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ----------------------------------------------------------
   SIDEBAR NAVIGATION
   ---------------------------------------------------------- */

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-grey-400);
  cursor: pointer;
  border-radius: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--color-grey-200);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-primary);
  border-radius: 0 2px 2px 0;
}

.nav-item__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-item__icon {
  opacity: 1;
}

.nav-item__label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item__badge {
  margin-left: auto;
}

/* Badge count pill inside nav items */
.nav-item .badge--count {
  margin-left: auto;
  flex-shrink: 0;
}

/* Logout nav item */
.nav-item--logout {
  color: var(--color-grey-500);
  margin-top: var(--space-2);
}

.nav-item--logout:hover {
  color: var(--color-error-light);
  background: rgba(220, 38, 38, 0.08);
}


/* ----------------------------------------------------------
   TABLES
   ---------------------------------------------------------- */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-grey-50);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.table tbody tr:hover td {
  background: var(--color-grey-50);
}

.table tbody tr.clickable {
  cursor: pointer;
}

.table .table__empty td {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-12);
}

/* Right-aligned column */
.table th.text-right,
.table td.text-right {
  text-align: right;
}


/* ----------------------------------------------------------
   MODALS
   ---------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - var(--space-12));
  display: flex;
  flex-direction: column;
  transform: scale(0.97) translateY(8px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal--lg {
  max-width: 720px;
}

.modal--sm {
  max-width: 380px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-xl);
  line-height: 1;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.modal__close:hover {
  background: var(--color-grey-100);
  color: var(--text-primary);
}

.modal__body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}


/* ----------------------------------------------------------
   WELCOME MODAL
   ---------------------------------------------------------- */

.modal--welcome {
  max-width: 540px;
  padding: 0;
  text-align: center;
  overflow: hidden;
}

.welcome-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-8) var(--space-4);
}

.welcome-modal__footer {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-8) var(--space-6);
  border-top: 1px solid var(--border-default);
}

.welcome-modal__icon {
  font-size: 2rem;
  margin-bottom: var(--space-3);
  line-height: 1;
}

.modal--welcome .modal__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.welcome-modal__intro {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.welcome-modal__beta {
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4);
  text-align: left;
  margin-bottom: var(--space-4);
}

.welcome-modal__beta-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  border-radius: var(--radius);
  padding: 2px var(--space-2);
  margin-bottom: var(--space-2);
}

.welcome-modal__beta p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--space-2);
}

.welcome-modal__beta p:last-child { margin-bottom: 0; }

.welcome-modal__beta a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
}

.welcome-modal__beta a:hover { text-decoration: underline; }

.welcome-modal__tips {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  text-align: left;
}

.welcome-modal__tip {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.welcome-modal__tip span {
  color: var(--brand-accent);
  font-size: var(--text-base);
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ----------------------------------------------------------
   SUBSCRIPTION MODULE LIST (Settings → Subscription tab)
   ---------------------------------------------------------- */

.subscription-module-list {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.subscription-module {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-default);
}

.subscription-module:last-child { border-bottom: none; }

.subscription-module--header {
  background: var(--surface-raised, #f8fafd);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.subscription-module__name { color: var(--text-primary); font-weight: 500; }

.subscription-module__price {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.subscription-module--total {
  background: var(--surface-raised, #f8fafd);
  font-weight: 600;
  border-top: 2px solid var(--border-default);
}

.subscription-module--total strong {
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------
   TOAST NOTIFICATIONS
   ---------------------------------------------------------- */

.toast {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-6);
  max-width: 360px;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  transform: translateX(calc(100% + var(--space-6)));
  opacity: 0;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
  pointer-events: none;
}

.toast.toast--visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.toast--info {
  background: var(--color-grey-900);
  color: var(--text-inverse);
}

.toast--success {
  background: var(--color-success);
  color: var(--text-inverse);
}

.toast--warning {
  background: var(--color-warning);
  color: var(--text-inverse);
}

.toast--error {
  background: var(--color-error);
  color: var(--text-inverse);
}

/* On auth pages the toast has no header to offset from */
.auth-page .toast,
.auth-split-page .toast {
  top: var(--space-6);
}


/* ----------------------------------------------------------
   SEARCH & FILTER BAR
   ---------------------------------------------------------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper__icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-grey-400);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) calc(var(--space-3) + 16px + var(--space-2));
  font-size: var(--text-sm);
  border: 1px solid var(--border-color-dark);
  border-radius: var(--radius);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
}


/* ----------------------------------------------------------
   EMPTY STATE
   ---------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  text-align: center;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  color: var(--color-grey-300);
  margin-bottom: var(--space-4);
}

.empty-state__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 320px;
  margin-bottom: var(--space-6);
}


/* ----------------------------------------------------------
   LOADING SPINNER
   ---------------------------------------------------------- */

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-grey-200);
  border-top-color: var(--brand-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner--sm {
  width: 16px;
  height: 16px;
}

.spinner--lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}


/* ----------------------------------------------------------
   DIVIDER
   ---------------------------------------------------------- */

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-6) 0;
}

.divider--sm {
  margin: var(--space-4) 0;
}


/* ----------------------------------------------------------
   INLINE ALERT BANNERS
   ---------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid;
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.alert--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info);
}

.alert--success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.alert--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}

.alert--error {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error);
}


/* ----------------------------------------------------------
   TYPOGRAPHY UTILITIES
   ---------------------------------------------------------- */

.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-lg      { font-size: var(--text-lg); }
.text-xl      { font-size: var(--text-xl); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-brand     { color: var(--text-brand); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-error     { color: var(--color-error); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ----------------------------------------------------------
   SPACING UTILITIES
   ---------------------------------------------------------- */

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.hidden { display: none !important; }


/* ----------------------------------------------------------
   CLIENT MODULE
   ---------------------------------------------------------- */

/* Two-column master–detail layout */
.client-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100dvh - var(--header-height) - 48px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Left column — list */
.client-layout__list {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-grey-50);
}

/* Panel header — title + add button */
.client-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--color-white);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.client-list-header__title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.client-list-header__add {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-list-search {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-color);
  background: var(--color-white);
}

.client-list-items {
  flex: 1;
  overflow-y: auto;
}

/* Individual list item */
.client-list-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.client-list-item:hover {
  background: var(--color-grey-100);
}

.client-list-item.active {
  background: var(--brand-primary-bg);
}

.client-list-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-primary);
}

.client-list-item--inactive {
  opacity: 0.55;
}

.client-list-item__info {
  flex: 1;
  min-width: 0;
}

.client-list-item__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-list-item__sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-list-item__badges {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: var(--space-1);
}

/* Avatar circle */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  color: var(--text-inverse);
  flex-shrink: 0;
  background: var(--brand-primary);
}

.avatar--standard {
  background: var(--color-success);
}

.avatar--elevated {
  background: var(--color-warning);
}

.avatar--restricted {
  background: var(--color-error);
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: var(--text-sm);
}

/* Right column — detail */
.client-layout__detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-white);
}

.client-layout__detail > .empty-state {
  flex: 1;
}

.client-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.client-detail__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--color-white);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 10;
}

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

.client-detail__name {
  font-size: var(--text-2xl, 1.5rem);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.client-detail__sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Quick stats strip */
.client-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
}

.client-stat__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: block;
  margin-bottom: var(--space-1);
}

.client-stat__value {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

/* Section label (like a field-group heading) */
.section-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-4);
  margin-top: var(--space-6);
}

/* Edit / view mode toggling */
.client-detail .edit-only { display: none; }
.client-detail.is-editing .edit-only { display: block; }
.client-detail.is-editing .edit-only.inline-flex { display: inline-flex; }
.client-detail.is-editing .view-only { display: none; }

/* In view mode: make form controls look like plain text */
.client-detail:not(.is-editing) .form-input,
.client-detail:not(.is-editing) .form-select,
.client-detail:not(.is-editing) .form-textarea {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
}

.client-detail:not(.is-editing) .form-check input {
  pointer-events: none;
}

/* Risk assessment banner */
.ra-banner {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
  margin-bottom: var(--space-4);
}

.ra-banner--standard {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.ra-banner--elevated {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}

.ra-banner--restricted {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error);
}

/* RA question answer buttons */
.ra-option-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border-color-dark);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  background: var(--color-white);
}

.ra-option-btn:hover {
  border-color: var(--brand-primary);
}

.ra-option-btn.selected {
  background: var(--brand-primary);
  color: var(--text-inverse);
  border-color: var(--brand-primary);
}

/* Holiday list item */
.holiday-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  background: var(--color-grey-50);
  font-size: var(--text-sm);
}

/* Task row */
.task-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Save/cancel edit actions */
.client-edit-actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-6);
  margin-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}


/* ============================================================
   SCHEDULE MODULE
   ============================================================ */

.schedule-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}
.schedule-page-header__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}
.schedule-page-header__date {
  text-align: right;
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.schedule-controls__left,
.schedule-controls__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.schedule-controls__title {
  font-weight: 600;
  font-size: var(--text-base);
  min-width: 160px;
  color: var(--brand-primary);
}
.btn-group { display: flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-group .btn--active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* Week view */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-week__header {
  display: contents;
}
.cal-week__day-header {
  background: var(--color-grey-50, #f9fafb);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}
.cal-week__day-header:last-child { border-right: none; }
.cal-week__day-header--today {
  color: var(--brand-primary);
  background: var(--color-primary-50, #eff6ff);
}
.cal-week__body {
  display: contents;
}
.cal-week__day {
  --cal-hour-px: 44px;
  min-height: 352px;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-right: 1px solid var(--border-color);
  background: #fff;
}
.cal-week__day:last-child { border-right: none; }
.cal-week__day--today { background: var(--color-primary-50, #eff6ff); }

/* Month view */
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-month__day-header {
  padding: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--color-grey-50, #f9fafb);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}
.cal-month__day-header:last-child { border-right: none; }
.cal-month__cell {
  min-height: 90px;
  padding: var(--space-1) var(--space-2);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: #fff;
}
.cal-month__cell:nth-child(7n) { border-right: none; }
.cal-month__cell--other-month { background: var(--color-grey-50, #f9fafb); }
.cal-month__cell--today { background: var(--color-primary-50, #eff6ff); }
.cal-month__day-num {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.cal-month__day-num--today { color: var(--brand-primary); }
.cal-month__overflow {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  cursor: pointer;
}

/* Job cards (week view) */
.job-card {
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-primary);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  transition: filter 0.15s, box-shadow 0.15s;
  user-select: none;
  min-height: calc(var(--job-hours, 1) * var(--cal-hour-px, 44px));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  overflow: hidden;
}
.job-card:hover {
  filter: brightness(0.97);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.job-card--scheduled {
  border-left-color: var(--brand-primary);
  background: #fff;
}
.job-card--in_progress {
  border-left-color: var(--color-amber-500, #f59e0b);
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: var(--color-amber-500, #f59e0b);
}
.job-card--completed {
  border-left-color: var(--color-success, #16a34a);
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: var(--color-success, #16a34a);
  opacity: 0.85;
}
.job-card--cancelled {
  border-left-color: var(--color-error, #dc2626);
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: var(--color-error, #dc2626);
  opacity: 0.65;
}
.job-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}
.job-card__time {
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.3;
}
.job-card__dur {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.job-card__client {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--text-sm);
  line-height: 1.3;
}
.job-card__service {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-card__staff {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: auto;
}
.job-card__staff--multi {
  color: var(--brand-primary);
  font-weight: var(--weight-medium);
}
.job-card__badges {
  display: flex;
  gap: 2px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.job-card__actions {
  margin-top: auto;
  padding-top: var(--space-1);
}
.job-card__invoice-btn {
  background: none;
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  color: #15803d;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
}
.job-card__invoice-btn:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

/* Job chips (month view) */
.job-chip {
  border-radius: 2px;
  padding: 1px 4px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}
.job-chip--scheduled   { background: var(--brand-primary); color: #fff; }
.job-chip--in_progress { background: var(--color-amber-500, #f59e0b); color: #fff; }
.job-chip--completed   { background: var(--color-success, #16a34a); color: #fff; opacity: 0.8; }
.job-chip--cancelled   { background: var(--color-error, #dc2626); color: #fff; opacity: 0.6; }

/* Extra staff tags */
.staff-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-grey-100, #f3f4f6);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
}
.staff-tag__remove {
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.staff-tag__remove:hover { color: var(--color-error, #dc2626); }

/* Pricing mode toggle */
.pricing-toggle {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-3);
}
.pricing-toggle .btn { flex: 1; }

/* Restricted property warning */
.alert--restricted {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

/* Job modal task list */
.task-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
}
.task-toggle-row:last-child { border-bottom: none; }
.task-outcome-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
}
.task-outcome-row:last-child { border-bottom: none; }
.task-outcome-icon { font-size: var(--text-base); flex-shrink: 0; }

/* Form select small */
.form-select--sm {
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-8) var(--space-1) var(--space-2);
  height: auto;
}

/* ============================================================
   RECURRING JOBS MODULE
   ============================================================ */

.recurring-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.recurring-controls__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.page-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-1);
  color: var(--text-primary);
}
.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

.recurring-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.recurring-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}
.recurring-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.recurring-table tr:last-child td { border-bottom: none; }
.recurring-row__name { font-weight: 600; color: var(--text-primary); }
.recurring-row__sub  { font-size: var(--text-xs); color: var(--text-muted); }

.badge--holiday {
  background: #fef9c3;
  color: #854d0e;
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: 10px;
  font-weight: 600;
}

/* Generation log */
.generation-log {
  margin-top: var(--space-6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.generation-log__title {
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-3) var(--space-4);
  background: var(--color-grey-50, #f9fafb);
  border-bottom: 1px solid var(--border-color);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.generation-log__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
}
.generation-log__row:last-child { border-bottom: none; }
.generation-log__row--success { background: #f0fdf4; }
.generation-log__row--info    { background: #fff; }
.generation-log__icon  { font-weight: 700; color: var(--color-success, #16a34a); }
.generation-log__client { font-weight: 600; }
.generation-log__result { color: var(--text-muted); text-align: right; }
.generation-log__reasons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}
.generation-log__reason {
  font-size: 10px;
  background: #f3f4f6;
  border-radius: var(--radius-sm);
  padding: 1px var(--space-2);
  color: var(--text-muted);
}

/* Avatar small variant */
.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
  min-width: 28px;
}

/* ============================================================
   BOOKING REQUESTS MODULE
   ============================================================ */

/* Status filter tabs */
.status-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--space-5);
}
.status-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color 0.15s;
}
.status-tab:hover { color: var(--text-primary); }
.status-tab--active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}
.status-tab__count {
  background: var(--color-grey-100, #f3f4f6);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.status-tab--active .status-tab__count {
  background: var(--brand-primary);
  color: #fff;
}

/* Booking request cards */
.booking-request-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  background: #fff;
}
.booking-request-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.booking-request-card__name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
}
.booking-request-card__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.booking-request-card__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.booking-detail {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.booking-detail--notes {
  background: var(--color-grey-50, #f9fafb);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--border-color);
  color: var(--text-primary);
  font-style: italic;
}
.booking-request-card__actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
}
.booking-request-card__footer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-color);
}

/* Success button variant */
.btn--success {
  background: var(--color-success, #16a34a);
  color: #fff;
  border-color: var(--color-success, #16a34a);
}
.btn--success:hover { filter: brightness(0.9); }

/* Form hint */
.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  margin-bottom: 0;
}

/* ============================================================
   INVOICES & PAYMENTS MODULE
   ============================================================ */

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.stat-card--success { border-left: 4px solid var(--color-success, #16a34a); }
.stat-card--error   { border-left: 4px solid var(--color-error,   #dc2626); }

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

.invoice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px auto auto;
  align-items: center;
  gap: var(--space-5);
  background: #fff;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: background var(--transition-fast);
}
.invoice-row:hover { background: var(--color-grey-50, #f9fafb); }

.invoice-row--draft   { border-left-color: #d1d5db; }
.invoice-row--issued  { border-left-color: #2563eb; }
.invoice-row--overdue { border-left-color: #dc2626; }
.invoice-row--paid    { border-left-color: #16a34a; }
.invoice-row--void    { border-left-color: #d1d5db; opacity: 0.6; }

.invoice-row__main    { min-width: 0; }
.invoice-row__number  { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); }
.invoice-row__client  { font-size: var(--text-sm); color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-row__dates   { font-size: var(--text-xs); color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.invoice-row__right   { display: flex; align-items: center; gap: var(--space-3); }
.invoice-row__total   { font-weight: 700; font-size: var(--text-lg); color: var(--text-primary); }
.invoice-row__actions { display: flex; gap: var(--space-1); align-items: center; }

.inv-sent-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #16a34a;
  padding: 0 var(--space-2);
  white-space: nowrap;
}

.inv-action-sep {
  width: 1px;
  height: 18px;
  background: var(--border-color);
  margin: 0 var(--space-1);
  flex-shrink: 0;
}

.inv-action--danger { color: var(--color-error, #dc2626); }
.inv-action--danger:hover { color: var(--color-error, #dc2626); background: #fee2e2; }

/* Badge variants needed for invoices */
.badge--info    { background: #dbeafe; color: #1d4ed8; }
.badge--neutral { background: #f3f4f6; color: var(--text-muted); }

/* Large modal variant */
.modal--lg { max-width: 760px; width: 95vw; }

/* Line items table */
.line-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  margin-top: var(--space-4);
}
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
.line-items-table th {
  text-align: left;
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.line-items-table td {
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.line-items-table tr:last-child td { border-bottom: none; }
.line-items-empty  { color: var(--text-muted); font-style: italic; padding: var(--space-4) !important; }
.line-item-qty     { width: 70px; }
.line-item-price   { width: 100px; }
.line-item-amount  { font-weight: 600; white-space: nowrap; }
.form-input--sm    { padding: 4px var(--space-2); font-size: var(--text-sm); }

/* Totals section */
.invoice-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  border-top: 2px solid var(--border-color);
  padding-top: var(--space-3);
}
.invoice-totals__row {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
  min-width: 200px;
  justify-content: space-between;
}
.invoice-totals__row span:last-child { font-weight: 600; color: var(--text-primary); }
.invoice-totals__row--total {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-1);
}
.invoice-totals__row--total span { color: var(--text-primary); }

/* Empty state (reusable) */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
}
.empty-state__icon  { font-size: 2.5rem; margin-bottom: var(--space-3); }
.empty-state__title { font-weight: 600; margin-bottom: var(--space-2); color: var(--text-primary); }
.empty-state__body  { font-size: var(--text-sm); }

/* ============================================================
   STAFF MODULE
   ============================================================ */

/* Staff grid */
/* ── Staff two-pane layout ── */
.staff-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100dvh - var(--header-height) - 48px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.staff-layout__list {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-grey-50);
}

.staff-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--color-white);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.staff-list-header__title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}
.staff-list-header__add {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.staff-layout__list .status-tabs {
  padding: var(--space-2) var(--space-3);
  background: var(--color-white);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow-x: auto;
}

#staffList {
  flex: 1;
  overflow-y: auto;
}

.staff-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  border-left: 3px solid transparent;
  transition: background var(--transition-fast);
}
.staff-list-item:hover { background: var(--color-white); }
.staff-list-item--active {
  background: var(--color-white);
  border-left-color: var(--brand-primary);
}

.staff-list-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.staff-list-item__info  { flex: 1; min-width: 0; }
.staff-list-item__name  { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-list-item__sub   { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }

/* Right detail panel */
.staff-layout__detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-white);
}
.staff-layout__detail > .empty-state { flex: 1; }

.staff-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.staff-detail__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  z-index: 10;
}
.staff-detail__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.staff-detail__names  { flex: 1; min-width: 0; }
.staff-detail__name   { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--text-primary); }
.staff-detail__role   { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.staff-detail__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.staff-detail__body   { flex: 1; overflow-y: auto; padding: var(--space-6); }

/* Info grid (2 columns) */
.staff-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.staff-info-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
}
.staff-info-row:last-child { border-bottom: none; }
.staff-info-row__label { color: var(--text-muted); width: 100px; flex-shrink: 0; }
.staff-info-row__value { color: var(--text-primary); font-weight: 500; }

/* Working day pills in detail panel */
.staff-day-pills { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.staff-day-pill {
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-grey-100);
  color: var(--text-muted);
}
.staff-day-pill--on {
  background: var(--brand-primary);
  color: #fff;
}

/* Staff modal tabs */
.staff-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  padding: 0 var(--space-6);
  background: var(--color-grey-50, #f9fafb);
}
.staff-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.staff-tab:hover { color: var(--text-primary); }
.staff-tab--active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}

/* Section titles within modal */
.staff-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

/* Working days checkboxes */
.working-days {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.working-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
}
.working-day input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}
.working-day span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
}

/* Leave records */
.leave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
}
.leave-row:last-child { border-bottom: none; }
.leave-row__dates { display: flex; flex-direction: column; gap: 2px; }
.leave-row__type  { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.leave-row__range { font-size: var(--text-sm); color: var(--text-muted); }
.leave-row__days  { font-size: var(--text-xs); color: var(--text-muted); }
.leave-row__right { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* Leave add form */
.leave-add-form {
  background: var(--color-grey-50, #f9fafb);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}


/* ============================================================
   FINANCIAL REPORTS MODULE
   ============================================================ */

/* 4-column stats row variant */
.stats-row--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Warning stat card */
.stat-card--warning { border-left: 4px solid #f59e0b; }

/* Finance layout grid: monthly table left, top clients + expenses right */
.finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
  align-items: start;
}
@media (max-width: 900px) {
  .finance-grid { grid-template-columns: 1fr; }
  .stats-row--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Section titles */
.finance-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

/* Finance tables */
.finance-table-wrap {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.finance-table th {
  text-align: left;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  background: var(--color-grey-50, #f9fafb);
}
.finance-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.finance-table tbody tr:last-child td { border-bottom: none; }
.finance-table tfoot td {
  padding: var(--space-3) var(--space-4);
  border-top: 2px solid var(--border-color);
  background: var(--color-grey-50, #f9fafb);
}
.finance-amount { text-align: right; font-variant-numeric: tabular-nums; }
.finance-rank   { color: var(--text-muted); width: 32px; }
.finance-positive { color: var(--color-success, #16a34a); font-weight: 600; }
.finance-negative { color: var(--color-error,   #dc2626); font-weight: 600; }
.finance-empty    { color: var(--text-muted); font-size: var(--text-sm); padding: var(--space-2) 0; }

/* Inline bar chart for expense categories */
.finance-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 120px;
}
.finance-bar {
  height: 8px;
  background: var(--brand-primary, #1a56db);
  border-radius: 4px;
  min-width: 2px;
  opacity: 0.7;
}
.finance-bar-pct {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* badge--warning already defined in the badge section above (uses CSS tokens) */

/* ── Expenses table ── */
.expenses-table-wrap {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--space-4);
}
.expenses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.expenses-table th {
  text-align: left;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  background: var(--color-grey-50, #f9fafb);
}
.expenses-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.expenses-table tbody tr:last-child td { border-bottom: none; }
.expenses-table tbody tr:hover td { background: var(--color-grey-50, #f9fafb); cursor: pointer; }
.expenses-table tfoot td {
  padding: var(--space-3) var(--space-4);
  border-top: 2px solid var(--border-color);
  font-weight: 600;
  background: var(--color-grey-50, #f9fafb);
}
.expenses-table .amount-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

/* ============================================================
   SETTINGS MODULE
   ============================================================ */

.settings-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--space-6);
}
.settings-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.settings-tab:hover { color: var(--text-primary); }
.settings-tab--active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}
.settings-panel {
  max-width: 680px;
}

.settings-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.settings-section__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
}

.settings-section__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
}

.colour-preview {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.colour-swatch {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s;
}

/* Team members list (Settings → Account & Team) */
.team-members-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-grey-50, #f9fafb);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}
.team-member__info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.team-member__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}
.team-member__you {
  font-weight: 400;
  color: var(--text-muted);
}
.team-member__role {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.team-member__role--admin {
  background: var(--brand-primary);
  color: #fff;
}
.team-member__role--staff {
  background: var(--border-color);
  color: var(--text-secondary);
}
.team-member__remove {
  color: var(--color-error, #dc2626);
  border-color: transparent;
  font-size: var(--text-xs);
}
.team-member__remove:hover {
  background: var(--color-error-light, #fef2f2);
  border-color: var(--color-error, #dc2626);
}
.settings-invite-form {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-5);
  margin-top: var(--space-2);
}
.settings-invite-form__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
}
.demo-restriction-notice {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  background: var(--color-grey-50, #f9fafb);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
.demo-restriction-notice__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.demo-restriction-notice__heading {
  font-weight: 700;
  font-size: var(--text-base);
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
}
.demo-restriction-notice__body {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   PAYROLL MODULE
   ============================================================ */

.payroll-run-row {
  cursor: pointer;
  transition: background 0.12s;
}
.payroll-run-row:hover { background: var(--color-grey-50, #f9fafb); }

.payroll-amount { text-align: right; font-variant-numeric: tabular-nums; }
.finance-table th.payroll-amount { text-align: right; }

.payroll-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.payroll-detail-actions { display: flex; gap: var(--space-2); align-items: center; padding-top: var(--space-6); }

.payslip-gross-input {
  width: 110px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  text-align: right;
}

.payroll-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-4);
  font-style: italic;
}

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-8) var(--space-4);
  font-size: var(--text-sm);
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.stat-card__sub--overdue {
  color: var(--color-error);
  font-weight: var(--weight-medium);
}

/* Two-column grid for today + bookings panels */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* Card panel */
.dash-section {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
/* Inside dash-grid the margin is handled by the grid gap */
.dash-grid .dash-section {
  margin-bottom: 0;
}

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

.dash-section__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.dash-section__sub {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--text-muted);
  margin-left: var(--space-2);
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-empty {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-4) 0;
  text-align: center;
}

/* ── Today's schedule job row ── */
.dash-job {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.dash-job:last-child { border-bottom: none; }

.dash-job--done { opacity: 0.55; }

.dash-job__time {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-brand);
  min-width: 42px;
  padding-top: 1px;
}

.dash-job__body {
  flex: 1;
  min-width: 0;
}

.dash-job__client {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-job__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

.dash-job__value {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  white-space: nowrap;
}

.dash-job__done-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  align-self: center;
}

/* ── Pending bookings row ── */
.dash-booking {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
}
.dash-booking:last-child { border-bottom: none; }

.dash-booking__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin: 0 0 2px;
}

.dash-booking__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

.dash-booking__age {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
}

/* ── Outstanding invoices table ── */
.dash-inv-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-inv-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
}
.dash-inv-row:last-child { border-bottom: none; }

.dash-inv-num {
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.dash-inv-client {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-inv-due {
  color: var(--text-muted);
  white-space: nowrap;
}

.dash-inv-due--overdue {
  color: var(--color-error);
  font-weight: var(--weight-medium);
}

.dash-inv-amount {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
}

/* ── Upcoming jobs day label ── */
.dash-day-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: var(--space-4) 0 var(--space-1);
}
.dash-day-label:first-child { margin-top: 0; }

/* ── Accounts ──────────────────────────────────────────────── */

/* Balance cards row */
.acct-balance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.acct-balance-card {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.acct-balance-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.acct-balance-card__name {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.acct-balance-card__amount {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1.1;
}
.acct-balance-card__amount--neg { color: var(--color-error, #dc2626); }
.acct-balance-card__sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.acct-no-accounts {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

/* Filter / date controls row */
.acct-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

/* Ledger table */
.acct-ledger-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-8);
  background: var(--color-white);
}
.acct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.acct-table thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  background: var(--color-grey-50);
}
.acct-table thead th.text-right { text-align: right; }
.acct-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}
.acct-table tbody tr:last-child { border-bottom: none; }
.acct-table tbody tr:hover { background: var(--color-grey-50); }
.acct-table td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
  color: var(--text-primary);
}
.acct-table td.text-right     { text-align: right; }
.acct-table__date    { white-space: nowrap; color: var(--text-secondary); }
.acct-table__desc    { max-width: 280px; }
.acct-table__source  { color: var(--text-muted); font-size: var(--text-xs); white-space: nowrap; }
.acct-table__actions { width: 36px; text-align: center; }
.acct-table__empty   { text-align: center; color: var(--text-muted); padding: var(--space-8) var(--space-4) !important; }
.acct-table__opening-row td {
  background: var(--color-grey-50);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Amount colours */
.acct-credit    { color: #16a34a; font-weight: 600; }
.acct-debit     { color: var(--color-error, #dc2626); font-weight: 600; }
.acct-balance   { color: var(--text-primary); }
.acct-nil       { color: var(--text-muted); }
.acct-recon-over { color: #d97706; font-weight: 600; }

/* "manual" label on rows */
.acct-manual-label {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--color-grey-100);
  color: var(--text-muted);
  margin-left: var(--space-1);
  vertical-align: middle;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Delete button — only visible on row hover */
.acct-delete-btn {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.acct-table tbody tr:hover .acct-delete-btn { opacity: 1; }

/* Reconciliation history */
.acct-recon-section { margin-top: var(--space-4); }
.acct-section-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}
.acct-recon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  background: var(--color-white);
  font-size: var(--text-sm);
}
.acct-recon-row__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.acct-recon-row__date    { color: var(--text-secondary); font-weight: 500; }
.acct-recon-row__account { color: var(--text-primary); font-weight: 600; }
.acct-recon-row__detail  { color: var(--text-secondary); }
.acct-recon-row__notes   { color: var(--text-muted); font-style: italic; }
.acct-recon-empty        { color: var(--text-muted); font-size: var(--text-sm); }

/* ============================================================
   KEY DATES
   ============================================================ */

.kd-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: #fff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}
.kd-hero__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kd-hero__body      { flex: 1; min-width: 0; }
.kd-hero__eyebrow   { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: var(--space-1); }
.kd-hero__title     { font-size: var(--text-base); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-1); }
.kd-hero__desc      { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-2); }
.kd-hero__right     { text-align: right; flex-shrink: 0; }
.kd-hero__date      { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); }
.kd-hero__pill {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--text-muted);
}
.kd-hero__pill--soon   { background: #fef9c3; color: #854d0e; }
.kd-hero__pill--urgent { background: #fee2e2; color: #991b1b; }
.kd-hero__recur { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

.kd-section       { margin-bottom: var(--space-6); }
.kd-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-3);
}
.kd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.kd-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.kd-card:hover        { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.kd-card--disabled    { opacity: 0.45; }
.kd-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  min-height: 34px;
}
.kd-card__body    { padding: var(--space-4); }
.kd-card__title   { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); margin-bottom: var(--space-1); }
.kd-card__desc    { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-3); line-height: 1.5; }
.kd-card__footer  { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.kd-card__date    { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); }
.kd-card__countdown {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--text-muted);
  white-space: nowrap;
}
.kd-card__countdown--soon    { background: #fef9c3; color: #854d0e; }
.kd-card__countdown--overdue { background: #fee2e2; color: #991b1b; }
.kd-card__recur  { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-2); }
.kd-card__manage { display: flex; align-items: center; gap: var(--space-2); }

.kd-card__action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.kd-card__action-btn:hover           { color: var(--brand-primary); background: rgba(0,0,0,0.06); }
.kd-card__action-btn--del:hover      { color: var(--color-error, #dc2626); background: rgba(220,38,38,0.08); }

.kd-category-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Compact toggle — same pattern as vbs-admin .vbs-toggle */
.kd-toggle { position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; flex-shrink: 0; }
.kd-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.kd-toggle__slider {
  position: absolute; inset: 0;
  background: var(--color-grey-300, #d1d5db);
  border-radius: 18px;
  transition: background 0.2s;
}
.kd-toggle__slider::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.kd-toggle input:checked + .kd-toggle__slider                { background: var(--brand-primary); }
.kd-toggle input:checked + .kd-toggle__slider::before        { transform: translateX(16px); }

/* ============================================================
   LEADS HUB
   ============================================================ */

/* Stats row — label top-left, icon top-right, large value, sub text */
.leads-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
@media (max-width: 900px) { .leads-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .leads-stats { grid-template-columns: 1fr; } }

.leads-stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.leads-stat-card--warning { border-color: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }

.leads-stat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.leads-stat-card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.leads-stat-card__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.leads-stat-card__icon--teal  { background: #ccfbf1; color: #0f766e; }
.leads-stat-card__icon--green { background: #dcfce7; color: #15803d; }
.leads-stat-card__icon--blue  { background: #dbeafe; color: #1d4ed8; }
.leads-stat-card__icon--amber { background: #fef3c7; color: #b45309; }
.leads-stat-card__value { font-size: 2rem; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.leads-stat-card__sub   { font-size: var(--text-xs); color: var(--text-muted); }

/* Stage tabs row */
.leads-tabs-row { margin-bottom: var(--space-3); }
.leads-tabs {
  display: flex;
  width: 100%;
  gap: var(--space-1);
}
.leads-tab {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.leads-tab:hover   { background: var(--color-grey-50, #f9fafb); border-color: var(--brand-primary); color: var(--brand-primary); }
.leads-tab--active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* Filters row */
.leads-filters-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.leads-filters-row .form-select { flex: 1; min-width: 160px; }
.leads-filters-row .btn         { flex-shrink: 0; }

/* Cards grid — 2 column matching FSCL */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (max-width: 700px) { .leads-grid { grid-template-columns: 1fr; } }
.leads-empty { color: var(--text-muted); font-size: var(--text-sm); padding: var(--space-6) 0; grid-column: 1/-1; }

/* Individual card */
.leads-card {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.leads-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); border-color: var(--brand-primary); }

.leads-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 2px;
}
.leads-card__name  { font-weight: 700; font-size: var(--text-lg); color: var(--text-primary); line-height: 1.2; }
.leads-card__del {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.leads-card__del:hover { color: #dc2626; background: #fee2e2; }

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

/* Contact lines with icons */
.leads-card__contact-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.leads-card__contact-line svg { flex-shrink: 0; color: var(--text-muted); }
.leads-card__contact-line--meta { color: var(--text-muted); }

.leads-card__value { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); }

/* Notes in a grey quoted box */
.leads-card__notes-box {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: var(--space-1);
  font-style: italic;
}

/* Stage badge */
.leads-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.leads-stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Staleness badge */
.leads-stale { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.leads-stale--amber { background: #fef3c7; color: #92400e; }
.leads-stale--red   { background: #fee2e2; color: #991b1b; }

/* Modal layout */
.modal--lg { max-width: 860px; }
.leads-modal-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-6);
}
@media (max-width: 680px) { .leads-modal-body { grid-template-columns: 1fr; } }
.leads-modal-body__left  { display: flex; flex-direction: column; gap: var(--space-4); }
.leads-modal-body__right { display: flex; flex-direction: column; }

/* Activity log */
.leads-activity            { display: flex; flex-direction: column; height: 100%; }
.leads-activity__header    { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.leads-activity__input-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.leads-activity__feed {
  flex: 1; overflow-y: auto; max-height: 320px;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.leads-activity__empty     { font-size: var(--text-xs); color: var(--text-muted); }
.leads-activity__entry     { background: var(--color-grey-50, #f9fafb); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.leads-activity__entry-date{ font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
.leads-activity__entry-text{ font-size: var(--text-xs); color: var(--text-primary); line-height: 1.5; }

/* Modal footer */
.leads-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.leads-modal-footer__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.leads-delete-btn { color: var(--color-error, #dc2626) !important; }

/* Utility variants */
.form-input--sm  { font-size: var(--text-sm); padding: 5px 10px; }
.btn--sm         { font-size: var(--text-xs); padding: 5px 12px; }
.btn--success    { background: #059669; color: #fff; border-color: #059669; }
.btn--success:hover { background: #047857; }
.btn--danger     { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn--danger:hover  { background: #b91c1c; }


/* ============================================================
   ONBOARDING — MODULE PICKER
   Component styles for /onboarding.html wizard.
   ============================================================ */

/* Base platform block */
.ob-base-block {
  background: var(--brand-primary-bg);
  border: 1.5px solid var(--brand-primary-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.ob-base-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.ob-base-block__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--text-primary);
}

.ob-base-block__tick {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

.ob-base-block__price {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
}

.ob-base-block__price span {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--text-muted);
}

.ob-base-block__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ob-base-block__chips span {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--color-white);
  border: 1px solid var(--brand-primary-border);
  border-radius: var(--radius-sm);
  padding: 3px var(--space-2);
}

/* Bundle offer card */
.ob-bundle {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 2px dashed var(--color-grey-300);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.ob-bundle:hover {
  border-color: var(--brand-accent);
  border-style: solid;
}

.ob-bundle--selected {
  border-style: solid;
  border-color: var(--brand-accent);
  background: var(--brand-accent-bg);
}

.ob-bundle__left {
  flex: 1;
  min-width: 0;
}

.ob-bundle__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  background: var(--brand-accent);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ob-bundle__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 3px;
}

.ob-bundle__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.ob-bundle__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.ob-bundle__price {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--brand-accent);
  line-height: 1;
}

.ob-bundle__price span {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--text-muted);
}

.ob-bundle__btn {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--brand-accent);
  border: 1.5px solid var(--brand-accent);
  border-radius: var(--radius);
  padding: 5px var(--space-3);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.ob-bundle--selected .ob-bundle__btn {
  background: var(--brand-accent);
  color: var(--color-white);
}

/* Bundled add-on rows — dimmed when bundle is selected */
.ob-addon--bundled {
  opacity: 0.55;
  pointer-events: none;
}

/* Add-ons section heading */
.ob-addons-header {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

/* Individual add-on row */
.ob-addon {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.ob-addon:hover {
  border-color: var(--brand-primary);
}

.ob-addon:has(.ob-addon__check:checked) {
  border-color: var(--brand-primary);
  background: var(--brand-primary-bg);
}

.ob-addon__check {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
}

.ob-addon__body {
  flex: 1;
  min-width: 0;
}

.ob-addon__name {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ob-addon__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.ob-addon__price {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  padding-top: 1px;
}

.ob-addon__price span {
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
  color: var(--text-muted);
}

/* Loading placeholder */
.ob-modules-loading {
  text-align: center;
  padding: var(--space-8) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Price summary bar */
.ob-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-grey-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: var(--space-5);
}

.ob-price-bar__total {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
}

.ob-price-bar__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: var(--space-2);
}

.ob-price-bar__amount {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.ob-price-bar__per {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.ob-price-bar__actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

@media (max-width: 540px) {
  .ob-price-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ob-price-bar__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Legal acceptance checkbox */
.ob-legal-accept {
  margin: var(--space-5) 0 var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-grey-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.ob-legal-accept__label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.ob-legal-accept__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--brand-primary, #1a56db);
  cursor: pointer;
}

.ob-legal-accept__label a {
  color: var(--brand-primary, #1a56db);
  text-decoration: underline;
}
