/* Antibiotic Renal Dose Guide - styles */

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #0f2a44;
  --ink-soft: #42607c;
  --muted: #6f829a;
  --line: #e2e8f0;
  --accent: #0b5cad;
  --accent-ink: #0b5cad;
  --accent-soft: #e7f0fb;
  --warn: #8a4b00;
  --warn-bg: #fff4e0;
  --danger: #b3261e;
  --good: #1f7a3f;
  --hd: #5d47a3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(12, 37, 65, 0.05), 0 6px 20px rgba(12, 37, 65, 0.06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.topbar {
  background: linear-gradient(180deg, #0b5cad 0%, #094e92 100%);
  color: white;
  padding: 18px 24px;
  box-shadow: 0 2px 10px rgba(11, 92, 173, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.15s ease, transform 0.15s ease;
  margin-right: 4px;
}
.back-link:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-1px);
}
.back-link svg {
  flex-shrink: 0;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.3px;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px 60px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.disclaimer {
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  line-height: 1.55;
  border-left: 4px solid #d48a1f;
}

.disclaimer strong {
  color: #6a3900;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eef3f9;
  border-radius: 10px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(11, 92, 173, 0.15);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Form fields */
.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: white;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.15);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.hint code {
  background: #eef3f9;
  padding: 1px 4px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* CrCl result bar */
.result-bar {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.result-label {
  font-size: 13px;
  color: var(--ink-soft);
}

.result-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.result-units {
  font-size: 13px;
  color: var(--ink-soft);
}

.result-stage {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 3px 10px;
  background: white;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Drug results */
.drug-results {
  margin-top: 10px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfe;
}

.drug-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 8px;
  transition: background 0.1s;
}

.drug-item:last-child {
  border-bottom: none;
}

.drug-item:hover {
  background: #eef3f9;
}

.drug-item.selected {
  background: var(--accent-soft);
}

.drug-name {
  font-weight: 600;
  color: var(--ink);
}

.drug-class {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.empty-msg {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Dose card */
.dose-card {
  border-top: 4px solid var(--accent);
}

.dose-placeholder {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}

.dose-drug-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dose-drug-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.dose-drug-class {
  font-size: 13px;
  color: var(--muted);
}

.dose-drug-route {
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

/* Indication picker */
.indication-picker {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f6f9fd;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.indication-picker-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 8px;
}

.indication-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.indication-chip {
  flex: 0 1 auto;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
}

.indication-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.indication-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(11, 92, 173, 0.35);
}

.multi-dot {
  color: var(--accent);
  font-size: 10px;
  vertical-align: 2px;
  margin-left: 2px;
}

.dose-primary {
  background: linear-gradient(135deg, #e7f0fb 0%, #f0f7ff 100%);
  border: 1px solid #c6d9ee;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.dose-primary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.dose-primary-crcl {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.dose-primary-value {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}

.dose-section {
  margin-top: 16px;
}

.dose-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 8px;
}

.tiers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tiers-table th,
.tiers-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.tiers-table th {
  background: #f6f9fd;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tiers-table tr.match td {
  background: #fff9e0;
  font-weight: 600;
}

.tiers-table tr.match td:first-child::before {
  content: "► ";
  color: var(--accent);
}

.tiers-table tr.no-data td {
  background: #fbf5f0;
  color: #7a5a3a;
  font-style: italic;
}

.tiers-table tr.match.no-data td {
  background: #f0dfd0;
  font-weight: 600;
}

.no-data-text {
  color: #a56b2a;
  font-style: italic;
}

.dose-primary-nodata {
  background: linear-gradient(135deg, #fff4e0 0%, #fdf6ea 100%) !important;
  border: 1px solid #e6c085 !important;
}

.dose-primary-nodata .dose-primary-label {
  color: #a15a00 !important;
}

.dose-primary-nodata .dose-primary-value {
  color: #6a3f00;
  font-style: italic;
  font-weight: 500;
}

.dose-primary-nodata-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: #7a4a00;
  line-height: 1.45;
  padding-top: 8px;
  border-top: 1px dashed #e0b878;
}

.dose-hd,
.dose-crrt,
.dose-notes {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
}

.dose-hd {
  background: #efeafd;
  color: var(--hd);
  border-left: 3px solid var(--hd);
}

.dose-crrt {
  background: #e7f5ec;
  color: var(--good);
  border-left: 3px solid var(--good);
}

.dose-notes {
  background: #fff4e0;
  color: var(--warn);
  border-left: 3px solid #d48a1f;
}

.dose-source {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  font-style: normal;
  line-height: 1.55;
}

.dose-source-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.dose-source-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}

.dose-source-list li {
  padding: 6px 10px;
  margin-bottom: 4px;
  background: #f6f9fd;
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}

.dose-source-list .ref-label {
  font-weight: 600;
  color: var(--accent);
  margin-right: 4px;
}

.dose-source-foot {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  padding-top: 4px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 30px;
}

.footer p {
  margin: 0;
}
