/* Theme black/white, Bootstrap-based */
body {
  background-color: #ffffff;
  color: #111;
}
.navbar-brand img {
  object-fit: cover;
}

/* Toast custom */
.toast-error {
  background-color: #f8d7da;
  color: #842029;
}
.toast-success {
  background-color: #d1e7dd;
  color: #0f5132;
}

/* Excel-like grid container */
.excel-grid {
  max-height: calc(100vh - 200px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.excel-grid table {
  border-collapse: separate;
  border-spacing: 0;
}

/* Sticky parts */
.excel-grid th.sticky-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}
.excel-grid th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #fff;
}
.excel-grid th.corner {
  z-index: 7;
}
.excel-grid tfoot tr .sticky-foot {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: #fff;
}

/* Header cells */
.excel-grid .client-head {
  padding: 6px 6px;
  border-bottom: 2px solid #dee2e6;
  width: 165px !important;
  min-width: 165px !important;
  max-width: 165px !important;
  vertical-align: top;
}
.excel-grid .client-head .client-head-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  white-space: normal;
  max-height: calc(1.1em * 4);
  cursor: help;
  font-size: 12px;
}

/* Row header (day label) */
.excel-grid tbody th {
  background: #fff;
  white-space: nowrap;
  font-weight: 600;
  padding: 6px 8px;
  border-right: 2px solid #dee2e6;
}

/* Cells */
.excel-grid td.cell {
  width: 165px !important;
  min-width: 165px !important;
  max-width: 165px !important;
  height: 33px;
  position: relative;
}
.excel-grid input.meal-input {
  width: 100%;
  height: 100%;
  border: 0;
  text-align: center;
  font-size: 16px;
  outline: none;
  background: transparent;
  padding: 0;
  -moz-appearance: textfield;
}
.excel-grid input.meal-input::-webkit-outer-spin-button,
.excel-grid input.meal-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.excel-grid input.meal-input:focus {
  background: #f1f8ff;
}
.excel-grid input.meal-input.readonly {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

.cell-active {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

/* Hover effects */
.row-hover td.cell {
  background-color: #f9fafb;
}
.col-hover {
  background-color: #f9fafb !important;
}

/* Birthday highlight */
.excel-grid .birthday {
  background-color: #fff3b0 !important;
}

/* Saving/error background hints */
.excel-grid input.meal-input.cell-saving {
  background-image: radial-gradient(#0d6efd 20%, transparent 21%);
  background-size: 6px 6px;
  background-repeat: repeat;
}
.excel-grid input.meal-input.cell-error {
  background-color: #fde8ea;
  box-shadow: inset 0 0 0 2px #dc3545;
}

/* Totals sticky footer cells */
.total-cell {
  font-size: 12px;
  font-weight: 600;
  white-space: pre-line;
}

/* Suspend hover when keyboard navigation */
.suspend-hover .row-hover td.cell,
.suspend-hover .col-hover {
  background-color: inherit !important;
}

/* Map overlay */
#mapWrapper {
  position: relative;
}
#mapOverlay {
  position: absolute;
  inset: 0;
  display: none;
  background: rgba(255, 255, 255, 0.6);
  z-index: 400;
}
#map.map-grayed {
  filter: grayscale(0.3);
}

/* Role dots (users list) */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.role-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.role-dot-user {
  background: #0d6efd;
} /* bleu */
.role-dot-admin {
  background: #dc3545;
} /* rouge */
.role-dot-god {
  background: #d4af37;
} /* doré */

/* Footer */
footer .container {
  font-size: 0.9rem;
}

/* Misc */
.table-bordered > :not(caption) > * {
  border-width: 1px;
}

th.sticky-col.sticky-foot {
  z-index: 8 !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}

nav {
  min-height: 60px;
  width: 100%;
  flex-shrink: 0;
}

main {
  flex: 1;
}

footer {
  min-height: 55px;
  width: 100%;
  flex-shrink: 0;
}

@media print {
  nav,
  .btn,
  .form-control,
  .form-select,
  .navbar,
  footer {
    display: none !important;
  }
  main.container {
    padding: 0 !important;
  }
  .card {
    border: 0;
  }
  .table {
    font-size: 12px;
  }
}

/* Style pour le panneau de configuration */
.config-panel {
  position: absolute;
  z-index: 1000;
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  width: 200px;
  padding: 10px;
  display: none; /* caché par défaut */
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.config-panel.show {
  display: block; /* visible lorsque .show est ajouté */
  opacity: 1; /* transition vers visible */
  transform: translateY(0); /* transition vers sa position d'origine */
}

/* Style pour l'intérieur du panneau */
.config-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Style pour l'icône de rouage */
.client-head .menu-icon {
  font-size: 1.2rem;
  margin-left: 8px;
  color: #6c757d;
}

.client-head .menu-icon:hover {
  color: #495057;
}

/* Style des input et labels dans le panneau */
.config-panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-panel input[type="number"] {
  width: 60px;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

input[type="checkbox"] {
  margin-right: 8px;
}
