/* ==========================================================================
   Material Design 3 Expressive - Components
   Home Agent Wave 2
   ========================================================================== */

/* --- 1. M3 Buttons & FAB --- */
.m3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-large);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  user-select: none;
  white-space: nowrap;
  min-height: 40px;
}

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

.m3-btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}
.m3-btn-filled:hover {
  box-shadow: var(--md-sys-elevation-2);
  filter: brightness(1.08);
}

.m3-btn-tonal {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline-variant);
}
.m3-btn-tonal:hover {
  background-color: var(--md-sys-color-surface-container-highest);
}

.m3-btn-outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-outline);
}
.m3-btn-outlined:hover {
  background-color: rgba(165, 180, 252, 0.08);
}

.m3-btn-text {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  padding: 0.5rem 0.75rem;
}
.m3-btn-text:hover {
  background-color: rgba(165, 180, 252, 0.08);
}

/* Icon Button (Square Pill / Circle) */
.m3-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  position: relative;
  transition: background-color var(--md-sys-motion-duration-short);
}
.m3-icon-btn:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

/* Extended Floating Action Button (FAB) */
.m3-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem; /* Sopra la bottom bar su mobile */
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--md-sys-elevation-3);
  font: var(--md-sys-typescale-title-medium);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
              box-shadow var(--md-sys-motion-duration-medium);
}
.m3-fab:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--md-sys-elevation-4);
}
.m3-fab:active {
  transform: scale(0.96);
}

/* --- 2. M3 Cards & Tonal Containers --- */
.m3-card {
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--md-sys-motion-duration-short),
              box-shadow var(--md-sys-motion-duration-short),
              border-color var(--md-sys-motion-duration-short);
}
.m3-card:hover {
  box-shadow: var(--md-sys-elevation-2);
  border-color: var(--md-sys-color-outline);
}

.m3-card-hero {
  background: linear-gradient(135deg, var(--md-sys-color-surface-container-high) 0%, var(--md-sys-color-surface-container) 100%);
  border: 1px solid rgba(165, 180, 252, 0.15);
  box-shadow: var(--md-sys-elevation-2);
}

.m3-card-highlight {
  border-left: 4px solid var(--md-sys-color-primary);
}
.m3-card-critical {
  border-left: 4px solid var(--md-sys-color-error);
}
.m3-card-warning {
  border-left: 4px solid var(--md-sys-color-tertiary);
}

/* --- 3. M3 Chips & Filters --- */
.m3-chip-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m3-chip-bar::-webkit-scrollbar { display: none; }

.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-label-medium);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short);
}
.m3-chip:hover {
  background-color: var(--md-sys-color-surface-container-high);
}
.m3-chip.active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
  font-weight: 600;
}

/* --- 3a. M3 Temporal Filter for Historical Bills --- */
.m3-time-filter-container {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.m3-chip-time {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-label-medium);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short);
}

.m3-chip-time:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.m3-chip-time.active {
  background-color: var(--md-sys-color-secondary-container, rgba(99, 102, 241, 0.2));
  color: var(--md-sys-color-primary, #818cf8);
  border-color: var(--md-sys-color-primary, #6366f1);
  font-weight: 600;
}

.m3-time-filter-paid .m3-chip-time.active {
  background-color: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}

/* --- 3b. M3 Primary Segmented Tabs --- */
.m3-segmented-tabs {
  display: inline-flex;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.m3-segmented-tabs::-webkit-scrollbar { display: none; }

.m3-segmented-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-title-small);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short) ease;
}
.m3-segmented-tab:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}
.m3-segmented-tab.active {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.m3-tab-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}
.m3-segmented-tab:not(.active) .m3-tab-pill-badge {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}
.m3-segmented-tab:not(.active) .m3-tab-pill-badge.badge-urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}
.m3-segmented-tab:not(.active) .m3-tab-pill-badge.badge-paid {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

/* --- 4. M3 Badges & Status Indicators --- */
.m3-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-small);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-critical {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-normal {
  background-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  animation: m3-pulse 2s infinite;
}
@keyframes m3-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Material 3 Expressive Spinner & Rotella Progress */
.m3-spin {
  animation: m3-spin 0.85s linear infinite !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

@keyframes m3-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.m3-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--md-sys-color-primary);
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  animation: m3-spin 0.85s linear infinite;
}

/* Material 3 Expressive Circular Progress (SVG) */
.m3-circular-progress {
  display: inline-block;
  vertical-align: middle;
  animation: m3-circular-rotate 1.4s linear infinite;
}
.m3-circular-progress-circle {
  stroke-dasharray: 1px, 200px;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  animation: m3-circular-dash 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes m3-circular-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes m3-circular-dash {
  0% {
    stroke-dasharray: 1px, 200px;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -15px;
  }
  100% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -125px;
  }
}

.m3-progress-linear {
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 9999px;
  overflow: hidden;
  height: 6px;
  width: 100%;
}
.m3-progress-linear-bar {
  height: 100%;
  background: var(--md-sys-color-primary);
  transition: width 0.4s ease;
  border-radius: 9999px;
}

/* Notification Bubble Count */
.notif-bubble {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background-color: var(--md-sys-color-error);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--md-sys-color-surface);
}

/* --- 5. M3 Form Controls & Text Fields --- */
.m3-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}
.m3-label {
  font: var(--md-sys-typescale-label-medium);
  color: var(--md-sys-color-on-surface-variant);
}
.m3-input, .m3-select, .m3-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-large);
  font-size: 16px; /* Evita zoom forzato su iOS */
  box-sizing: border-box;
  transition: border-color var(--md-sys-motion-duration-short),
              box-shadow var(--md-sys-motion-duration-short);
}
.m3-input:focus, .m3-select:focus, .m3-textarea:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.25);
  background-color: var(--md-sys-color-surface-container);
}

/* --- 6. M3 Bottom Sheet & Native Dialog --- */
dialog.m3-dialog {
  padding: 0;
  border: none;
  border-radius: var(--md-sys-shape-corner-extra-large-increased);
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-sys-elevation-5);
  max-width: 580px;
  width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  margin: auto;
}
dialog.m3-dialog:not([open]) {
  display: none !important;
}
dialog.m3-dialog::backdrop {
  background-color: var(--md-sys-color-scrim);
  backdrop-filter: blur(4px);
  animation: fadeIn 200ms ease;
}

/* Bottom Sheet Variant on Mobile */
@media (max-width: 768px) {
  dialog.m3-dialog {
    width: 100vw;
    max-width: 100vw;
    margin-bottom: 0;
    margin-top: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--md-sys-shape-corner-extra-large-increased);
    border-top-right-radius: var(--md-sys-shape-corner-extra-large-increased);
    animation: slideUp 250ms var(--md-sys-motion-easing-emphasized);
  }
}

.m3-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background-color: var(--md-sys-color-outline);
  margin: 0.75rem auto 0.25rem;
}
.m3-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.m3-dialog-body {
  padding: 1.5rem;
  max-height: calc(85vh - 140px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.m3-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container);
}

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

/* --- 7. M3 Responsive Data Table --- */
.m3-table-wrapper {
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  overflow: hidden;
}
.m3-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.m3-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font: var(--md-sys-typescale-body-medium);
}
.m3-table th {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-medium);
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  white-space: nowrap;
}
.m3-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
}
.m3-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}
.m3-table tr:last-child td {
  border-bottom: none;
}

/* --- 8. M3 Global Search Trigger & Dialog (Command Palette) --- */
.m3-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 0.4rem 0.85rem 0.4rem 0.65rem;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-medium);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  user-select: none;
}
.m3-search-trigger:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-surface);
}
.m3-search-trigger kbd {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-search-mobile-btn {
  display: none;
}

@media (max-width: 640px) {
  .m3-search-trigger {
    display: none;
  }
  .m3-search-mobile-btn {
    display: inline-flex;
  }
}

/* Dialog Command Palette */
dialog.m3-search-dialog {
  max-width: 680px;
  width: 92vw;
  border-radius: var(--md-sys-shape-corner-extra-large-increased);
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-5);
  padding: 0;
  overflow: hidden;
}

.m3-search-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-high);
}

.m3-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-title-medium);
  font-size: 1.05rem;
  padding: 0.25rem 0;
}
.m3-search-input::placeholder {
  color: var(--md-sys-color-outline);
}

.m3-search-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.m3-search-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font: var(--md-sys-typescale-label-medium);
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.m3-search-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.m3-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.m3-search-item:hover, .m3-search-item.selected {
  background-color: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
  transform: translateX(3px);
}

.m3-search-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.m3-search-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--md-sys-shape-corner-small);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m3-search-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.m3-search-item-title {
  font: var(--md-sys-typescale-title-small);
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m3-search-item-sub {
  font: var(--md-sys-typescale-body-small);
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-search-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.m3-search-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background-color: var(--md-sys-color-surface-container-low);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font: var(--md-sys-typescale-label-small);
  color: var(--md-sys-color-outline);
}
.m3-search-footer kbd {
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* --- 9. M3 & Classic UI Toggle Switch Component --- */
.ui-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.ui-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ui-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  border: 1px solid #475569;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.ui-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.ui-toggle input:checked + .ui-toggle-slider {
  background-color: #10b981;
  border-color: #059669;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.ui-toggle input:checked + .ui-toggle-slider:before {
  transform: translateX(22px);
  background-color: #ffffff !important;
}

.m3-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  box-sizing: border-box;
}
.m3-switch:hover {
  background-color: rgba(51, 65, 85, 0.6);
  border-color: var(--md-sys-color-outline);
}
.m3-switch-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}
.m3-switch-title {
  font: var(--md-sys-typescale-title-small);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.m3-switch-desc {
  font: var(--md-sys-typescale-body-small);
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.35;
}
.m3-switch-control {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.m3-switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.m3-switch-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  border: 1px solid #475569;
  border-radius: 9999px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.m3-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: #ffffff !important;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.m3-switch-control input:checked + .m3-switch-track {
  background-color: #10b981;
  border-color: #059669;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.m3-switch-control input:checked + .m3-switch-track .m3-switch-thumb {
  transform: translateX(22px);
  background-color: #ffffff !important;
}


