.monitor-hero {
  padding: 106px 0 40px;
  text-align: left;
}

.monitor-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.monitor-hero h1 {
  margin: 2px 0 4px;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.04em;
}

.monitor-hero p { margin: 0; font-size: 15px; }

.eyebrow,
.panel-kicker {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.month-chip {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: var(--text-muted);
  font-size: 13px;
}

.monitor-page { padding: 34px 0 64px; }

.profile-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--gradient2);
  color: white;
  font-size: 19px;
  font-weight: 800;
}

.profile-copy { min-width: 0; }
.profile-copy h2 { font-size: 16px; line-height: 1.3; }
.profile-copy p { color: var(--text-muted); font-size: 13px; }

.profile-status {
  margin-left: auto;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-neutral { color: var(--text-muted); background: var(--bg-section); }
.status-safe { color: #047857; background: #ecfdf5; }
.status-warning { color: #b45309; background: #fffbeb; }
.status-danger { color: #b91c1c; background: #fef2f2; }

.profile-actions { display: flex; gap: 8px; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-primary { color: white; background: var(--gradient); box-shadow: 0 6px 18px rgba(14,165,233,0.20); }
.button-secondary { color: var(--text); background: white; border-color: var(--border); }
.button-small { min-height: 36px; padding: 7px 13px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.summary-card,
.panel {
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.summary-card { padding: 22px; border-radius: 16px; }
.summary-label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 12px; }
.summary-value { display: block; color: var(--text); font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; }
.summary-note { display: block; margin-top: 8px; color: var(--text-dim); font-size: 12px; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel { padding: 24px; border-radius: 18px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading h2 { margin-top: 4px; font-size: 18px; }
.text-button { border: 0; background: none; color: var(--primary-dark); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }

.budget-visual { padding-top: 14px; }
.budget-percentage { margin-bottom: 14px; font-size: 42px; font-weight: 800; letter-spacing: -0.05em; }
.budget-bar { height: 12px; overflow: hidden; border-radius: 999px; background: #e8f2f7; }
.budget-bar-fill { width: 0; height: 100%; border-radius: inherit; background: var(--gradient2); transition: width 0.45s ease; }
.budget-visual p { margin-top: 12px; color: var(--text-muted); font-size: 13px; }

.category-list { display: flex; flex-direction: column; gap: 11px; }
.category-item { display: grid; grid-template-columns: 34px 70px 1fr auto; align-items: center; gap: 10px; }
.category-mark { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #eef8fc; color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.category-name { font-size: 13px; font-weight: 700; }
.category-track { height: 7px; overflow: hidden; border-radius: 999px; background: #edf3f6; }
.category-fill { height: 100%; border-radius: inherit; background: var(--gradient); }
.category-amount { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.empty-compact { padding: 24px 10px; color: var(--text-dim); font-size: 13px; text-align: center; }

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
}
.notice[hidden],
.form-message[hidden] { display: none; }
.notice strong { display: block; margin-bottom: 2px; }
.notice p { color: inherit; font-size: 13px; opacity: 0.82; }
.notice-warning { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; }
.records-panel { margin-top: 0; }
.records-list { display: flex; flex-direction: column; gap: 9px; }
.record-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border-light); border-radius: 12px; background: #fbfdff; }
.record-mark { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #eef8fc; color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.record-title { font-size: 14px; font-weight: 700; }
.record-meta { color: var(--text-muted); font-size: 12px; }
.record-tag { padding: 4px 8px; border-radius: 999px; color: #047857; background: #ecfdf5; font-size: 11px; font-weight: 700; }
.record-tag.is-impulse { color: #b45309; background: #fffbeb; }
.record-amount { color: #be123c; font-size: 15px; font-weight: 800; }

.empty-state { padding: 46px 20px; text-align: center; }
.empty-mark { width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; border: 1px solid var(--border); border-radius: 18px; background: #f4fbff; color: var(--primary); font-size: 22px; font-weight: 800; }
.empty-state h3 { margin-bottom: 6px; font-size: 17px; }
.empty-state p { max-width: 460px; margin: 0 auto 18px; color: var(--text-muted); font-size: 13px; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.42); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px; border: 1px solid rgba(255,255,255,0.7); border-radius: 20px; background: white; box-shadow: 0 24px 80px rgba(15,23,42,0.22); }
.modal-card-small { width: min(460px, 100%); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-heading h2 { margin-top: 3px; font-size: 22px; }
.modal-close { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; color: var(--text-muted); font-size: 13px; font-weight: 700; }
.field input,
.field select,
.field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfdff; color: var(--text); font: inherit; font-size: 14px; outline: none; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,0.10); }
.field-help { margin: -4px 0 14px; color: var(--text-muted); font-size: 12px; }
.form-message { margin-bottom: 14px; padding: 10px 12px; border-radius: 9px; color: #991b1b; background: #fef2f2; font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }
body.modal-open { overflow: hidden; }

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .profile-strip { flex-wrap: wrap; }
  .profile-status { margin-left: 0; }
  .profile-actions { width: 100%; }
  .profile-actions .button { flex: 1; }
}

@media (max-width: 560px) {
  .monitor-hero { padding: 94px 0 30px; }
  .monitor-hero-inner { align-items: flex-start; flex-direction: column; gap: 12px; }
  .monitor-page { padding-top: 22px; }
  .profile-strip { padding: 16px; }
  .profile-status { order: 4; }
  .profile-actions { order: 5; }
  .panel { padding: 19px; }
  .panel-heading { margin-bottom: 18px; }
  .record-item { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .record-mark { width: 36px; height: 36px; }
  .record-tag { display: none; }
  .record-amount { grid-column: 3; grid-row: 1; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 22px 18px; }
  .notice { align-items: flex-start; flex-direction: column; }
}
