/* 今月の状況タブ専用CSS */

#tab-today {
  overflow: hidden;
  overflow-x: hidden;
  height: 100%;
  flex: 1;
  min-height: 0;
}

.page-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  box-sizing: border-box;
  height: 100%;
}

.section {
  margin-bottom: 1.5rem;
}

.today-layout {
  display: flex;
  gap: 1.5rem;
  height: 100%;
}

.today-layout__main {
  flex: 0 0 60%;
  max-width: 60%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.today-layout__main .section {
  margin-bottom: 0;
}

.today-layout__side {
  flex: 0 0 40%;
  max-width: 40%;
  overflow-y: auto;
  padding-right: 0.5rem;
  padding-bottom: 1rem;
}

.today-layout__side .top-cards {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.today-layout__side .card {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  border-left-width: 3px;
}

.today-layout__side .amount--main {
  font-size: var(--fs-24);
}

.today-layout__side .card-sub,
.today-layout__side .ref-item {
  color: var(--text-sub);
}

.today-layout__side .period-scope,
.today-layout__side .fuyo-container,
.today-layout__side .next-action {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.today-layout__side .period-scope {
  padding: 0.75rem 1rem;
}

.today-side__title {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text-sub);
  margin: 0.5rem 0 1rem;
}

/* =========================
  今月の判断カード
========================= */
.monthly-judgment {
  background: linear-gradient(135deg, rgba(236, 246, 255, 0.95), rgba(160, 212, 255, 0.22));
  border-radius: 16px;
  padding: 2rem 2.25rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(90, 160, 220, 0.25);
}

.monthly-judgment__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.monthly-judgment__title {
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
}

.monthly-judgment__status {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--text-main);
}

.monthly-judgment__status-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.monthly-judgment__remaining {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.monthly-judgment__bar {
  margin-bottom: 0.5rem;
}

.monthly-judgment__bar-track {
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.monthly-judgment__bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, rgba(69, 179, 117, 0.9) 0%, rgba(255, 215, 120, 0.95) 55%, rgba(237, 84, 112, 0.95) 100%);
}

.monthly-judgment__bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: var(--fs-10);
  color: var(--text-sub);
}

.monthly-judgment__bar-label {
  white-space: nowrap;
}

.monthly-judgment__label {
  font-size: var(--fs-12);
  color: var(--text-sub);
  margin-bottom: 0.25rem;
}

.monthly-judgment__amount {
  font-size: var(--fs-36);
  font-weight: 700;
  color: var(--text-main);
}

.monthly-judgment__prediction {
  font-size: var(--fs-14);
  color: var(--text-sub);
  margin-bottom: 0;
}

.monthly-judgment__cta {
  display: flex;
  justify-content: flex-start;
}

.monthly-judgment__button {
  padding: 0.85rem 1.75rem;
  background: rgba(94, 200, 216, 0.18);
  border: 1px solid rgba(94, 200, 216, 0.35);
  border-radius: 10px;
  color: rgba(17, 78, 86, 0.9);
  font-size: var(--fs-15);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.monthly-judgment__button:hover {
  background: rgba(94, 200, 216, 0.28);
  border-color: rgba(94, 200, 216, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(94, 200, 216, 0.2);
}

/* =========================
  今月のおすすめ行動
========================= */
.monthly-recommend {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.monthly-recommend__title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.75rem 0;
}

.monthly-recommend__lead {
  font-size: var(--fs-13);
  color: var(--text-sub);
  margin-bottom: 0.5rem;
}

.monthly-recommend__list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-main);
  font-size: var(--fs-15);
  line-height: 1.6;
}

/* =========================
   期間スコープ（画面最上部）
========================= */
.period-scope {
  background: linear-gradient(135deg, rgba(248, 249, 251, 0.95), rgba(225, 231, 238, 0.7));
  border-radius: 16px;
  padding: 0.75rem 1.1rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.period-scope__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.period-scope__year-month {
  font-size: var(--fs-16);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  line-height: 1.2;
  flex: 0 0 auto;
}

.period-nav-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  color: var(--text-main);
  padding: 0;
  flex: 0 0 auto;
}

.period-nav-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(94, 200, 216, 0.3);
  transform: scale(1.05);
}

.period-nav-btn:active {
  transform: scale(0.95);
}

.period-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.period-scope__label {
  font-size: var(--fs-14);
  color: var(--text-sub);
  line-height: 1.4;
}

/* =========================
   今の状況セクション
========================= */
.status-section {
  margin-bottom: 1.5rem;
}

.top-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
  width: 100%;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-left: 4px solid transparent;
  width: 100%;
  box-sizing: border-box;
}

#tab-today .card-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0.75rem 1rem;
  align-items: start;
}

#tab-today .card-inner > :not(.ref-block) {
  grid-column: 1;
}

#tab-today .card-inner .ref-block {
  grid-column: 2;
  grid-row: 1 / span 10;
  align-self: start;
}

.card--revenue {
  background: linear-gradient(135deg, rgba(220, 245, 236, 0.9), rgba(255, 255, 255, 0.98));
  border-left-color: rgba(76, 175, 131, 0.45);
}

.card--expense {
  background: linear-gradient(135deg, rgba(255, 228, 234, 0.9), rgba(255, 255, 255, 0.98));
  border-left-color: rgba(237, 84, 112, 0.4);
}

.card-title {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.amount--main {
  font-size: var(--fs-32);
  font-weight: 700;
  color: var(--text-main);
  margin: 0.5rem 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card-sub {
  font-size: var(--fs-14);
  color: var(--text-sub);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.card-draft {
  background: rgba(237, 84, 112, 0.1);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  min-height: 0;
}

.card-draft[style*="display: none"] {
  margin-top: 0;
  margin-bottom: 0;
  min-height: 0;
}

#today-income-draft-text,
#today-expense-draft-text {
  font-size: var(--fs-14);
  color: rgba(237, 84, 112, 0.9);
  display: block;
  margin-bottom: 0.375rem;
  line-height: 1.4;
  font-weight: 500;
}

.card-draft-note {
  font-size: var(--fs-12);
  color: rgba(237, 84, 112, 0.8);
  text-decoration: none;
  display: block;
  line-height: 1.4;
}

.card-draft-note:hover {
  text-decoration: underline;
}

#tab-today .ref-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  min-height: 0;
  font-size: var(--fs-11);
}

.ref-title {
  font-size: var(--fs-12);
  color: var(--text-sub);
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.4;
}

.ref-item {
  font-size: var(--fs-11);
  color: var(--text-sub);
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

/* =========================
   扶養コンテナ（横棒グラフ）
========================= */
.fuyo-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(240, 244, 248, 0.6));
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.fuyo-container__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.fuyo-container__title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
}

.fuyo-container__link {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: var(--fs-14);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  font-weight: 500;
}

.fuyo-container__link:hover {
  text-decoration: underline;
  color: var(--text-main);
}

.fuyo-progress-bar {
  width: 100%;
  margin-top: 0.75rem;
}

.fuyo-progress-bar__track {
  position: relative;
  width: 100%;
  height: 36px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fuyo-progress-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 18px;
  transition: width 0.6s ease;
}

.fuyo-progress-bar__fill--confirmed {
  z-index: 2;
}

.fuyo-progress-bar__fill--draft {
  z-index: 1;
  opacity: 0.65;
}

.fuyo-progress-bar__fill--zone-safe {
  background: linear-gradient(90deg, rgba(94, 200, 216, 0.5), rgba(143, 216, 200, 0.45));
}

.fuyo-progress-bar__fill--zone-warning {
  background: linear-gradient(90deg, rgba(255, 218, 180, 0.6), rgba(255, 201, 214, 0.55));
}

.fuyo-progress-bar__fill--zone-critical {
  background: linear-gradient(90deg, rgba(237, 84, 112, 0.55), rgba(180, 96, 120, 0.5));
}

.fuyo-progress-bar__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--fs-15);
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  z-index: 3;
  white-space: nowrap;
  pointer-events: none;
}

.fuyo-progress-bar__label--draft {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-12);
  color: var(--text-sub);
  z-index: 4;
  white-space: nowrap;
  pointer-events: none;
  font-weight: 500;
}

/* =========================
   次にやること
========================= */
.next-action {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(94, 200, 216, 0.06));
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.next-action__title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.next-action__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.next-action__text {
  font-size: var(--fs-14);
  color: var(--text-main);
  line-height: 1.6;
}

.next-action__button {
  align-self: flex-start;
  padding: 0.625rem 1.25rem;
  background: rgba(94, 200, 216, 0.1);
  border: 1px solid rgba(94, 200, 216, 0.3);
  border-radius: 8px;
  color: rgba(94, 200, 216, 0.9);
  font-size: var(--fs-14);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.next-action__button: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);
}

/* レスポンシブ */
@media (max-width: 768px) {
  #tab-today {
    overflow-y: auto;
  }

  .page-container {
    padding: 0 0.25rem;
    height: auto;
  }

  .section {
    margin-bottom: 1rem;
  }

  .today-layout {
    flex-direction: column;
    height: auto;
  }

  .today-layout__main,
  .today-layout__side {
    max-width: 100%;
    flex: 1 1 auto;
  }

  .today-layout__main {
    gap: 1rem;
  }

  .today-layout__side {
    overflow: visible;
    padding-right: 0;
  }

  .today-side__title {
    margin: 0.25rem 0 0.75rem;
  }

  .top-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .amount--main {
    font-size: var(--fs-20);
    margin: 0.375rem 0;
  }
  
  .period-scope {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
  }

  .monthly-judgment {
    padding: 1.125rem 1.25rem;
    border-radius: 12px;
  }

  .monthly-judgment__title {
    font-size: var(--fs-18);
  }

  .monthly-judgment__status {
    font-size: var(--fs-14);
  }

  .monthly-judgment__amount {
    font-size: var(--fs-22);
  }

  .monthly-judgment__bar-track {
    height: 12px;
  }

  .monthly-judgment__button {
    width: 100%;
    text-align: center;
  }

  .monthly-recommend {
    padding: 1rem 1.125rem;
    border-radius: 12px;
  }

  .monthly-recommend__title {
    font-size: var(--fs-15);
  }

  .monthly-recommend__list {
    font-size: var(--fs-13);
  }

  .monthly-recommend__lead {
    font-size: var(--fs-12);
  }

  .period-scope__year-month {
    font-size: var(--fs-14);
    margin-bottom: 0.2rem;
  }

  .period-scope__label {
    font-size: var(--fs-12);
  }

  .period-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .card {
    padding: 0.9rem 1rem;
    border-radius: 12px;
  }

  #tab-today .card-inner {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  #tab-today .card-inner > :not(.ref-block) {
    grid-column: auto;
  }

  #tab-today .card-inner .ref-block {
    grid-column: auto;
    grid-row: auto;
    margin-top: 0.5rem;
  }

  .card-title {
    font-size: var(--fs-14);
    margin-bottom: 0.5rem;
  }

  .card-sub {
    font-size: var(--fs-12);
    margin-bottom: 0.375rem;
  }

  .card-draft {
    padding: 0.75rem 0.875rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
  }

  #today-income-draft-text,
  #today-expense-draft-text {
    font-size: var(--fs-13);
    margin-bottom: 0.25rem;
  }

  .card-draft-note {
    font-size: var(--fs-11);
  }

  #tab-today .ref-block {
    margin-top: 0;
    padding-top: 0;
    min-height: 0;
  }

  .ref-title {
    font-size: var(--fs-11);
    margin-bottom: 0.375rem;
  }

  .ref-item {
    font-size: var(--fs-11);
    margin-bottom: 0.2rem;
  }
  
  .fuyo-container {
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .fuyo-container__header {
    margin-bottom: 0.75rem;
  }

  .fuyo-container__title {
    font-size: var(--fs-16);
  }

  .fuyo-container__link {
    font-size: var(--fs-12);
  }

  .fuyo-progress-bar {
    margin-top: 0.5rem;
  }

  .fuyo-progress-bar__track {
    height: 32px;
    border-radius: 16px;
  }

  .fuyo-progress-bar__label {
    font-size: var(--fs-13);
  }

  .fuyo-progress-bar__label--draft {
    font-size: var(--fs-11);
  }

  .next-action {
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .next-action__title {
    font-size: var(--fs-16);
    margin-bottom: 0.75rem;
  }

  .next-action__content {
    gap: 0.5rem;
  }

  .next-action__text {
    font-size: var(--fs-13);
    line-height: 1.5;
  }

  .next-action__button {
    padding: 0.5rem 1rem;
    font-size: var(--fs-13);
    border-radius: 8px;
  }
}

