:root {
  --primary-color: #2563eb;
  --success-color: #10b981;
  --danger-color: #e11d48;
  --light-color: #f9fafb;
  --dark-color: #374151;
  --border-color: #e6e9ee;
  --gray-color: #6b7280;
  --edit-icon-color: #246cf9;
  --gray-light: #ced4da;
}

* {
  font-family: "Inter", sans-serif;
}

.settings-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.settings-nav .nav-link {
  color: var(--gray-color);
  border: none;
  background: none;
  padding: 8px 12px;
  margin-right: 16px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.settings-nav .nav-link.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.settings-nav .nav-link:hover {
  color: var(--primary-color);
}

.settings-sidebar .nav-link:hover {
  background: white;
  color: var(--gray-color);
}

.settings-sidebar .nav-link.active {
  background-color: #eff5fb;
  color: var(--primary-color);
  width: 100%;
  height: 44px;
  gap: 12px;
  opacity: 1;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0%;
}

.threshold-section {
  margin-bottom: 16px;
  background: white;
}

.auto-transfer-toggle-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.threshold-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.threshold-title {
  flex: 0 0 auto;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-color);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.info-icon {
  color: #000000;
  background-color: #ffffff;
  cursor: pointer;
  font-size: 16px;
}

.info-icon-white {
  color: #1f2937;
  background-color: #ffffff;
  border: 1.5px solid #1f2937;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* White tooltip override */
.tooltip .tooltip-inner {
  background-color: #ffffff;
  color: #1f2937;
  border: 1px solid #e6e9ee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  padding: 6px 10px;
}

.tooltip .tooltip-arrow::before {
  border-top-color: #e6e9ee !important;
}


.threshold-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.threshold-input {
  width: 300px;
  height: 32px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0 8px;
}

.threshold-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.threshold-input.is-invalid {
  border-color: var(--danger-color);
  background-image: none;
}

.threshold-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.08);
}

.invalid-feedback {
  color: var(--danger-color);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  width: 100%;
  margin-top: 4px;
  display: block;
}

.unit-label {
  width: 40px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--gray-color);
  text-align: center;
}

.edit-icon {
  color: var(--edit-icon-color);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s ease;
}

.edit-icon:hover {
  color: var(--primary-color);
  opacity: 0.8;
}

.btn-save {
  width: 32px;
  height: 32px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  background: var(--primary-color);
  border: none;
  color: white;
  transition: none;
}

.btn-cancel {
  width: 32px;
  height: 32px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--gray-light);
  color: var(--edit-icon-color);
  transition: none;
}

.btn-cancel:hover,
.btn-cancel:active,
.btn-cancel:focus {
  background: white;
  border: 1px solid var(--gray-light);
  color: var(--edit-icon-color);
  transition: none;
}

.btn-save:hover,
.btn-save:active,
.btn-save:focus {
  background: var(--primary-color);
  border: none;
  color: white;
  transition: none;
}

.page-title {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: var(--dark-color);
  margin-bottom: 16px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

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

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

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

input:checked + .slider {
  background-color: var(--primary-color);
}

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

/* Custom Toast Styles */
.custom-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 350px;
  font-family: "Inter", sans-serif;
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  background-color: var(--light-color);
  overflow: hidden;
}

.custom-toast-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5rem;
  color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-toast-header.success {
  background-color: var(--success-color);
}

.custom-toast-header.error {
  background-color: var(--danger-color);
}

.custom-toast-header .toast-icon {
  margin-right: 0.5rem;
}

.custom-toast-header .toast-title {
  flex-grow: 1;
  font-weight: 700;
}

.custom-toast-header .toast-close {
  background: none;
  border: none;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.8;
}

.custom-toast-header .toast-close:hover {
  opacity: 1;
}

.custom-toast-body {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--dark-color);
}

.custom-toast.fade-in {
  animation: fadeIn 0.3s ease-in;
}

.custom-toast.fade-out {
  animation: fadeOut 0.3s ease-out;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.modal.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.confirm-modal .modal-content {
  background: white;
  width: 724px;
  padding: 40px;
  position: relative;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  max-width: none;
  box-shadow: none;
}

.modal.confirm-modal .modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #e8e8ed;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: #6c757d;
  padding: 0;
  line-height: 1;
  transition: background-color 0.2s;
}

.modal.confirm-modal .modal-close-btn:hover {
  background: #d1d5db;
  color: #343a40;
}

.modal.confirm-modal .modal-title {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  text-align: center;
  color: var(--dark-color);
  margin-bottom: 24px;
}

.modal.confirm-modal .modal-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: center;
}

.modal.confirm-modal .modal-message .warning-icon {
  color: #f0ad4e;
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.modal.confirm-modal .modal-message p {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
}

.modal.confirm-modal .modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 40px;
}

.modal.confirm-modal .modal-buttons .btn-modal-cancel {
  background: #ffffff;
  color: #327cc8;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  border: none;
  padding: 13px 20px;
  cursor: pointer;
}

.modal.confirm-modal .modal-buttons .btn-modal-cancel:hover {
  background: #f8f9fa;
}

.modal.confirm-modal .modal-buttons .btn-modal-confirm {
  background: linear-gradient(180deg, #4685ff 0%, #246cf9 100%);
  border: none;
  border-radius: 8px;
  padding: 13px 20px;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  cursor: pointer;
}

.modal.confirm-modal .modal-buttons .btn-modal-confirm:hover {
  background: linear-gradient(180deg, #3a7ae8 0%, #1d5fd6 100%);
}

@media (max-width: 768px) {
  .settings-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-nav .nav-link {
    margin-right: 16px;
    font-size: 0.75rem;
    padding: 8px;
  }

  .threshold-row {
    gap: 8px;
  }

  .threshold-input-container {
    flex-wrap: wrap;
  }

  .custom-toast {
    max-width: 90%;
  }

  .modal.confirm-modal .modal-content {
    width: 95%;
    padding: 24px;
  }

  .modal.confirm-modal .modal-title {
    font-size: 24px;
    line-height: 32px;
  }
}
