/* =====================================================================
   Bajrang Electricals and Engineering Works — Component Library
   Shared across the public website, admin dashboard, worker dashboard,
   and customer portal. Requires tokens.css and base.css to be loaded
   first. Components read color from the --surface-* tokens (see
   tokens.css §10) so the same rules work on the public site's dark
   marketing sections and the light .app-shell surface without
   duplication.
===================================================================== */

/* ---------- 1. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  padding: 0.85rem 1.6rem;
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn--sm {
  padding: 0.55rem 1.15rem;
  font-size: var(--text-sm);
}

.btn--lg {
  padding: 1.05rem 2rem;
  /* Fixed rather than --text-lg: buttons do not wrap, so the public site's
     larger reading scale would push a long label off a phone screen. */
  font-size: 1.125rem;
}

/* On a phone a long label (the Hindi ones especially) is allowed a second
   line instead of running off the screen. */
@media (max-width: 480px) {
  .btn--lg {
    max-width: 100%;
    padding-inline: 1.4rem;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--icon {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-electric-blue), var(--color-electric-blue-light));
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(47, 125, 255, 0.28);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(47, 125, 255, 0.4);
}

.btn--primary:active {
  transform: translateY(0) scale(0.98);
}

.btn--secondary {
  background: transparent;
  color: var(--surface-text);
  border-color: var(--surface-border);
}

.btn--secondary:hover {
  border-color: var(--color-electric-blue-light);
  color: var(--color-electric-blue);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--surface-text-secondary);
  padding-inline: 1rem;
}

.btn--ghost:hover {
  background: var(--color-electric-blue-dim);
  color: var(--surface-text);
}

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

.btn--danger:hover {
  background: #a8232f;
  transform: translateY(-2px);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--color-white);
  animation: btn-spin 0.7s linear infinite;
}

.btn--secondary.is-loading::after,
.btn--ghost.is-loading::after {
  color: var(--surface-text);
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 2. FORMS & INPUTS ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--surface-text);
}

.field__label .required {
  color: var(--color-danger);
  margin-left: 0.2rem;
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--surface-text-muted);
}

.field__error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-danger);
}

.input,
.textarea,
.select select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--surface-text);
  background: var(--surface-card);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--surface-text-muted);
}

.input:hover,
.textarea:hover,
.select select:hover {
  border-color: var(--color-navy-500, var(--surface-border));
}

.input:focus-visible,
.textarea:focus-visible,
.select select:focus-visible {
  outline: none;
  border-color: var(--color-electric-blue);
  box-shadow: var(--shadow-focus);
}

.input[aria-invalid='true'],
.textarea[aria-invalid='true'],
.field--error .select select {
  border-color: var(--color-danger);
}

.input[aria-invalid='true']:focus-visible,
.textarea[aria-invalid='true']:focus-visible {
  box-shadow: 0 0 0 3px var(--color-danger-bg);
}

.input:disabled,
.textarea:disabled,
.select select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.select {
  position: relative;
}

.select select {
  appearance: none;
  padding-right: 2.5rem;
}

.select::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--surface-text-muted);
  border-bottom: 2px solid var(--surface-text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-sm);
  color: var(--surface-text);
  cursor: pointer;
}

.checkbox input,
.radio input {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border: 1.5px solid var(--surface-border);
  background: var(--surface-card);
  display: inline-grid;
  place-content: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.checkbox input {
  border-radius: 5px;
}

.radio input {
  border-radius: 50%;
}

.checkbox input::before {
  content: '';
  width: 0.6rem;
  height: 0.6rem;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform var(--transition-fast);
  background: var(--color-white);
}

.radio input::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  transform: scale(0);
  transition: transform var(--transition-fast);
  background: var(--color-white);
}

.checkbox input:checked,
.radio input:checked {
  background: var(--color-electric-blue);
  border-color: var(--color-electric-blue);
}

.checkbox input:checked::before,
.radio input:checked::before {
  transform: scale(1);
}

.checkbox input:focus-visible,
.radio input:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 2px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.switch input {
  appearance: none;
  width: 2.6rem;
  height: 1.5rem;
  border-radius: var(--radius-pill);
  background: var(--surface-border);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.switch input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--color-white);
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.switch input:checked {
  background: var(--color-electric-blue);
}

.switch input:checked::before {
  transform: translateX(1.1rem);
}

.switch input:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 2px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

/* ---------- 3. CARDS ---------- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.card--interactive {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-electric-blue-light);
}

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

.card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--surface-text);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--surface-text-muted);
  margin-top: 0.2rem;
}

.card__footer {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.stat-card__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--surface-text);
}

.stat-card__delta {
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
}

.stat-card__delta--up {
  color: var(--color-success);
}

.stat-card__delta--down {
  color: var(--color-danger);
}

/* ---------- 4. TABLES ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

.table {
  font-size: var(--text-sm);
  min-width: 640px;
}

.table th,
.table td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
}

.table th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--surface-text-muted);
  background: color-mix(in srgb, var(--surface-card) 92%, var(--surface-border) 8%);
}

.table td {
  color: var(--surface-text);
}

.table td.is-numeric,
.table td.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--color-electric-blue-dim);
}

.table--compact th,
.table--compact td {
  padding: 0.55rem 0.85rem;
}

/* ---------- 5. BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.badge--neutral {
  background: color-mix(in srgb, var(--surface-text-muted) 16%, transparent);
  color: var(--surface-text-secondary);
}

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

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

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

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

/* ---------- 6. ALERTS ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-sm);
}

.alert__icon {
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.1rem;
}

.alert__body {
  flex: 1;
}

.alert__title {
  font-weight: 700;
  margin-bottom: 0.15rem;
  display: block;
}

.alert__close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.7;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.alert__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.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--danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}

/* ---------- 7. DROPDOWNS ---------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--app-surface, var(--surface-card));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  z-index: 60;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  /* visibility, not just opacity, is what actually removes a closed menu's
     links from the tab order — opacity alone leaves them invisibly
     focusable, a real keyboard trap. No transition on visibility itself,
     so opening still reads as an instant "now visible" the moment the fade
     starts; closing loses the fade-out (an acceptable trade for not
     trapping keyboard focus). */
  visibility: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.dropdown[data-open='true'] .dropdown__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--app-text-primary, var(--surface-text));
  border-radius: var(--radius-sm);
  text-align: left;
  /* The menu is as wide as its longest item; an item never breaks in two. */
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.dropdown__item:hover {
  background: var(--color-electric-blue-tint);
  color: var(--color-electric-blue-dark);
}

.dropdown__item--danger {
  color: var(--color-danger);
}

.dropdown__item--danger:hover {
  background: var(--color-danger-bg);
}

.dropdown__divider {
  height: 1px;
  background: var(--surface-border);
  margin: 0.35rem 0.25rem;
}

/* ---------- 8. MODALS ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 22, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  /* See the matching comment on .dropdown__menu — without this, a closed
     modal's buttons stay reachable by Tab even though nothing is visible. */
  visibility: hidden;
  transition: opacity var(--transition-fast);
}

.modal-overlay[data-open='true'] {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: min(640px, 90vh);
  overflow-y: auto;
  background: var(--app-surface, var(--surface-card));
  color: var(--app-text-primary, var(--surface-text));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-fast);
}

.modal-overlay[data-open='true'] .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: 700;
}

.modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--app-text-secondary, var(--surface-text-secondary));
  transition: background var(--transition-fast);
}

.modal__close:hover {
  background: color-mix(in srgb, var(--surface-text-muted) 14%, transparent);
}

.modal__body {
  color: var(--app-text-secondary, var(--surface-text-secondary));
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.modal__footer {
  margin-top: var(--space-md);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ---------- 9. LOADING STATES ---------- */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2.5px solid var(--surface-border);
  border-top-color: var(--color-electric-blue);
  animation: spin 0.7s linear infinite;
}

.spinner--sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-border);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-card) 70%, white 10%), transparent);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton--text {
  height: 0.9rem;
  width: 100%;
  max-width: 220px;
}

.skeleton--title {
  height: 1.4rem;
  width: 60%;
  max-width: 320px;
}

.skeleton--avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}

.skeleton--block {
  height: 100%;
  width: 100%;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ---------- 10. ERROR & EMPTY STATES ---------- */
.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: var(--space-xl) var(--space-md);
  color: var(--surface-text-secondary);
}

.state-panel__icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 0.4rem;
}

.state-panel--error .state-panel__icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.state-panel--empty .state-panel__icon {
  background: color-mix(in srgb, var(--surface-text-muted) 14%, transparent);
  color: var(--surface-text-muted);
}

.state-panel__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--surface-text);
}

.state-panel__message {
  font-size: var(--text-sm);
  max-width: 42ch;
}

.state-panel__action {
  margin-top: 0.4rem;
}

/* ---------- 11. NAVIGATION — PUBLIC SITE HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 1.1rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

.site-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-sm);
  background: var(--color-electric-blue-dim);
  color: var(--color-electric-blue-light);
  font-size: 1.1rem;
}

.site-logo__accent {
  color: var(--color-electric-blue-light);
}

.site-nav {
  display: none;
  gap: var(--space-lg);
}

.site-nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  position: relative;
  padding: 0.3rem 0;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-electric-blue-light);
  transition: width var(--transition-fast);
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--color-text-primary);
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after {
  width: 100%;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Below 900px the drawer takes over navigation and already offers its own
   prominent Log In button — keeping a second one in the header is what
   was pushing the hamburger trigger off-screen on narrow phones. */
.site-header__login-link {
  display: none;
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }

  .site-header__login-link {
    display: inline-flex;
  }
}

/* Small laptops and landscape tablets: the full menu is showing but there
   is not yet room for its widest spacing, least of all in Hindi. */
@media (min-width: 900px) and (max-width: 1199px) {
  .site-header__inner {
    gap: var(--space-sm);
  }

  .site-nav {
    gap: 1.1rem;
  }

  .site-header__actions {
    gap: var(--space-xs);
  }
}

@media (max-width: 380px) {
  .site-header__actions {
    gap: var(--space-2xs);
  }
}

/* ---------- 12. MOBILE NAVIGATION DRAWER ---------- */
.mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--surface-border);
  color: var(--surface-text);
}

@media (min-width: 900px) {
  .mobile-nav-toggle {
    display: none;
  }
}

.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 300;
  visibility: hidden;
}

.mobile-nav-drawer[data-open='true'] {
  visibility: visible;
}

.mobile-nav-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 13, 0.65);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.mobile-nav-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(320px, 85vw);
  background: var(--color-navy-900);
  border-left: 1px solid var(--color-navy-600);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  transform: translateX(100%);
  transition: transform var(--transition-med);
}

.mobile-nav-drawer[data-open='true'] .mobile-nav-drawer__overlay {
  opacity: 1;
}

.mobile-nav-drawer[data-open='true'] .mobile-nav-drawer__panel {
  transform: translateX(0);
}

.mobile-nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mobile-nav-drawer__link {
  padding: 0.9rem 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-navy-700);
}

@media (min-width: 900px) {
  .mobile-nav-drawer {
    display: none;
  }
}

/* ---------- 13. LANGUAGE SWITCHER ---------- */
.lang-switch__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--surface-border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--surface-text);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.lang-switch__trigger:hover {
  border-color: var(--color-electric-blue-light);
  color: var(--color-electric-blue-light);
}

.lang-switch__menu {
  min-width: 168px;
}

.lang-switch__item[aria-checked='true'] {
  color: var(--color-electric-blue-dark);
  font-weight: 700;
}

.lang-switch__item[aria-checked='true']::after {
  content: '';
  width: 0.4rem;
  height: 0.7rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* ---------- 14. APPLICATION SHELL — sidebar, header, layout ---------- */
.app-shell {
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text-primary);
  display: grid;
  grid-template-columns: var(--app-sidebar-width) 1fr;
}

.app-sidebar {
  background: var(--color-navy-950);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  padding: var(--space-sm);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.5rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--color-navy-700);
}

.app-sidebar__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-sm);
  background: var(--color-electric-blue-dim);
  color: var(--color-electric-blue-light);
  flex-shrink: 0;
}

.app-sidebar__section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.6rem 0.75rem 0.3rem;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.app-sidebar__nav-item svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.app-sidebar__nav-item:hover {
  background: var(--color-navy-800);
  color: var(--color-text-primary);
}

.app-sidebar__nav-item.is-active {
  background: var(--color-electric-blue-dim);
  color: var(--color-electric-blue-light);
  font-weight: 600;
}

.app-sidebar__footer {
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-navy-700);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--app-header-height);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-inline: var(--space-md);
}

.app-header__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--app-text-primary);
}

.app-header__search {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  color: var(--app-text-muted);
  min-width: 240px;
  flex: 1;
  max-width: 360px;
}

.app-header__search input {
  border: none;
  background: none;
  width: 100%;
  color: var(--app-text-primary);
  font-size: var(--text-sm);
}

.app-header__search svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .app-header__search {
    display: flex;
  }
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  color: var(--app-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.app-icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.app-icon-btn:hover {
  background: var(--app-bg);
  color: var(--app-text-primary);
}

.app-icon-btn__dot {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-danger);
  border: 1.5px solid var(--app-surface);
}

.app-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast);
}

.app-user-trigger:hover {
  background: var(--app-bg);
}

.app-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--color-electric-blue-dim);
  color: var(--color-electric-blue-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.app-user-trigger__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--app-text-primary);
  text-align: left;
  line-height: 1.2;
}

.app-user-trigger__role {
  font-size: var(--text-xs);
  color: var(--app-text-muted);
  display: block;
}

/* Below this width the header has too little room for the name/role block
   (hamburger + title + language + bell + avatar already fill a 375px
   screen) — the avatar alone still makes it clear this opens the user
   menu, and the full name is one tap away inside it. */
@media (max-width: 639px) {
  .app-user-trigger__meta {
    display: none;
  }

  .app-header {
    padding-inline: var(--space-sm);
  }

  .app-header__actions {
    gap: 0.15rem;
  }

  .lang-switch__trigger {
    padding: 0.5rem;
  }

  .lang-switch__trigger span:not(.visually-hidden) {
    display: none;
  }
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-content {
  padding: var(--space-md);
  max-width: var(--app-max-width);
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.app-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  color: var(--app-text-secondary);
}

.app-sidebar-toggle:hover {
  background: var(--app-bg);
}

@media (min-width: 1024px) {
  .app-sidebar-toggle {
    display: none;
  }
}

/* Below 1024px the sidebar becomes an off-canvas drawer, reusing the same
   markup rather than a second sidebar implementation. */
@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 300;
    width: min(280px, 85vw);
    transform: translateX(-100%);
    transition: transform var(--transition-med);
    box-shadow: var(--shadow-lg);
  }

  .app-shell[data-sidebar-open='true'] .app-sidebar {
    transform: translateX(0);
  }

  .app-shell__sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 13, 0.55);
    z-index: 250;
  }

  .app-shell[data-sidebar-open='true'] .app-shell__sidebar-overlay {
    display: block;
  }
}

@media (min-width: 1024px) {
  .app-shell__sidebar-overlay {
    display: none !important;
  }
}

/* ---------- 15. MARKETING SITE — sections, rhythm ---------- */
.section {
  padding-block: var(--space-2xl);
}

.section--tight {
  padding-block: var(--space-xl);
}

.section__head {
  max-width: 640px;
  margin-bottom: var(--space-lg);
}

.section__head--center {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.section__eyebrow {
  color: var(--color-electric-blue-light);
  display: block;
  margin-bottom: var(--space-2xs);
}

.surface-light .section__eyebrow {
  color: var(--color-electric-blue-dark);
}

.section__title {
  margin-bottom: var(--space-xs);
}

/* A heading is the brightest text in its block, a step above the paragraph
   under it. These used to inherit the paragraph colour, so a title and its
   body read at the same weight on the dark sections. */
.section__title,
.feature-card h3,
.service-card h3,
.process-step h3,
.faq-item h3 {
  color: var(--surface-text);
}

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

/* ---------- 16. PAGE HERO (sub-pages — lighter than the home hero) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-2xl) var(--space-xl);
  background: linear-gradient(160deg, var(--color-navy-900) 0%, var(--color-navy-950) 100%);
}

.page-hero__glow {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: var(--color-electric-blue);
  filter: blur(100px);
  opacity: 0.28;
  top: -140px;
  right: -60px;
  pointer-events: none;
}

.page-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.page-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.page-hero__breadcrumb a {
  color: var(--color-text-secondary);
}

.page-hero__breadcrumb a:hover {
  color: var(--color-electric-blue-light);
}

.page-hero h1 {
  color: var(--color-text-primary);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  margin-block: var(--space-xs) 0.85rem;
}

.page-hero p.lead {
  color: var(--color-text-secondary);
}

/* ---------- 17. HOME HERO ---------- */
.home-hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, var(--color-navy-900) 0%, var(--color-navy-950) 55%, #060a16 100%);
}

.home-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
}

.home-hero__glow--one {
  width: 460px;
  height: 460px;
  background: var(--color-electric-blue);
  top: -140px;
  right: -100px;
}

.home-hero__glow--two {
  width: 340px;
  height: 340px;
  background: #1a3d8f;
  bottom: -120px;
  left: -80px;
}

.home-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-xl);
  padding-block: var(--space-2xl);
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .home-hero__inner {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
  }
}

.home-hero h1 {
  color: var(--color-text-primary);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  margin-block: var(--space-sm);
}

.home-hero__panel {
  background: linear-gradient(145deg, var(--color-navy-800), var(--color-navy-700));
  border: 1px solid var(--color-navy-600);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.home-hero__panel-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--color-navy-600);
}

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

.home-hero__panel-stat dt {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.home-hero__panel-stat dd {
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ---------- 18. FEATURE / SERVICE GRID ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  background: var(--color-electric-blue-dim);
  color: var(--color-electric-blue-light);
  margin-bottom: var(--space-sm);
}

.surface-light .feature-card__icon {
  background: var(--color-electric-blue-tint);
  color: var(--color-electric-blue-dark);
}

.feature-card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.feature-card h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.35rem;
}

.feature-card p {
  color: var(--surface-text-secondary);
  font-size: var(--text-sm);
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-electric-blue-light);
}

.service-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-electric-blue-dim);
  color: var(--color-electric-blue-light);
  margin-bottom: var(--space-sm);
}

.surface-light .service-card__icon {
  background: var(--color-electric-blue-tint);
  color: var(--color-electric-blue-dark);
}

.service-card__icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.service-card h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.4rem;
}

.service-card p {
  color: var(--surface-text-secondary);
  font-size: var(--text-sm);
  flex: 1;
  margin-bottom: var(--space-sm);
}

.service-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-electric-blue-light);
}

.surface-light .service-card__link {
  color: var(--color-electric-blue-dark);
}

.service-card__link svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform var(--transition-fast);
}

.service-card:hover .service-card__link svg {
  transform: translateX(3px);
}

/* ---------- 19. STAT BAND ----------
   Deliberately built for qualitative capability statements, not invented
   historical numbers (customer counts, "years in business", etc.) that
   this project has no real source for — see the content in each page. */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-navy-950);
  border-radius: var(--radius-lg);
}

.stat-band__item {
  text-align: center;
}

.stat-band__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-electric-blue-light);
  display: block;
}

.stat-band__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* ---------- 20. PROCESS STEPS ---------- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  counter-reset: process-step;
}

.process-step {
  position: relative;
  padding: var(--space-md);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

.process-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-electric-blue);
  color: var(--color-white);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.process-step h3 {
  font-size: var(--text-md);
  margin-bottom: 0.3rem;
}

.process-step p {
  font-size: var(--text-sm);
  color: var(--surface-text-secondary);
}

/* ---------- 21. CTA BANNER ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-navy-800), var(--color-navy-900));
  border: 1px solid var(--color-navy-600);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.cta-banner h2 {
  color: var(--color-text-primary);
  max-width: 46ch;
}

.cta-banner p {
  color: var(--color-text-secondary);
  max-width: 56ch;
}

.cta-banner__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

/* ---------- 22. FAQ ACCORDION ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.faq-item {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--surface-text);
}

.faq-item__icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--surface-border);
  color: var(--surface-text-secondary);
}

.faq-item__icon svg {
  width: 0.85rem;
  height: 0.85rem;
}

.faq-item__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-med);
}

.faq-item[data-open='true'] .faq-item__panel {
  max-height: 480px;
}

.faq-item__panel-inner {
  padding: 0 var(--space-md) var(--space-md);
  color: var(--surface-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.faq-item .icon-minus,
.faq-item .icon-plus {
  display: none;
}

.faq-item[data-open='true'] .icon-minus {
  display: block;
}

.faq-item:not([data-open='true']) .icon-plus {
  display: block;
}

/* ---------- 23. PREMIUM FOOTER ---------- */
.site-footer--premium {
  background: var(--color-navy-950);
  padding-block: var(--space-xl) var(--space-md);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
}

@media (max-width: 900px) {
  .site-footer__grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.site-footer__brand p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
  max-width: 32ch;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.site-footer__col h6 {
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.site-footer__col a {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.site-footer__col a:hover {
  color: var(--color-electric-blue-light);
}

.site-footer__contact-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.site-footer__contact-line svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--color-electric-blue-light);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-navy-700);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---------- 24. AUTH PAGES (login / register) ---------- */
.auth-shell {
  min-height: calc(100vh - var(--app-header-height, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-sm);
  background: linear-gradient(160deg, var(--color-navy-900) 0%, var(--color-navy-950) 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-navy-800);
  border: 1px solid var(--color-navy-600);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.auth-card__head {
  text-align: center;
  margin-bottom: var(--space-md);
}

.auth-card__head h1 {
  color: var(--color-text-primary);
  font-size: var(--text-2xl);
}

.auth-card__head p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-top: 0.3rem;
}

.auth-card .field__label,
.auth-card .field__hint {
  color: var(--color-text-secondary);
}

.auth-card .field__label {
  color: var(--color-text-primary);
}

.auth-card .input,
.auth-card .select select {
  background: var(--color-navy-900);
  border-color: var(--color-navy-600);
  color: var(--color-text-primary);
}

.auth-card .input::placeholder {
  color: var(--color-text-muted);
}

.auth-card__foot {
  text-align: center;
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.auth-card__foot a {
  color: var(--color-electric-blue-light);
  font-weight: 600;
}

.input-group {
  position: relative;
}

.input-group .input {
  padding-right: 2.75rem;
}

.input-group__toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--surface-text-muted);
}

.input-group__toggle:hover {
  color: var(--surface-text);
}

.input-group__toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* ---------- 25. FORM STATUS BANNER (submit success/error on real forms) ---------- */
.form-status {
  display: none;
}

.form-status.is-visible {
  display: flex;
}

/* ---------- 26. RESPONSIVE: hide the register CTA before the drawer takes over,
   consistent with why the login link already hides at this width ---------- */
.site-header__register-link {
  display: none;
}

@media (min-width: 900px) {
  .site-header__register-link {
    display: inline-flex;
  }
}

/* ---------- 27. STATUS TIMELINE (job detail) ---------- */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-step {
  position: relative;
  display: flex;
  gap: 0.9rem;
  padding-bottom: 1.5rem;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-step__dot {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 2px solid var(--surface-border);
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-step__dot svg {
  width: 0.75rem;
  height: 0.75rem;
}

.timeline-step__line {
  flex: 1;
  width: 2px;
  background: var(--surface-border);
  margin-block: 0.2rem;
}

.timeline-step.is-done .timeline-step__dot {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-white);
}

.timeline-step.is-done .timeline-step__line {
  background: var(--color-success);
}

.timeline-step.is-current .timeline-step__dot {
  background: var(--color-electric-blue);
  border-color: var(--color-electric-blue);
  color: var(--color-white);
  box-shadow: 0 0 0 4px var(--color-electric-blue-dim);
}

.timeline-step__body {
  padding-top: 0.05rem;
}

.timeline-step__title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--surface-text);
}

.timeline-step__time {
  font-size: var(--text-xs);
  color: var(--surface-text-muted);
  font-family: var(--font-mono);
}

/* ---------- 28. TABS (jobs active/history) ---------- */
.tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface-border);
  border-radius: var(--radius-pill);
}

.tabs__item {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--surface-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tabs__item.is-active {
  background: var(--surface-card);
  color: var(--surface-text);
  box-shadow: var(--shadow-sm);
}

/* ---------- 29. TOOLBAR (admin list-page search/filter row) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.toolbar__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 260px;
  min-width: 200px;
  padding: 0 0.85rem;
  height: 2.5rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--surface-text-muted);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.toolbar__search:focus-within {
  border-color: var(--color-electric-blue);
  box-shadow: 0 0 0 3px var(--color-electric-blue-dim);
}

.toolbar__search svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.toolbar__search input {
  flex: 1;
  border: none;
  background: none;
  color: var(--surface-text);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
}

.toolbar__select {
  height: 2.5rem;
  padding: 0 2rem 0 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-card) 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='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  background-size: 1rem;
  appearance: none;
  color: var(--surface-text);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
}

.toolbar__select:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 1px;
}

.toolbar__spacer {
  flex: 1;
}

/* Second toolbar row: one narrow control per column filter. */
.toolbar--filters {
  margin-top: -0.5rem;
}

.toolbar__search--compact {
  flex: 0 1 12rem;
  min-width: 9rem;
}

.toolbar__count {
  color: var(--surface-text-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

/* ---------- 30. PAGINATION ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  flex-wrap: wrap;
}

.pagination__info {
  font-size: var(--text-sm);
  color: var(--surface-text-muted);
}

.pagination__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- 31. KPI CARD (executive dashboard tile with trend accent) ---------- */
.kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--kpi-accent, var(--color-electric-blue));
}

.kpi-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--surface-text-muted);
}

.kpi-card__icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-md);
  background: var(--kpi-accent-tint, var(--color-electric-blue-tint));
  color: var(--kpi-accent, var(--color-electric-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.kpi-card__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--surface-text);
  font-variant-numeric: tabular-nums;
}

.kpi-card__meta {
  font-size: var(--text-xs);
  color: var(--surface-text-muted);
}

/* ---------- 32. SIMPLE BAR CHART (hand-rolled, no chart library) ---------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  height: 160px;
  padding-top: 0.5rem;
}

.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  height: 100%;
}

.bar-chart__bar {
  width: 100%;
  max-width: 2.2rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--color-electric-blue);
  min-height: 3px;
  transition: opacity var(--transition-fast);
}

.bar-chart__col:hover .bar-chart__bar {
  opacity: 0.8;
}

.bar-chart__label {
  font-size: var(--text-xs);
  color: var(--surface-text-muted);
  white-space: nowrap;
}

/* ---------- 33. DESTRUCTIVE CONFIRM (inline modal footer variant) ---------- */
.confirm-danger-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-danger-bg);
  color: var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.confirm-danger-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- 34. AI ASSISTANT — chat widget, inline "AI Assist" panels, insights card ----------
   One consistent visual language for every AI surface in the product
   (customer chat, admin summarize/draft/insights panels): the violet
   --color-ai-accent, a small sparkle glyph, and a calm, text-forward
   layout — never a flashing "AI-powered!" badge treatment. */

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--color-ai-accent-tint);
  color: var(--color-ai-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ai-badge svg {
  width: 0.85rem;
  height: 0.85rem;
}

/* -- Floating chat launcher (customer portal) -- */
.ai-fab {
  position: fixed;
  right: 1.75rem;
  bottom: 1.75rem;
  z-index: 60;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-ai-accent), var(--color-ai-accent-light));
  color: var(--color-white);
  box-shadow: 0 10px 28px rgba(101, 82, 224, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 34px rgba(101, 82, 224, 0.5);
}

.ai-fab svg {
  width: 1.5rem;
  height: 1.5rem;
}

.ai-fab__dot {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--color-danger);
  border: 2px solid var(--app-surface);
}

/* -- Chat panel -- */
.ai-panel {
  position: fixed;
  right: 1.75rem;
  bottom: 6rem;
  z-index: 60;
  width: min(23rem, calc(100vw - 2.5rem));
  height: min(34rem, calc(100vh - 8.5rem));
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0.75rem) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.ai-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.ai-panel__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, var(--color-ai-accent), var(--color-ai-accent-light));
  color: var(--color-white);
  flex-shrink: 0;
}

.ai-panel__header-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-panel__header-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.ai-panel__header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.ai-panel__header-title {
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.2;
}

.ai-panel__header-subtitle {
  font-size: var(--text-xs);
  opacity: 0.85;
}

.ai-panel__close {
  background: transparent;
  border: none;
  color: var(--color-white);
  opacity: 0.85;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  display: flex;
}

.ai-panel__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.ai-panel__close svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ai-panel__lang {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 0.15rem;
  flex-shrink: 0;
}

.ai-panel__lang button {
  border: none;
  background: transparent;
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  opacity: 0.75;
}

.ai-panel__lang button.is-active {
  background: var(--color-white);
  color: var(--color-ai-accent);
  opacity: 1;
}

.ai-panel__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--app-bg);
}

.ai-msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ai-msg--assistant {
  align-self: flex-start;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-text-primary);
  border-bottom-left-radius: 0.3rem;
}

.ai-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-ai-accent), var(--color-ai-accent-light));
  color: var(--color-white);
  border-bottom-right-radius: 0.3rem;
}

.ai-msg--error {
  align-self: center;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning);
  font-size: var(--text-xs);
  text-align: center;
}

.ai-msg--typing {
  align-self: flex-start;
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 0.9rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  border-bottom-left-radius: 0.3rem;
}

.ai-msg--typing span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-ai-accent-light);
  animation: ai-typing 1.1s ease-in-out infinite;
}

.ai-msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-0.2rem); opacity: 1; }
}

.ai-panel__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  background: var(--app-bg);
  flex-shrink: 0;
}

.ai-suggestion-chip {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text-secondary);
  font-size: var(--text-xs);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.ai-suggestion-chip:hover {
  border-color: var(--color-ai-accent-light);
  color: var(--color-ai-accent);
}

.ai-panel__composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
  flex-shrink: 0;
}

.ai-panel__composer textarea {
  flex: 1 1 auto;
  resize: none;
  max-height: 5rem;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--app-text-primary);
  background: var(--app-bg);
}

.ai-panel__composer textarea:focus {
  outline: none;
  border-color: var(--color-ai-accent-light);
  box-shadow: 0 0 0 3px var(--color-ai-accent-dim);
}

.ai-panel__send {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-ai-accent);
  color: var(--color-white);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.ai-panel__send:hover {
  background: var(--color-ai-accent-light);
  transform: scale(1.05);
}

.ai-panel__send:disabled {
  background: var(--app-border-strong);
  cursor: not-allowed;
  transform: none;
}

.ai-panel__send svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* -- Inline "AI Assist" panel (admin service-request/job detail) -- */
.ai-assist {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--color-ai-accent-tint), var(--app-surface) 40%);
  overflow: hidden;
}

.ai-assist__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
}

.ai-assist__header-icon {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-ai-accent);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-assist__header-icon svg {
  width: 1rem;
  height: 1rem;
}

.ai-assist__header-title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--app-text-primary);
}

.ai-assist__header-subtitle {
  font-size: var(--text-xs);
  color: var(--app-text-muted);
}

.ai-assist__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.ai-assist__result {
  margin: 0 1rem 1rem;
  padding: 0.85rem 0.95rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--app-text-primary);
  white-space: pre-wrap;
}

.ai-assist__result--empty {
  color: var(--app-text-muted);
  font-style: italic;
}

.ai-assist__result--notice {
  color: var(--app-text-muted);
  background: var(--app-bg);
}

.ai-assist__review {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.5rem 1rem 1rem;
}

.ai-assist__review-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ai-assist__review-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.ai-assist__review-btn:hover {
  border-color: var(--color-ai-accent-light);
  color: var(--color-ai-accent);
}

.ai-assist__review-btn.is-accepted {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.ai-assist__review-btn.is-rejected {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}

/* -- Business insights card (admin dashboard) -- */
.ai-insights-card {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ai-insights-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, var(--color-ai-accent), var(--color-ai-accent-light));
  color: var(--color-white);
}

.ai-insights-card__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: var(--text-base);
}

.ai-insights-card__title svg {
  width: 1.15rem;
  height: 1.15rem;
}

.ai-insights-card__body {
  padding: 1.1rem 1.25rem;
}

.ai-insights-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-insights-card__list li {
  display: flex;
  gap: 0.6rem;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--app-text-primary);
}

.ai-insights-card__list li::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: var(--color-ai-accent);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .ai-panel {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 5.5rem;
    width: auto;
  }

  .ai-fab {
    right: 1.1rem;
    bottom: 1.1rem;
  }
}

/* ---------- 35. REPORTS & ANALYTICS — date-range filters, trend badges, line/donut charts ---------- */

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.date-range-presets {
  display: flex;
  gap: 0.3rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

.date-range-preset {
  border: none;
  background: transparent;
  color: var(--surface-text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.date-range-preset.is-active {
  background: var(--color-electric-blue);
  color: var(--color-white);
}

.date-range-custom {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

.date-range-custom input[type='date'] {
  border: none;
  background: none;
  color: var(--surface-text);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
  width: 8.6rem;
}

.date-range-custom span {
  color: var(--surface-text-muted);
  font-size: var(--text-xs);
}

/* -- KPI trend delta (used inside .kpi-card__meta) -- */
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
}

.kpi-trend svg {
  width: 0.75rem;
  height: 0.75rem;
}

.kpi-trend--up { color: var(--color-success); }
.kpi-trend--down { color: var(--color-danger); }
.kpi-trend--flat { color: var(--surface-text-muted); }

/* -- Stacked bar chart (jobs trend: completed/other/cancelled) -- */
.stacked-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  height: 160px;
  padding-top: 0.5rem;
}

.stacked-bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  height: 100%;
}

.stacked-bar-chart__bar {
  width: 100%;
  max-width: 2.2rem;
  display: flex;
  flex-direction: column-reverse;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
  min-height: 3px;
}

.stacked-bar-chart__segment:first-child {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border);
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--surface-text-secondary);
}

.chart-legend__swatch {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  flex-shrink: 0;
}

/* -- Line/area trend chart (SVG) -- */
.line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.line-chart__grid {
  stroke: var(--surface-border);
  stroke-width: 1;
}

.line-chart__area {
  fill: url(#lineChartGradient);
  opacity: 0.35;
}

.line-chart__line {
  fill: none;
  stroke: var(--color-electric-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart__dot {
  fill: var(--color-electric-blue);
  stroke: var(--surface-card);
  stroke-width: 2;
}

.line-chart__label {
  fill: var(--surface-text-muted);
  font-size: 10px;
  font-family: var(--font-base);
}

.line-chart__value-label {
  fill: var(--surface-text);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* -- Donut chart (status breakdowns) -- */
.donut-chart-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.donut-chart {
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.donut-chart__center-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-xl);
  fill: var(--surface-text);
  transform: rotate(90deg);
  text-anchor: middle;
  dominant-baseline: middle;
}

.donut-chart__center-label {
  font-size: 9px;
  fill: var(--surface-text-muted);
  text-anchor: middle;
  dominant-baseline: middle;
  transform: rotate(90deg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-width: 140px;
}

.donut-legend__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
}

.donut-legend__swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.donut-legend__label {
  flex: 1;
  color: var(--surface-text-secondary);
}

.donut-legend__value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--surface-text);
}

/* -- Report summary strip above a table (e.g. maintenance "by type" counts) -- */
.report-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.report-summary-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  color: var(--surface-text-secondary);
}

.report-summary-chip strong {
  font-family: var(--font-mono);
  color: var(--surface-text);
  font-size: var(--text-sm);
}

.report-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 720px) {
  .donut-chart-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 31. PHOTOGRAPHY / MEDIA ----------
   The public site's photographic layer. Every rule here assumes a real
   photo behind it, so each one pairs the image with a scrim or a solid
   surface — text is never laid directly on an unmodified photograph. */

/* Hero: a photograph behind the existing navy gradient rather than instead
   of it, so the headline keeps the same contrast it had without one. */
.home-hero__photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 62%;
  opacity: 0.34;
  /* The backdrop is a daylight photo of a bright green canopy. Taking most
     of the colour out keeps the hero in the brand's navy and stops the
     headline sitting on a green wash; the photo in the card beside it is
     shown in full colour. */
  filter: grayscale(0.9) brightness(0.85);
  pointer-events: none;
}

.home-hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 12, 26, 0.55) 0%, rgba(8, 12, 26, 0.2) 40%, rgba(8, 12, 26, 0.92) 100%),
    linear-gradient(90deg, rgba(8, 12, 26, 0.88) 0%, rgba(8, 12, 26, 0.45) 55%, rgba(8, 12, 26, 0.25) 100%);
}

/* The hero's equipment photo — deliberately a card, not a bleed, so it
   reads as "our equipment" rather than decorative background texture. */
.hero-media {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.hero-media__frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
}

.hero-media__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  background: linear-gradient(180deg, rgba(8, 12, 26, 0) 0%, rgba(8, 12, 26, 0.85) 70%);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.hero-media__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.hero-media__stat {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-xs);
  text-align: center;
}

.hero-media__stat dt {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-bottom: 0.2rem;
}

.hero-media__stat dd {
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-sm);
}

/* Equipment showcase: a deliberately uneven grid, so it reads as a set of
   photographs rather than a row of identical thumbnails. */
.photo-strip {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .photo-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .photo-strip {
    grid-template-columns: 1.4fr 1fr 1fr;
    grid-template-rows: repeat(2, 200px);
  }
  .photo-strip__item--tall {
    grid-row: span 2;
  }
}

.photo-strip__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  min-height: 200px;
  border: 1px solid var(--surface-border);
}

.photo-strip__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-base, 250ms ease);
}

.photo-strip__item:hover img {
  transform: scale(1.04);
}

.photo-strip__label {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-lg) var(--space-sm) var(--space-sm);
  background: linear-gradient(180deg, rgba(8, 12, 26, 0) 0%, rgba(8, 12, 26, 0.88) 65%);
  color: #fff;
}

.photo-strip__label strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
}

.photo-strip__label span {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.78);
}

/* A photo paired with content, rather than a section of icons alone. */
.split-media {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .split-media {
    grid-template-columns: 0.85fr 1.15fr;
  }
  .split-media--flip .split-media__figure {
    order: 2;
  }
}

.split-media__figure {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 520px;
  box-shadow: var(--shadow-lg);
}

.split-media__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Photo header on a service card. Sits above the existing card padding, so
   the image meets the card's own rounded edge with no seam. */
.service-card--media {
  padding: 0;
  overflow: hidden;
}

.service-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-navy-800, #16203a);
}

.service-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-base, 250ms ease);
}

.service-card--media:hover .service-card__media img {
  transform: scale(1.05);
}

.service-card__body {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
}

/* The icon moves onto the photo's lower edge, tying the two halves together
   instead of stacking two unrelated blocks. */
.service-card__media-icon {
  position: absolute;
  left: var(--space-sm);
  bottom: calc(var(--space-sm) * -1);
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-electric-blue);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.service-card__media-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.service-card--media .service-card__body {
  padding-top: calc(var(--space-md) + 0.5rem);
}

@media (prefers-reduced-motion: reduce) {
  .photo-strip__item img,
  .service-card__media img {
    transition: none;
  }
  .photo-strip__item:hover img,
  .service-card--media:hover .service-card__media img {
    transform: none;
  }
}

/* ---------- 32. 3D GENERATOR VISUAL ----------
   Paired layout: copy on one side, the WebGL canvas on the other. The
   canvas keeps a fixed aspect so the reserved space doesn't collapse
   before Three.js has drawn anything. */
.gen3d {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .gen3d {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.gen3d__figure {
  min-width: 0;
}

.gen3d__stage {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background:
    radial-gradient(ellipse at 50% 108%, rgba(47, 125, 255, 0.24) 0%, rgba(47, 125, 255, 0) 62%),
    linear-gradient(160deg, var(--color-navy-800) 0%, var(--color-navy-950) 100%);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

/* The still photo is the resting state and the no-WebGL fallback. Once
   generator-3d.js has the texture on the GPU it adds .is-3d and the canvas
   takes over. */
.gen3d__photo {
  position: absolute;
  inset: 6% 4% 12%;
  width: 92%;
  height: 82%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.gen3d__stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  cursor: grab;
  /* pan-y keeps vertical page scrolling working over the canvas on a phone,
     while horizontal drags belong to the model. */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gen3d__stage.is-3d canvas {
  display: block;
}

.gen3d__stage.is-3d .gen3d__photo {
  display: none;
}

.gen3d__stage canvas:active {
  cursor: grabbing;
}

/* Hotspots are positioned each frame by the script from projected 3D
   coordinates; without the canvas there is nothing to anchor them to. */
.gen3d__hotspot {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: var(--text-xs);
  cursor: default;
  transform: translate(-0.6rem, -50%);
  will-change: left, top;
}

.gen3d__stage.is-3d .gen3d__hotspot {
  display: inline-flex;
}

.gen3d__hotspot--left {
  flex-direction: row-reverse;
  transform: translate(calc(-100% + 0.6rem), -50%);
}

/* A hotspot belongs to one side of the machine and goes away while that
   side is turned from the viewer. */
.gen3d__hotspot {
  transition: opacity 0.25s ease, visibility 0.25s;
}

.gen3d__stage.is-3d .gen3d__hotspot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gen3d__dot {
  position: relative;
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: rgba(47, 125, 255, 0.9);
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(47, 125, 255, 0.55);
  animation: gen3d-ping 2.4s ease-out infinite;
}

@keyframes gen3d-ping {
  0% { box-shadow: 0 0 0 0 rgba(47, 125, 255, 0.55); }
  70%, 100% { box-shadow: 0 0 0 0.8rem rgba(47, 125, 255, 0); }
}

.gen3d__tag {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background: rgba(8, 12, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* Tags stay tucked away on small screens and while the model is moving; they
   open on hover, keyboard focus or tap. */
.gen3d__hotspot:hover .gen3d__tag,
.gen3d__hotspot:focus-visible .gen3d__tag,
.gen3d__hotspot:focus .gen3d__tag {
  opacity: 1;
  transform: none;
}

@media (min-width: 720px) {
  .gen3d__stage:not(.is-dragging) .gen3d__tag {
    opacity: 1;
    transform: none;
  }
}

.gen3d__hotspot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}

.gen3d__credit {
  margin-top: var(--space-sm);
  color: var(--surface-text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .gen3d__dot {
    animation: none;
  }
}

/* Sits over the canvas rather than under it, so the hint doesn't add
   height that shifts the section when it fades. */
.gen3d__hint {
  position: absolute;
  left: 50%;
  bottom: var(--space-sm);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  background: rgba(8, 12, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
}

.gen3d__specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.gen3d__spec {
  border-left: 2px solid var(--color-electric-blue);
  padding-left: var(--space-sm);
}

.gen3d__spec dt {
  color: var(--surface-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.gen3d__spec dd {
  color: var(--surface-text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-base);
}

/* ---------- 33. FLOATING WHATSAPP / CALL BUTTONS ----------
   One fixed pair, injected once by layout.js on every public page.
   Sits above ordinary content but below drawers/modals (z-index 200+). */
.floating-contact {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.floating-contact__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.floating-contact__btn svg {
  width: 1.6rem;
  height: 1.6rem;
}

.floating-contact__btn:hover,
.floating-contact__btn:focus-visible {
  transform: translateY(-2px) scale(1.04);
}

.floating-contact__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.floating-contact__btn--whatsapp {
  background: #25d366;
  position: relative;
}

/* A single soft pulse marks it as "tap me" without nagging — matches the
   restrained ping already used on the homepage 3D hotspots. */
.floating-contact__btn--whatsapp::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  animation: floating-contact-ping 2.6s ease-out infinite;
}

@keyframes floating-contact-ping {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70%, 100% { box-shadow: 0 0 0 0.9rem rgba(37, 211, 102, 0); }
}

.floating-contact__btn--call {
  background: var(--color-electric-blue);
}

@media (max-width: 480px) {
  .floating-contact {
    right: var(--space-sm);
    bottom: var(--space-sm);
  }
  .floating-contact__btn {
    width: 2.9rem;
    height: 2.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-contact__btn--whatsapp::before {
    animation: none;
  }
}

/* ---------- 34. CLIENTS STRIP ----------
   A row of real client wordmarks, shown at their natural colour on the
   page's light surface (matching the surrounding process/stats sections)
   rather than boxed into cards — the logos themselves carry enough
   visual weight already. */
.clients-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg) var(--space-2xl);
  margin-top: var(--space-md);
}

.clients-strip__item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
}

.clients-strip__item img {
  height: 100%;
  width: auto;
  max-width: 9rem;
  object-fit: contain;
  filter: grayscale(1) opacity(0.55);
  transition: filter var(--transition-fast, 0.15s ease);
}

.clients-strip__item:hover img {
  filter: none;
}

@media (max-width: 640px) {
  .clients-strip {
    gap: var(--space-md) var(--space-lg);
  }
  .clients-strip__item {
    height: 2.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clients-strip__item img {
    transition: none;
  }
}

/* ---------- 35. BRAND LOGO ----------
   The artwork is dark navy on near-white, so it lives on a light chip that
   matches its own background colour — no visible box edge, readable on the
   dark header and footer alike. */
.site-logo__img {
  display: block;
  height: 3rem;
  width: auto;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #fefefe;
}

.site-logo--full .site-logo__img {
  height: auto;
  width: min(16rem, 100%);
  padding: 0.5rem 0.9rem;
}

@media (min-width: 720px) {
  .site-logo__img {
    height: 3.5rem;
  }
}

/* Dashboard sidebar brand: the logo on its light chip, with the company
   name written out beside it. */
.app-sidebar__brand--logo {
  gap: 0.7rem;
}

.app-sidebar__logo {
  display: block;
  flex-shrink: 0;
  height: 2.6rem;
  width: auto;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: #fefefe;
}

.app-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-size: 0.95rem;
}

.app-sidebar__brand-text small {
  margin-top: 0.15rem;
  color: var(--color-electric-blue-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- 36. STAFF LIST (Settings → Team Access) ---------- */
.staff-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--surface-border);
}

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

.staff-row__who {
  flex: 1 1 14rem;
  min-width: 0;
}

.staff-row__name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.staff-row__meta {
  color: var(--surface-text-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.staff-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---------- 37. PHOTO GALLERY ----------
   Photos keep their own proportions (a column layout, not a fixed-ratio
   grid), so nothing is cropped a second time on screen. */
.gallery-grid {
  columns: 3 17rem;
  column-gap: var(--space-sm);
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 var(--space-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-navy-800);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.gallery-item__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.gallery-item__open img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.gallery-item__open:hover img {
  transform: scale(1.03);
}

.gallery-item__open:focus-visible {
  outline: 2px solid var(--color-electric-blue-light);
  outline-offset: -2px;
}

.gallery-item figcaption {
  padding: 0.7rem 0.9rem 0.8rem;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  background: rgba(3, 5, 10, 0.93);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  /* Leaves room for the caption beneath it on a short screen. */
  max-height: calc(100vh - 7rem);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
}

.lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.9rem;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  text-align: center;
}

.lightbox__count {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 24, 48, 0.85);
  color: #fff;
  cursor: pointer;
}

.lightbox__btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.lightbox__btn:hover {
  background: var(--color-electric-blue);
}

.lightbox__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

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

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev {
  left: var(--space-sm);
}

.lightbox__nav--next {
  right: var(--space-sm);
}

@media (max-width: 640px) {
  .lightbox {
    padding: var(--space-sm);
  }
  /* On a phone the arrows sit below the photo instead of over its edges. */
  .lightbox__nav {
    top: auto;
    bottom: var(--space-sm);
    transform: none;
  }
  .lightbox__img {
    max-height: calc(100vh - 11rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item__open img {
    transition: none;
  }
  .gallery-item__open:hover img {
    transform: none;
  }
}

/* ---------- 38. QUOTATION / INVOICE EDITOR (billing-editor.js) ---------- */
.bill-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bill-lines__head,
.bill-line {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 6rem 4.5rem 4.75rem 6.5rem 4.75rem 6.75rem 2rem;
  gap: 0.4rem;
  align-items: center;
}

.bill-lines__head {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--surface-text-muted);
  padding-bottom: 0.15rem;
}

.bill-lines__head span:nth-child(7) {
  text-align: right;
}

.bill-lines__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bill-line .input {
  padding-inline: 0.5rem;
  min-width: 0;
}

.bill-line.has-error .input[data-k='description'],
.bill-line.has-error .input[data-k='hsnSac'] {
  border-color: var(--color-danger);
}

.bill-line__cell {
  display: block;
  min-width: 0;
}

.bill-line__label {
  display: none;
}

.bill-line__amount {
  text-align: right;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--surface-text);
}

.bill-lines__add {
  align-self: flex-start;
}

.bill-totals {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: var(--text-sm);
  width: min(100%, 300px);
  margin-left: auto;
}

.bill-totals__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.bill-totals__row .font-mono {
  font-variant-numeric: tabular-nums;
}

.bill-totals__row--total {
  font-weight: 700;
  font-size: var(--text-base);
  border-top: 1px solid var(--surface-border);
  padding-top: 0.4rem;
  margin-top: 0.15rem;
}

.bill-totals__row--due {
  font-weight: 700;
}

.bill-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-md);
}

.bill-party {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.bill-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1.25rem;
  font-size: var(--text-sm);
  margin-bottom: 1rem;
}

.bill-meta dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--surface-text-muted);
}

.bill-meta dd {
  margin: 0.15rem 0 0;
  color: var(--surface-text);
  overflow-wrap: anywhere;
}

.bill-section-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin: 1.25rem 0 0.4rem;
}

.bill-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: var(--text-sm);
}

.bill-list-row__meta {
  color: var(--surface-text-muted);
  font-size: var(--text-xs);
}

.modal-footer-spacer {
  margin-right: auto;
}

@media (max-width: 760px) {
  .bill-lines__head {
    display: none;
  }

  .bill-line {
    grid-template-columns: 1fr 1fr 1fr;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    position: relative;
  }

  .bill-line__cell:first-child {
    grid-column: 1 / -1;
    padding-right: 2rem;
  }

  .bill-line__label {
    display: block;
    font-size: var(--text-xs);
    color: var(--surface-text-muted);
    margin-bottom: 0.15rem;
  }

  .bill-line__amount {
    align-self: end;
    padding-bottom: 0.55rem;
  }

  .bill-line__remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
  }
}

/* ---------- 39. ATTENDANCE (worker app card, dashboard register) ---------- */
.attendance-card {
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.attendance-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.attendance-card__date {
  font-size: var(--text-sm);
  color: var(--app-text-muted, var(--surface-text-muted));
}

.attendance-card__status {
  margin: 0;
  font-size: var(--text-base);
}

.attendance-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.attendance-card__actions .btn--lg {
  flex: 1 1 14rem;
}

.att-toolbar {
  margin-bottom: var(--space-md);
}

.att-rules-note,
.att-legend {
  font-size: var(--text-sm);
  color: var(--surface-text-muted);
}

.att-legend {
  margin: 0 0 0.6rem;
}

.att-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.6rem;
  margin-bottom: var(--space-md);
}

.att-count {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
}

.att-count__n {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.att-count__label {
  font-size: var(--text-xs);
  color: var(--surface-text-muted);
}

.att-count--present .att-count__n { color: var(--color-success); }
.att-count--late .att-count__n,
.att-count--half_day .att-count__n { color: var(--color-warning); }
.att-count--absent .att-count__n { color: var(--color-danger); }

.att-worker {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  font: inherit;
}

.att-worker__name {
  font-weight: 600;
}

.att-worker:hover .att-worker__name,
.att-worker:focus-visible .att-worker__name {
  text-decoration: underline;
}

.att-worker__meta,
.att-flag {
  font-size: var(--text-xs);
  color: var(--surface-text-muted);
}

.att-late {
  font-size: var(--text-xs);
  color: var(--color-warning);
  font-weight: 600;
}

.att-map {
  color: var(--color-electric-blue);
  vertical-align: middle;
}

.att-thumb {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm, 6px);
  padding: 0;
  background: var(--surface-card);
  cursor: zoom-in;
  width: 2.6rem;
  height: 2.6rem;
  overflow: hidden;
}

.att-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.att-register {
  font-size: var(--text-xs);
  border-collapse: separate;
  border-spacing: 0;
}

.att-register th,
.att-register td {
  padding: 0.3rem 0.25rem;
  text-align: center;
  white-space: nowrap;
}

.att-register .att-sticky {
  position: sticky;
  left: 0;
  background: var(--surface-card);
  z-index: 1;
  text-align: left;
  min-width: 11rem;
  padding-left: 0.75rem;
  box-shadow: 1px 0 0 var(--surface-border);
}

.att-day small {
  display: block;
  font-weight: 400;
  color: var(--surface-text-muted);
}

.att-day--sun {
  background: var(--color-danger-bg, #fde8ea);
}

.att-day--today {
  box-shadow: inset 0 -2px 0 var(--color-electric-blue);
}

.att-cell button {
  width: 1.9rem;
  height: 1.7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}

.att-cell button:hover,
.att-cell button:focus-visible {
  border-color: var(--color-electric-blue);
}

.att-cell--present button { background: var(--color-success-bg); color: var(--color-success); }
.att-cell--late button,
.att-cell--half_day button { background: var(--color-warning-bg); color: var(--color-warning); }
.att-cell--absent button { background: var(--color-danger-bg, #fde8ea); color: var(--color-danger); }
.att-cell--leave button { background: var(--surface-wash, #eef1f7); }
.att-cell--working button { background: var(--color-electric-blue-tint); color: var(--color-electric-blue); }
.att-cell--not_marked button { color: var(--surface-text-muted); }

.att-total {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: var(--surface-wash, #f4f6fb);
}

.att-total--strong {
  font-weight: 700;
}

@media print {
  body[data-active='attendance'] .app-sidebar,
  body[data-active='attendance'] .app-header,
  body[data-active='attendance'] .att-toolbar,
  body[data-active='attendance'] #att-day-panel,
  body[data-active='attendance'] #att-month-panel .toolbar,
  body[data-active='attendance'] .whatsapp-float {
    display: none !important;
  }

  body[data-active='attendance'] .app-main {
    margin: 0 !important;
  }

  body[data-active='attendance'] .att-register-card .table-wrap {
    overflow: visible !important;
  }

  body[data-active='attendance'] .att-register {
    font-size: 7.5pt;
  }

  body[data-active='attendance'] .att-register .att-sticky {
    position: static;
    min-width: 0;
  }
}
