@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/SourceSansPro-Regular.ttf');
}

html,
body {
  width: 100%;
  height: 100%;
  font-family:
    Source Sans Pro,
    sans-serif;
}

body {
  background: linear-gradient(to top right, #18c9fa4d 30%, #f4f6fd 70%);
  margin: 0;
  display: flex;
  flex-direction: column;
}

a {
  color: #2bcbdf;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-grow: 1;
}

main > section {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: 940px;
  gap: 64px;
}

.title {
  color: #333;
  font-weight: 600;
  margin: 0;
  margin-block-start: 0;
  margin-block-end: 0;
}

h1 {
  font-size: 58px;
}

h2 {
  font-size: 20px;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1em;
  padding: 0 2em;
}

.header-container > img {
  height: 24px;
  width: auto;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(1, 1fr);
  gap: 32px;
  padding: 0 2em;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  background-color: white;
  border-radius: 8px;
  padding: 40px;
}

.card > .icon {
  width: 60px;
  height: 60px;
}

.card > .card-content {
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

footer {
  color: #1a1a1a;
  padding: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

@media screen and (max-width: 1024px) {
  main > section {
    width: 100%;
  }

  .card {
    flex-direction: row;
    height: fit-content;
  }

  .cards-container {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  html, body {
    height: auto;
    width: 100%;
  }

  .header-container > img {
    height: auto;
    width: 100%;
  }

  main {
    padding-top: 2em;
  }

  .card {
    flex-direction: column;
  }
}
.reservations-page {
  display: block;
  min-height: 100%;
  background: #f6f8fb;
  padding: 24px;
}
.reservations-page h1 {
  font-size: 32px;
  margin: 0 0 24px 0;
}
.reservations-page table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}
.reservations-page th,
.reservations-page td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.reservations-page th {
  background: #f1f5f9;
  font-weight: 600;
}
.planning-page{
  display:block;
  min-height:100vh;
  background:#f4f7fb;
  padding:24px;
  font-family:Arial,sans-serif;
}
.planning-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:18px;
  flex-wrap:wrap;
}
.planning-toolbar input{
  width:360px;
  max-width:100%;
  padding:10px 14px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:white;
  font-size:14px;
}
.planning-wrap{
  overflow:auto;
  max-height:75vh;
  border:1px solid #dbe3ec;
  border-radius:14px;
  background:white;
  box-shadow:0 6px 20px rgba(15,23,42,.08);
}
.planning-grid{
  border-collapse:separate;
  border-spacing:0;
  min-width:max-content;
}
.planning-grid th,
.planning-grid td{
  border-right:1px solid #e2e8f0;
  border-bottom:1px solid #e2e8f0;
  height:54px;
  min-width:78px;
  padding:0;
  text-align:center;
  vertical-align:middle;
}
.planning-grid thead th{
  position:sticky;
  top:0;
  z-index:5;
  background:#f8fafc;
  font-size:12px;
  font-weight:700;
}
.planning-grid .apartment{
  position:sticky;
  left:0;
  z-index:4;
  min-width:110px;
  background:white;
  font-weight:700;
  color:#0f172a;
}
.planning-grid thead .apartment{
  z-index:8;
  background:#eaf0f8;
}
.planning-grid .weekend{
  background:#f8fafc;
}
.booking{
  box-sizing:border-box;
  margin:4px;
  min-height:44px;
  border-radius:9px;
  padding:5px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:11px;
  line-height:1.2;
  font-weight:600;
  box-shadow:0 2px 6px rgba(15,23,42,.12);
  overflow:hidden;
}
.booking-direct{background:#dbeafe;color:#1e3a8a}
.booking-booking{background:#dcfce7;color:#166534}
.booking-airbnb{background:#fee2e2;color:#991b1b}
.booking-other{background:#fef3c7;color:#92400e}
.reservation-modal[hidden]{
  display:none;
}

.reservation-modal{
  position:fixed;
  inset:0;
  z-index:1000;
  background:rgba(15,23,42,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.reservation-modal-card{
  width:520px;
  max-width:100%;
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 60px rgba(15,23,42,.25);
  padding:22px;
}

.reservation-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.reservation-modal-header h2{
  margin:0;
  font-size:22px;
}

#reservation-modal-close{
  border:0;
  background:transparent;
  font-size:28px;
  cursor:pointer;
}

#reservation-edit-form{
  display:flex;
  flex-direction:column;
  gap:8px;
}

#reservation-edit-form label{
  font-size:13px;
  font-weight:700;
  color:#334155;
  margin-top:8px;
}

#reservation-edit-form input{
  width:100%;
  box-sizing:border-box;
  padding:10px 12px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  font-size:14px;
}

.reservation-form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.reservation-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:18px;
}

.reservation-modal-actions button{
  padding:10px 16px;
  border-radius:9px;
  border:1px solid #cbd5e1;
  cursor:pointer;
  font-weight:700;
}

#reservation-save{
  background:#2563eb;
  color:white;
  border-color:#2563eb;
}

#reservation-save-message{
  min-height:20px;
  margin-top:8px;
  font-size:14px;
  font-weight:700;
}

.booking{
  cursor:pointer;
}
.reservation-form-row-3{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
  align-items:end;
}
.payment-section select,
.parking-section select{
  width:100%;
  box-sizing:border-box;
  padding:10px 12px;
  min-height:42px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  background:#fff;
  font-size:14px;
}

.payment-section label,
.parking-section label{
  display:block;
  margin-bottom:5px;
  font-size:13px;
  font-weight:700;
  color:#334155;
}
.payment-options-row{
  display:grid;
  grid-template-columns:1.4fr .9fr;
  gap:18px;
  margin-top:10px;
}

.payment-options-row > div{
  min-width:0;
}

.payment-options-row select{
  width:100%;
}
.parking-options-row{
  display:grid;
  grid-template-columns:.8fr 1.2fr 1.4fr;
  gap:18px;
  margin-top:10px;
}

.parking-options-row > div{
  min-width:0;
}

.parking-options-row select{
  width:100%;
}
.reservation-credit{
  margin-top:18px;
  padding-top:12px;
  border-top:1px solid #e2e8f0;
  text-align:center;
  font-size:12px;
  font-weight:500;
  color:#64748b;
}
.payment-section h3,
.parking-section h3{
  font-size:16px;
  margin-top:12px;
  margin-bottom:10px;
}

.reservation-credit{
  font-size:11px;
  font-weight:400;
  color:#64748b;
  text-align:center;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid #e2e8f0;
}
.parking-options-row{
  margin-bottom:0;
}

.reservation-modal-actions{
  margin-top:8px;
}

.reservation-credit{
  margin-top:6px;
  padding-top:7px;
}
.parking-options-row{
  margin-bottom:-4px;
}

.reservation-modal-actions{
  margin-top:2px;
}

.reservation-credit{
  margin-top:2px;
  padding-top:5px;
  line-height:1.2;
}
#new-reservation-button{
  background:#2563eb;
  color:#fff;
  border:1px solid #2563eb;
  border-radius:9px;
  padding:9px 14px;
  font-weight:700;
  cursor:pointer;
}

#new-reservation-button:hover{
  background:#1d4ed8;
}
#reservation-delete{
  margin-right:auto;
  background:#dc2626;
  color:#fff;
  border-color:#dc2626;
}

#reservation-delete:hover{
  background:#b91c1c;
}

.planning-appearance-inline{display:flex;align-items:center;gap:8px;margin-right:auto}.planning-appearance-inline input[type="color"]{width:44px;height:40px;padding:3px;cursor:pointer}.planning-appearance-inline select{width:78px;height:40px}.reservation-modal-actions{display:flex;align-items:center;gap:10px}
.movement-table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  font-size:15px;
}

.movement-table th,
.movement-table td{
  padding:10px 12px;
  border:1px solid #d9dee7;
  text-align:left;
  white-space:nowrap;
}

.movement-table th{
  background:#eef3f8;
  font-weight:700;
}

.movement-table tbody tr:hover{
  background:#f7faff;
}

.planning-page h2{
  margin-top:28px;
  margin-bottom:10px;
}

.login-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef4fb 0%, #dfeaf7 100%);
  font-family: Arial, Helvetica, sans-serif;
}

.login-shell {
  width: min(92%, 720px);
  text-align: center;
  background: rgba(255,255,255,0.96);
  padding: 56px 48px 34px;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(20, 45, 80, 0.18);
}

.login-shell h1 {
  margin: 0 0 38px;
  font-size: 36px;
  line-height: 1.2;
  color: #163a63;
}

.login-form {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.login-form label {
  display: block;
  margin: 18px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #24384d;
}

.login-form input {
  width: 100%;
  box-sizing: border-box;
  height: 58px;
  padding: 0 18px;
  font-size: 20px;
  border: 2px solid #c8d4e2;
  border-radius: 14px;
  outline: none;
  background: #fff;
}

.login-form input:focus {
  border-color: #2f6fab;
  box-shadow: 0 0 0 4px rgba(47,111,171,0.12);
}

.login-form button {
  width: 100%;
  height: 58px;
  margin-top: 28px;
  border: 0;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  background: #163a63;
  color: white;
}

.login-form button:hover {
  background: #0f2f51;
}

.login-signature {
  margin-top: 34px;
  font-size: 17px;
  color: #5d6b79;
  font-style: italic;
}

@media (max-width: 640px) {
  .login-shell {
    padding: 36px 22px 28px;
  }

  .login-shell h1 {
    font-size: 28px;
  }

  .login-form input,
  .login-form button {
    height: 54px;
    font-size: 18px;
  }
}


/* ===== LOGIN BACKGROUND - SWISS FLATS ===== */
.login-page {
  background-image: url('/public/images/login-background.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Carte de connexion au-dessus de la photo */
.login-shell {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ===== LOGIN CARD COMPACT ===== */
.login-shell {
  width: min(90%, 620px);
  padding: 42px 48px 30px;
  border-radius: 22px;
  box-sizing: border-box;
}

.login-shell h1 {
  margin: 0 0 30px;
  font-size: 32px;
}

.login-signature {
  margin-top: 28px;
}

/* ===== FIX LOGIN HEIGHT ===== */
.login-shell {
  flex-grow: 0;
  min-height: auto;
  height: auto;
}

/* ===== GOLD LOGIN LOGO ===== */
.login-roof-logo {
  position: relative;
  width: 82px;
  height: 50px;
  flex: 0 0 82px;
}

.login-roof-logo::before,
.login-roof-logo::after {
  content: "";
  position: absolute;
  height: 7px;
  background: #c3a35f;
  transform-origin: left center;
}

.login-roof-logo::before {
  width: 52px;
  left: 4px;
  top: 34px;
  transform: rotate(-36deg);
}

.login-roof-logo::after {
  width: 48px;
  left: 44px;
  top: 4px;
  transform: rotate(36deg);
}

.login-roof-logo span {
  position: absolute;
  width: 26px;
  height: 23px;
  left: 31px;
  top: 24px;
  border-left: 6px solid #c3a35f;
  border-top: 6px solid #c3a35f;
  transform: rotate(45deg);
}


/* ===== FINAL LOGIN TUNING ===== */

.login-brand {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.login-roof-logo {
  width: 96px;
  height: 54px;
  flex: 0 0 54px;
  transform: scale(1.12);
}

.login-brand span {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 1.4px;
  color: #1b2f49;
}

.login-brand strong {
  color: #1b2f49;
  font-weight: 500;
}

.login-shell h1 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 34px;
}

.login-shell {
  padding-top: 36px;
}


/* ===== LOGIN TITLE TWO LINES ===== */
.login-title-brand {
  white-space: nowrap;
}


/* ===== HOME PAGE REDESIGN ===== */

.home-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    linear-gradient(rgba(20, 45, 75, 0.10), rgba(20, 45, 75, 0.10)),
    url('/public/images/login-background.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.home-shell {
  width: min(90%, 760px);
  padding: 42px 52px 34px;
  box-sizing: border-box;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(20, 45, 80, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-align: center;

  flex-grow: 0;
  min-height: auto;
  height: auto;
}

.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.home-brand-name {
  font-size: 18px;
  letter-spacing: 1.4px;
  font-weight: 500;
  color: #1b2f49;
}

.home-shell h1 {
  margin: 12px 0 8px;
  font-size: 38px;
  color: #163a63;
}

.home-subtitle {
  margin: 0 0 32px;
  font-size: 18px;
  color: #5f6f80;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  width: 100%;
}

.home-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 150px;
  padding: 20px;

  text-decoration: none;
  border-radius: 18px;

  background: #f7faff;
  border: 1px solid #d7e1ec;

  box-shadow: 0 8px 24px rgba(20, 45, 80, 0.08);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.home-action-card:hover {
  transform: translateY(-4px);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(20, 45, 80, 0.15);
}

.home-action-icon {
  font-size: 34px;
  margin-bottom: 12px;
}

.home-action-title {
  font-size: 19px;
  font-weight: 700;
  color: #163a63;
  margin-bottom: 6px;
}

.home-action-text {
  font-size: 14px;
  color: #6a7887;
}

.home-signature {
  margin: 30px 0 0;
  font-size: 15px;
  color: #657484;
  font-style: italic;
}

@media (max-width: 700px) {

  .home-shell {
    padding: 34px 22px 28px;
  }

  .home-shell h1 {
    font-size: 30px;
  }

  .home-actions {
    grid-template-columns: 1fr;
  }

}


/* ===== HOME CARDS FINAL POLISH ===== */

.home-action-card,
.home-action-card:link,
.home-action-card:visited,
.home-action-card:focus,
.home-action-card:active {
  border: 1px solid #d7e1ec;
  outline: none;
  color: inherit;
}

.home-action-card:hover {
  border-color: #c3a35f;
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(20, 45, 80, 0.16);
}


/* ===== PLANNING + MOVEMENTS FONT SIZE ===== */

.planning-toolbar,
.planning-toolbar button,
.planning-toolbar a,
.planning-toolbar label {
  font-size: 16px;
}

.planning-toolbar input {
  font-size: 16px;
}

.planning-grid thead th {
  font-size: 14px;
}

.planning-grid .apartment {
  font-size: 14px;
}

.booking {
  font-size: 13px;
  line-height: 1.25;
}

/* Arrivées / Départs */
.movement-table th {
  font-size: 15px;
}

.movement-table td {
  font-size: 15px;
}

.planning-page h2 {
  font-size: 22px;
}


/* ===== MOBILE VERSION - PLANNING + MOVEMENTS ===== */

@media (max-width: 768px) {

  .planning-page {
    padding: 12px;
  }

  .planning-page h1 {
    font-size: 30px;
    line-height: 1.1;
    margin-top: 8px;
    margin-bottom: 20px;
  }

  .planning-page h2 {
    font-size: 20px;
    margin-top: 22px;
  }

  .planning-toolbar {
    gap: 8px;
    align-items: stretch;
  }

  .planning-toolbar input {
    width: 100%;
    font-size: 16px;
    min-height: 44px;
    box-sizing: border-box;
  }

  .planning-toolbar button,
  .planning-toolbar a {
    font-size: 15px;
    min-height: 42px;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  .planning-wrap {
    width: 100%;
    max-height: 72vh;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }

  .planning-grid thead th {
    font-size: 13px;
  }

  .planning-grid .apartment {
    font-size: 13px;
    min-width: 90px;
  }

  .planning-grid th,
  .planning-grid td {
    height: 48px;
    min-width: 70px;
  }

  .booking {
    font-size: 12px;
    padding: 4px 6px;
    min-height: 40px;
  }

  .movement-table {
    min-width: 760px;
  }

  .movement-table th,
  .movement-table td {
    font-size: 14px;
    padding: 9px 10px;
    white-space: nowrap;
  }

}

@media (max-width: 480px) {

  .planning-page {
    padding: 8px;
  }

  .planning-page h1 {
    font-size: 26px;
  }

  .planning-toolbar {
    flex-direction: column;
  }

  .planning-toolbar input,
  .planning-toolbar button,
  .planning-toolbar a {
    width: 100%;
  }

  .planning-wrap {
    border-radius: 8px;
  }

}


.booking-overbooking {
  animation: overbooking-alert 1.2s ease-in-out infinite;
}

@keyframes overbooking-alert {
  0%, 100% {
    background-color: #dc2626;
    box-shadow: 0 0 0 rgba(220, 38, 38, 0);
  }
  50% {
    background-color: #f87171;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .booking-overbooking {
    animation: none;
  }
}

/* ===== MOBILE APP V1 - iPhone stable layout ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f4f7fb;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: rgba(22, 58, 99, 0.12);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select {
  touch-action: manipulation;
}

button,
.planning-toolbar a,
.home-action-card {
  min-height: 44px;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.login-page,
.home-page {
  min-height: 100svh;
  min-height: 100dvh;
  padding:
    max(14px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.login-shell,
.home-shell {
  max-width: 100%;
}

.planning-page,
.reservations-page {
  min-height: 100svh;
  min-height: 100dvh;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-right: max(18px, env(safe-area-inset-right));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
}

.planning-toolbar button,
.planning-toolbar a {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  color: #163a63;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.planning-toolbar button:active,
.planning-toolbar a:active,
.home-action-card:active {
  transform: scale(0.985);
}

.planning-wrap {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.reservation-modal-card {
  overscroll-behavior: contain;
}

.reservations-page #reservation-search {
  width: min(100%, 560px);
  min-height: 46px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
}

@media (max-width: 768px) {
  .login-page,
  .home-page {
    align-items: center;
    background-attachment: scroll;
    background-position: center center;
  }

  .login-shell,
  .home-shell {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(20, 45, 80, 0.2);
  }

  .login-shell {
    max-height: calc(100dvh - max(28px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)));
    overflow-y: auto;
    padding: 26px 20px 22px;
  }

  .login-brand {
    margin-bottom: 14px;
  }

  .login-roof-logo {
    transform: scale(0.94);
  }

  .login-brand span {
    font-size: 15px;
    letter-spacing: 0.8px;
  }

  .login-shell h1 {
    margin-bottom: 22px;
    font-size: clamp(22px, 6.5vw, 28px);
  }

  .login-title-brand {
    white-space: normal;
  }

  .login-form label {
    margin-top: 14px;
    font-size: 16px;
  }

  .login-form input,
  .login-form button {
    min-height: 52px;
    height: 52px;
    font-size: 16px;
  }

  .login-form button {
    margin-top: 22px;
  }

  .login-signature {
    margin-top: 22px;
    font-size: 13px;
  }

  .home-shell {
    max-height: calc(100dvh - max(28px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)));
    overflow-y: auto;
    padding: 26px 18px 22px;
  }

  .home-shell h1 {
    margin-top: 6px;
    font-size: 28px;
  }

  .home-subtitle {
    margin-bottom: 20px;
    font-size: 16px;
  }

  .home-actions {
    gap: 12px;
  }

  .home-action-card {
    min-height: 112px;
    padding: 16px;
  }

  .home-action-icon {
    margin-bottom: 6px;
    font-size: 30px;
  }

  .home-signature {
    margin-top: 20px;
    font-size: 13px;
  }

  .planning-page,
  .reservations-page {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .planning-page h1,
  .reservations-page h1 {
    font-size: clamp(25px, 7vw, 30px);
    line-height: 1.08;
  }

  .planning-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .planning-toolbar > label,
  .planning-toolbar > input,
  .planning-toolbar > #planning-info {
    grid-column: 1 / -1;
  }

  .planning-toolbar label {
    display: grid;
    gap: 5px;
    color: #334155;
    font-weight: 700;
  }

  .planning-toolbar input,
  .planning-toolbar select,
  .planning-toolbar button,
  .planning-toolbar a {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    font-size: 16px;
  }

  .planning-wrap {
    max-width: 100%;
    max-height: 68dvh;
    -webkit-overflow-scrolling: touch;
  }

  .planning-grid .apartment {
    box-shadow: 3px 0 5px rgba(15, 23, 42, 0.08);
  }

  .reservation-modal {
    align-items: flex-end;
    padding: max(8px, env(safe-area-inset-top)) 0 0;
  }

  .reservation-modal-card {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    padding: 18px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-radius: 20px 20px 0 0;
  }

  .reservation-modal-header {
    position: sticky;
    top: -18px;
    z-index: 3;
    margin: -18px -16px 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #e2e8f0;
  }

  #reservation-modal-close {
    width: 44px;
    height: 44px;
  }

  #reservation-edit-form input,
  #reservation-edit-form select {
    min-height: 46px;
    font-size: 16px;
  }

  .reservation-form-row,
  .reservation-form-row-3,
  .payment-options-row,
  .parking-options-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reservation-modal-actions {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 8px;
  }

  .planning-appearance-inline {
    order: 4;
    width: 100%;
    margin: 0;
    justify-content: center;
  }

  .reservation-modal-actions > button {
    flex: 1 1 calc(50% - 8px);
    min-height: 46px;
  }
}

@media (max-width: 640px) {
  .movement-table,
  .reservations-page table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .movement-table thead,
  .reservations-page table > tbody > tr:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .movement-table tbody,
  .reservations-page table > tbody {
    display: grid;
    gap: 12px;
  }

  .movement-table tr,
  .reservations-page table tr {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  }

  .movement-table td,
  .reservations-page table td {
    display: grid;
    grid-template-columns: minmax(105px, 40%) 1fr;
    gap: 10px;
    align-items: start;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .movement-table td:last-child,
  .reservations-page table td:last-child {
    border-bottom: 0;
  }

  .movement-table td::before,
  .reservations-page table td::before {
    content: attr(data-label);
    color: #64748b;
    font-weight: 700;
    text-align: left;
  }

  .planning-page .planning-wrap:has(.movement-table) {
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
}

@media (max-width: 380px) {
  .planning-toolbar {
    grid-template-columns: 1fr;
  }

  .planning-toolbar > * {
    grid-column: 1;
  }

  .login-shell,
  .home-shell {
    border-radius: 16px;
  }
}

/* ===== MOVEMENTS V1.1 - one compact reservation per line ===== */

.movement-table {
  table-layout: fixed;
}

.movement-table th:nth-child(1),
.movement-table td:nth-child(1) {
  width: 18%;
}

.movement-table th:nth-child(2),
.movement-table td:nth-child(2) {
  width: 18%;
}

.movement-table th:nth-child(3),
.movement-table td:nth-child(3) {
  width: 36%;
}

.movement-table th:nth-child(4),
.movement-table td:nth-child(4) {
  width: 28%;
}

@media (max-width: 640px) {
  .planning-page .planning-wrap:has(.movement-table) {
    overflow-x: auto;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #fff;
  }

  .movement-table {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    background: #fff;
    font-size: 13px;
  }

  .movement-table thead {
    position: static;
    display: table-header-group;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }

  .movement-table tbody {
    display: table-row-group;
  }

  .movement-table tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .movement-table th,
  .movement-table td {
    display: table-cell;
    padding: 9px 7px;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .movement-table th {
    font-size: 12px;
    line-height: 1.15;
  }

  .movement-table td {
    font-size: 13px;
    line-height: 1.2;
  }

  .movement-table td::before {
    content: none;
  }
}

@media (display-mode: standalone) {
  body {
    user-select: none;
    -webkit-user-select: none;
  }

  input,
  textarea,
  select {
    user-select: text;
    -webkit-user-select: text;
  }
}


/* Formulaire réservation - présentation 2026-09-22 */
.reservation-modal-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}

.planning-appearance-inline{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:8px;
  margin-right:0;
}

.planning-appearance-inline input[type="color"]{
  flex:0 0 44px;
  width:44px;
  height:44px;
}

.planning-appearance-inline select{
  flex:0 0 82px;
  width:82px;
  height:44px;
}

.reservation-modal-actions #reservation-delete,
.reservation-modal-actions #reservation-cancel,
.reservation-modal-actions #reservation-save{
  box-sizing:border-box;
  flex:0 0 150px;
  width:150px;
  min-height:52px;
  margin:0;
  padding:10px 14px;
  color:#fff;
  font-weight:700;
  text-align:center;
}

#reservation-delete{
  background:#dc2626;
  border-color:#dc2626;
}

#reservation-cancel{
  background:#16a34a;
  border-color:#16a34a;
}

#reservation-cancel:hover{
  background:#15803d;
}

#reservation-save{
  background:#2563eb;
  border-color:#2563eb;
}

@media (max-width:700px){
  .reservation-modal-actions{
    justify-content:center;
  }

  .planning-appearance-inline{
    flex:1 0 100%;
    justify-content:center;
  }

  .reservation-modal-actions #reservation-delete,
  .reservation-modal-actions #reservation-cancel,
  .reservation-modal-actions #reservation-save{
    flex:1 1 120px;
    width:auto;
    min-width:0;
  }
}


/* Couleurs des boutons du planning - 2026-09-22 */
#today-button{
  background:#fbbf24;
  color:#422006;
  border-color:#f59e0b;
}

#today-button:hover{
  background:#f59e0b;
}

#overbooking-toggle{
  background:#dc2626;
  color:#ffffff;
  border-color:#dc2626;
}

#overbooking-toggle:hover{
  background:#b91c1c;
}

#movements-button{
  background:#16a34a;
  color:#ffffff;
  border-color:#16a34a;
}

#movements-button:hover{
  background:#15803d;
}

#new-reservation-button{
  background:#2563eb;
  color:#ffffff;
  border-color:#2563eb;
}

#new-reservation-button:hover{
  background:#1d4ed8;
}

/* ===== SWISSFLATS : FENÊTRE EXPORT ICAL ===== */

#ical-export-modal .reservation-modal-card {
  width: min(94vw, 540px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 75px rgba(15, 35, 50, 0.22);
}

#ical-export-modal .reservation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e8edf0;
}

#ical-export-modal h2 {
  margin: 0;
  color: #183b34;
  font-size: 24px;
  font-weight: 700;
}

#ical-export-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f4;
  color: #42544f;
  font-size: 25px;
  cursor: pointer;
}

#ical-export-modal p {
  color: #667570;
  line-height: 1.6;
}

#ical-export-modal label {
  display: block;
  margin: 22px 0 9px;
  color: #243f36;
  font-weight: 600;
}

#ical-export-apartment {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid #ccdcd4;
  border-radius: 12px;
  background: white;
  color: #203d33;
  font-size: 16px;
}

#ical-export-apartment:focus {
  outline: 2px solid #278565;
  outline-offset: 2px;
}

#ical-export-links {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

#ical-export-links > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e3ebe7;
  border-radius: 15px;
  background: #f8fbf9;
}

#ical-export-links strong {
  color: #24463b;
  font-size: 16px;
}

#ical-export-links button {
  padding: 11px 17px;
  border: 0;
  border-radius: 10px;
  background: #23835e;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#ical-export-links button:hover {
  background: #176849;
}

#ical-export-links span {
  color: #23835e;
  font-size: 13px;
}

#ical-export-modal .reservation-modal-actions {
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid #e8edf0;
}

#ical-export-cancel {
  padding: 12px 22px;
  border: 1px solid #d5e0da;
  border-radius: 10px;
  background: #f1f5f3;
  color: #29473c;
  cursor: pointer;
}

@media (max-width: 600px) {
  #ical-export-modal .reservation-modal-card {
    width: 94vw;
    padding: 20px;
    border-radius: 17px;
  }

  #ical-export-modal h2 {
    font-size: 20px;
  }

  #ical-export-links > div {
    align-items: stretch;
  }
}


/* ===== ICAL : ALIGNEMENT ET SÉLECTEUR ===== */

#ical-export-modal .reservation-modal-card {
  width: min(94vw, 650px);
  box-sizing: border-box;
}

#ical-export-apartment {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  min-height: 56px;
  font-size: 17px;
  padding: 12px 16px;
}

#ical-export-links > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 165px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  box-sizing: border-box;
}

#ical-export-links strong {
  min-width: 0;
}

#ical-export-links button {
  width: 165px;
  min-height: 46px;
  box-sizing: border-box;
  white-space: nowrap;
}

#ical-export-links span {
  grid-column: 1 / -1;
  margin-left: 0 !important;
}

@media (max-width: 600px) {
  #ical-export-links > div {
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 10px;
    padding: 14px;
  }

  #ical-export-links button {
    width: 145px;
    padding: 10px;
  }
}


/* Sélecteur d'appartement iCal */

#ical-export-modal select#ical-export-apartment {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 58px !important;
  min-height: 58px !important;
  padding: 0 18px !important;
  box-sizing: border-box !important;
  border: 2px solid #cbded5 !important;
  border-radius: 12px !important;
  background-color: #ffffff !important;
  color: #203d33 !important;
  font-size: 17px !important;
  cursor: pointer;
}

#ical-export-modal select#ical-export-apartment:focus {
  border-color: #23835e !important;
  outline: 3px solid rgba(35, 131, 94, 0.12);
}


/* Bouton Exporter iCal — bleu ciel */

#ical-export-button {
  background: #38BDF8 !important;
  color: #ffffff !important;
  border: 1px solid #0EA5E9 !important;
  border-radius: 10px !important;
  padding: 12px 20px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

#ical-export-button:hover {
  background: #0284C7 !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

