/* =========================================================
   GUARDIAN APP UI — CLEAN B STYLE
   Depends on style_B.css (design tokens)
   ========================================================= */

/* =========================================================
   CORE LAYOUT
   ========================================================= */

.page-wrapper {
  max-width: 1120px;
  margin: 40px auto;
  padding: 0 20px;
}

.wealth-layout {
  display: block;        /* ❌ grid */
}

.wealth-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

/* =========================================================
   CARDS & SECTIONS
   ========================================================= */

.card,
.input-card,
.result-card,
.panel,
.section {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Bank table wrapper skal ALDRIG kunne være bredere end card */
.result-card { 
  width: 100%;
}

/* gør wrapperen til scroll-container */
.result-table-wrapper{
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

/* tabellen må gerne være bredere end card, men wrapperen scroller */
.result-table{
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* header/celler (hvis du ikke allerede rammer dem via andre regler) */
.result-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  white-space: nowrap;
}

.result-table td, 
.result-table th{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.card h2,
.section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* =========================================================
   FORM STRUCTURE
   ========================================================= */

.field,
.form-group,
.ga-row {
  margin-bottom: 14px;
}

.card label,
.section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-hint,
.field-note,
.helper-text,
.text-muted {
  font-size: 0.8rem;
  color: var(--muted);
}

.text-strong {
  font-weight: 600;
}

/* Grids */

.ga-grid-2,
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .ga-grid-2,
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Inputs */

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15,118,110,0.15);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suffix {
  font-size: 0.75rem;
  color: var(--muted);
}

/* =========================================================
   RADIO / OPTIONS
   ========================================================= */

.wage-growth-box {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.wage-growth-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.primary-btn,
button.primary,
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.primary-btn:hover,
.btn-primary:hover {
  background: var(--primary-hover);
}

.ghost-btn,
button.secondary,
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
}

.ghost-btn:hover,
.btn-ghost:hover {
  background: rgba(15,118,110,0.08);
}

/* =========================================================
   SCENARIO LIST
   ========================================================= */

.scenario-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scenario-list-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.15s ease;
}

.scenario-list-item:hover {
  background: rgba(15,118,110,0.06);
}

.scenario-list-item--active {
  border-color: var(--primary);
  background: rgba(15,118,110,0.1);
}

.scenario-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* =========================================================
   TABLE SYSTEM (Guardian)
   ========================================================= */

.table-wrapper{
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

/* Nøglen: lad tabellen være mindst 100%, men gerne bredere hvis mange kolonner */
.table-wrapper > table{
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.table-wrapper thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  text-align: left;
  padding: 10px 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-wrapper tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text);
}

.table-wrapper tbody tr:hover{
  background: rgba(15,118,110,0.05);
}

/* hjælper: align tal */
td.text-right, th.text-right{
  text-align: right;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  padding: 8px 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text);
}

tbody tr:hover {
  background: rgba(15,118,110,0.05);
}

td.text-right {
  text-align: right;
}

/* Income rows */

.income-row--baseline td {
  color: var(--text);
}

.income-row--event td {
  background: rgba(15,118,110,0.06);
}

.income-row--total td {
  font-weight: 600;
  border-top: 2px solid var(--border);
}

/* =========================================================
   RESULT / PREMIUM
   ========================================================= */

.result-premium {
  width: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.result-heading {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.result-topline {
  text-align: center;
}

.topline-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.topline-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  text-align: center;
}

.result-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.result-value {
  font-size: 1.3rem;
  font-weight: 600;
}

.result-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.result-insight {
  padding: 14px 18px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
  display: none;
}

/* =========================================================
   UTILITIES
   ========================================================= */

.hidden {
  display: none !important;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }


/* Failsafe: any table inside card looks like Guardian table */
.card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.card thead th {
  background: var(--surface);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.card tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

/* Income output cards: same spacing as other cards */
.income-output-card .card-title{
  margin: 0 0 12px;
}

/* Sørg for at std-table aldrig sprænger kortet */
.income-output-card .table-wrapper{
  max-width: 100%;
  overflow-x: auto;
}

/* Hvis std-table nogle gange ikke får korrekt width */
.income-output-card .std-table{
  min-width: 720px;   /* justér hvis du vil */
  width: 100%;
}

/* (valgfrit) gør tal-kolonner pænere hvis JS kan sætte class */
.std-table td.text-right{
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Lad Guardian styre farver */
body {
  background: var(--bg);
  color: var(--text);
}

/* Sørg for cards matcher */
.card,
.panel,
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.result-note{
  margin: 0;
  padding: 14px 18px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
}
.result-note:empty{ display:none; }

.gpw-note{
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.gpw-note-heading{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 0 0 10px;
  font-size: 1.0rem;
  font-weight: 700;
}
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;          /* ← FAST HØJDE */
}

.gpw-insight {
  margin: 24px auto 8px;
  padding: 14px 18px;
  max-width: 640px;
  text-align: center;

  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 14px;

  font-size: 0.85rem;
  font-weight: 500;
  color: #065f46;

  display: block;
}

.gpw-insight-text {
  line-height: 1.45;
}

.gpw-note {
  margin-top: 24px;
  padding: 16px 18px;

  background: rgba(15,23,42,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;

  font-size: 0.8rem;
  color: var(--text);
}

.gpw-note h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gpw-note p {
  margin: 0 0 10px;
  color: var(--muted);
}

.gpw-note-list {
  margin: 0;
  padding-left: 18px;
}

.gpw-note-list li {
  margin-bottom: 6px;
  color: var(--muted);
}

.guardian-container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}


/* ===== Guardian dots (status / zones) ===== */

.guardian-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
  top: -1px; /* optisk align med tekst */
  flex-shrink: 0;
}

/* Farver */
.guardian-dot-green {
  background-color: #22c55e; /* grøn */
}

.guardian-dot-yellow {
  background-color: #facc15; /* gul */
}

.guardian-dot-red {
  background-color: #ef4444; /* rød */
}


