* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f5f5f3;
  color: #1a1a1a;
}

header {
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.2rem;
  margin: 0;
}

header a {
  color: #666;
  font-size: 0.9rem;
  text-decoration: none;
}

.tabs {
  display: flex;
  gap: 1.25rem;
}

.tabs a.active {
  color: #3949ab;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notif {
  position: relative;
}

.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
}

.notif-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  z-index: 10;
}

.notif-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  padding: 0.4rem 0.5rem;
}

.notif-item {
  padding: 0.5rem;
  border-radius: 4px;
}

.notif-item + .notif-item {
  border-top: 1px solid #eee;
}

.notif-item-meta {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.15rem;
}

.notif-item-message {
  font-size: 0.8rem;
  word-break: break-word;
}

.notif-empty {
  text-align: center;
  color: #888;
  font-size: 0.8rem;
  padding: 1rem 0;
  margin: 0;
}

table.simple {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

table.simple th, table.simple td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

table.simple th {
  background: #fafafa;
  border-top: none;
  color: #666;
  font-weight: 600;
}

table.simple a {
  color: #3949ab;
  word-break: break-all;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.controls label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #666;
  gap: 0.25rem;
}

.controls input, .controls select {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.controls .range {
  display: flex;
  gap: 0.4rem;
}

.controls .range input {
  width: 6rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}

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

.card .photo {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #eee;
}

.card .body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.card .titre {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.card .infos {
  font-size: 0.85rem;
  color: #444;
}

.card .meta {
  font-size: 0.75rem;
  color: #888;
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.badge {
  display: inline-block;
  background: #eef2ff;
  color: #3949ab;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.address-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid #eee;
}

.address-row .address-text {
  font-size: 0.75rem;
  color: #2e7d32;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maps-btn {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid #3949ab;
  color: #3949ab;
  background: none;
  border-radius: 999px;
  cursor: pointer;
}

.empty {
  text-align: center;
  color: #888;
  padding: 3rem 0;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  width: 100%;
  max-width: 320px;
}

.login-box h1 {
  font-size: 1.1rem;
  margin-top: 0;
}

.login-box input {
  width: 100%;
  padding: 0.5rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-box button {
  width: 100%;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  background: #3949ab;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

.login-error {
  color: #c62828;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  body { background: #16171a; color: #e8e8e8; }
  header, .controls, .card, .login-box { background: #1f2023; border-color: #2c2d30; }
  header a, .controls label, .card .infos, .card .meta { color: #9aa0a6; }
  .controls input, .controls select, .login-box input { background: #16171a; border-color: #3a3b3e; color: #e8e8e8; }
  .badge { background: #262a44; color: #a6b3ff; }
  .address-row { border-color: #2c2d30; }
  .address-row .address-text { color: #66bb6a; }
  .maps-btn { color: #a6b3ff; border-color: #a6b3ff; }
  .tabs a.active { color: #a6b3ff; }
  table.simple { background: #1f2023; border-color: #2c2d30; }
  table.simple th, table.simple td { border-color: #2c2d30; }
  table.simple th { background: #16171a; color: #9aa0a6; }
  table.simple a { color: #a6b3ff; }
  .notif-panel { background: #1f2023; border-color: #2c2d30; }
  .notif-panel-title { color: #9aa0a6; }
  .notif-item + .notif-item { border-color: #2c2d30; }
  .notif-item-meta { color: #9aa0a6; }
  .notif-empty { color: #9aa0a6; }
}
