/* ==========================================================================
   BigzInvoice Admin Portal — Whimsical Design System
   Palette: Deep Plum ink (#250835) on Lavender Mist (#ebe6ee)
   Accents: Vivid Violet (#ab2fed), Lavender Wash (#decaff)
   ========================================================================== */

:root {
  --plum: #250835;
  --plum-dark: #190525;
  --plum-light: #3d1454;
  --lavender-mist: #f4eff7;
  --lavender-wash: #decaff;
  --lavender-subtle: #f9f6fc;
  --vivid-violet: #ab2fed;
  --vivid-violet-hover: #9319d6;
  --vivid-blue: #3b82f6;
  --surface: #ffffff;
  --surface-card: rgba(255, 255, 255, 0.95);
  --border: rgba(37, 8, 53, 0.12);
  --border-focus: #ab2fed;
  --text-primary: #250835;
  --text-muted: #6b5876;
  --text-dim: #9785a2;
  
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  --info-bg: #eff6ff;
  --info-text: #1e40af;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(37, 8, 53, 0.04);
  --shadow-md: 0 8px 24px rgba(37, 8, 53, 0.08);
  --shadow-lg: 0 16px 36px rgba(37, 8, 53, 0.12);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--lavender-mist);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--plum);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--vivid-violet), #decaff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--plum);
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(171, 47, 237, 0.4);
}

.brand-text h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-text p {
  font-size: 11px;
  color: var(--lavender-wash);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(222, 202, 255, 0.5);
  font-weight: 700;
  padding: 12px 12px 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(171, 47, 237, 0.22);
  color: #ffffff;
  border-color: rgba(171, 47, 237, 0.4);
  box-shadow: 0 2px 8px rgba(171, 47, 237, 0.2);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(222, 202, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #decaff;
  font-size: 14px;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--vivid-violet);
  color: #ffffff;
  text-transform: uppercase;
}

.btn-logout {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-logout:hover {
  color: #ff6b6b;
  background: rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.page-title h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--plum);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.promo-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--lavender-wash);
  border: 1px solid rgba(171, 47, 237, 0.3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--plum);
}

.promo-pill .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

/* Content Container */
.content-body {
  padding: 32px;
  flex: 1;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out forwards;
}

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

/* Cards & Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--vivid-violet), var(--lavender-wash));
}

.kpi-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--plum);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.kpi-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Section Container */
.card-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--plum);
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Filter Bar & Controls */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.input-search {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--lavender-subtle);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
  min-width: 220px;
}

.input-search:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(171, 47, 237, 0.15);
}

.select-filter {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--lavender-subtle);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.select-filter:focus {
  border-color: var(--border-focus);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--plum);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 8, 53, 0.2);
}

.btn-primary:hover {
  background: var(--plum-light);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--vivid-violet);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(171, 47, 237, 0.3);
}

.btn-accent:hover {
  background: var(--vivid-violet-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--plum);
}

.btn-outline:hover {
  background: var(--lavender-mist);
  border-color: var(--plum);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.whimsical-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
}

.whimsical-table th {
  padding: 12px 16px;
  background: var(--lavender-subtle);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.whimsical-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.whimsical-table tr:hover td {
  background-color: var(--lavender-subtle);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-pro {
  background: var(--lavender-wash);
  color: var(--plum);
  border: 1px solid rgba(171, 47, 237, 0.3);
}

.badge-admin {
  background: var(--plum);
  color: #ffffff;
}

.badge-user {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-inactive {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-paid {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-issued {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge-overdue {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-payment_submitted {
  background: #fef3c7;
  color: #b45309;
}

/* Monetization Switch Card */
.monetization-banner {
  background: linear-gradient(135deg, rgba(37, 8, 53, 0.95), rgba(61, 20, 84, 0.95)), var(--plum);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.monetization-text h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #ffffff;
}

.monetization-text p {
  font-size: 14px;
  color: var(--lavender-wash);
  max-width: 600px;
}

.toggle-switch-container {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-label {
  font-size: 14px;
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.3);
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(37, 8, 53, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.2s ease-out forwards;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--plum);
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--lavender-subtle);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(171, 47, 237, 0.15);
}

.modal-footer {
  padding: 16px 24px;
  background: var(--lavender-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--plum);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast.toast-success {
  background: #065f46;
  border: 1px solid #10b981;
}

.toast.toast-error {
  background: #991b1b;
  border: 1px solid #ef4444;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}

/* ==========================================================================
   Merchant Portal Specific Styles
   ========================================================================== */

/* Template Gallery Grid */
.template-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.template-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(171, 47, 237, 0.4);
}

.template-card.active {
  border-color: var(--vivid-violet);
  box-shadow: 0 8px 24px rgba(171, 47, 237, 0.25);
}

.template-badge-current {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--vivid-violet);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px rgba(171, 47, 237, 0.4);
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-thumbnail-wrap {
  width: 100%;
  height: 220px;
  background: #f0ecf4;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.template-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}

.template-card:hover .template-thumbnail-wrap img {
  transform: scale(1.03);
}

.template-info {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--plum);
  margin-bottom: 4px;
}

.template-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Logo Uploader Dropzone */
.logo-dropzone {
  border: 2px dashed rgba(171, 47, 237, 0.4);
  background: var(--lavender-subtle);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logo-dropzone:hover {
  background: rgba(222, 202, 255, 0.3);
  border-color: var(--vivid-violet);
}

.logo-preview-box {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: repeating-conic-gradient(#f4eff7 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.logo-preview-box img {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
}

/* Modal Form Line Items */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.line-items-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.line-items-table td {
  padding: 8px 10px;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-remove-item:hover {
  background: #fee2e2;
}

.calc-summary-box {
  background: var(--lavender-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.calc-row.total {
  font-size: 17px;
  font-weight: 800;
  color: var(--plum);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

/* Template Gallery Cards */
.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--vivid-violet);
}

.template-card-active {
  border: 2px solid #10b981 !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.template-preview {
  position: relative;
  background: #f8fafc;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.template-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}

.template-card:hover .template-preview img {
  transform: scale(1.03);
}

.template-active-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #10b981;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.template-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.template-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--plum);
  margin-bottom: 6px;
}

.template-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

/* Badges */
.badge-tier {
  background: rgba(171, 47, 237, 0.15);
  color: #ab2fed;
  font-weight: 800;
}

.badge-neutral {
  background: #f3f4f6;
  color: #4b5563;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

