/* ==========================================================================
   EuroCheking v2 — Components CSS
   18 components: btn, card, input, select, textarea, checkbox, badge,
   toast, modal, tab-bar, table, stat, dropdown, tooltip, skeleton,
   empty-state, progress, step-indicator
   ========================================================================== */

/* ==============================
   1. Button (.btn)
   ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: var(--s-sm) var(--s-md);
  font-size: var(--f-sm);
  font-weight: var(--f-weight-medium);
  line-height: 1;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-100) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
  min-height: 36px;
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--c-primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--c-primary-hover);
}

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--c-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--c-bg);
}

.btn-danger {
  background: var(--c-danger);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--c-danger-hover);
}

.btn-success {
  background: var(--c-success);
  color: #ffffff;
}
.btn-success:hover:not(:disabled) {
  background: var(--c-success-hover);
}

.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--c-primary-light);
}

.btn-sm {
  padding: var(--s-xs) var(--s-sm);
  font-size: var(--f-xs);
  min-height: 28px;
  border-radius: 4px;
}

.btn-lg {
  padding: var(--s-md) var(--s-lg);
  font-size: var(--f-md);
  min-height: 44px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-sm);
}
.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}
.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
}

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

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  display: none;
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 600ms ease-out;
  pointer-events: none;
}

@media (pointer: coarse) {
  .btn::after,
  .ripple::after {
    display: block;
  }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ==============================
   2. Card (.card)
   ============================== */
.card {
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border-light);
  overflow: hidden;
  transition: box-shadow var(--duration-200) var(--ease-out);
}

@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-md);
  border-bottom: 1px solid var(--c-border-light);
}

.card-body {
  padding: var(--s-md);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-sm);
  padding: var(--s-sm) var(--s-md);
  border-top: 1px solid var(--c-border-light);
  background: var(--c-bg);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--c-border-light);
}

/* ==============================
   3. Input / Select / Textarea
   ============================== */
.input,
.select,
.textarea {
  display: block;
  width: 100%;
  padding: var(--s-sm) var(--s-md);
  font-size: var(--f-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  transition: border-color var(--duration-200) var(--ease-out),
              box-shadow var(--duration-200) var(--ease-out);
  appearance: none;
  -webkit-appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--c-text-secondary);
}

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

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--c-bg);
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px var(--c-danger-light);
}

.input.is-valid,
.select.is-valid,
.textarea.is-valid {
  border-color: var(--c-success);
  box-shadow: 0 0 0 3px var(--c-success-light);
}

.input {
  height: 36px;
}

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

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2386868b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input {
  border-radius: 0;
}
.input-group .input:first-child {
  border-top-left-radius: var(--r-sm);
  border-bottom-left-radius: var(--r-sm);
}
.input-group .input:last-child {
  border-top-right-radius: var(--r-sm);
  border-bottom-right-radius: var(--r-sm);
}
.input-group .btn {
  border-radius: 0;
  flex-shrink: 0;
}
.input-group .btn:first-child {
  border-top-left-radius: var(--r-sm);
  border-bottom-left-radius: var(--r-sm);
  border-right: none;
}
.input-group .btn:last-child {
  border-top-right-radius: var(--r-sm);
  border-bottom-right-radius: var(--r-sm);
}

.form-field {
  margin-bottom: var(--s-md);
}

.form-label {
  display: block;
  margin-bottom: var(--s-xs);
  font-size: var(--f-sm);
  font-weight: var(--f-weight-medium);
}

.form-help {
  margin-top: var(--s-xs);
  font-size: var(--f-xs);
  color: var(--c-text-secondary);
}

.form-error {
  margin-top: var(--s-xs);
  font-size: var(--f-xs);
  color: var(--c-danger);
}

/* ==============================
   4. Checkbox / Toggle
   ============================== */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-size: var(--f-sm);
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--duration-100) var(--ease-out);
}

.checkbox input[type="checkbox"]:checked {
  background: var(--c-primary);
  border-color: var(--c-primary);
}

.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 6px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px var(--c-primary-light);
}

.checkbox input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-size: var(--f-sm);
  cursor: pointer;
  user-select: none;
}

.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  background: var(--c-border);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background var(--duration-200) var(--ease-out);
  flex-shrink: 0;
}

.toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-200) var(--ease-out);
}

.toggle input[type="checkbox"]:checked {
  background: var(--c-primary);
}

.toggle input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.toggle input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px var(--c-primary-light);
}

/* ==============================
   5. Badge
   ============================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--s-sm);
  font-size: var(--f-xs);
  font-weight: var(--f-weight-medium);
  line-height: 1.5;
  border-radius: var(--r-full);
  white-space: nowrap;
  background: var(--c-border-light);
  color: var(--c-text-secondary);
}

.badge-success {
  background: var(--c-success-light);
  color: var(--c-success);
}
.badge-warning {
  background: var(--c-warning-light);
  color: var(--c-warning);
}
.badge-danger {
  background: var(--c-danger-light);
  color: var(--c-danger);
}
.badge-info {
  background: var(--c-info-light);
  color: var(--c-info);
}
.badge-primary {
  background: var(--c-primary-light);
  color: var(--c-primary);
}

.badge-dot {
  padding-left: var(--s-sm);
}
.badge-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  background: currentColor;
}

.badge-pill {
  border-radius: var(--r-full);
}

/* ==============================
   6. Toast
   ============================== */
.toast-container {
  position: fixed;
  bottom: var(--s-lg);
  right: var(--s-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-sm);
  max-width: 400px;
  width: calc(100% - var(--s-lg) * 2);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-sm);
  padding: var(--s-sm) var(--s-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  font-size: var(--f-sm);
  animation: toastIn var(--duration-300) var(--ease-out);
  pointer-events: auto;
}

.toast-success {
  border-left: 4px solid var(--c-success);
}
.toast-error {
  border-left: 4px solid var(--c-danger);
}
.toast-warning {
  border-left: 4px solid var(--c-warning);
}
.toast-info {
  border-left: 4px solid var(--c-info);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: var(--f-sm);
  color: var(--c-text-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--duration-100);
}
.toast-close:hover {
  opacity: 1;
}

.toast-leave {
  animation: toastOut var(--duration-200) var(--ease-out) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
}

/* ==============================
   7. Modal
   ============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-md);
  animation: fadeIn var(--duration-200) var(--ease-out);
  backdrop-filter: blur(4px);
}

@supports not (backdrop-filter: blur(4px)) {
  .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
  }
}

.modal {
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - var(--s-xl) * 2);
  display: flex;
  flex-direction: column;
  z-index: var(--z-modal);
  animation: scaleIn var(--duration-200) var(--ease-out);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-full { max-width: calc(100vw - var(--s-xl) * 2); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-md);
  border-bottom: 1px solid var(--c-border-light);
}

.modal-body {
  padding: var(--s-md);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-sm);
  padding: var(--s-sm) var(--s-md);
  border-top: 1px solid var(--c-border-light);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  font-size: 18px;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: background var(--duration-100);
}
.modal-close:hover {
  background: var(--c-bg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 767px) {
  .modal {
    max-width: 100%;
    max-height: calc(100vh - var(--s-xl));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    margin-top: auto;
    margin-bottom: 0;
    animation: slideUp var(--duration-300) var(--ease-out);
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ==============================
   8. Tab Bar
   ============================== */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--c-border-light);
  gap: 0;
}

.tab {
  padding: var(--s-sm) var(--s-md);
  font-size: var(--f-sm);
  font-weight: var(--f-weight-medium);
  color: var(--c-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--duration-200), border-color var(--duration-200);
  white-space: nowrap;
}

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

.tab.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

@media (max-width: 767px) {
  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar {
    display: none;
  }
}

/* ==============================
   9. Table
   ============================== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--f-sm);
}

.table th {
  padding: var(--s-sm) var(--s-md);
  text-align: left;
  font-weight: var(--f-weight-medium);
  color: var(--c-text-secondary);
  border-bottom: 2px solid var(--c-border-light);
  white-space: nowrap;
  user-select: none;
}

.table th[data-sort] {
  cursor: pointer;
}
.table th[data-sort]:hover {
  color: var(--c-text);
}
.table th[data-sort]::after {
  content: " ↕";
  opacity: 0.3;
  font-size: var(--f-xs);
}
.table th[data-sort].sort-asc::after {
  content: " ↑";
  opacity: 1;
  color: var(--c-primary);
}
.table th[data-sort].sort-desc::after {
  content: " ↓";
  opacity: 1;
  color: var(--c-primary);
}

.table td {
  padding: var(--s-sm) var(--s-md);
  border-bottom: 1px solid var(--c-border-light);
  vertical-align: middle;
}

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

.table-striped tbody tr:nth-child(even) {
  background: var(--c-bg);
}

.table-hover tbody tr:hover {
  background: var(--c-primary-light);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-sm);
}

.table-wrapper .table th,
.table-wrapper .table td {
  white-space: nowrap;
}

/* ==============================
   10. Stat
   ============================== */
.stat {
  padding: var(--s-md);
}

.stat-value {
  font-size: var(--f-xl);
  font-weight: var(--f-weight-bold);
  line-height: 1;
  color: var(--c-text);
}

.stat-label {
  margin-top: var(--s-xs);
  font-size: var(--f-sm);
  color: var(--c-text-secondary);
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--f-xs);
  font-weight: var(--f-weight-medium);
}
.stat-change.positive {
  color: var(--c-success);
}
.stat-change.negative {
  color: var(--c-danger);
}

/* ==============================
   11. Dropdown
   ============================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--s-xs);
  min-width: 200px;
  padding: var(--s-xs);
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
  display: none;
  animation: scaleIn var(--duration-150) var(--ease-out);
  transform-origin: top right;
}

.dropdown.open > .dropdown-menu,
.dropdown-menu[aria-hidden="false"] {
  display: block;
}

.dropdown-menu-left {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  width: 100%;
  padding: var(--s-sm) var(--s-md);
  font-size: var(--f-sm);
  color: var(--c-text);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-100);
}
.dropdown-item:hover {
  background: var(--c-bg);
}

.dropdown-item-danger {
  color: var(--c-danger);
}

.dropdown-divider {
  height: 1px;
  margin: var(--s-xs) 0;
  background: var(--c-border-light);
}

/* ==============================
   12. Tooltip
   ============================== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--s-xs) var(--s-sm);
  font-size: var(--f-xs);
  font-weight: var(--f-weight-normal);
  color: #fff;
  background: var(--c-text);
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-200);
  z-index: var(--z-tooltip);
  margin-bottom: var(--s-xs);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
}

/* ==============================
    13. Skeleton
    ============================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-border-light) 25%,
    var(--c-bg) 50%,
    var(--c-border-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: var(--s-sm);
  border-radius: 4px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 24px;
  width: 40%;
  margin-bottom: var(--s-md);
  border-radius: 4px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--r-md);
  margin-bottom: var(--s-md);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-block {
  padding: var(--s-md);
}

[data-skeleton-content] {
  display: none;
}

.no-js .skeleton-block {
  display: none;
}

.no-js [data-skeleton-content] {
  display: block;
}

/* ==============================
   14. Empty State
   ============================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-3xl) var(--s-md);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--s-md);
  color: var(--c-border);
  opacity: 0.6;
}

.empty-state-icon img,
.empty-state-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.empty-state-title {
  font-size: var(--f-lg);
  font-weight: var(--f-weight-semibold);
  margin-bottom: var(--s-sm);
}

.empty-state-desc {
  font-size: var(--f-sm);
  color: var(--c-text-secondary);
  max-width: 400px;
  margin-bottom: var(--s-lg);
}

/* ==============================
   15. Progress
   ============================== */
.progress {
  width: 100%;
  height: 8px;
  background: var(--c-bg);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--c-primary);
  border-radius: var(--r-full);
  transition: width var(--duration-300) var(--ease-out);
}

.progress-bar-success { background: var(--c-success); }
.progress-bar-warning { background: var(--c-warning); }
.progress-bar-danger  { background: var(--c-danger); }

.progress-horizontal {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--c-bg);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-horizontal .progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--f-xs);
  color: #fff;
  min-width: 24px;
}

/* ==============================
   16. Step Indicator
   ============================== */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--c-border-light);
  margin-inline: var(--s-sm);
  transition: background var(--duration-200);
}

.step.completed:not(:last-child)::after {
  background: var(--c-primary);
}

.step-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  background: var(--c-surface);
  font-size: var(--f-xs);
  font-weight: var(--f-weight-medium);
  color: var(--c-text-secondary);
  flex-shrink: 0;
  transition: all var(--duration-200) var(--ease-out);
}

.step.active .step-circle {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

.step.completed .step-circle {
  border-color: var(--c-success);
  background: var(--c-success);
  color: #fff;
}

.step-label {
  font-size: var(--f-sm);
  color: var(--c-text-secondary);
  white-space: nowrap;
  transition: color var(--duration-200);
}

.step.active .step-label {
  color: var(--c-text);
  font-weight: var(--f-weight-medium);
}

.step.completed .step-label {
  color: var(--c-text);
}

@media (max-width: 767px) {
  .step-label {
    display: none;
  }
  .step:not(:last-child)::after {
    display: none;
  }
}

/* ==============================
   17. Focus ring (global)
   ============================== */
.focus-ring {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ==============================
   18. Page transition
   ============================== */
.page-enter {
  animation: pageIn var(--duration-200) var(--ease-out);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================
   Dark mode overrides
   ============================== */
.dark .btn-secondary {
  border-color: var(--c-border);
}
.dark .btn-ghost:hover:not(:disabled) {
  background: var(--c-border);
}
.dark .table-striped tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
.dark .table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}
.dark .skeleton {
  background: linear-gradient(
    90deg,
    var(--c-border) 25%,
    rgba(255, 255, 255, 0.05) 50%,
    var(--c-border) 75%
  );
  background-size: 200% 100%;
}
.dark .progress {
  background: var(--c-border);
}
.dark .toast {
  background: var(--c-surface);
  border-color: var(--c-border);
}
.dark .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* ==============================
   Responsive: Modal full-width on mobile already covered above.
   Tables scroll horizontally on small screens via .table-wrapper.
   ============================== */

@media (max-width: 767px) {
  .btn-block-sm {
    display: flex;
    width: 100%;
  }
}

@media print {
  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  .table th,
  .table td {
    padding: 4px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
  .toast {
    animation: none;
  }
  .modal {
    animation: none;
  }
  .modal-overlay {
    animation: none;
  }
}
