/* ADD BUTTON */
.add-btn {
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: filter 140ms, background var(--t);
}

.add-btn:hover { filter: brightness(1.1); }

/* NAV SELECT */
.nav-select {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 5px 26px 5px 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%235A8880' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms, color var(--t);
  min-width: 0;
}

.nav-select:hover { border-color: var(--border); }
.nav-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.nav-select option { background: var(--surface); color: var(--text); font-family: var(--font-ui); }

/* THEME CYCLE BUTTON */
.theme-cycle-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 140ms, color 140ms, border-color var(--t);
}

.theme-cycle-btn:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border-mid);
}

/* FIELDS */
.field { margin-bottom: 18px; }

.field-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  transition: color var(--t);
}

.form-control,
.form-select {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms, background var(--t), color var(--t);
  -webkit-appearance: none;
  appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%235A8880' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.field:has(.is-invalid) .invalid-feedback { display: block; }
.field:has(.is-invalid) .form-control,
.field:has(.is-invalid) .form-select { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }

.invalid-feedback {
  display: none;
  font-size: 0.77rem;
  color: var(--red);
  margin-top: 5px;
}

.input-group { display: flex; }

.input-group-text {
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--r) 0 0 var(--r);
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t), color var(--t);
}

.input-group .form-control {
  border-radius: 0 var(--r) var(--r) 0;
  flex: 1;
  min-width: 0;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 0.87rem;
  font-weight: 500;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 140ms;
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-outline {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--border-mid);
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-danger-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-bg); color: var(--red); }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; border-radius: 5px; }
.btn-full { width: 100%; }

/* BADGE */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}

.badge-danger  { background: var(--red-bg);   color: var(--red); }
.badge-success { background: var(--green-bg);  color: var(--green); }
.badge-primary { background: var(--blue-bg);   color: var(--blue); }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); }

/* LOADING */
.loading {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.87rem;
  display: none;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 7px;
}

/* TOASTS */
.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  min-width: 240px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: 0.87rem;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in 240ms ease forwards;
}

.toast.out { animation: toast-out 240ms ease forwards; }

.toast-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.toast.success .toast-dot { background: var(--green); }
.toast.danger  .toast-dot { background: var(--red); }
.toast.warning .toast-dot { background: var(--accent); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(5px); } }

/* FAB */
.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: filter 140ms, transform 140ms, background var(--t);
}
.fab:hover { filter: brightness(1.08); transform: scale(1.05); }
.fab:active { transform: scale(0.96); }
