:root {
  --surface: #ffffff;
  --surface-muted: #f4f6fb;
  --border: #e5e9f2;
  --border-strong: #d5d9e2;
  --text: #1f2933;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #e0e7ff;
  --accent-contrast: #0b1f4a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow-soft: 0 16px 30px rgba(15, 23, 42, 0.08);
}

body,
.app-body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--surface-muted);
  color: var(--text);
  letter-spacing: 0.01em;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-brand span {
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.shadow-soft {
  box-shadow: var(--shadow-soft);
}

.text-light-50 {
  color: var(--text-muted) !important;
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-outline-secondary {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.btn-warning:hover,
.btn-warning:focus {
  background: #d97706;
  border-color: #d97706;
}

.btn-glow {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-glow:hover,
.btn-glow:focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

.card,
.card-body,
.form-control,
.form-select,
.btn {
  border-radius: 0.9rem;
}

.card-spotlight {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card-spotlight h1 {
  color: var(--accent-contrast);
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-chip .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.stat-chip .stat-value {
  font-size: 1.8rem;
  font-weight: 600;
}

.glass-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  border-radius: 1.25rem;
}

.btn-chip {
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.35rem 0.85rem;
  font-weight: 500;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-chip:hover,
.btn-chip:focus {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent-contrast);
}

.badge.bg-gradient {
  background: var(--accent-soft);
  color: var(--accent-contrast);
}

.badge.bg-chip {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-contrast);
}

.badge-dreamer {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-contrast);
  border: 1px solid rgba(37, 99, 235, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.dream-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dream-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 35px rgba(15, 23, 42, 0.12);
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 1.2rem;
  background: var(--surface);
  padding: 3rem 1.5rem;
}

.dream-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  border-radius: 1.5rem;
}

.stat-tile {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-tile .tile-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.stat-tile .tile-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.timeline {
  position: relative;
  margin-left: 1rem;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 3px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0));
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -0.95rem;
  top: 0.2rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-soft);
}

.form-control,
.form-select {
  background-color: #fff;
  border: 1px solid var(--border-strong);
  padding: 0.85rem 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.md-form {
  gap: 2rem !important;
}

.md-section {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.75rem;
}

.md-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.md-field + .md-field {
  margin-top: 1.5rem;
}

.md-field .md-input {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 0.9rem;
  padding: 1.1rem 1rem 0.65rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.md-field .md-input:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.md-field .md-input::placeholder {
  color: transparent;
}

.md-field .md-label {
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.18s ease, color 0.18s ease;
}

.md-field .md-input:focus + .md-label,
.md-field .md-input:not(:placeholder-shown) + .md-label,
.md-field .md-input.is-filled + .md-label {
  transform: translateY(-0.75rem) scale(0.85);
  color: var(--accent-contrast);
}

.md-field .md-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.md-field.md-field-select::after {
  content: "expand_more";
  font-family: "Material Icons Round";
  position: absolute;
  right: 0.85rem;
  top: 1rem;
  font-size: 1.35rem;
  color: var(--text-muted);
  pointer-events: none;
}

.md-field.md-field-select .md-input {
  padding-right: 2.75rem;
}

.md-field.md-field-select:focus-within::after {
  color: var(--accent);
}

.md-textarea {
  min-height: 220px;
  resize: vertical;
}

.concept-entry.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}

.concept-entry .card-body {
  padding: 1.5rem;
}

.concept-entry .remove-concept {
  border-radius: 999px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.concept-entry .remove-concept:hover {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.rich-text p {
  line-height: 1.7;
}

footer.app-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.journal-body {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.75rem;
  line-height: 1.75;
  box-shadow: var(--shadow-soft);
  min-height: 240px;
}

.journal-highlight-mark {
  background: #fde68a;
  border-radius: 0.4rem;
  padding: 0 0.15rem;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.4);
}

.journal-highlight-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.journal-highlight-snippet {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

.journal-highlight-chip {
  display: inline-block;
  width: 36px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.journal-highlight-preview {
  border: 1px dashed var(--border-strong);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(253, 230, 138, 0.2);
  min-height: 80px;
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 767.98px) {
  .navbar .btn {
    width: 100%;
  }

  .md-section {
    padding: 1.5rem;
  }
}
