/* =========================================================
   CRITICAL CARE TOOLS – ICU PHARMACOPOEIA
   Light Clinical Blue Version
========================================================= */

:root {
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-soft: #F1F5F9;
  --bg-input: #FFFFFF;

  --accent: #38BDF8;          /* Azul celeste */
  --accent-soft: #0EA5E9;     /* Azul celeste fuerte */

  --text-main: #0F172A;
  --text-muted: #64748B;

  --border: #E2E8F0;
  --danger: #DC2626;

  --radius: 12px;
}

/* ================= BASE ================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 2rem 1.5rem 3rem;
}

/* ================= LANGUAGE SWITCHER ================= */

.language-switcher {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.language-switcher a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: 0.2s ease;
}

.language-switcher a.active,
.language-switcher a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.language-switcher a:hover {
  background: rgba(56,189,248,0.15);
}

/* ================= BREADCRUMB ================= */

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--accent-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ================= CONTROLS ================= */

.controls {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: end;
}

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

.controls input,
.controls select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: 0.2s ease;
}

.controls input:focus,
.controls select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56,189,248,0.2);
}

.controls-actions {
  display: flex;
  justify-content: flex-start;
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn.secondary {
  background: #E2E8F0;
  color: var(--text-main);
}

.btn.secondary:hover {
  background: #CBD5E1;
}

/* ================= SECTION TITLES ================= */

h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  color: var(--accent-soft);
}

/* ================= DRUG CARD ================= */

.drug-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  transition: 0.2s ease;
}

.drug-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}

.drug-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drug-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.8rem;
}

/* ================= TOGGLE BUTTON ================= */

.toggle-sheet {
  background: var(--accent);
  color: #fff;
}

.toggle-sheet:hover {
  background: var(--accent-soft);
}

/* ================= DRUG SHEET ================= */

.drug-sheet {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.2s ease;
}

.hidden {
  display: none;
}

/* ================= SHEET GRID ================= */

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.sheet-grid span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.sheet-grid b {
  font-size: 0.9rem;
}

/* ================= CALC BLOCK ================= */

.calc-block {
  background: var(--bg-soft);
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
}

.calc-block label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.calc-block input {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
}

.calc-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.calc-result span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calc-result b {
  font-size: 1rem;
  color: var(--accent-soft);
}

/* ================= CLINICAL NOTE ================= */

.clinical-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #E0F2FE;
  padding: 0.8rem;
  border-left: 3px solid var(--accent-soft);
  border-radius: 6px;
}

/* ================= FOOTER ================= */

.site-footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #FFFFFF;
}

.footer-nav {
  margin-bottom: 0.7rem;
}

.footer-nav a {
  color: var(--accent-soft);
  text-decoration: none;
  margin: 0 0.4rem;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* ================= ANIMATION ================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .drug-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

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