/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  min-height: var(--tap);
  padding: var(--space-3) var(--space-5);

  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;

  border: 1px solid transparent;
  border-radius: var(--radius-md);

  transition: background var(--fast) var(--ease),
              transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
  touch-action: manipulation;
  user-select: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.btn--primary:hover {
  background: var(--brand-ink);
}

.btn--secondary {
  background: var(--card);
  color: var(--brand);
  border-color: var(--brand-border);
}

.btn--secondary:hover {
  background: var(--brand-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
}

.btn--ghost:hover {
  background: rgba(17, 17, 17, 0.05);
}

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

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

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

/* 2.5rem rather than the more typical 2.25rem: these are real actions on a
   touch screen, not desktop toolbar buttons. */
.btn--sm {
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  min-height: 3.25rem;
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

/* Icon-only controls still need a full-size hit area. */
.btn--icon {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: var(--radius-full);
}

/* Spinner shown while a form or fetch is in flight. */
.btn.is-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn--secondary.is-loading::after,
.btn--ghost.is-loading::after {
  border-color: rgba(39, 57, 184, 0.3);
  border-top-color: var(--brand);
}

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

/* ==========================================================================
   Forms
   ========================================================================== */

.field {
  display: block;
  margin-bottom: var(--space-4);
}

.field__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink-2);
}

.field__hint {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
}

.field__error {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--danger);
}

/* A value the resident can see but not change. Rendered as text rather than a
   disabled input, so it never looks like something that has stopped working. */
.readonly-value {
  min-height: var(--tap);
  padding: var(--space-3) 0;

  font-size: 1rem;
  font-weight: var(--weight-medium);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-3) var(--space-4);

  /* 16px minimum: anything smaller makes iOS Safari zoom on focus. */
  font-size: 1rem;

  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);

  transition: border-color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}

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

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(39, 57, 184, 0.16);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

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

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: right 1.15rem center, right 0.9rem center;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: var(--space-10);
}

.file-input {
  width: 100%;
  padding: var(--space-3);
  font-size: var(--text-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.form-actions .btn {
  flex: 1;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);

  min-height: var(--tap);
  padding: var(--space-2) 0;

  font-size: var(--text-base);
  cursor: pointer;
}

.radio-row input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--brand);
  flex-shrink: 0;
}

/* Two fields per row once there is width for them. Add `field--wide` to keep
   something (an address, a message) on its own row. */
@media (min-width: 48rem) {
  .field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-5);
  }

  .field-grid > .field--wide {
    grid-column: 1 / -1;
  }

  .form-actions {
    justify-content: flex-end;
  }

  .form-actions .btn {
    flex: 0 0 auto;
    min-width: 10rem;
  }
}

/* ---- OTP boxes ---- */

.otp-inputs {
  display: flex;
  gap: var(--space-2);
  justify-content: space-between;
  margin-block: var(--space-6);
}

.otp-inputs input {
  width: 100%;
  max-width: 3.25rem;
  aspect-ratio: 3 / 4;
  padding: 0;

  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  text-align: center;

  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
}

.otp-inputs input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(39, 57, 184, 0.16);
}

.otp-inputs input.is-filled {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ==========================================================================
   Cards
   ========================================================================== */

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

.card + .card {
  margin-top: var(--space-4);
}

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

.card__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semi);
}

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

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.card__actions .btn {
  flex: 1 1 8rem;
}

/* ==========================================================================
   Card list
   --------------------------------------------------------------------------
   A single stacked column on a phone; two or three columns once there is
   width for them, so a desktop is not one narrow ribbon of cards.
   ========================================================================== */

.card-list {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

/* Cards inside the grid own their own spacing. */
.card-list > .card + .card,
.card-list > .visitor-card + .visitor-card {
  margin-top: 0;
}

@media (min-width: 48rem) {
  .card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Full-width rows for things that should not be split, e.g. an empty state. */
  .card-list > .empty-state,
  .card-list > .summary-card,
  .card-list > .card-list__full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 80rem) {
  .card-list--dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- summary strip ---- */

.summary-card {
  padding: var(--space-5);
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-brand);
}

.summary-card__label {
  font-size: var(--text-sm);
  opacity: 0.85;
}

.summary-card__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  margin-top: var(--space-1);
}

/* ==========================================================================
   Swipe-to-dismiss row
   --------------------------------------------------------------------------
   The card slides over a fixed "remove" layer. There is also a visible close
   button on every row -- swiping is a shortcut, not the only way out, so the
   list still works with a mouse, a keyboard or a screen reader.
   ========================================================================== */

.swipe {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.swipe__behind {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);

  padding-inline: var(--space-5);

  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius-lg);
}

.swipe__front {
  position: relative;
  touch-action: pan-y;
  transition: transform var(--normal) var(--ease);
  will-change: transform;
}

.swipe.is-armed .swipe__behind {
  background: #8f1414;
}

.swipe__remove {
  color: var(--muted);
  flex-shrink: 0;
}

.swipe__remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.swipe.is-collapsing {
  height: 0 !important;
  margin: 0;
  opacity: 0;
  transition: height var(--normal) var(--ease),
              opacity var(--fast) var(--ease),
              margin var(--normal) var(--ease);
}

.swipe-hint {
  margin-bottom: var(--space-1);
}

/* Pointer devices have the button; the hint is only true on touch. */
@media (hover: hover) {
  .swipe-hint {
    display: none;
  }
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem var(--space-3);

  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  white-space: nowrap;

  border-radius: var(--radius-full);
}

.badge--ok      { background: var(--ok-soft);     color: var(--ok); }
.badge--pending { background: var(--warn-soft);   color: var(--warn); }
.badge--danger  { background: var(--danger-soft); color: var(--danger); }
.badge--info    { background: var(--info-soft);   color: var(--info); }
.badge--neutral { background: var(--surface-2);   color: var(--ink-2); }

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: 0.3rem;

  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state {
  padding: var(--space-10) var(--space-5);
  text-align: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.empty-state__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-4);
  color: var(--brand);
  opacity: 0.6;
}

.empty-state__title {
  font-size: var(--text-md);
  margin-bottom: var(--space-2);
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ==========================================================================
   Page header
   ========================================================================== */

.page-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);

  display: flex;
  align-items: center;
  gap: var(--space-3);

  margin-inline: calc(var(--space-4) * -1);
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--safe-top) + var(--space-3));
  margin-bottom: var(--space-5);

  background: var(--surface);
  border-bottom: 1px solid transparent;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.page-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-1);
}

.page-header__title {
  flex: 1;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-1);
}

.back-btn:hover {
  text-decoration: none;
  background: var(--surface-2);
}

@media (min-width: 48rem) {
  .page-header {
    margin-inline: calc(var(--space-6) * -1);
    padding-inline: var(--space-6);
    margin-bottom: var(--space-6);
  }

  .page-header__title {
    font-size: var(--text-xl);
  }
}

/* With a left rail there is always a visible way back, so the sticky header
   can sit in the flow rather than pinned over the content. */
@media (min-width: 64rem) {
  .page-header {
    position: static;
    background: transparent;
  }

  .page-header.is-stuck {
    border-bottom-color: transparent;
    box-shadow: none;
  }
}

/* ==========================================================================
   Bottom navigation
   ========================================================================== */

.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--z-nav);

  display: flex;
  justify-content: space-around;

  width: 100%;
  max-width: var(--app-max);
  margin-inline: auto;
  padding-bottom: var(--safe-bottom);

  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(17, 17, 17, 0.06);
}

.bottom-nav__item {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;

  min-height: var(--nav-height);
  padding: var(--space-2) var(--space-1);

  font-size: 0.6875rem;
  font-weight: var(--weight-medium);
  color: var(--muted);
}

.bottom-nav__item:hover {
  text-decoration: none;
}

.bottom-nav__item svg {
  width: 1.4rem;
  height: 1.4rem;
}

.bottom-nav__item[aria-current="page"] {
  color: var(--brand);
}

.bottom-nav__badge {
  position: absolute;
  top: 0.4rem;
  left: 55%;
}

@media (min-width: 48rem) {
  .bottom-nav__item {
    font-size: var(--text-xs);
    gap: 0.25rem;
  }

  .bottom-nav__item svg {
    width: 1.55rem;
    height: 1.55rem;
  }
}

/* ---- desktop: the tab bar becomes a left rail ----
   Same markup, re-laid out. A bar pinned to the bottom of a 1440px monitor is
   a phone idiom that reads as broken on a desktop. */
@media (min-width: 64rem) {
  .bottom-nav {
    inset: 0 auto 0 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-1);

    width: var(--rail-width);
    max-width: none;
    margin-inline: 0;
    padding: var(--space-6) var(--space-3) var(--space-4);

    border-top: none;
    border-right: 1px solid var(--line);
    box-shadow: none;
    overflow-y: auto;
  }

  /* Brand lockup above the links. */
  .bottom-nav::before {
    content: "Maurya Vihar";
    padding: 0 var(--space-3) var(--space-5);
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
    color: var(--brand);
  }

  .bottom-nav__item {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);

    min-height: var(--tap);
    padding: var(--space-3);

    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-md);
  }

  .bottom-nav__item:hover {
    background: var(--surface-2);
  }

  .bottom-nav__item[aria-current="page"] {
    color: var(--brand);
    background: var(--brand-soft);
  }

  .bottom-nav__badge {
    position: static;
    margin-left: auto;
  }
}

/* ==========================================================================
   Toasts / flash messages
   ========================================================================== */

.toast-region {
  position: fixed;
  inset-inline: 0;
  top: calc(var(--safe-top) + var(--space-3));
  z-index: var(--z-toast);

  display: flex;
  flex-direction: column;
  gap: var(--space-2);

  width: min(calc(100% - 2rem), var(--app-max));
  margin-inline: auto;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);

  padding: var(--space-3) var(--space-4);

  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--card);

  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);

  pointer-events: auto;
  animation: toast-in var(--normal) var(--ease);
}

.toast--success { border-left-color: var(--ok); }
.toast--error   { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warn); }

.toast__text {
  flex: 1;
}

.toast__close {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--muted);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.toast.is-leaving {
  animation: toast-out var(--normal) var(--ease) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-0.75rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-0.75rem); }
}

/* Inline (non-floating) banner variant. */
.banner {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.banner--info    { background: var(--info-soft);   color: var(--brand-ink); }
.banner--warning { background: var(--warn-soft);   color: var(--warn); }
.banner--error   { background: var(--danger-soft); color: var(--danger); }
.banner--success { background: var(--ok-soft);     color: var(--ok); }

/* ==========================================================================
   Drawer
   ========================================================================== */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);

  background: rgba(17, 17, 17, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--normal) var(--ease), visibility var(--normal);
}

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

.drawer {
  position: fixed;
  inset-block: 0;
  left: 0;
  z-index: var(--z-drawer);

  display: flex;
  flex-direction: column;

  width: min(19rem, 85vw);
  padding: calc(var(--safe-top) + var(--space-5)) var(--space-5)
           calc(var(--safe-bottom) + var(--space-5));

  background: var(--card);
  box-shadow: var(--shadow-3);

  overflow-y: auto;
  overscroll-behavior: contain;

  transform: translateX(-100%);
  transition: transform var(--normal) var(--ease);
}

.drawer.is-open {
  transform: none;
}

.drawer__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-3);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.drawer__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);

  min-height: var(--tap);
  padding: var(--space-3) var(--space-2);

  font-size: var(--text-base);
  color: var(--ink);
  border-radius: var(--radius-sm);
}

.drawer__item:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.drawer__item svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
  flex-shrink: 0;
}

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

.drawer__item--danger svg {
  color: var(--danger);
}

.drawer__spacer {
  flex: 1;
}

.drawer__social {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

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

.drawer__social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  background: var(--surface-2);
  border-radius: var(--radius-full);
}

.drawer__social-icons img {
  width: 1.35rem;
  height: 1.35rem;
}

/* ==========================================================================
   Modal / sheet
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);

  display: none;
  align-items: center;
  justify-content: center;

  padding: var(--space-4);
  background: rgba(17, 17, 17, 0.6);
  overscroll-behavior: contain;
}

.modal.is-open {
  display: flex;
}

.modal__panel {
  width: 100%;
  max-width: 24rem;
  max-height: 85dvh;
  overflow-y: auto;

  padding: var(--space-6);
  text-align: center;

  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);

  animation: modal-in var(--normal) var(--ease);
}

.modal__panel--media {
  max-width: min(96vw, 40rem);
  padding: var(--space-2);
  background: transparent;
  box-shadow: none;
}

.modal__panel--media img {
  width: 100%;
  border-radius: var(--radius-md);
}

.modal__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.modal__text {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-5);
}

.modal__close {
  position: absolute;
  top: calc(var(--safe-top) + var(--space-4));
  right: var(--space-4);
  width: var(--tap);
  height: var(--tap);
  font-size: var(--text-xl);
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(0.5rem); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Avatar
   ========================================================================== */

.avatar {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.avatar--lg { width: 4.5rem; height: 4.5rem; }
.avatar--sm { width: 2.25rem; height: 2.25rem; }

/* ==========================================================================
   Lists (admin / guard)
   ========================================================================== */

.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);

  width: 100%;
  min-height: var(--tap);
  padding: var(--space-3) var(--space-4);

  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.list-row + .list-row {
  margin-top: var(--space-2);
}

.list-row:hover {
  text-decoration: none;
  background: var(--surface-2);
}

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

/* block, because these are <span>s inside an <a> and would otherwise sit on
   one run-together line. */
.list-row__title {
  display: block;
  font-weight: var(--weight-semi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row__meta {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ==========================================================================
   Tables (admin)
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

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

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-weight: var(--weight-semi);
  color: var(--muted);
  background: var(--surface-2);
}

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

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  height: var(--tap);
  padding-inline: var(--space-3);

  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}

.pagination__link:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.pagination__link[aria-current="page"] {
  color: #fff;
  background: var(--brand);
}

.pagination__link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   Skeleton loading
   ========================================================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    #e4e4e4 37%,
    var(--surface-2) 63%
  );
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  from { background-position: 100% 50%; }
  to   { background-position: 0 50%; }
}

/* ==========================================================================
   Segmented control
   ========================================================================== */

.segmented {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.segmented__option {
  flex: 1;
  min-height: 2.5rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
}

.segmented__option[aria-pressed="true"] {
  color: var(--brand);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

/* ==========================================================================
   Stepper
   ========================================================================== */

.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  font-size: var(--text-lg);
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-full);
}

.stepper__btn:disabled {
  opacity: 0.4;
}

.stepper__value {
  min-width: 2.5rem;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  text-align: center;
}
