/* 入出金記録タブ専用スタイル */

/* 入出金記録タブの表示制御は base.css に委譲（.active クラスで制御） */
#tab-transactions.tab-panel.active {
  overflow: hidden !important;
  height: 100%;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding-top: 0;
  padding-right: 0;
}

#tab-transactions .transactions-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* =========================
   フィルターセクション
========================= */
  #tab-transactions .transactions-filter-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  flex-shrink: 0;
}

#tab-transactions .filter-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

#tab-transactions .filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

#tab-transactions .filter-label {
  font-size: var(--fs-14);
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  order: 2; /* デフォルトで右側に配置 */
}

#tab-transactions .filter-select-editable {
  order: 1;
}

#tab-transactions .filter-input-editable {
  order: 1;
}

/* 編集モード時のラベルも右側に配置 */
#tab-transactions .filter-group.editing .filter-label {
  order: 2;
}

.filter-select {
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.75rem;
  font-size: var(--fs-14);
  background: white;
  color: var(--text-main);
  min-width: 80px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.filter-select:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.filter-select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 2px rgba(94, 200, 216, 0.1);
}

.filter-select-editable {
  cursor: text;
  min-width: 100px;
}

.filter-input-editable {
  border-radius: 8px;
  border: 2px solid rgba(94, 200, 216, 0.5);
  padding: 0.5rem 0.75rem;
  font-size: var(--fs-14);
  background: white;
  color: var(--text-main);
  min-width: 100px;
  outline: none;
  transition: border-color 0.2s ease;
  box-shadow: 0 0 0 2px rgba(94, 200, 216, 0.1);
}

.filter-input-editable:focus {
  border-color: rgba(94, 200, 216, 0.8);
  box-shadow: 0 0 0 3px rgba(94, 200, 216, 0.15);
}

.filter-info {
  flex: 1;
  min-width: 200px;
}

.filter-note {
  font-size: var(--fs-12);
  color: var(--text-sub);
  margin: 0;
  line-height: 1.5;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-left: auto;
}

.btn-update,
.btn-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: var(--fs-14);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* 更新ボタン（グレー系） */
.btn-update {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-main);
}

.btn-update:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-update:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-update:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 追加ボタン（ミント系） */
.btn-add {
  background: rgba(94, 200, 216, 0.1);
  border-color: rgba(94, 200, 216, 0.3);
  color: rgba(94, 200, 216, 0.9);
}

.btn-add:hover {
  background: rgba(94, 200, 216, 0.15);
  border-color: rgba(94, 200, 216, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(94, 200, 216, 0.2);
}

.btn-add:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-icon-update {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.btn-icon-update.spinning {
  animation: spin 0.6s linear;
}

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

.btn-icon-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

/* =========================
   取引一覧テーブルセクション
========================= */
#tab-transactions .transactions-table-section {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  max-height: 100%;
}

.transactions-table-header {
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.transactions-title {
  font-size: var(--fs-20);
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.transactions-info {
  font-size: var(--fs-12);
  color: var(--text-sub);
  margin: 0;
  line-height: 1.5;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}

.transactions-table thead {
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.transactions-table th {
  padding: 4px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
  font-size: var(--fs-13);
  white-space: nowrap;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.transactions-table th:last-child {
  border-right: none;
}

.transactions-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-main);
  vertical-align: middle;
}

.transactions-table td:last-child {
  border-right: none;
}

.transactions-table tbody tr {
  transition: background-color 0.2s ease;
}

.transactions-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

/* 未確定行のハイライト（グレイッシュピンク系） */
.tx-row-unconfirmed {
  background-color: rgba(200, 180, 180, 0.12) !important;
}

.tx-row-unconfirmed:hover {
  background-color: rgba(200, 180, 180, 0.18) !important;
}

/* カラム幅 */
.col-type {
  width: 60px;
  min-width: 60px;
  text-align: center;
  padding: 4px 8px;
}

.col-date {
  width: 80px;
  min-width: 80px;
}

.col-content {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

.col-category {
  width: 160px;
  min-width: 160px;
}

.col-income {
  width: 160px;
  min-width: 160px;
  text-align: right;
  font-weight: 600;
  color: #1ca58a;
}

.col-expense {
  width: 160px;
  min-width: 160px;
  text-align: right;
  font-weight: 600;
  color: #e1687c;
}

.col-status {
  width: 100px;
  min-width: 100px;
  text-align: center;
}

.col-action {
  width: 80px;
  min-width: 80px;
  text-align: center;
}

/* 金額表示 */
.col-income {
  color: #1ca58a;
}

.col-expense {
  color: #e1687c;
}

.col-income:empty::before,
.col-expense:empty::before {
  content: "—";
  color: var(--text-sub);
  font-weight: normal;
}

/* 「—」のスタイル */
.col-income:contains("—"),
.col-expense:contains("—") {
  color: var(--text-sub);
  font-weight: normal;
}

/* 状態トグルスイッチ（スライドボタン） */
.status-toggle {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.status-toggle-wrapper {
  position: relative;
  display: inline-block;
  width: 85px;
  height: 24px;
}

.status-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.status-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(237, 84, 112, 0.3);
  transition: 0.3s;
  border-radius: 24px;
  cursor: pointer;
  overflow: visible;
}

.status-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: rgba(237, 84, 112, 0.9);
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

/* 確定状態（ON） */
.status-toggle.status-confirmed .status-toggle-slider {
  background-color: rgba(0, 0, 0, 0.3);
}

.status-toggle.status-confirmed .status-toggle-slider:before {
  background-color: white;
  transform: translateX(61px);
}

/* 未確定状態（OFF）はデフォルトスタイル */

.status-toggle:hover .status-toggle-slider {
  opacity: 0.8;
}

.status-toggle:active .status-toggle-slider:before {
  transform: scale(0.95);
}

.status-toggle.status-confirmed:active .status-toggle-slider:before {
  transform: translateX(61px) scale(0.95);
}

.status-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--fs-11);
  font-weight: 600;
  color: white;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: color 0.3s ease;
  line-height: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 確定状態のテキスト色 */
.status-toggle.status-confirmed .status-label {
  color: rgba(255, 255, 255, 0.95);
}

/* 削除ボタン */
.btn-delete {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: white;
  color: var(--text-sub);
  font-size: var(--fs-12);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: nowrap;
}

.btn-delete:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
}

.btn-delete:active {
  transform: translateY(1px);
}

/* =========================
   セル編集スタイル
========================= */
.cell-edit-input,
.cell-edit-select {
  outline: none;
  box-shadow: 0 0 0 2px rgba(94, 200, 216, 0.2);
}

/* 日付入力のカレンダーボタンを非表示（ダブルクリックで開くため） */
.cell-edit-input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

.cell-edit-input[type="date"]::-webkit-inner-spin-button,
.cell-edit-input[type="date"]::-webkit-clear-button {
  display: none;
  -webkit-appearance: none;
}

.cell-edit-input:focus,
.cell-edit-select:focus {
  border-color: rgba(94, 200, 216, 0.8);
  box-shadow: 0 0 0 3px rgba(94, 200, 216, 0.15);
}

/* 未確定行のセル編集スタイル（くすみローズ） */
.cell-edit-input.cell-edit-unconfirmed,
.cell-edit-select.cell-edit-unconfirmed {
  box-shadow: 0 0 0 2px rgba(200, 180, 180, 0.3);
}

.cell-edit-input.cell-edit-unconfirmed:focus,
.cell-edit-select.cell-edit-unconfirmed:focus {
  border-color: rgba(200, 180, 180, 0.6);
  box-shadow: 0 0 0 3px rgba(200, 180, 180, 0.2);
  background-color: rgba(200, 180, 180, 0.05);
}

/* 入出金アイコンバッジ（PC版テーブル） */
.tx-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: var(--fs-13);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(140, 160, 190, 0.15);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.tx-type-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(140, 160, 190, 0.25);
}

.tx-type-badge:active {
  transform: scale(0.95);
}

.tx-type-income {
  background: linear-gradient(135deg, 
    rgba(94, 200, 216, 0.2) 0%,
    rgba(183, 240, 235, 0.15) 100%);
  color: #5ec8d8;
  border-color: rgba(94, 200, 216, 0.3);
}

.tx-type-expense {
  background: linear-gradient(135deg, 
    rgba(237, 84, 112, 0.2) 0%,
    rgba(255, 201, 214, 0.15) 100%);
  color: rgba(237, 84, 112, 0.9);
  border-color: rgba(237, 84, 112, 0.3);
}

.tx-type-label {
  line-height: 1;
}

/* 編集可能なセルにカーソルを変更 */
.col-date,
.col-content,
.col-category,
.col-income,
.col-expense {
  cursor: pointer;
  position: relative;
}

.col-date:hover,
.col-content:hover,
.col-category:hover,
.col-income:hover,
.col-expense:hover {
  background-color: rgba(94, 200, 216, 0.05);
}

/* =========================
   確認ダイアログ
========================= */
.confirm-dialog,
.alert-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.confirm-dialog-overlay,
.alert-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.confirm-dialog-content,
.alert-dialog-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(140, 160, 190, 0.25);
  z-index: 1;
  animation: confirmDialogSlideIn 0.2s ease-out;
}

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

.confirm-dialog-title,
.alert-dialog-title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.confirm-dialog-message,
.alert-dialog-message {
  font-size: var(--fs-14);
  color: var(--text-main);
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.confirm-dialog-actions,
.alert-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirm-dialog-btn,
.alert-dialog-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: var(--fs-14);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.confirm-dialog-btn-cancel {
  background: white;
  color: var(--text-main);
}

.confirm-dialog-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.2);
}

.confirm-dialog-btn-confirm {
  background: rgba(237, 84, 112, 0.1);
  border-color: rgba(237, 84, 112, 0.3);
  color: rgba(237, 84, 112, 0.9);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.confirm-dialog-btn-confirm:hover {
  background: rgba(237, 84, 112, 0.15);
  border-color: rgba(237, 84, 112, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(237, 84, 112, 0.2);
}

.alert-dialog-btn-ok {
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.15), rgba(143, 140, 243, 0.12));
  border-color: rgba(94, 200, 216, 0.3);
  color: rgba(94, 200, 216, 0.9);
}

.alert-dialog-btn-ok:hover {
  background: linear-gradient(135deg, rgba(94, 200, 216, 0.2), rgba(143, 140, 243, 0.15));
  border-color: rgba(94, 200, 216, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(94, 200, 216, 0.2);
}

.confirm-dialog-btn:active,
.alert-dialog-btn:active {
  transform: translateY(0);
}

/* PC版：カードを非表示 */
@media (min-width: 769px) {
  .transactions-cards {
    display: none !important;
  }
}

/* レスポンシブ */
@media (max-width: 768px) {
  #tab-transactions .transactions-filter-section {
    flex-direction: column;
  }
  
  .filter-actions {
    display: none; /* スマホ版では非表示（フローティングボタンに移動） */
  }
  
  /* フローティングアクションボタン（スマホ版） */
  .transactions-floating-actions {
    position: fixed;
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom)) + 16px);
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
  }
  
  .transactions-floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-24);
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
  }
  
  .transactions-floating-btn-add {
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.9) 0%,
      rgba(143, 140, 243, 0.85) 100%);
    color: white;
  }
  
  .transactions-floating-btn-add:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(94, 200, 216, 0.4);
  }
  
  .transactions-floating-btn-update {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    border: 2px solid rgba(226, 232, 240, 0.8);
  }
  
  .transactions-floating-btn-update:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
  
  .transactions-floating-btn-label {
    position: absolute;
    right: 64px;
    white-space: nowrap;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    border-radius: 8px;
    font-size: var(--fs-12);
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
  }
  
  .transactions-floating-btn:hover .transactions-floating-btn-label {
    opacity: 1;
    visibility: visible;
  }
  
  /* スマホ版ではテーブルを非表示 */
  .table-wrapper {
    display: none;
  }
  
  /* カード形式の取引一覧 */
  .transactions-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin-top: 1rem;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .tx-card {
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.2s ease;
  }
  
  .tx-card-unconfirmed {
    border-left: 4px solid rgba(200, 180, 180, 0.6);
    background: rgba(200, 180, 180, 0.12);
  }
  
  .tx-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  }
  
  .tx-card-date {
    font-size: var(--fs-11);
    font-weight: 600;
    color: var(--text-main);
  }
  
  .tx-card-content {
    margin-bottom: 6px;
  }
  
  .tx-card-description {
    font-size: var(--fs-12);
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-word;
  }
  
  .tx-card-category {
    font-size: var(--fs-11);
    color: var(--text-sub);
    padding: 2px 5px;
    background: rgba(245, 248, 255, 0.6);
    border-radius: 4px;
    display: inline-block;
    margin-top: 3px;
  }
  
  .tx-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    gap: 10px;
  }

  .tx-card-amount-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
  }

  .tx-card-type-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    font-size: var(--fs-11);
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(140, 160, 190, 0.15);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
  }

  .tx-card-type-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(140, 160, 190, 0.25);
  }

  .tx-card-type-badge:active {
    transform: scale(0.95);
  }

  .tx-card-type-income {
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.2) 0%,
      rgba(183, 240, 235, 0.15) 100%);
    color: #5ec8d8;
    border-color: rgba(94, 200, 216, 0.3);
  }

  .tx-card-type-expense {
    background: linear-gradient(135deg, 
      rgba(237, 84, 112, 0.2) 0%,
      rgba(255, 201, 214, 0.15) 100%);
    color: rgba(237, 84, 112, 0.9);
    border-color: rgba(237, 84, 112, 0.3);
  }

  .tx-card-type-label {
    font-size: var(--fs-13);
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .tx-card-amount {
    font-size: var(--fs-16);
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
  }
  
  .btn-delete-card {
    padding: 6px 12px;
    font-size: var(--fs-12);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .btn-delete-card:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
  }
  
  .tx-card .status-toggle {
    margin: 0;
  }
  
  /* テーブル以外の要素は横スクロールを防ぐ */
  #tab-transactions > *:not(.table-wrapper) {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  .confirm-dialog-content {
    padding: 1.25rem;
    max-width: 90%;
  }
  
  .confirm-dialog-actions {
    flex-direction: column-reverse;
  }
  
  .confirm-dialog-btn {
    width: 100%;
  }

  /* 取引編集ボトムシートモーダル */
  .tx-edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .tx-edit-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .tx-edit-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.15);
  }

  .tx-edit-modal.is-visible {
    transform: translateY(0);
  }

  .tx-edit-modal::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
  }

  .tx-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px 8px;
    margin-top: 12px;
  }

  .tx-edit-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: var(--fs-20);
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
  }

  .tx-edit-modal-close:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
  }

  .tx-edit-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .tx-edit-field {
    margin-bottom: 12px;
  }

  .tx-edit-field:last-child {
    margin-bottom: 0;
  }

  .tx-edit-label {
    display: block;
    font-size: var(--fs-11);
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 5px;
  }

  .tx-edit-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    font-size: var(--fs-13);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }

  .tx-edit-input:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 2px rgba(94, 200, 216, 0.1);
    background: white;
  }

  .tx-edit-amount {
    font-size: var(--fs-16);
    font-weight: 700;
    text-align: right;
  }

  .tx-edit-type-toggle {
    display: flex;
    gap: 8px;
  }

  .tx-edit-type-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    font-size: var(--fs-13);
    font-weight: 600;
    background: white;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .tx-edit-type-btn.tx-edit-type-income.active {
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.2) 0%,
      rgba(183, 240, 235, 0.15) 100%);
    border-color: rgba(94, 200, 216, 0.4);
    color: #5ec8d8;
  }

  .tx-edit-type-btn.tx-edit-type-expense.active {
    background: linear-gradient(135deg, 
      rgba(237, 84, 112, 0.2) 0%,
      rgba(255, 201, 214, 0.15) 100%);
    border-color: rgba(237, 84, 112, 0.4);
    color: rgba(237, 84, 112, 0.9);
  }

  .tx-edit-modal-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(226, 232, 240, 0.4);
  }

  .tx-edit-btn-save {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: var(--fs-13);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.2) 0%,
      rgba(143, 140, 243, 0.15) 100%);
    border: 1px solid rgba(94, 200, 216, 0.3);
    color: rgba(94, 200, 216, 0.9);
  }

  .tx-edit-btn-save:hover {
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.25) 0%,
      rgba(143, 140, 243, 0.2) 100%);
    border-color: rgba(94, 200, 216, 0.4);
    transform: translateY(-1px);
  }

  .tx-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .btn-edit-card {
    padding: 6px 12px;
    font-size: var(--fs-12);
    background: rgba(94, 200, 216, 0.1);
    color: #5ec8d8;
    border: 1px solid rgba(94, 200, 216, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .btn-edit-card:hover {
    background: rgba(94, 200, 216, 0.15);
    border-color: rgba(94, 200, 216, 0.3);
  }

  .btn-delete-card {
    cursor: pointer;
    pointer-events: auto;
  }
}

/* PC版ではフローティングボタンと編集モーダルを非表示 */
@media (min-width: 769px) {
  .transactions-floating-actions {
    display: none !important;
  }
  
  .tx-edit-modal-overlay,
  .tx-edit-modal {
    display: none !important;
  }
}
