﻿/* ==========================================================================
   COMPONENTS -- Buttons, Inputs, Cards, Tables, Modals, Toasts
   ========================================================================== */

/* ---------------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-height);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  background: var(--panel-hover);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: 1;
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast);
  white-space: nowrap;
}

.btn:hover {
  background: var(--panel-pressed);
  border-color: var(--border-soft);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-border);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
}

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

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: var(--panel-hover);
}

.btn--danger {
  background: var(--btn-danger-bg);
  border-color: var(--btn-danger-border);
  color: var(--btn-danger-text);
}

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

.btn--sm {
  height: var(--btn-height-sm);
  padding: 0 12px;
  font-size: 12px;
}

.btn--lg {
  height: var(--btn-height-lg);
  padding: 0 20px;
  font-size: var(--fs-base);
}

.btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}

.btn__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------------------
   INPUTS / FORM FIELDS
   --------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.field--grow {
  flex: 1;
}

.field__label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.field__req { color: var(--bad); }

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  color: var(--input-text);
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  line-height: 1.4;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
  color-scheme: dark;
}

.field__input:hover,
.field__select:hover {
  border-color: var(--input-border-hover);
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-bg);
  background: var(--panel-hover);
}

.field__input:disabled,
.field__select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field__input::placeholder {
  color: var(--input-placeholder);
}

.field__input--sm {
  height: var(--input-height-sm);
  font-size: var(--fs-sm);
  padding: 8px 10px;
}

.field__textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.6;
}

/* Custom select chevron */
.field__select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a89890' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field__select option,
.field__select optgroup {
  background: var(--bg-elevated);
  color: var(--text);
}

/* Form layout inside modals */
.form { display: flex; flex-direction: column; gap: 14px; }
.field__control { position: relative; }
.form-error {
  padding: 10px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
  color: var(--bad); background: rgba(255, 93, 84, .09);
  border: 1px solid rgba(255, 93, 84, .38);
}

.field__help {
  font-size: var(--help-font-size);
  color: var(--help-color);
  line-height: 1.5;
}

/* Field hint icon + floating tooltip (hover/focus help for inputs) */
.field__hint-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border: 1px solid var(--text-faint);
  border-radius: 50%;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  user-select: none;
}
.field__hint-ic:hover,
.field__hint-ic:focus {
  border-color: var(--accent-border);
  color: var(--text);
  outline: none;
}
[dir="rtl"] .field__hint-ic { margin-left: 0; margin-right: 6px; }

.field-hint-tip {
  position: fixed;
  z-index: var(--z-tooltip);
  max-width: 280px;
  padding: 8px 11px;
  border: 1px solid var(--nav-tooltip-border);
  border-radius: 8px;
  background: var(--nav-tooltip-bg);
  box-shadow: var(--elevation-2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity var(--motion-fast), visibility var(--motion-fast), transform var(--motion-fast);
}
.field-hint-tip.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

.field__error {
  font-size: var(--error-font-size);
  color: var(--error-color);
  display: none;
}

.field__error--visible {
  display: block;
}

.field--error .field__input,
.field--error .field__select {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.field__datetime24 {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.field__datetime24 .field__input {
  min-width: 0;
  flex: 1 1 auto;
}
.field__datetime24 .field__datetime24-time,
.field__datetime24 input[type="text"] {
  flex: 0 1 104px;
  max-width: 104px;
}
.field__datetime24 .field__datetime24-sep {
  color: var(--text-muted, #8892a6);
  flex: 0 0 auto;
  line-height: 1;
}

.field__input[type="number"]::-webkit-inner-spin-button,
.field__input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.5;
}

.field__input[type="number"]::-webkit-inner-spin-button:hover {
  opacity: 1;
}

/* Input with suffix (unit) */
.field--with-suffix {
  position: relative;
}

.field__suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: var(--fs-sm);
  pointer-events: none;
}

.field--with-suffix .field__input {
  padding-right: 40px;
}

/* ---------------------------------------------------------------------------
   FORM ROW / GRID
   --------------------------------------------------------------------------- */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-row--dense {
  gap: 8px;
}

/* ---------------------------------------------------------------------------
   CARDS
   --------------------------------------------------------------------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
}

.card--fuel {
  position: relative;
  overflow: hidden;
}

.card--fuel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--fuel-diesel);
}

.card--fuel[data-fuel="diesel"]::before { background: var(--fuel-diesel); }
.card--fuel[data-fuel="hfo"]::before { background: var(--fuel-hfo); }
.card--fuel[data-fuel="lpg"]::before { background: var(--fuel-lpg); }

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card__title {
  font-weight: 700;
  font-size: var(--fs-base);
}

.card__title--diesel { color: var(--fuel-diesel); }
.card__title--hfo { color: var(--fuel-hfo); }
.card__title--lpg { color: var(--fuel-lpg); }

.card__subtitle {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   BADGES / TAGS
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--badge-padding);
  border-radius: var(--badge-radius);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge--ok {
  background: var(--good-bg);
  color: var(--good);
  border: 1px solid var(--good-border);
}

.badge--warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}

.badge--bad {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid var(--bad-border);
}

.badge--empty {
  background: var(--panel-hover);
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.badge--fuel {
  background: var(--fuel-diesel-bg);
  color: var(--fuel-diesel);
  border: 1px solid var(--fuel-diesel-border);
}

.badge--fuel[data-fuel="hfo"] {
  background: var(--fuel-hfo-bg);
  color: var(--fuel-hfo);
  border: 1px solid var(--fuel-hfo-border);
}

.badge--fuel[data-fuel="lpg"] {
  background: var(--fuel-lpg-bg);
  color: var(--fuel-lpg);
  border: 1px solid var(--fuel-lpg-border);
}

.badge--info {
  background: var(--accent-bg, rgba(255, 165, 0, 0.1));
  color: var(--accent);
  border: 1px solid var(--accent-border, rgba(255, 165, 0, 0.25));
}

/* Transaction color utilities */
.tx-pos { color: var(--good, #27ae60); }
.tx-neg { color: var(--bad, #e74c3c); }
.tx-zero { color: var(--text-faint); }

/* ---------------------------------------------------------------------------
   TABLES / DATATABLE
   --------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--panel);
  position: relative;
}

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

.table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table th {
  position: sticky;
  top: 0;
  height: var(--table-header-h);
  padding: var(--table-cell-pad);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

/* NOTE: freezing is handled exclusively by DataTable.js (.th-frozen/.td-frozen +
   --frozen-left). Never add blanket :first-child stickiness here -- it fights the
   pin system and keeps the first column stuck after unpinning. */

.table td {
  padding: var(--table-cell-pad);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: var(--table-hover-bg);
}


.table__cell--numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.table__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.table__action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}

.table__action-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.table__action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--fuel-diesel);
}

.table__action-btn--edit:hover {
  color: var(--fuel-diesel);
  border-color: var(--fuel-diesel-border);
  background: var(--fuel-diesel-bg);
}

.table__action-btn--delete:hover {
  color: var(--bad);
  border-color: var(--bad-border);
  background: var(--bad-bg);
}

.table__action-btn svg {
  width: 16px;
  height: 16px;
}

.table__empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: var(--fs-base);
}

.table__empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

/* Column resize handle */
.table__resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  opacity: 0;
  transition: opacity var(--motion-fast), background var(--motion-fast);
}

.table th:hover .table__resize-handle {
  opacity: 1;
}

.table__resize-handle:hover,
.table__resize-handle.dragging {
  background: var(--fuel-diesel);
  opacity: 1;
}

/* ---------------------------------------------------------------------------
   MODALS
   --------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-overlay);
  background: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-base), visibility var(--motion-base);
  will-change: opacity;
}

.modal-overlay--open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: var(--modal-w);
  max-height: var(--modal-max-h);
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98) translateY(8px);
  transition: transform var(--motion-spring);
  will-change: transform;
}

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

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

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

.modal__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: 0;
}

.modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}

.modal__close:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__message {
  font-size: var(--fs-base);
  color: var(--text-dim);
  line-height: var(--lh-relaxed);
  margin: 0 0 16px;
}

.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft, rgba(0,0,0,0.03));
  font-size: var(--fs-sm);
  color: var(--text-main);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.confirm-check input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent, #2563eb);
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft, rgba(0, 0, 0, 0.03));
}

.history-summary__item {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  white-space: nowrap;
}

.history-summary__item strong {
  color: var(--text-main);
  font-weight: 600;
}

.history-summary__item .hs-up {
  color: var(--good, #58c96b);
}

.history-summary__item .hs-down {
  color: var(--bad, #e5484d);
}

/* ---------------------------------------------------------------------------
   TOASTS
   --------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 380px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--elevation-3);
  transform: translateX(120%);
  opacity: 0;
  transition: transform var(--motion-spring), opacity var(--motion-base);
  will-change: transform, opacity;
}

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

.toast--diesel { border-left-color: var(--fuel-diesel); }
.toast--hfo { border-left-color: var(--fuel-hfo); }
.toast--lpg { border-left-color: var(--fuel-lpg); }
.toast--success { border-left-color: var(--good); }
.toast--warning { border-left-color: var(--warn); }
.toast--error { border-left-color: var(--bad); }
.toast--info { border-left-color: var(--info); }

.toast__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast__icon svg {
  width: 100%;
  height: 100%;
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  margin-bottom: 2px;
}

.toast__message {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: 1.5;
}

.toast__close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--motion-fast), color var(--motion-fast);
  flex-shrink: 0;
}

.toast__close:hover {
  background: var(--panel-hover);
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   TOOLTIPS (for rail mode)
   --------------------------------------------------------------------------- */
.tooltip {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  border: 1px solid var(--nav-tooltip-border);
  border-radius: 6px;
  background: var(--nav-tooltip-bg);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--elevation-2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--motion-fast), visibility var(--motion-fast);
  z-index: var(--z-tooltip);
}

.tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--nav-tooltip-border);
}

.tooltip::after {
  content: '';
  position: absolute;
  right: calc(100% - 1px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--nav-tooltip-bg);
}

.nav-item:hover .tooltip,
.nav-item:focus .tooltip {
  opacity: 1;
  visibility: visible;
}

/* ---------------------------------------------------------------------------
   DROPDOWN MENUS (for table actions, column menu)
   --------------------------------------------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown__menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--elevation-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--motion-fast), visibility var(--motion-fast), transform var(--motion-fast);
  z-index: var(--z-tooltip);
  will-change: transform, opacity;
}

.dropdown--open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--motion-fast);
}

.dropdown__item:hover {
  background: var(--panel-hover);
}

.dropdown__item:focus-visible {
  outline: none;
  background: var(--panel-hover);
  box-shadow: 0 0 0 2px var(--fuel-diesel);
}

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

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

.dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.dropdown__item__icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.dropdown__item__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------------------
   TABS (for sub-navigation within content)
   --------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
  white-space: nowrap;
}

.tab:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.tab--active {
  background: var(--panel-hover);
  border-color: var(--border);
  color: var(--text);
}

.tab__icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.tab__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------------------
   LOADING STATES
   --------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-hover) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--fuel-diesel);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* ---------------------------------------------------------------------------
   DIVIDERS
   --------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.divider--vertical {
  width: 1px;
  height: 24px;
  margin: 0 8px;
  background: var(--border);
}
/* ============================================================
   MOBILE -- phones (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal,
  .modal[style] {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 96dvh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ============================================================================
   MAINTENANCE REPORT MODAL
   ============================================================================ */
.maint-report {
  font-size: 13px;
  line-height: 1.5;
}
.maint-report__header {
  text-align: left;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-soft);
}
.maint-report__header .maint-report__brand {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.maint-report__header .maint-report__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.maint-report__header .maint-report__subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
}
.maint-report__section {
  margin-bottom: 32px;
  page-break-before: always;
}
.maint-report__section:first-child {
  page-break-before: avoid;
}
.maint-report__section-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.maint-report__subsection {
  margin-bottom: 24px;
}
.maint-report__subsection h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.maint-report__subsection h4 {
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.maint-report__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}
.maint-report__table th,
.maint-report__table td {
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  text-align: left;
}
.maint-report__table th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.03em;
}
.maint-report__table td {
  color: var(--text-primary);
}
.maint-report__table tr:nth-child(even) td {
  background: var(--bg-elevated);
}
.maint-report__day {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.maint-report__day h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
}
.maint-report__day p {
  margin: 4px 0;
  font-size: 12px;
}
.maint-report__day strong {
  color: var(--text-primary);
}

/* Report Filters Panel */
.report-filters-panel {
  padding: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  height: fit-content;
}
.report-filter-group {
  margin-bottom: 20px;
}
.report-filter-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.report-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}
.report-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}
.report-date-input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.report-export-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Report Preview Panel */
.report-preview-panel {
  min-height: 400px;
}
#reportPreview {
  min-height: 100%;
}

@media print {
  .maint-report__section {
    page-break-before: always;
  }
  .maint-report__section:first-child {
    page-break-before: avoid;
  }
  .maint-report__table th,
  .maint-report__table td {
    border: 1px solid #ddd;
  }
}
  .modal__body { max-height: calc(96dvh - 128px); overflow-y: auto; padding: 14px 16px; }
  .modal__header { padding: 12px 16px; }
  .modal__footer { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .field__control input,
  .field__control select,
  .field__control textarea { font-size: 16px; }
  .btn--lg { width: 100%; }
}