/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  --accent: #00d4ff;
  --accent-hover: #00b8e6;
  --danger: #e74c3c;
  --success: #2ecc71;
  --warning: #f39c12;
  --border: #2a2a3e;
  --shadow: rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.3s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== LIGHT MODE ===== */
body.light {
  --bg-primary: #f4f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #eeeef4;
  --bg-input: #e0e0ea;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8a;
  --accent: #0099cc;
  --accent-hover: #007aa3;
  --border: #d0d0de;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border-bottom: 1px solid var(--border);
  position: relative;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.header-author {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.header-author a { color: var(--accent); text-decoration: none; }
.header-author a:hover { text-decoration: underline; }

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.6;
}

.theme-toggle:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ===== NAVIGATION ===== */
.tool-nav {
  display: flex;
  gap: 0;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tool-nav::-webkit-scrollbar {
  height: 4px;
}

.tool-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1.2rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
  position: relative;
}

.nav-item:hover {
  color: var(--text-secondary);
  background: rgba(0, 212, 255, 0.03);
}

.nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0, 212, 255, 0.05);
}

.nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== TOOL SECTIONS ===== */
.tool-section {
  display: none;
}

.tool-section.active {
  display: block;
}

.tool-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}

.tool-intro h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.tool-intro p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== LAYOUTS ===== */
.layout-sidebar {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.layout-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
}

.layout-centered > * {
  width: 100%;
}

/* ===== PANEL DE ENTRADA ===== */
.panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}

.card-wide {
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ===== INPUTS ===== */
.form-group {
  margin-bottom: 0.8rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

input[type="color"] {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: transparent;
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

/* Toggle buttons */
.toggle-group {
  display: flex;
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.toggle-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.toggle-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

.toggle-btn:hover:not(.active) {
  background: var(--bg-card);
}

/* Slider */
.slider-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-secondary);
}

input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-secondary);
}

.slider-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
}

/* Select & pagas */
.pagas-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.pagas-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.pagas-group select,
select {
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.8rem;
}

/* Salary result */
.salary-result {
  margin-top: 0.8rem;
  padding: 0.7rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius);
  text-align: center;
}

.salary-result .label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.salary-result .amount { font-size: 1.5rem; font-weight: 700; color: var(--accent); }

/* ===== CATEGORIAS ===== */
.categories-list { display: flex; flex-direction: column; gap: 0.6rem; }

.category-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  transition: background var(--transition);
}

.category-item:hover { background: rgba(22, 33, 62, 0.8); }
.category-item input[type="color"] { width: 32px; height: 32px; flex-shrink: 0; }
.category-item input[type="text"] { flex: 1; min-width: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.category-item input[type="number"] { width: 90px; flex-shrink: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; text-align: right; }
.category-item .euro-symbol { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }

.btn-delete {
  width: 28px; height: 28px;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all var(--transition);
}

.btn-delete:hover { background: rgba(231, 76, 60, 0.2); color: var(--danger); }

.btn-add {
  width: 100%; padding: 0.6rem;
  border: 2px dashed var(--border); background: transparent;
  color: var(--text-secondary); font-size: 0.85rem;
  cursor: pointer; border-radius: var(--radius);
  transition: all var(--transition);
  margin-top: 0.6rem;
}

.btn-add:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 212, 255, 0.05); }

/* Total bar */
.total-bar {
  margin-top: 0.8rem; padding: 0.7rem;
  background: var(--bg-card); border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center;
}

.total-bar .label { font-size: 0.8rem; color: var(--text-secondary); }
.total-bar .amount { font-size: 1.1rem; font-weight: 700; }
.total-bar .amount.over-budget { color: var(--danger); }
.total-bar .amount.under-budget { color: var(--success); }

.warning-msg {
  margin-top: 0.5rem; padding: 0.5rem 0.7rem;
  background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: var(--radius); font-size: 0.8rem; color: var(--danger);
  display: none;
}

.warning-msg.visible { display: block; }

/* ===== CALENDAR SECTION ===== */
.calendar-section { display: flex; flex-direction: column; gap: 1.2rem; }

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

.month-nav button {
  width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-primary); border-radius: var(--radius);
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.month-nav button:hover { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }
.month-nav .month-label { font-size: 1.3rem; font-weight: 600; min-width: 200px; text-align: center; }

/* Calendar grid */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}

.calendar-grid .day-header {
  text-align: center; font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; padding: 0.3rem 0;
}

.calendar-grid .day-header.weekend-header { opacity: 0.6; }

.calendar-grid .day-cell {
  aspect-ratio: 1; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 600; cursor: default;
  transition: all var(--transition); position: relative; min-height: 50px;
}

.calendar-grid .day-cell .day-number { font-size: 1rem; font-weight: 700; line-height: 1; }

.calendar-grid .day-cell .day-label {
  font-size: 0.55rem; font-weight: 400; opacity: 0.8;
  margin-top: 2px; text-align: center; line-height: 1.1;
  max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.calendar-grid .day-cell.empty { background: transparent; }

.calendar-grid .day-cell.weekend,
.calendar-grid .day-cell.holiday { opacity: 0.55; position: relative; }
.calendar-grid .day-cell.weekend { background: #2a2a3e; color: var(--text-muted); }
.calendar-grid .day-cell.holiday {
  background: linear-gradient(135deg, #2a1a2e, #1a2a2e);
  color: var(--text-muted); border: 1px dashed rgba(167, 139, 250, 0.4);
}
.calendar-grid .day-cell.holiday .day-label { color: #a78bfa; opacity: 1; font-weight: 500; }

.calendar-grid .day-cell:not(.empty):hover { transform: scale(1.08); z-index: 2; box-shadow: 0 4px 15px var(--shadow); }
.calendar-grid .day-cell.weekend:hover,
.calendar-grid .day-cell.holiday:hover { opacity: 0.85; }

/* Tooltip */
.tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; font-size: 0.75rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
  z-index: 10; box-shadow: 0 4px 12px var(--shadow);
}

.day-cell:hover .tooltip { opacity: 1; }
.tooltip .tooltip-cat { font-weight: 600; }
.tooltip .tooltip-amount { color: var(--text-secondary); margin-top: 2px; }

/* Summary */
.summary {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
}

.summary .impact-text { font-size: 1.1rem; line-height: 1.6; text-align: center; margin-bottom: 1.2rem; }
.summary .impact-text .highlight { font-weight: 700; color: var(--accent); }
.summary .impact-text .highlight-danger { font-weight: 700; color: var(--danger); }
.summary .impact-text .highlight-success { font-weight: 700; color: var(--success); }

/* Progress bar */
.progress-container { margin-top: 1rem; }

.progress-bar {
  width: 100%; height: 24px; background: var(--bg-card);
  border-radius: 12px; overflow: hidden; display: flex;
}

.progress-segment { height: 100%; transition: width var(--transition); }

/* Legend */
.legend {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  margin-top: 1rem; justify-content: center;
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-secondary); }
.legend-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-item .legend-days { font-weight: 600; color: var(--text-primary); }

/* ===== TOOL 1: TAXÍMETRO ===== */
.habits-list { display: flex; flex-direction: column; gap: 0.6rem; }

.habit-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem; background: var(--bg-card); border-radius: var(--radius);
}

.habit-item input[type="text"] { flex: 1; min-width: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.habit-item input[type="number"] { width: 80px; flex-shrink: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; text-align: right; }
.habit-item .habit-unit { color: var(--text-muted); font-size: 0.75rem; flex-shrink: 0; min-width: 35px; }

.taxi-total {
  text-align: center; margin-bottom: 1.5rem; padding: 1rem;
  background: rgba(231, 76, 60, 0.08); border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: var(--radius);
}

.taxi-total .taxi-total-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; }
.taxi-total .taxi-total-amount { font-size: 2rem; font-weight: 700; color: var(--danger); }
.taxi-total .taxi-total-daily { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

.taxi-goals { display: flex; flex-direction: column; gap: 1rem; }

.taxi-goal-item { }
.taxi-goal-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.taxi-goal-name { font-size: 0.9rem; font-weight: 600; }
.taxi-goal-time { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

.taxi-goal-bar {
  width: 100%; height: 20px; background: var(--bg-card);
  border-radius: 10px; overflow: hidden; position: relative;
}

.taxi-goal-fill {
  height: 100%; border-radius: 10px;
  transition: width 0.5s ease;
}

.taxi-goal-pct {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 0.7rem; font-weight: 600; color: var(--text-primary);
}

/* ===== TOOL 2: LIBERTAD FINANCIERA ===== */
.lib-big-number {
  text-align: center; margin-bottom: 0.5rem;
}

.lib-big-number .lib-number { font-size: 3.5rem; font-weight: 700; color: var(--accent); line-height: 1; }
.lib-big-number .lib-unit { font-size: 1.2rem; color: var(--text-secondary); margin-left: 0.3rem; }

.lib-date {
  text-align: center; font-size: 1rem; color: var(--text-secondary); margin-bottom: 1.5rem;
}

.lib-date strong { color: var(--danger); font-size: 1.1rem; }

.lib-timeline-container { margin: 1rem 0; }

.lib-timeline {
  display: flex; height: 40px; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-card);
}

.lib-timeline-seg {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; transition: width 0.5s ease;
  overflow: hidden; white-space: nowrap;
}

.lib-message {
  text-align: center; margin-top: 1rem; font-size: 1rem; line-height: 1.6;
  padding: 1rem; background: var(--bg-card); border-radius: var(--radius);
}

.lib-message .lib-msg-highlight { font-weight: 700; color: var(--warning); }

/* ===== TOOL 3: INTERÉS COMPUESTO ===== */
.ci-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem; margin-bottom: 1.5rem;
}

.ci-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 1rem; text-align: center;
}

.ci-card .ci-years { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.ci-card .ci-value { font-size: 1.4rem; font-weight: 700; color: var(--success); margin: 0.3rem 0; }
.ci-card .ci-gain { font-size: 0.8rem; color: var(--accent); }

.ci-chart-container {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}

.ci-chart-container canvas {
  width: 100%;
  height: auto;
  display: block;
}

.ci-verdict {
  text-align: center; font-size: 1rem; line-height: 1.6;
  padding: 1rem; background: var(--bg-card); border-radius: var(--radius);
}

.ci-verdict strong { color: var(--success); }

/* ===== TOOL 4: SUELDO REAL ===== */
.sr-comparison {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 1rem; align-items: center; margin-bottom: 1.5rem;
}

.sr-box {
  text-align: center; padding: 1.2rem;
  background: var(--bg-card); border-radius: var(--radius);
}

.sr-box .sr-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.3rem; }
.sr-box .sr-amount { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.sr-box .sr-sublabel { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }
.sr-box.nominal .sr-amount { color: var(--text-secondary); }
.sr-box.real .sr-amount { color: var(--danger); }

.sr-arrow { font-size: 1.5rem; color: var(--text-muted); }

.sr-details { margin-top: 1rem; }
.sr-detail-row {
  display: flex; justify-content: space-between; padding: 0.4rem 0;
  border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.sr-detail-row:last-child { border-bottom: none; }
.sr-detail-label { color: var(--text-secondary); }
.sr-detail-value { font-weight: 600; }
.sr-detail-value.negative { color: var(--danger); }

.sr-verdict {
  text-align: center; padding: 1rem; font-size: 1rem; line-height: 1.6;
  background: var(--bg-card); border-radius: var(--radius);
}

.sr-verdict strong { color: var(--danger); }

/* ===== TOOL 5: LIBERACIÓN FISCAL ===== */
.fisc-result {
  margin-top: 1rem; padding: 1rem;
  background: var(--bg-card); border-radius: var(--radius);
}

.fisc-result .fisc-row {
  display: flex; justify-content: space-between;
  padding: 0.3rem 0; font-size: 0.85rem;
}

.fisc-result .fisc-row .fisc-val { font-weight: 600; }
.fisc-result .fisc-row .fisc-val.danger { color: var(--danger); }
.fisc-result .fisc-row .fisc-val.success { color: var(--success); }

.fisc-summary {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  text-align: center; margin-bottom: 1rem;
}

.fisc-placeholder { color: var(--text-muted); font-size: 0.95rem; }

.fisc-big {
  margin-bottom: 0.5rem;
}

.fisc-big .fisc-day-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; }
.fisc-big .fisc-day-value { font-size: 2rem; font-weight: 700; color: var(--success); }

.fisc-detail { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; }
.fisc-detail strong.danger { color: var(--danger); }
.fisc-detail strong.success { color: var(--success); }

.fisc-year-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
.fisc-month-box {
  background: var(--bg-secondary); border-radius: 6px; padding: 0.4rem;
  border: 1px solid var(--border);
}
.fisc-month-title {
  text-align: center; font-size: 0.7rem; font-weight: 600;
  color: var(--accent); padding: 0.2rem 0; margin-bottom: 0.2rem;
}
.fisc-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
}
.fisc-mini-header {
  font-size: 0.5rem; text-align: center; color: var(--text-muted);
  padding: 1px 0; font-weight: 600;
}
.fisc-mini-header.weekend-header { color: var(--text-muted); opacity: 0.5; }
.fisc-mini-cell {
  font-size: 0.55rem; text-align: center; padding: 2px 0;
  border-radius: 2px; line-height: 1.4;
}
.fisc-mini-cell.empty { visibility: hidden; }
.fisc-mini-cell.fisc-tax { background: var(--danger); color: #fff; opacity: 0.7; }
.fisc-mini-cell.fisc-free { background: var(--success); color: #fff; }
.fisc-mini-cell.fisc-liberation {
  background: var(--accent); color: var(--bg-primary);
  border: 1px solid #fff; font-weight: 700;
}
.fisc-mini-cell.fisc-weekend { background: var(--bg-input); color: var(--text-muted); opacity: 0.4; }

/* ===== TOOL 7: INFLACIÓN PERSONAL ===== */
.infl-categories { display: flex; flex-direction: column; gap: 0.5rem; }

.infl-cat-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem; background: var(--bg-card); border-radius: var(--radius);
}

.infl-cat-name { flex: 1; font-size: 0.85rem; color: var(--text-primary); min-width: 0; }
.infl-cat-row input[type="number"] { width: 100px; flex-shrink: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; text-align: right; }
.infl-cat-rate { font-size: 0.8rem; font-weight: 600; min-width: 50px; text-align: right; flex-shrink: 0; }
.infl-cat-rate.rate-up { color: var(--danger); }
.infl-cat-rate.rate-down { color: var(--success); }

.infl-summary { text-align: center; margin-bottom: 1.5rem; }
.infl-big { font-size: 3rem; font-weight: 700; color: var(--danger); line-height: 1; }
.infl-big-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.3rem; }

.infl-bill { margin-bottom: 1.5rem; }

.infl-bill-visual {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-bottom: 1rem;
}

.infl-bill-before, .infl-bill-after {
  text-align: center; padding: 1rem 1.5rem;
  background: var(--bg-card); border-radius: var(--radius);
}

.infl-bill-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.infl-bill-before .infl-bill-amount { font-size: 1.8rem; font-weight: 700; color: var(--text-secondary); }
.infl-bill-after .infl-bill-amount { font-size: 1.8rem; font-weight: 700; color: var(--danger); }
.infl-bill-arrow { font-size: 1.5rem; color: var(--text-muted); }
.infl-loss { text-align: center; font-size: 1rem; color: var(--text-secondary); }
.infl-loss strong { color: var(--danger); }

.infl-detail-title { font-size: 0.8rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }

.infl-detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}

.infl-detail-row:last-child { border-bottom: none; }
.infl-detail-name { flex: 1; color: var(--text-secondary); }
.infl-detail-rate { min-width: 50px; text-align: right; font-weight: 600; margin: 0 1rem; }
.infl-detail-extra { min-width: 100px; text-align: right; font-weight: 600; color: var(--danger); }

/* ===== TOOL 8: PENSIÓN VS. LIBERTAD ===== */
.pen-summary { text-align: center; margin-bottom: 1.5rem; }
.pen-big { font-size: 3rem; font-weight: 700; color: var(--success); line-height: 1; }
.pen-big-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.3rem; }

.pen-timeline { margin: 1.5rem 0; }

.pen-timeline-bar {
  display: flex; height: 44px; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card);
}

.pen-tl-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; overflow: hidden; white-space: nowrap;
  transition: width 0.5s ease;
}

.pen-tl-work { background: var(--danger); color: #fff; }
.pen-tl-free { background: var(--success); color: #fff; }

.pen-tl-labels {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; padding: 0 0.2rem;
}

.pen-message {
  padding: 1rem; background: var(--bg-card); border-radius: var(--radius);
  font-size: 0.95rem; line-height: 1.6; text-align: center;
}

/* ===== TOOL 9: SUSCRIPCIONES ZOMBIS ===== */
.sub-list { display: flex; flex-direction: column; gap: 0.5rem; }

.sub-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem; background: var(--bg-card); border-radius: var(--radius);
}

.sub-item input[type="text"] { flex: 1; min-width: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.sub-item input[type="number"] { width: 90px; flex-shrink: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; text-align: right; }
.sub-freq-toggle {
  flex-shrink: 0; padding: 0.3rem 0.5rem; font-size: 0.7rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
  background: var(--bg-input); color: var(--text-muted); min-width: 50px; text-align: center;
  transition: background 0.2s, color 0.2s;
}
.sub-freq-toggle:hover { border-color: var(--accent); color: var(--text-primary); }
.sub-freq-toggle.annual { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

.sub-summary { margin-bottom: 1.5rem; }

.sub-amounts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1rem;
}

.sub-amount-box {
  text-align: center; padding: 0.8rem; background: var(--bg-card); border-radius: var(--radius);
}

.sub-amount-val { font-size: 1.3rem; font-weight: 700; color: var(--danger); }
.sub-amount-val.sub-annual { font-size: 1.5rem; }
.sub-amount-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-top: 0.2rem; }

.sub-question {
  text-align: center; font-size: 1rem; color: var(--text-secondary); line-height: 1.5;
}

.sub-question strong { color: var(--danger); }

.sub-equiv-title {
  font-size: 0.8rem; font-weight: 600; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 0.5rem;
}

.sub-equiv-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}

.sub-equiv-row:last-child { border-bottom: none; }
.sub-equiv-name { color: var(--text-secondary); }
.sub-equiv-times { font-weight: 600; color: var(--success); }

/* ===== TOOL 10: PRECIO DE LA FELICIDAD ===== */
.lf-list { display: flex; flex-direction: column; gap: 0.5rem; }

.lf-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem; background: var(--bg-card); border-radius: var(--radius);
}

.lf-item input[type="text"] { flex: 1; min-width: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.lf-item input[type="number"] { width: 100px; flex-shrink: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem; text-align: right; }
.lf-item .lf-euro { color: var(--text-muted); font-size: 0.8rem; flex-shrink: 0; }

.lf-items { margin-bottom: 1rem; }

.lf-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border);
}

.lf-row:last-child { border-bottom: none; }
.lf-row-name { font-size: 0.9rem; color: var(--text-secondary); }
.lf-row-cost { font-size: 0.85rem; color: var(--text-muted); }

.lf-row-hours {
  font-size: 1rem; font-weight: 700; color: var(--danger);
  min-width: 80px; text-align: right;
}

.lf-verdict {
  text-align: center; padding: 1rem; font-size: 1rem; line-height: 1.6;
  background: var(--bg-card); border-radius: var(--radius);
}

.lf-verdict strong { color: var(--danger); }
.lf-verdict .lf-highlight { color: var(--accent); font-weight: 700; }

/* ===== FOOTER ===== */
.footer {
  text-align: center; padding: 2rem 1rem;
  color: var(--text-muted); font-size: 0.8rem;
  border-top: 1px solid var(--border); margin-top: 2rem;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-more { margin-top: 0.5rem; font-size: 0.85rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .layout-sidebar {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .header h1 { font-size: 1.4rem; }

  .calendar-grid .day-cell { min-height: 40px; }
  .calendar-grid .day-cell .day-number { font-size: 0.85rem; }
  .calendar-grid .day-cell .day-label { font-size: 0.5rem; }
  .month-nav .month-label { font-size: 1.1rem; min-width: 160px; }

  .form-row-2 { grid-template-columns: 1fr; }

  .sr-comparison { grid-template-columns: 1fr; }
  .sr-arrow { transform: rotate(90deg); text-align: center; }
  .fisc-year-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .header { padding: 1rem 0.8rem 0.8rem; }
  .header h1 { font-size: 1.2rem; }

  .layout-sidebar, .layout-centered { padding: 0.8rem; gap: 1rem; }
  .card { padding: 1rem; }

  .calendar-grid { gap: 3px; }
  .calendar-grid .day-cell { min-height: 34px; border-radius: 4px; }
  .calendar-grid .day-cell .day-number { font-size: 0.75rem; }
  .calendar-grid .day-cell .day-label { display: none; }

  .category-item { flex-wrap: wrap; }
  .category-item input[type="number"] { width: 75px; }
  .habit-item { flex-wrap: wrap; }

  .summary .impact-text { font-size: 0.95rem; }

  .nav-item { padding: 0.6rem 0.8rem; }
  .nav-label { font-size: 0.6rem; }
  .nav-icon { font-size: 1.1rem; }

  .ci-grid { grid-template-columns: repeat(2, 1fr); }
  .lib-big-number .lib-number { font-size: 2.5rem; }
  .sr-box .sr-amount { font-size: 1.5rem; }

  .infl-cat-row { flex-wrap: wrap; }
  .infl-bill-visual { flex-direction: column; gap: 0.5rem; }
  .infl-bill-arrow { transform: rotate(90deg); }
  .infl-big { font-size: 2.2rem; }
  .pen-big { font-size: 2.2rem; }
  .sub-amounts { grid-template-columns: 1fr; }
  .sub-item { flex-wrap: wrap; }
  .lf-item { flex-wrap: wrap; }
  .lf-row { flex-wrap: wrap; gap: 0.3rem; }
  .fisc-year-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .fisc-month-box { padding: 0.3rem; }
  .fisc-mini-cell { font-size: 0.5rem; }
}
