/* ============================================================
   K.W. Products — Shared Components
   Button, Form, Card, DataTable (card-on-mobile), Modal, Toast,
   Flash, Skeleton, Empty, Badge, Tabs, Menu, Qty, Thumb grid.
   Prefix: .c-* for new; also provides legacy class names for retrofit.
   ============================================================ */

/* ============ BUTTONS ============ */
.btn, .c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
}
.btn:active, .c-btn:active { transform: translateY(1px); }
.btn:focus-visible, .c-btn:focus-visible { box-shadow: var(--shadow-focus); outline: none; }

.btn-primary, .c-btn--primary {
  background: var(--color-primary);
  color: var(--color-text-invert);
  border-color: var(--color-primary);
}
.btn-primary:hover, .c-btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-invert);
}

.btn-secondary, .c-btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover, .c-btn--secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-gray-400);
}

.btn-outline, .c-btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover, .c-btn--outline:hover {
  background: var(--color-primary);
  color: var(--color-text-invert);
}

.btn-ghost, .c-btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}
.btn-ghost:hover, .c-btn--ghost:hover {
  background: var(--color-surface-2);
}

.btn-danger, .c-btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover, .c-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-success, .c-btn--success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.btn-success:hover, .c-btn--success:hover { background: #166534; border-color: #166534; }

.btn-sm  { padding: 7px 12px;  font-size: var(--fs-sm); border-radius: var(--radius-xs); }
.btn-lg  { padding: 14px 24px; font-size: var(--fs-lg); border-radius: var(--radius-md); }
.btn-block { display: flex; width: 100%; }

.btn[disabled], .btn.is-disabled, .c-btn[disabled], .c-btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

/* Loading state */
.btn.is-loading, .c-btn.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn.is-loading::after, .c-btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  color: var(--color-text);
  animation: spin 0.6s linear infinite;
}
.btn-primary.is-loading::after { color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .btn, .c-btn { min-height: var(--touch-min); padding-top: 12px; padding-bottom: 12px; }
  .btn-sm { min-height: 38px; }
}

/* Icon-only button */
.btn-icon, .c-btn--icon {
  width: 40px; height: 40px; padding: 0; border-radius: var(--radius-sm);
}
@media (max-width: 600px) { .btn-icon { width: 44px; height: 44px; } }


/* ============ FORMS ============ */
.field, .c-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.field-label, .c-field-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text);
}
.field-label .required, .c-field-label .required { color: var(--color-danger); margin-left: 2px; }

.field-input, .field-textarea, .field-select,
.c-input, .c-textarea, .c-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-base);
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.field-input:focus, .field-textarea:focus, .field-select:focus,
.c-input:focus, .c-textarea:focus, .c-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}
.field-textarea, .c-textarea { min-height: 120px; resize: vertical; }

.field-hint  { font-size: var(--fs-xs); color: var(--color-text-muted); }
.field-error { font-size: var(--fs-xs); color: var(--color-danger); display: none; }
.field.is-invalid .field-input,
.field.is-invalid .field-textarea,
.field.is-invalid .field-select { border-color: var(--color-danger); }
.field.is-invalid .field-error  { display: block; }

/* Input + button combo */
.field-group { display: flex; gap: var(--space-2); align-items: stretch; flex-wrap: wrap; }
.field-group > .field-input { flex: 1 1 160px; min-width: 0; }

/* Password visibility toggle wrapper */
.field-password { position: relative; }
.field-password .field-input { padding-right: 44px; }
.field-password .password-toggle {
  position: absolute;
  right: 4px; top: 4px; bottom: 4px;
  width: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: var(--color-text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.field-password .password-toggle:hover { background: var(--color-surface-2); }
@media (max-width: 600px) {
  .field-password .password-toggle { width: 40px; }
}

/* Checkbox / radio */
.c-check, .c-radio {
  display: inline-flex; align-items: center; gap: var(--space-2);
  cursor: pointer; user-select: none;
  min-height: 32px;
}
.c-check input, .c-radio input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--color-primary); }


/* ============ CARDS ============ */
.card, .c-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
}
.card:hover, .c-card:hover { box-shadow: var(--shadow-sm); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card-header, .c-card__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.card-body, .c-card__body { padding: var(--space-5); }
.card-footer, .c-card__foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.card-title { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }

@media (max-width: 600px) {
  .card-header, .c-card__head, .card-body, .c-card__body, .card-footer, .c-card__foot {
    padding: var(--space-4);
  }
}


/* ============ DATA TABLES (card on mobile) ============ */
.data-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table, table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  background: var(--color-surface);
}
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  background: var(--color-surface-2);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.data-table tbody tr:hover { background: var(--color-surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 600px) {
  .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table td, .data-table th {
    display: block;
    width: 100%;
  }
  .data-table thead {
    position: absolute;
    clip: rect(0 0 0 0);
    width: 1px; height: 1px; overflow: hidden;
  }
  .data-table tr {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    box-shadow: var(--shadow-xs);
  }
  .data-table tbody tr:hover { background: var(--color-surface); }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px dashed var(--color-border);
    text-align: right;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    flex: 0 0 40%;
  }
  .data-table td:not([data-label])::before { content: ""; flex: 0; }
  .data-table td.cell-actions, .data-table td.no-label {
    justify-content: flex-end;
  }
}


/* ============ MODAL ============ */
.c-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: var(--z-backdrop);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  animation: fadeIn var(--dur-base) var(--ease-out);
}
.c-modal {
  position: relative;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn var(--dur-slow) var(--ease-out);
  z-index: var(--z-modal);
}
.c-modal__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
}
.c-modal__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin: 0; }
.c-modal__close {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
}
.c-modal__close:hover { background: var(--color-surface-2); color: var(--color-text); }
.c-modal__body { padding: var(--space-5); overflow-y: auto; flex: 1; }
.c-modal__foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap;
  background: var(--color-surface-2);
}
@media (max-width: 600px) {
  .c-modal { max-width: 100%; max-height: 95vh; border-radius: var(--radius-md); }
  .c-modal__foot { flex-direction: column-reverse; }
  .c-modal__foot .btn, .c-modal__foot .c-btn { width: 100%; }
}

/* Off-canvas drawer variant */
.c-modal-backdrop.is-drawer { align-items: stretch; justify-content: flex-start; padding: 0; }
.c-modal-backdrop.is-drawer.is-right { justify-content: flex-end; }
.c-modal-backdrop.is-drawer .c-modal {
  max-width: 360px; height: 100%; max-height: 100%; border-radius: 0;
  animation: drawerIn var(--dur-slow) var(--ease-out);
}
.c-modal-backdrop.is-drawer.is-right .c-modal { animation: drawerInRight var(--dur-slow) var(--ease-out); }


/* ============ TOAST ============ */
.c-toast-container {
  position: fixed;
  bottom: var(--space-4); right: var(--space-4);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2);
  pointer-events: none;
  max-width: calc(100vw - var(--space-8));
}
@media (max-width: 600px) {
  .c-toast-container { bottom: var(--space-3); right: var(--space-3); left: var(--space-3); }
}
.c-toast {
  pointer-events: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 420px;
  display: flex; align-items: center; gap: var(--space-3);
  animation: toastIn var(--dur-slow) var(--ease-out);
}
.c-toast.is-leaving { animation: toastOut var(--dur-base) var(--ease-in) forwards; }
.c-toast--success { border-left-color: var(--color-success); }
.c-toast--error   { border-left-color: var(--color-danger); }
.c-toast--warning { border-left-color: var(--color-warning); }
.c-toast__msg { flex: 1; font-size: var(--fs-sm); }
.c-toast__close { color: var(--color-text-muted); width: 24px; height: 24px; }


/* ============ FLASH ============ */
.flash, .c-flash {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  background: var(--color-surface);
}
.flash .flash-msg { flex: 1; }
.flash .flash-close {
  color: currentColor; opacity: 0.7;
  width: 28px; height: 28px; border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; line-height: 1;
}
.flash .flash-close:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.flash-success, .c-flash--success {
  background: var(--color-success-soft); color: var(--color-success-text); border-color: var(--color-success);
}
.flash-error, .c-flash--error, .flash-danger {
  background: var(--color-danger-soft); color: var(--color-danger-text); border-color: var(--color-danger);
}
.flash-warning, .c-flash--warning {
  background: var(--color-warning-soft); color: var(--color-warning-text); border-color: var(--color-warning);
}
.flash-info, .c-flash--info {
  background: var(--color-info-soft); color: var(--color-info-text); border-color: var(--color-info);
}


/* ============ SKELETON (loading placeholder) ============ */
.skeleton, .c-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--color-gray-200) 25%, var(--color-gray-100) 50%, var(--color-gray-200) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-xs);
}
[data-theme="dark"] .skeleton,
body.dark-mode .skeleton {
  background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-surface-3) 50%, var(--color-surface-2) 75%);
  background-size: 200% 100%;
}
.skeleton-line   { height: 12px; margin: 6px 0; border-radius: 6px; }
.skeleton-line.lg { height: 18px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-block  { width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-md); }
.skeleton-card   { height: 280px; border-radius: var(--radius-md); }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .c-skeleton { animation: none; background: var(--color-gray-200); }
}
@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ============ EMPTY STATE ============ */
.empty-state, .c-empty {
  text-align: center;
  padding: var(--space-12) var(--space-5);
  color: var(--color-text-muted);
}
.empty-state__icon, .c-empty__icon {
  font-size: 48px;
  color: var(--color-gray-300);
  margin-bottom: var(--space-3);
}
.empty-state__title { font-size: var(--fs-lg); color: var(--color-text); margin: 0 0 var(--space-2) 0; font-weight: var(--fw-semibold); }
.empty-state__hint  { margin: 0 0 var(--space-4) 0; }


/* ============ BADGE / PILL ============ */
.c-badge, .pill-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  background: var(--color-surface-3);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.c-badge--success, .pill-badge.success { background: var(--color-success-soft); color: var(--color-success-text); border-color: transparent; }
.c-badge--danger,  .pill-badge.danger  { background: var(--color-danger-soft);  color: var(--color-danger-text);  border-color: transparent; }
.c-badge--warning, .pill-badge.warning { background: var(--color-warning-soft); color: var(--color-warning-text); border-color: transparent; }
.c-badge--info,    .pill-badge.info    { background: var(--color-info-soft);    color: var(--color-info-text);    border-color: transparent; }
.c-badge--primary, .pill-badge.primary { background: var(--color-primary-50);   color: var(--color-primary-700);  border-color: transparent; }


/* ============ TABS ============ */
.c-tabs {
  display: flex; gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}
.c-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 10px 16px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
  cursor: pointer;
}
.c-tab:hover { color: var(--color-text); }
.c-tab.active, .c-tab[aria-selected="true"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
@media (max-width: 600px) { .c-tab { padding: 12px 14px; min-height: var(--touch-min); } }


/* ============ QUANTITY STEPPER ============ */
.c-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.c-qty button {
  width: var(--touch-min); min-height: var(--touch-min);
  background: var(--color-surface-2);
  color: var(--color-text);
  transition: background var(--dur-fast);
}
.c-qty button:hover { background: var(--color-surface-3); }
.c-qty input {
  width: 56px; text-align: center; border: 0; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-base);
}
.c-qty input:focus { outline: none; }


/* ============ THUMBNAIL GRID ============ */
.c-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.c-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-2);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.c-thumb img { width: 100%; height: 100%; object-fit: cover; }
.c-thumb:hover { transform: translateY(-1px); }
.c-thumb.is-active { border-color: var(--color-primary); }
.c-thumb__remove {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}


/* ============ DROPDOWN MENU ============ */
.c-menu {
  position: absolute;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-popover);
  display: none;
}
.c-menu.is-open { display: block; animation: fadeIn var(--dur-fast) var(--ease-out); }
.c-menu__item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
}
.c-menu__item:hover { background: var(--color-surface-2); color: var(--color-text); }
.c-menu__item.is-danger:hover { background: var(--color-danger-soft); color: var(--color-danger-text); }
.c-menu__sep { height: 1px; background: var(--color-border); margin: 4px 0; }


/* ============ TIMELINE (order status, etc.) ============ */
.c-timeline {
  display: flex; gap: var(--space-3);
  padding: var(--space-4) 0;
  overflow-x: auto;
}
.c-timeline-item {
  flex: 1 1 0;
  min-width: 120px;
  text-align: center;
  position: relative;
}
.c-timeline-item::before {
  content: "";
  position: absolute;
  top: 18px; left: 50%; right: -50%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}
.c-timeline-item:last-child::before { display: none; }
.c-timeline-item .dot {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
  margin-bottom: var(--space-2);
}
.c-timeline-item.is-active .dot,
.c-timeline-item.is-done .dot {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.c-timeline-item.is-active ~ .c-timeline-item::before,
.c-timeline-item.is-active::before { background: var(--color-border); }
.c-timeline-item.is-done::before { background: var(--color-primary); }
.c-timeline-item .label { font-size: var(--fs-xs); color: var(--color-text-muted); }

@media (max-width: 600px) {
  .c-timeline { flex-direction: column; gap: 0; padding: var(--space-3) 0; }
  .c-timeline-item { display: flex; align-items: flex-start; gap: var(--space-3); text-align: left; min-width: 0; padding: 6px 0; }
  .c-timeline-item::before {
    top: 38px; left: 17px; right: auto; bottom: -10px;
    width: 2px; height: calc(100% - 30px);
  }
  .c-timeline-item:last-child::before { display: none; }
  .c-timeline-item .dot { margin: 0; flex: 0 0 auto; }
  .c-timeline-item .label { font-size: var(--fs-sm); padding-top: 8px; }
}


/* ============ BREADCRUMB ============ */
.c-breadcrumb {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
}
.c-breadcrumb a { color: var(--color-text-muted); }
.c-breadcrumb a:hover { color: var(--color-primary); }
.c-breadcrumb .sep { color: var(--color-gray-300); }


/* ============ PAGINATION ============ */
.c-pagination, .pagination {
  display: flex; gap: var(--space-1); flex-wrap: wrap;
  justify-content: center;
  padding: var(--space-4) 0;
  list-style: none;
}
.c-pagination li, .pagination li { list-style: none; }
.c-pagination a, .c-pagination span,
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-sm);
}
.c-pagination a:hover, .pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.c-pagination .active a, .pagination .active a,
.c-pagination li.active span, .pagination li.active span {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
@media (max-width: 600px) {
  .c-pagination a, .pagination a { min-width: var(--touch-min); min-height: var(--touch-min); }
}


/* ============ AUTH CARD ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6) var(--space-4);
  background:
    radial-gradient(circle at 0% 0%, var(--color-primary-50), transparent 40%),
    radial-gradient(circle at 100% 100%, var(--color-primary-100), transparent 45%),
    var(--color-bg);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-lg);
}
.auth-card .logo-wrap { text-align: center; margin-bottom: var(--space-5); }
.auth-card .logo-wrap img { max-height: 56px; display: inline-block; }
.auth-card h1 { text-align: center; font-size: var(--fs-2xl); margin-bottom: var(--space-4); }
.auth-card .auth-divider {
  display: flex; align-items: center; gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--color-text-muted); font-size: var(--fs-xs);
}
.auth-card .auth-divider::before,
.auth-card .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }


/* ============ ANIMATIONS ============ */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes drawerIn      { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes drawerInRight { from { transform: translateX(100%); }  to { transform: none; } }
@keyframes toastIn   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut  { to   { opacity: 0; transform: translateY(16px); } }


/* ============ MOBILE BOTTOM ACTION BAR ============ */
.c-mobile-bar {
  display: none;
  position: sticky; bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-3);
  gap: var(--space-2);
  z-index: var(--z-overlay);
  box-shadow: 0 -8px 20px rgba(15,23,42,0.08);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
}
@media (max-width: 600px) {
  .c-mobile-bar { display: flex; }
  .c-mobile-bar .btn, .c-mobile-bar .c-btn { flex: 1; }
}
