/* =========================================================
   Sports Center Booking — Modern Mobile-First Stylesheet
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette */
  --primary: #0f766e;
  --primary-600: #0d9488;
  --primary-700: #0b5a54;
  --primary-50: #f0fdfa;
  --accent: #f59e0b;
  --accent-600: #d97706;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --success: #16a34a;
  --success-50: #f0fdf4;
  --warning: #d97706;
  --warning-50: #fffbeb;

  /* Neutrals */
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;

  /* Shape & motion */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container: 720px;
  --header-h: 60px;

  /* Safe area helpers (iOS notch) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Fluid typography */
  --fs-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --fs-sm: clamp(0.8125rem, 0.78rem + 0.25vw, 0.9375rem);
  --fs-base: clamp(0.9375rem, 0.9rem + 0.25vw, 1rem);
  --fs-lg: clamp(1.0625rem, 1rem + 0.4vw, 1.1875rem);
  --fs-xl: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
  --fs-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --fs-3xl: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-700);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Typography ---------- */
h1 {
  font-size: var(--fs-2xl);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
}
h2 {
  font-size: var(--fs-xl);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin-bottom: 8px;
}
h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
}
h4 {
  font-size: var(--fs-base);
  font-weight: 600;
}

p {
  color: var(--text);
}

small,
.muted {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 16px;
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
}

.section {
  margin-block: 24px;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(140%) blur(6px);
  flex-direction: column;
}

.app-header .brand {
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.app-header nav a {
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--transition);
}

.app-header nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.app-header nav a.btn-primary {
  background: #fff;
  color: var(--primary-700);
}

.app-header nav a.btn-primary:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

/* ---------- Buttons ---------- */
.btn,
.btn-primary,
.btn-danger,
.btn-ghost,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn:active,
.btn-primary:active,
.btn-danger:active {
  transform: translateY(1px);
}

.btn-primary {
  margin: 10px 0;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--primary-700);
  color: #fff;
}
.btn-primary:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
  box-shadow: none;
}

.btn {
  margin: 10px 0;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--primary-50);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-block {
  width: 100%;
}

/* Small button */
.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}

/* ---------- Cards ---------- */
.card,
.sport-card,
.booking-card,
.detail-card,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.sport-card:hover,
.booking-card:hover {
  box-shadow: var(--shadow-md);
}

.sport-card h3 {
  margin-bottom: 6px;
}

.sport-card .price {
  color: var(--primary);
  font-weight: 700;
  font-size: var(--fs-lg);
  margin-top: 10px;
}

.sport-card .courts {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: 12px;
}

.sport-card .btn-primary {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  padding: 8px 0 20px;
  text-align: left;
}

.hero h1 {
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  margin-bottom: 16px;
}

.hero .btn-primary {
  min-height: 48px;
  padding-inline: 24px;
}

/* ---------- Grids ---------- */
.sports-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px) {
  .sports-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .sports-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Forms ---------- */
form label,
.field {
  display: block;
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
}

form input,
form select,
form textarea,
.input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

form textarea,
textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

form select,
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2364748b' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

form input:focus,
form select:focus,
form textarea:focus,
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

form input:disabled,
form select:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* File input */
input[type="file"] {
  padding: 10px;
  background: var(--surface-2);
  border-style: dashed;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--primary);
  transform: scale(1.15);
}

/* ---------- Auth Pages ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(15, 118, 110, 0.08), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(245, 158, 11, 0.08), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 28px 22px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 6px;
  font-size: var(--fs-2xl);
}

.auth-card > p:first-of-type {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: var(--fs-sm);
}

.auth-card .btn-primary {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}

.auth-card .msg {
  text-align: center;
  margin-top: 14px;
  min-height: 20px;
  font-size: var(--fs-sm);
}

/* ---------- Messages ---------- */
.msg {
  color: var(--primary);
  font-size: var(--fs-sm);
  margin-top: 10px;
}

.msg.error {
  color: var(--danger);
}

.msg.success {
  color: var(--success);
}

/* ---------- Booking Flow ---------- */
.booking-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.step h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: var(--fs-lg);
}

.step h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}

/* ---------- Calendar ---------- */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--surface);
  padding: 8px;
  border-radius: var(--radius);
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-controls strong {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.calendar-controls button {
  min-height: 40px;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.calendar-controls button:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.calendar .header {
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 0;
}

.calendar .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition);
  user-select: none;
}

.calendar .day:hover {
  transform: scale(1.06);
}

.calendar .day.available {
  background: var(--success-50);
  color: #166534;
  border-color: #bbf7d0;
}

.calendar .day.partial {
  background: var(--warning-50);
  color: #92400e;
  border-color: #fde68a;
}

.calendar .day.full {
  background: var(--danger-50);
  color: #991b1b;
  border-color: #fecaca;
}

.calendar .day.disabled {
  color: var(--text-soft);
  background: transparent;
  pointer-events: none;
  opacity: 0.5;
}

.calendar .day.selected {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary-700) !important;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

/* ---------- Time Slots ---------- */
.slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 480px) {
  .slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 720px) {
  .slots {
    grid-template-columns: repeat(4, 1fr);
  }
}

.slot {
  padding: 12px 10px;
  border-radius: var(--radius);
  background: var(--success-50);
  border: 2px solid transparent;
  text-align: center;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
  user-select: none;
}

.slot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.slot strong {
  display: block;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
}

.slot small {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  margin-top: 3px;
}

.slot.partial {
  background: var(--warning-50);
}
.slot.partial strong {
  color: #92400e;
}

.slot.full {
  background: var(--danger-50);
  cursor: not-allowed;
  opacity: 0.7;
}
.slot.full strong {
  color: #991b1b;
}

.slot.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
  transform: translateY(-2px);
}

/* ---------- Summary ---------- */
.summary {
  margin-top: 14px;
  padding: 14px;
  background: var(--primary-50);
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.summary p {
  margin: 2px 0;
  color: var(--text);
}

.summary strong {
  color: var(--primary-700);
  font-size: var(--fs-base);
}

/* ---------- Bookings list ---------- */
.bookings-list {
  display: grid;
  gap: 12px;
}

.booking-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.booking-card header strong {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: var(--fs-sm);
  color: var(--primary-700);
}

.booking-card p {
  margin: 3px 0;
  font-size: var(--fs-sm);
  color: var(--text);
}

.booking-card .pay {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  margin-top: 6px;
}

.booking-card .btn,
.booking-card .btn-primary {
  margin-top: 10px;
  margin-right: 6px;
  min-height: 40px;
  padding: 8px 14px;
  font-size: var(--fs-sm);
}

/* ---------- Status Pills ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-CONFIRMED {
  background: var(--success-50);
  color: #166534;
}
.status-PENDING_ADMIN_APPROVAL {
  background: var(--warning-50);
  color: #92400e;
}
.status-APPROVED_PAYMENT_PENDING {
  background: #dbeafe;
  color: #1e40af;
}
.status-COMPLETED {
  background: var(--primary-50);
  color: var(--primary-700);
}
.status-CANCELLED,
.status-REJECTED,
.status-FULLY_BOOKED {
  background: var(--danger-50);
  color: #991b1b;
}
.status-AVAILABLE {
  background: var(--success-50);
  color: #166534;
}
.status-PARTIALLY_AVAILABLE {
  background: var(--warning-50);
  color: #92400e;
}

/* ---------- Detail Card ---------- */
.detail-card p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  margin: 0;
}

.detail-card p:last-child {
  border-bottom: none;
}

.detail-card p strong {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* ---------- Tables (used in admin) ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: var(--fs-sm);
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: none;
}

.status-UNAVAILABLE {
  background: #e2e8f0;
  color: #475569;
}

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 16px;
  padding-bottom: calc(24px + var(--safe-bottom));
  font-size: var(--fs-xs);
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }

.flex {
  display: flex;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    #e2e8f0 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
  min-height: 60px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Offline indicator */
body.offline::after {
  content: "You are offline";
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

/* ---------- Dialog ---------- */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 520px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  margin: auto;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

/* ---------- Print ---------- */
@media print {
  .app-header,
  .app-footer,
  .no-print,
  .btn,
  .btn-primary,
  .btn-danger {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card,
  .detail-card {
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

/* ---------- Small mobile ---------- */
@media (max-width: 360px) {
  .app-header nav a {
    padding: 8px 10px;
    font-size: var(--fs-xs);
  }
  .container {
    padding: 12px;
  }
  .auth-card {
    padding: 22px 16px;
  }
}

/* =========================================================
   Number Stepper — mobile-friendly +/− controls
   ========================================================= */
.stepper {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-top: 6px;
}

.stepper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.stepper input[type="number"] {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-weight: 600;
  font-size: var(--fs-base);
  padding: 12px 8px;
  margin: 0;
  appearance: textfield;
  -moz-appearance: textfield;
  outline: none;
}

/* Hide native spinners (we provide our own) */
.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper .step-btn {
  flex: 0 0 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: none;
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background var(--transition), color var(--transition);
}

.stepper .step-btn:hover:not(:disabled) {
  background: var(--primary-50);
}

.stepper .step-btn:active:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.stepper .step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper .step-btn.minus {
  border-right: 1px solid var(--border);
}
.stepper .step-btn.plus {
  border-left: 1px solid var(--border);
}

/* Compact variant (for tables / inline forms) */
.stepper.compact .step-btn { flex-basis: 36px; min-height: 36px; font-size: 1.1rem; }
.stepper.compact input { padding: 6px 4px; font-size: var(--fs-sm); }

/* Optional: show the unit next to the value */
.stepper .unit {
  padding: 0 10px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  background: var(--surface-2);
}