* { box-sizing: border-box; }
body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: #f4f4f2;
  color: #222;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  background: #1c3a5e;
  color: white;
}
.topbar h1 { font-size: 18px; margin: 0; }

.week-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.week-label { text-align: center; font-size: 13px; }

.btn {
  display: inline-block;
  padding: 6px 12px;
  background: #ffffff22;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid #ffffff55;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: #ffffff44; }
.btn-primary { background: #2e8b57; border-color: #2e8b57; }
.btn-primary:hover { background: #379a63; }

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

.table-wrap {
  overflow-x: auto;
  padding: 16px;
}

table.planning {
  border-collapse: collapse;
  background: white;
  font-size: 11px;
  min-width: 100%;
}
table.planning th, table.planning td {
  border: 1px solid #bbb;
  padding: 2px;
  text-align: center;
  white-space: nowrap;
}
table.planning thead th {
  background: #dce6f1;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.planning .label-col {
  text-align: left;
  padding-left: 6px;
  min-width: 130px;
  background: #eef1e0;
  position: sticky;
  left: 0;
  z-index: 1;
}
table.planning .agent-col { min-width: 26px; }

tr.section-row td {
  background: #d6d80a;
  font-weight: bold;
  text-align: left;
  padding-left: 6px;
}

td.cell input {
  width: 30px;
  text-align: center;
  border: none;
  font-size: 11px;
  padding: 3px 0;
  background: transparent;
}
td.cell input:focus {
  outline: 2px solid #2e8b57;
  background: #fffff0;
}

.legend-preview { padding: 0 20px 30px; }
.legend-preview ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.legend-preview li { font-size: 13px; }
.legend-preview ul.notes-list { display: block; }
.legend-preview ul.notes-list li { margin-bottom: 4px; }
.swatch {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid #999;
  border-radius: 3px;
  font-weight: bold;
  margin-right: 4px;
}
.note-swatch { background: #000; color: #fff; }

.login-box {
  max-width: 340px;
  margin: 60px auto;
  padding: 24px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  text-align: center;
}
.login-box input[type="password"] {
  width: 100%;
  padding: 8px;
  margin: 12px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.login-error { color: #c0392b; font-weight: bold; }

/* --- Module Astreintes --- */
table.astreintes th, table.astreintes td.astreinte-cell {
  min-width: 26px;
}
table.astreintes .weekend-col {
  background: #f2f2f2;
}
td.astreinte-cell {
  padding: 0 !important;
}
.astreinte-box {
  width: 100%;
  height: 22px;
  cursor: pointer;
}
.astreinte-box:hover {
  outline: 2px solid #2e8b57;
  outline-offset: -2px;
}
.astreintes-legend {
  padding: 0 20px 30px;
  font-size: 13px;
}
.astreintes-legend .swatch {
  border: 1px solid #999;
  border-radius: 3px;
  padding: 2px 10px;
  margin: 0 4px;
}
.btn-danger {
  background: #c0392b;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.legend-editor { padding: 20px; }
table.legend-form { border-collapse: collapse; margin-bottom: 12px; }
table.legend-form th, table.legend-form td {
  border: 1px solid #ccc;
  padding: 6px;
}
.note-num {
  background: #000;
  color: #fff;
  font-weight: bold;
  text-align: center;
  width: 24px;
}
