:root {
  --accent: #2e8b57;
  --muted: #666;
  --bg: #f7f8fa;
  --text: #111;
  --hover: #e6f2ea;
  --border: #ddd;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  background: linear-gradient(90deg, #fff, #eef);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 18px;
  margin: 0;
}

main {
  padding: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.2s background, 0.2s color, 0.2s border-color;
}

.tab:hover {
  background: var(--hover);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: 0.2s box-shadow;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 8px;
  border-bottom: 1px solid #efefef;
  text-align: center;
}

th {
  background: #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 2;
}

td.editable {
  cursor: pointer;
  transition: 0.2s background;
}

td.editable:hover {
  background: var(--hover);
}

.big {
  font-size: 48px;
  font-weight: 700;
  text-align: center;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  transition: 0.2s background, 0.2s color, 0.2s border-color, 0.2s box-shadow;
}

button:hover {
  background: var(--hover);
}

button:focus {
  outline: 3px solid rgba(46, 139, 87, 0.3);
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

button.positive {
  background: #28a745;
  color: #fff;
}

button.selected {
  outline: 3px solid rgba(46, 139, 87, 0.18);
}

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

input[type=text], select {
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.top-meta {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

.table-wrapper {
  max-height: 400px;
  overflow: auto;
  position: relative;
}

.table-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  main {
    max-width: 1000px;
    margin: 20px auto;
  }
}

/* Style actif pour Gauche/Droite */
#btn-left.active,
#btn-right.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

