/* ── Form elements ── */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.modal-header-input {
  font-size: 20px !important;
  font-weight: 500 !important;
  background: none !important;
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  transition: border-bottom-color 0.2s !important;
  font-family: "Fredoka", sans-serif !important;
}
.modal-header-input:focus {
  border-bottom-color: var(--border) !important;
}
/* ── Row layouts ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.desc-emoji-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.desc-emoji-row .form-input {
  flex: 1;
}
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-submit {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}
.form-submit:active {
  transform: scale(0.98);
  opacity: 0.9;
}
.form-submit:hover:not(:disabled) {
  background: var(--accent-light);
}
.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Delete button ── */
.form-delete {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-sm);
  background: var(--red-bg);
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}
.form-delete:active {
  transform: scale(0.98);
  opacity: 0.8;
}
.form-delete:hover {
  background: rgba(255, 107, 107, 0.2);
}

/* ── Amount input ── */
.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.currency-flip-btn {
  position: absolute;
  left: 6px;
  background: var(--accent);
  border: none;
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}
.currency-flip-btn:hover {
  background: #5a4bd4;
}
.currency-flip-btn:active {
  transform: scale(0.95);
}
.amount-input-wrap .form-input {
  padding-left: 62px;
  padding-right: 36px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.3px;
}
.amount-clear-btn {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s;
}
.amount-clear-btn:hover {
  background: var(--text-muted);
  color: var(--surface);
}
.amount-clear-btn.visible {
  display: flex;
}
.amount-converted {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Toggle ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.toggle-row-label {
  font-size: 14px;
  font-weight: 500;
}
.toggle-row-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.recurring-options {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  display: none;
}
.recurring-options.show {
  display: block;
}
.recurring-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* ── Emoji picker ── */
.emoji-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.emoji-picker-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  font-size: 24px;
  cursor: pointer;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.emoji-picker-btn:hover {
  border-color: var(--accent);
}
emoji-picker.hidden {
  display: block !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

emoji-picker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 350px;
  height: 420px;
  --background: var(--surface);
  --border-color: var(--border);
  --outline-color: var(--accent);
  --category-tab-highlight-background: var(--accent);
}

@media (max-width: 480px) {
  emoji-picker {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100% !important;
    height: 50vh !important;
    border-radius: 20px 20px 0 0;
    border: none;
    border-top: 1px solid var(--border);
  }
}

/* ── Today pill toggle ── */
.today-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 8px;
}
.today-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.today-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.today-row label::before {
  content: "\1F4C5";
  font-size: 14px;
}
.today-row input[type="checkbox"]:checked + label {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
