:root {
  --main-color: #0056b3;
  --main-hover: #004494;
  --accent-color: #2c8a45;
  --text-color: #ffffff;
  --text-dark: #212529;
  --border-color: #ced4da;
  --background-alt: #f8f9fa;
  --active-color: #ffc107;
  --danger: #dc3545;
  --warning: #fd7e14;
  --narcotique-bg: #fff3e0;
  --morphinique-bg: #e1f5fe;
  --curare-bg: #ffe9f6;
  --antibiotique-bg: #e8f5e9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text-dark);
  background-color: #fff;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#content {
  flex: 1;
 padding: 0 0.5rem 55px;
  /* espace pour la tabBar */
}

/* === Barre de navigation fixe === */
.tabBar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--main-color);
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  padding-bottom: 0;
}

.tabButton {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tabButton:hover {
  background-color: var(--main-hover);
}

.tabButton[aria-current="page"] {
  color: var(--active-color);
  font-weight: 600;
}
.tabButton.active {
  color: #FFC107; /* Jaune doré */
  font-weight: 600;
  position: relative;
}

.tabIcon {
  width: 24px;
  height: 24px;
  margin-bottom: 0.2rem;
  fill: currentColor;
}
.tabLabel {
  font-size: 0.75rem;
}
/* iOS PWA safe-area */
@media (display-mode: standalone),
(display-mode: fullscreen) {
  body {
    padding-top: env(safe-area-inset-top, 0);
  }

  #content {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
  }

  .tabBar {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* Typographie et cartes */
h1,
h2,
h3,
h4 {
  color: var(--main-color);
  margin: 1.5rem 0 1rem;
  line-height: 1.2;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.3rem;
}

h3 {
  font-size: 1.3rem;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Tables médicales */
.medical-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
}

.medical-table th {
  background-color: var(--main-color);
  color: var(--text-color);
  padding: 0.4rem;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

.medical-table td {
  padding: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.medical-table tr:not(.narcotique):not(.morphinique):not(.curare):not(.antibiotique):nth-child(even) {
  background-color: var(--background-alt);
}

.medical-table tr.narcotique {
  background-color: var(--narcotique-bg);
  border-left: 4px solid #e65100;
}

.medical-table tr.morphinique {
  background-color: var(--morphinique-bg);
  border-left: 4px solid #0288d1;
}

.medical-table tr.curare {
  background-color: var(--curare-bg);
  border-left: 4px solid #d32f2f;
}

.medical-table tr.antibiotique {
  background-color: var(--antibiotique-bg);
}

/* Formulaires */
.form-container {
  background-color: rgba(0, 87, 179, 0.13);
  padding: 0.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.input-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.input-item {
  flex: 1;
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 0.4rem;
  font-weight: 500;
}

label.required::after {
  content: " *";
  color: var(--danger);
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.3rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}

/* Alertes et liens */
.alert {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.medical-alert {
  background-color: #fff8e1;
  color: #212529;
}

.legal-notice {
  font-size: 0.8rem;
  color: #6c757d;
}

a {
  color: var(--main-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .tabButton {
    font-size: 0.75rem;
    padding: 0.3rem;
  }

  .tabIcon {
    width: 22px;
    height: 22px;
  }

  .input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
}