/* 
======================================================
   DISHUN - ESTILOS PRINCIPALES
====================================================== 
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Tuna Palette */
  --wg-50: #fafafa;
  --wg-100: #f3f3f6;
  --wg-200: #e1e1ea;
  --wg-300: #d0d0dc;
  --wg-400: #9999b2;
  --wg-500: #696982;
  --wg-600: #4a4a63;
  --wg-700: #39394c;
  --wg-800: #30303b;
  --wg-900: #15151e;
  --wg-950: #07070d;

  /* Global mappings */
  --primary-green: var(--wg-600);
  --dark-green: var(--wg-800);
  --accent-tan: var(--wg-400);
  --light-blue: var(--wg-100);
  --primary-blue: var(--wg-500);
  --text-color: var(--wg-950);
  --text-muted: var(--wg-500);
  --white: #ffffff;
  --border-radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--wg-50);
  padding: 48px 0 0 64px;
  /* Reduced from 55px to match slimmer header */
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  /* Added padding back to the content area */
  animation: sectionOpen 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes sectionOpen {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  color: var(--primary-green);
  margin-bottom: 20px;
}

h2 {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* Header */
.header {
  background: var(--wg-800);
  color: white;
  padding: 8px 25px;
  /* Reduced height */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-logo img {
  transition: transform 0.3s ease;
}

.header-logo:hover img {
  transform: scale(1.05);
}

.header a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.header-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.status-badge-premium {
  background: #facc15;
  color: #854d0e;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-block;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.status-badge-trial {
  background: #94a3b8;
  color: white;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-block;
  letter-spacing: 0.5px;
}

.header-user-info {
    font-family: 'Montserrat', sans-serif;
}


/* Sidebar Navigation - Icon Only + Hover Expand */
.tabs {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 64px;
  background: var(--wg-800);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 65px 0 10px;
  /* 65px top padding to leave room for the header */
  z-index: 999;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
}

.tabs:hover {
  width: 210px;
}

.tab {
  background: transparent;
  border: none;
  padding: 12px 0;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75) !important;
  display: flex;
  align-items: center;
  font-weight: 500;
  transition: all 0.25s ease;
  white-space: nowrap;
  min-height: 48px;
  border-left: 3px solid transparent;
  width: 100%;
  box-sizing: border-box;
}

.tab i {
  font-size: 1.25rem;
  width: 64px;
  /* Exactly matches the collapsed sidebar width */
  text-align: center;
  flex-shrink: 0;
  margin-left: -3px;
  /* Compensate for the transparent border-left */
}

.tab .tab-label {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s ease 0.05s, transform 0.2s ease 0.05s;
  pointer-events: none;
}

.tabs:hover .tab .tab-label {
  opacity: 1;
  transform: translateX(0);
}

.tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white !important;
  border-left-color: rgba(255, 255, 255, 0.4);
}

.tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: white !important;
  font-weight: 700;
  border-left-color: #22963e;
}

.tab.active i {
  color: #22963e;
}

/* Offset body content for sidebar */
body {
  padding-left: 64px;
}

/* Mobile: bottom bar instead of sidebar */
@media (max-width: 768px) {
  .tabs {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 56px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  }

  .tabs:hover {
    width: 100% !important;
  }

  .tab {
    flex-direction: column;
    gap: 3px;
    padding: 8px 4px;
    border-left: none;
    border-top: 2px solid transparent;
    min-height: auto;
    font-size: 0.65rem;
    justify-content: center;
  }

  .tab i {
    font-size: 1rem;
    min-width: auto;
  }

  .tab .tab-label {
    opacity: 1;
    transform: none;
    font-size: 0.6rem;
  }

  .tab.active {
    border-left-color: transparent;
    border-top-color: #22963e;
  }

  body {
    padding-top: 85px !important; /* Evita que el header tape el contenido y el título/botón limpiar */
    padding-left: 0 !important;
    padding-bottom: 80px !important; /* Espacio para las pestañas de navegación inferiores */
  }

  .header {
    margin-left: 0;
    padding: 6px 15px !important; /* Header más delgado en móvil */
    height: auto;
    min-height: 55px;
  }

  .header-logo img {
    height: 32px !important; /* Logo más pequeño en móvil */
    margin-right: 8px !important;
  }

  .header-logo span {
    font-size: 1.1rem !important; /* Texto de marca más pequeño */
  }

  .header-user-info {
    gap: 8px !important;
  }

  /* Oculta "Hola, Username" en pantallas pequeñas para liberar espacio */
  .header-user-info > div:first-child {
    display: none !important;
  }

  .header-btn {
    padding: 6px 10px !important; /* Botones del header más compactos */
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    min-height: auto;
  }
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.grid-5-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

.grid-6-cols {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card h2,
.card h3 {
  color: var(--primary-green);
  margin-bottom: 15px;
}

/* Form Groups */
.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-green);
}

/* Buttons */
.btn {
  background: var(--primary-green);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  background: var(--dark-green);
}

.btn-equal {
  min-width: 140px;
  width: 100%;
}

.btn-secondary {
  background: #666;
}

.btn-secondary:hover {
  background: #555;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-outline-tan {
  background: transparent;
  border: 1.5px solid var(--accent-tan);
  color: var(--accent-tan);
}

.btn-outline-tan:hover {
  background: var(--accent-tan);
  color: white;
}

.btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

/* Nutritients Grid */
.nutrients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.nutrient-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nutrient-input label {
  width: 80px;
  margin: 0;
  font-size: 0.85rem;
}

.nutrient-input input {
  width: 84px;
  text-align: center;
}

/* Macro Layout */
.macro-layout-container {
  display: flex;
  gap: 30px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.macro-inputs-panel {
  flex: 1.2;
  min-width: 300px;
}

.macro-graph-panel {
  flex: 1;
  min-width: 300px;
  background: var(--wg-50);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--wg-200);
}

.nutrients-grid-single {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--wg-700);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--wg-200);
  padding-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ternary-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ternary-wrapper {
  background: white;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid var(--wg-200);
  max-width: 480px;
}

.t-line {
  stroke: #e0e0e0;
  stroke-width: 0.3;
}

.t-tick {
  font-size: 3px;
  fill: #999;
}

.t-label {
  font-size: 5px;
  fill: var(--wg-700);
}

.poly-cation {
  fill: rgba(74, 144, 226, 0.1);
  stroke: var(--primary-blue);
  stroke-width: 0.5;
  stroke-dasharray: 1, 1;
}

.poly-anion {
  fill: rgba(36, 206, 73, 0.1);
  stroke: #24ce49;
  stroke-width: 0.5;
  stroke-dasharray: 1, 1;
}

#pt-cation {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

#pt-anion {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.results-table th,
.results-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.results-table th {
  background: #f8f8f8;
  font-weight: 600;
}

.results-table tr:hover {
  background: #fafafa;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.stat {
  background: #f0f7f1;
  padding: 15px;
  border-radius: 6px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-green);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Presets */
.presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.preset {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
}

.preset:hover {
  background: #c8e6c9;
}

/* Modal */
#modalOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.modal-close:hover {
  color: #000;
}

.modal h2 {
  margin-bottom: 15px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: flex-end;
}

/* Input with Unit */
.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-unit input {
  flex: 1;
}

.input-with-unit .unit {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 38px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.result-item {
  padding: 15px;
  border-radius: var(--border-radius);
  background: #f2fbfa;
  border-left: 4px solid var(--primary-green);
}

.result-item h4 {
  margin-bottom: 5px;
  color: var(--dark-green);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-color);
}

.result-box {
  background-color: #d4f3f1;
  border-left: 5px solid var(--primary-green);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-top: 15px;
  font-weight: 700;
  color: var(--dark-green);
  font-size: 1rem;
  line-height: 1.5;
}

.result-box.danger {
  background-color: #f8dbcf;
  border-left-color: #dc3545;
  color: #a71d2a;
}

.result-box.warning {
  background-color: #fff3cd;
  border-left-color: #ffc107;
  color: #856404;
}

/* Table Container */
.table-container {
  overflow-x: auto;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

th {
  background-color: var(--light-blue);
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr:hover {
  background-color: #f2fbfa;
}

td input {
  width: 90%;
  min-width: 55px;
  padding: 6px;
  text-align: center;
  font-size: 15px;
}

.readonly-cell {
  background-color: #e9ecef;
  font-weight: 700;
  color: var(--primary-green);
}

.no-print {
  display: block;
}

/* Section Headers */
.section-header {
  color: var(--primary-green);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.section-header-small {
  color: var(--primary-green);
  margin-bottom: 10px;
  font-size: 1rem;
}

/* Form Sections */
.form-section {
  margin-bottom: 20px;
}

.form-section-title {
  color: var(--primary-green);
  margin-bottom: 10px;
}

/* Input Groups */
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.input-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.input-row-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Compatibility Matrix */
.compat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 15px;
  min-width: 800px;
}

.compat-table th,
.compat-table td {
  border: 1px solid var(--wg-200);
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  width: 6.5%;
  /* Adjust width to fit */
}

.compat-table th {
  background: var(--wg-100);
  color: var(--wg-800);
  writing-mode: horizontal-tb;
  font-size: 0.75rem;
  height: 100px;
  vertical-align: bottom;
}

.compat-table th span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.compat-table th.row-header,
.compat-table td.row-header {
  text-align: left;
  writing-mode: horizontal-tb;
  height: auto;
  white-space: nowrap;
  width: auto;
}

.compat-table .empty-cell {
  border: none;
  background: transparent;
}

.compat-c {
  background-color: #00b050;
  color: white;
}

.compat-cr {
  background-color: #ffeb3b;
  color: #d84315;
}

.compat-i {
  background-color: #ff0000;
  color: white;
}

.compat-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  max-width: 400px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-color {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: white;
  font-weight: bold;
}

.legend-color.c {
  background: #00b050;
}

.legend-color.cr {
  background: #ffeb3b;
  color: #d84315;
}

.legend-color.i {
  background: #ff0000;
}

.input-group input {
  flex: 1;
}

.input-group .unit {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 40px;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}

/* Stats Box */
.stats-box {
  text-align: center;
}

.stats-box-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-green);
}

.stats-box-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Table Headers */
.table-header {
  background: #f0f7f1;
  padding: 10px;
  text-align: left;
}

.table-cell {
  padding: 8px;
}

.table-cell-center {
  padding: 8px;
  text-align: center;
}

.table-cell-input {
  padding: 6px;
  width: 100%;
  text-align: center;
}

/* Totals Row */
.totals-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
  padding: 15px;
  background: #f0f7f1;
  border-radius: 6px;
}

.totals-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-green);
}

/* Section Container */
.section-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card Results */
.card-results {
  display: none;
  padding: 20px;
  background: #f0f7f1;
  border-top: 2px solid var(--primary-green);
}

/* Alert Colors */
.alert-danger {
  color: #dc3545;
}

.alert-warning {
  color: #ff9800;
}

.alert-success {
  color: var(--primary-green);
}

/* Utilities */
.text-green {
  color: var(--primary-green);
}

.text-green-bold {
  color: var(--primary-green);
  font-weight: bold;
  font-size: 1.5rem;
}

/* Readonly cell with green text */
.readonly-cell-green {
  padding: 8px;
  text-align: center;
  font-weight: bold;
  color: var(--primary-green);
}

.btn-margin-top {
  margin-top: 15px;
}

.btn-full {
  width: 100%;
}

/* Page Specific */
/* Interpretación */
#interpretacion {
  line-height: 1.7;
  font-size: 0.95rem;
}

#interpretacion ul {
  margin-top: 10px;
  padding-left: 20px;
}

#interpretacion li {
  margin-bottom: 5px;
}

/* Responsive Grid for Reports */
.info-grid-row {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: white;
  border: 1px solid var(--wg-200);
  border-radius: 8px;
  margin-bottom: 15px;
}
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
.cols-8 { grid-template-columns: repeat(8, 1fr); }

.fert-input-row {
  display: grid;
  grid-template-columns: 1fr 0.2fr 0.2fr;
  gap: 12px;
}

.info-field {
  display: flex;
  flex-direction: column;
}

/* Media Queries */
@media (max-width: 992px) {
  .grid-3-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-6-cols {
    grid-template-columns: repeat(3, 1fr);
  }

  .input-row-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .header-buttons {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
  }

  .tab {
    padding: 8px 15px;
    font-size: 0.8rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .nutrients-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2-cols,
  .grid-3-cols,
  .grid-5-cols,
  .grid-6-cols,
  .input-row,
  .input-row-3,
  .input-row-5,
  .cols-2,
  .cols-3,
  .cols-4,
  .cols-5,
  .cols-8,
  .fert-input-row {
    grid-template-columns: 1fr !important;
  }

  .info-grid-row {
    padding: 10px;
  }

  .info-field {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--wg-200);
    padding-bottom: 8px;
    margin-bottom: 8px;
  }

  .info-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .info-field span:first-child {
    margin-bottom: 0 !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .macro-layout-container {
    flex-direction: column;
  }

  .macro-inputs-panel,
  .macro-graph-panel {
    width: 100%;
    min-width: 0;
  }

  .container {
    padding: 10px;
  }

  .card {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .nutrients-grid {
    grid-template-columns: 1fr;
  }

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

  .btn-fab {
    bottom: 15px;
    right: 15px;
    padding: 10px 18px;
    font-size: 0.8rem;
  }

  .btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .header-logo span {
    display: none !important; /* Oculta texto de marca en pantallas muy pequeñas, el logo es suficiente */
  }

  body {
    padding-top: 75px !important; /* Header extra compacto, menos padding requerido */
  }
}

@media (min-width: 481px) and (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 901px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Floating Action Button - Siguiente */
.btn-fab {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 900;
  background: var(--wg-700);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  min-height: 48px;
}

.btn-fab:hover {
  background: var(--wg-900);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.btn-fab:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Print Styles */
@media print {

  body,
  table,
  td,
  th,
  h1,
  h2,
  h3,
  h4,
  h5,
  span,
  p {
    font-family: 'Courier New', Courier, monospace !important;
  }

  .no-print {
    display: none !important;
  }

  .tabs,
  .header,
  .btn-fab,
  button.btn-danger,
  .main-footer {
    display: none !important;
  }
}

.main-footer {
  background: #15151e;
  color: #ffffff;
  padding: 80px 40px 40px;
  font-family: 'Montserrat', sans-serif;
  margin-top: 60px;
  position: relative;
  z-index: 100;
  border-top: 4px solid #1aaf7d;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 50px;
  margin-bottom: 60px;
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.footer-brand-logo img {
  height: 45px;
  filter: brightness(0) invert(1);
}

.footer-brand-logo span {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.footer-brand-desc {
  color: #999999;
  line-height: 1.8;
  font-size: 1rem;
  max-width: 750px;
  margin: 0 auto;
}

.footer-help-centered h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

.footer-help-centered ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.footer-help-centered ul li a i {
  color: #1aaf7d;
  margin-right: 8px;
}

.footer-column ul li {
  margin-bottom: 15px;
}

.footer-column ul li a {
  color: #999999;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.95rem;
}

.footer-column ul li a:hover {
  color: #1aaf7d;
}

.footer-bottom {
  max-width: 1300px;
  margin: 0 auto;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.newsletter-section h3 {
  font-size: 1.3rem;
  margin-bottom: 25px;
}

.newsletter-input-group {
  display: flex;
  border-bottom: 2px solid #333333;
  padding: 10px 0;
  width: 350px;
  transition: border-color 0.3s ease;
}

.newsletter-input-group:focus-within {
  border-color: #1aaf7d;
}

.newsletter-input-group input {
  background: transparent;
  border: none;
  color: white;
  flex: 1;
  outline: none;
  font-size: 0.9rem;
}

.newsletter-input-group button {
  background: #3a1c8b;
  border: none;
  color: white;
  width: 35px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
}

.footer-copyright {
  color: #666666;
  font-size: 0.85rem;
}