/* Refonte UI 2026 : thème immobilier professionnel et responsive */
:root {
  --brand-900: #0a1a33;
  --brand-700: #162a4d;
  --brand-600: #1f3e6d;
  --brand-500: #3357a1;
  --brand-400: #4f6ed1;
  --accent-500: #f0a561;
  --accent-400: #f7c68c;
  --ink: #142136;
  --muted: #6c7a96;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --surface-alt: #edf1fb;
  --border-soft: #dfe5f1;
  --border-strong: #c0cbe0;
  --shadow-soft: rgba(15, 23, 42, 0.08);
  --shadow-strong: rgba(15, 23, 42, 0.15);
  --success: #0f9d58;
  --warning: #ef8c3b;
  --danger: #d84747;
}

@layer base {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    line-height: 1.5;
    background:
      radial-gradient(circle at 25% -10%, rgba(79, 110, 209, 0.18), transparent 55%),
      radial-gradient(circle at 80% 5%, rgba(240, 165, 97, 0.12), transparent 45%),
      linear-gradient(180deg, #f9fbff 0%, #eef2fb 60%, #f7f8fc 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  padding: clamp(1.5rem, 3vw, 3rem) 0 3rem;
}

.container-app {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
}

.header-inner {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.header-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  height: 60px;
  width: auto;
  display: block;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.brand-copy span {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--brand-700);
  box-shadow: 0 14px 28px rgba(12, 26, 51, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.nav-toggle-active .nav-toggle-bars .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.nav-toggle-active .nav-toggle-bars .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.nav-toggle-active .nav-toggle-bars .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .header-bar {
    width: auto;
    flex: 1;
    gap: 1.5rem;
  }

  .nav-toggle {
    display: none;
  }
}

.admin-banner {
  margin-top: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.85rem;
  background: var(--surface-muted);
  color: var(--brand-700);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-banner span {
  color: var(--brand-500);
}

.site-nav {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.site-nav[data-open="true"] {
  display: flex;
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    gap: 0.45rem;
    flex: 1;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand-700);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--surface-muted);
  border-color: var(--border-soft);
  color: var(--brand-600);
}

.nav-logout {
  margin-top: 0.35rem;
  display: flex;
  width: 100%;
}

.nav-logout .btn-ghost {
  width: 100%;
  justify-content: center;
}

.site-nav form {
  width: 100%;
}

@media (min-width: 1024px) {
  .nav-link {
    width: auto;
    justify-content: center;
    border-radius: 999px;
    padding: 0.55rem 1rem;
  }

  .site-nav form {
    width: auto;
  }

  .nav-logout {
    margin-top: 0;
    margin-left: 0.5rem;
    width: auto;
  }

  .nav-logout .btn-ghost {
    width: auto;
  }
}

.flash {
  border-radius: 1rem;
  padding: 0.95rem 1.15rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid transparent;
}

.flash-success {
  background: #ecfdf5;
  color: #036848;
  border-color: #a7f3d0;
}

.flash-error {
  background: #fef2f2;
  color: #9f1239;
  border-color: #fecdd3;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: center;
}

@media (max-width: 640px) {
  .page-header {
    grid-template-columns: 1fr;
  }
}

.page-header h1 {
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  font-weight: 600;
  color: var(--brand-700);
  margin: 0;
}

.page-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}

.page-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-end;
}

.card {
  border-radius: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 25px 60px rgba(12, 26, 51, 0.08);
  padding: 1.75rem;
}

.card-muted {
  background: var(--surface-muted);
  border-style: dashed;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  border-radius: 1.1rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(145deg, rgba(51, 87, 161, 0.08), rgba(23, 138, 144, 0.08));
  border: 1px solid rgba(51, 87, 161, 0.15);
}

.stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--brand-700);
}

.btn,
.btn-outline,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border: none;
}

.btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  box-shadow: 0 18px 35px rgba(23, 63, 132, 0.35);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(23, 63, 132, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--brand-600);
  border: 1px solid rgba(51, 87, 161, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--surface-muted);
  border-color: var(--brand-500);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-600);
  border: 1px solid var(--border-strong);
  padding-inline: 1.35rem;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--surface-muted);
}

.btn-danger {
  background: linear-gradient(135deg, #f76464, var(--danger));
  box-shadow: 0 18px 35px rgba(216, 71, 71, 0.35);
}

.label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 0.4rem;
}

.input,
select.input,
textarea.input {
  width: 100%;
  border-radius: 0.95rem;
  border: 1px solid var(--border-soft);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
select.input:focus,
textarea.input:focus {
  outline: none;
  border-color: rgba(79, 110, 209, 0.85);
  box-shadow: 0 0 0 3px rgba(79, 110, 209, 0.2);
}

.helper-text {
  font-size: 0.82rem;
  color: var(--muted);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 1.8rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
  background-image: linear-gradient(135deg, #0f2645, #205f73);
  color: #f8fafc;
  box-shadow: 0 35px 80px rgba(9, 20, 41, 0.45);
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: center;
  }
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.2), transparent 45%);
  opacity: 0.4;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hero p {
  color: rgba(249, 250, 251, 0.88);
  margin: 0 0 1.5rem;
  max-width: 520px;
}

.hero-actions {
  justify-content: flex-start;
  z-index: 1;
}

.hero .btn-outline,
.hero-outline {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.hero .btn-outline:hover,
.hero-outline:hover,
.hero .btn-outline:focus-visible,
.hero-outline:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.metric-card {
  border-radius: 1.1rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f8fafc;
  backdrop-filter: blur(6px);
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 600;
  display: block;
}

.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  opacity: 0.75;
}

.metric-card p {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: rgba(248, 250, 252, 0.8);
}

.table-shell {
  border-radius: 1.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.08);
  overflow-x: auto;
}

.table-shell::-webkit-scrollbar {
  height: 8px;
}

.table-shell::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.table thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.85rem 1rem;
  text-align: left;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-strong);
}

.table tbody tr {
  background: var(--surface);
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border-soft);
}

.table tbody tr:nth-child(even) {
  background: var(--surface-muted);
}

.table tbody tr:hover {
  background: rgba(79, 110, 209, 0.05);
}

.table td {
  padding: 1.05rem 1rem;
  border-bottom: 1px solid transparent;
  vertical-align: middle;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.table-actions .btn,
.table-actions .btn-outline,
.table-actions .btn-danger {
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
  border-radius: 0.85rem;
}

.table td:first-child {
  padding-left: 1.25rem;
}

.table td:last-child {
  padding-right: 1.25rem;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table td.actions {
  min-width: 220px;
}

.table-empty {
  text-align: center;
  padding: 1.5rem;
  font-weight: 500;
  color: var(--muted);
}

.table-responsive td {
  vertical-align: top;
}

@media (max-width: 768px) {
  .table-shell {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  .table-actions {
    flex-direction: column;
    justify-content: stretch;
  }
  .table-actions .btn,
  .table-actions .btn-outline,
  .table-actions .btn-danger {
    width: 100%;
  }

  .table-responsive thead {
    display: none;
  }

  .table-responsive tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .table-responsive tr {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-soft);
    border-radius: 1.25rem;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  }

  .table-responsive td {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    border: none;
    padding: 0.35rem 0;
  }

  .table-responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
  }

  .table-responsive td.table-empty {
    display: block;
    text-align: center;
  }

  .table-responsive td.table-empty::before {
    content: none;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill.success {
  background: rgba(15, 157, 88, 0.15);
  color: #0f9d58;
}

.status-pill.warning {
  background: rgba(239, 140, 59, 0.18);
  color: #b45309;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(51, 87, 161, 0.12);
  color: var(--brand-600);
}

.chip-warning {
  background: rgba(239, 140, 59, 0.15);
  color: #b45309;
}

.chip-danger {
  background: rgba(216, 71, 71, 0.15);
  color: #b91c1c;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 80;
}

.modal-backdrop.active {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 1.35rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.15);
  padding: 1.75rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 0.5rem;
}

.modal-message {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.email-recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.site-footer {
  background: var(--brand-900);
  color: rgba(248, 250, 252, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem 0;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

