:root{
    --ink:#FFFFFF;
    --ink-soft:#C3CCDD;
    --gold:#FCA311;
    --gold-dark:#FFC262;
    --on-gold:#0B1220;
    --bg:#0A1420;
    --surface:#101B2C;
    --muted:#93A0B8;
    --line: rgba(255,255,255,0.12);
    --danger:#F87171;
    --success:#4ADE80;
    --radius:16px;
    --shadow: 0 4px 18px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.55);
  }
  *{box-sizing:border-box;}
  html{ color-scheme: dark; }
  html, body{ overflow-x:hidden; }
  body{
    margin:0;
    font-family:'Manrope', sans-serif;
    background:var(--bg);
    color:var(--ink);
    -webkit-font-smoothing:antialiased;
    position:relative;
  }
  a{color:inherit;}
  h1,h2,h3{margin:0;}

  /* -------- Vagues animées en arrière-plan -------- */
  .wave-bg{
    position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none;
  }
  .wave{
    position:absolute; left:0; bottom:0; width:200%; height:26vh; min-height:180px;
  }
  .wave1{ animation:waveMove 22s linear infinite; opacity:0.55; }
  .wave2{ bottom:-2vh; animation:waveMove 34s linear infinite reverse; opacity:0.35; }
  .wave3{ bottom:-4vh; animation:waveMove 46s linear infinite; opacity:0.22; }
  @keyframes waveMove{
    from{ transform:translateX(0); }
    to{ transform:translateX(-50%); }
  }

  header{
    background:rgba(10,20,32,0.85); backdrop-filter:blur(10px); border-bottom:1px solid var(--line);
    position:sticky; top:0; z-index:20;
  }
  .header-inner{
    max-width:1100px; margin:0 auto; padding:14px 24px;
    display:flex; align-items:center; gap:14px;
  }
  .logo{display:flex; align-items:center; gap:14px;}
  .logo-mark{
    width:64px; height:64px; border-radius:50%; object-fit:cover; display:block;
    box-shadow:0 0 0 2px rgba(252,163,17,0.35), var(--shadow);
  }
  .logo-text{font-weight:800; font-size:20px; letter-spacing:-0.01em; white-space:nowrap;}
  nav{margin-left:auto; display:flex; gap:22px; align-items:center;}
  nav a{text-decoration:none; font-size:14px; font-weight:500; color:var(--ink-soft);}
  nav a:hover{color:var(--ink);}
  #admin-toggle{
    background:var(--gold); color:var(--on-gold); border:none; border-radius:10px;
    padding:9px 16px; font-size:13px; font-weight:800; cursor:pointer; font-family:inherit;
  }
  #admin-toggle:hover{background:var(--gold-dark);}

  .hero{max-width:1100px; margin:0 auto; padding:56px 24px 8px;}
  .hero-badge{
    display:inline-block; background:rgba(252,163,17,0.14); color:var(--gold-dark);
    font-size:12px; font-weight:700; padding:6px 14px; border-radius:999px; margin-bottom:18px;
  }
  h1.hero-title{
    font-size:clamp(32px,4.4vw,48px); font-weight:800; letter-spacing:-0.02em;
    line-height:1.08; margin-bottom:14px; max-width:680px;
  }
  .hero-sub{font-size:16px; line-height:1.6; color:var(--muted); max-width:560px;}

  #admin-panel{max-width:1100px; margin:24px auto 0; padding:0 24px; display:none;}
  #admin-panel.open{display:block;}
  .admin-inner{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:28px 32px; box-shadow:var(--shadow);}
  .admin-note{font-size:13px; color:var(--muted); margin-bottom:18px; line-height:1.5;}
  .pending-item{
    border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:10px;
    display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  }
  .pending-info{font-size:13px; line-height:1.5;}
  .pending-actions{display:flex; gap:8px;}
  .pending-actions button{
    border-radius:999px; padding:7px 14px; font-size:12px; cursor:pointer; font-family:inherit;
    border:1px solid var(--line); font-weight:700;
  }
  .btn-accept{background:var(--success); color:#fff; border-color:var(--success) !important;}
  .btn-reject{background:transparent; color:var(--danger); border-color:var(--danger) !important;}

  .dash-table{width:100%; border-collapse:collapse; font-size:13px;}
  .dash-table th{
    text-align:left; padding:9px 10px; color:var(--muted); font-weight:700; font-size:11px;
    text-transform:uppercase; letter-spacing:0.03em; border-bottom:1px solid var(--line);
  }
  .dash-table td{padding:10px; border-bottom:1px solid var(--line); vertical-align:top;}
  .dash-table tr:last-child td{border-bottom:none;}
  .status-pill{
    display:inline-block; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:700;
  }
  .status-confirme{background:rgba(74,222,128,0.15); color:var(--success);}
  .status-en_attente{background:rgba(252,163,17,0.16); color:var(--gold-dark);}
  .status-refuse{background:rgba(248,113,113,0.15); color:var(--danger);}
  .dash-filters{display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap;}
  .dash-filter-btn{
    background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:7px 14px;
    font-size:12px; font-weight:700; cursor:pointer; font-family:inherit; color:var(--ink-soft);
  }
  .dash-filter-btn.active{background:var(--gold); color:var(--on-gold); border-color:var(--gold);}

  main{max-width:1100px; margin:0 auto; padding:32px 24px 80px;}

  #index-title{font-size:20px; font-weight:800; margin-bottom:16px; letter-spacing:-0.01em;}
  #apartment-list{
    list-style:none; margin:0 0 40px; padding:0;
    display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:14px;
  }
  .index-item{
    text-align:left; background:var(--surface); border:1px solid var(--line);
    border-radius:var(--radius); padding:0; cursor:pointer; font-family:inherit; overflow:hidden;
    transition:box-shadow .18s, transform .18s; box-shadow:var(--shadow);
  }
  .index-item:hover{box-shadow:var(--shadow-lg); transform:translateY(-2px);}
  .index-item.active{outline:2px solid var(--gold); outline-offset:-2px;}
  .index-banner{height:74px; background:linear-gradient(135deg, var(--g1), var(--g2)); background-size:cover; background-position:center;}
  .index-body{padding:14px 16px 16px;}
  .index-ref{font-size:11px; font-weight:700; color:var(--gold-dark); letter-spacing:0.03em;}
  .index-name{font-weight:800; font-size:15px; margin:2px 0 4px; letter-spacing:-0.01em;}
  .index-meta{font-size:12.5px; color:var(--muted);}
  .index-badge{font-size:11px; margin-top:8px; color:var(--ink-soft); font-weight:600;}

  #fiche{background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:36px 40px; box-shadow:var(--shadow);}
  .carousel-viewport{
    position:relative; width:calc(100% + 80px); margin:-36px -40px 24px; height:440px;
    border-radius:20px 20px 0 0; overflow:hidden; background:#0D1826;
  }
  .carousel-img{width:100%; height:100%; object-fit:contain; display:block;}
  .carousel-arrow{
    position:absolute; top:50%; transform:translateY(-50%); background:rgba(10,20,32,0.55); color:#fff;
    border:none; width:46px; height:46px; border-radius:50%; font-size:24px; cursor:pointer;
    display:flex; align-items:center; justify-content:center; backdrop-filter:blur(4px); z-index:2;
    transition:background .15s;
  }
  .carousel-arrow:hover{background:rgba(10,20,32,0.85);}
  .carousel-prev{left:16px;}
  .carousel-next{right:16px;}
  .carousel-dots{position:absolute; bottom:16px; left:50%; transform:translateX(-50%); display:flex; gap:7px; z-index:2;}
  .carousel-dot{width:9px; height:9px; border-radius:50%; background:rgba(255,255,255,0.45); cursor:pointer; border:none; padding:0;}
  .carousel-dot.active{background:#fff;}
  .carousel-count{
    position:absolute; top:16px; right:16px; background:rgba(10,20,32,0.6); color:#fff; font-size:12px;
    font-weight:700; padding:5px 11px; border-radius:999px; z-index:2; backdrop-filter:blur(4px);
  }
  .fiche-banner{height:0;}
  .fiche-ref{font-size:12px; font-weight:700; color:var(--gold-dark); letter-spacing:0.03em;}
  .fiche-title{font-size:30px; font-weight:800; margin:4px 0 2px; letter-spacing:-0.02em;}
  .fiche-loc{font-size:14px; color:var(--muted);}
  .fiche-stats{
    display:grid; grid-template-columns:repeat(4,1fr); gap:12px; padding:20px 0;
    border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin:16px 0 22px;
  }
  .stat-value{font-size:18px; font-weight:800; display:block;}
  .stat-label{font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--muted); display:block; margin-top:2px;}
  .fiche-desc{font-size:15px; line-height:1.65; color:var(--ink-soft); margin-bottom:18px;}
  .equip-list{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px;}
  .equip-pill{
    font-size:12.5px; padding:6px 13px; border-radius:999px; background:var(--bg);
    color:var(--ink-soft); font-weight:600;
  }
  .divider{height:1px; background:var(--line); margin:30px 0 24px;}
  .cal-sync-row{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
  .booking-title{font-size:19px; font-weight:800; margin:0; letter-spacing:-0.01em;}
  #ics-btn{
    background:var(--bg); border:1px solid var(--line); color:var(--ink-soft); border-radius:999px;
    padding:9px 16px; font-size:12.5px; cursor:pointer; font-family:inherit; font-weight:600;
  }
  #ics-btn:hover{border-color:var(--gold); color:var(--gold-dark);}
  .sync-note{font-size:12.5px; color:var(--muted); line-height:1.55; margin:8px 0 18px; max-width:580px;}

  #calendar{border:1px solid var(--line); border-radius:16px; padding:18px 20px; max-width:380px; background:#0D1826;}
  .cal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
  .cal-nav{background:var(--surface); border:1px solid var(--line); border-radius:8px; width:32px; height:32px; cursor:pointer; font-size:17px; font-family:inherit; color:var(--ink);}
  .cal-nav:hover{border-color:var(--gold);}
  .cal-month{font-weight:800; font-size:16px; color:var(--ink);}
  .cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px;}
  .cal-day-label{font-size:12px; text-align:center; color:var(--ink-soft); padding:2px 0; font-weight:800; text-transform:uppercase;}
  .cal-cell{
    aspect-ratio:1; border:1px solid transparent; background:var(--surface); border-radius:8px; font-size:14px; font-weight:700;
    cursor:pointer; font-family:inherit; transition:background .15s, border-color .15s; color:var(--ink);
  }
  .cal-cell:not(:disabled):hover{background:rgba(252,163,17,0.18); border-color:rgba(252,163,17,0.4);}
  .cal-cell:disabled{cursor:not-allowed;}
  .cal-cell.available{background:rgba(74,222,128,0.14); color:#B9F5CC; border-color:rgba(74,222,128,0.25);}
  .cal-cell.available:hover{background:rgba(74,222,128,0.26); border-color:rgba(74,222,128,0.5);}
  .cal-cell.booked{background:rgba(248,113,113,0.22); color:#FFB4B4; font-weight:800;}
  .cal-cell.pending{background:rgba(252,163,17,0.22); color:var(--gold-dark); font-weight:800;}
  .cal-cell.past{color:rgba(237,241,247,0.28); background:transparent;}
  .cal-cell.selected{background:var(--gold); color:var(--on-gold); font-weight:800;}
  .cal-legend{display:flex; gap:16px; margin-top:14px; font-size:12.5px; color:var(--ink-soft); flex-wrap:wrap; font-weight:600;}
  .legend-dot{display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px;}

  form{display:flex; flex-direction:column; gap:14px;}
  .picked-dates{font-size:13.5px; font-weight:700; color:var(--gold-dark); margin:0;}
  .form-row{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
  .form-row-four{display:grid; grid-template-columns:repeat(4,1fr); gap:14px;}
  label{display:flex; flex-direction:column; gap:6px; font-size:12.5px; color:var(--ink-soft); font-weight:600;}
  input, textarea{
    border:1px solid var(--line); border-radius:10px; padding:11px 13px; font-size:14px;
    font-family:inherit; color:#FFFFFF !important; background:var(--surface); transition:border-color .15s;
  }
  input::placeholder, textarea::placeholder{ color:var(--muted); opacity:1; }
  input:focus, textarea:focus{outline:none; border-color:var(--gold);}
  .warn-text{color:var(--danger); font-size:13px; margin:0; font-weight:600;}
  .ok-text{color:var(--success); font-size:13px; margin:4px 0 0; font-weight:600;}
  .form-footer{display:flex; align-items:center; justify-content:space-between; margin-top:6px; gap:12px; flex-wrap:wrap;}
  .total-label{display:block; font-size:12px; color:var(--muted);}
  .total-value{display:block; font-size:22px; font-weight:800;}
  button[type="submit"], .submit-btn{
    background:var(--gold); color:var(--on-gold); border:none; border-radius:999px; padding:13px 26px;
    font-size:14px; font-weight:800; cursor:pointer; font-family:inherit; transition:background .15s, transform .15s;
  }
  button[type="submit"]:not(:disabled):hover, .submit-btn:not(:disabled):hover{background:var(--gold-dark); transform:translateY(-1px);}
  button:disabled{opacity:0.4; cursor:not-allowed;}

  footer{max-width:1100px; margin:0 auto; padding:0 24px 60px;}
  .footer-text{font-size:13px; color:var(--muted);}

  #loading{padding:70px 24px; text-align:center; color:var(--muted); font-size:14px;}
  #load-error{
    max-width:600px; margin:40px auto; padding:24px 28px; background:rgba(248,113,113,0.1);
    border:1px solid rgba(248,113,113,0.35); border-radius:14px; color:#FCA5A5; font-size:14px; line-height:1.6; display:none;
  }
  #load-error strong{display:block; margin-bottom:6px; font-size:15px; color:#FCA5A5;}

  @media (max-width: 720px){
    #fiche{padding:26px 22px;}
    .carousel-viewport{ width:calc(100% + 44px); margin:-26px -22px 20px; height:260px; }
    .fiche-stats{grid-template-columns:repeat(2,1fr);}
    .form-row, .form-row-four{grid-template-columns:1fr;}
  }

/* -------- Ajouts : page admin séparée + sélecteur de photos -------- */
.back-link{
  display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600;
  color:var(--ink-soft); text-decoration:none; margin-bottom:18px;
}
.back-link:hover{color:var(--gold);}
.photo-picker{
  border:1px solid var(--line); border-radius:10px; padding:10px; max-height:220px;
  overflow-y:auto; display:flex; flex-direction:column; gap:2px; background:var(--surface);
}
.photo-picker label{
  flex-direction:row; align-items:center; gap:10px; font-size:13px; color:var(--ink);
  font-weight:500; padding:6px 4px; border-radius:6px; cursor:pointer;
}
.photo-picker label:hover{background:rgba(255,255,255,0.04);}
.photo-picker input[type="checkbox"]{width:16px; height:16px; accent-color:var(--gold); cursor:pointer;}
.photo-picker-empty{font-size:13px; color:var(--muted); padding:6px 4px;}
.login-page{max-width:440px; margin:70px auto; padding:0 24px;}
#admin-card{background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:32px 36px; box-shadow:var(--shadow);}
@media (max-width: 720px){ #admin-card{padding:24px 20px;} }
.btn-edit{background:transparent; color:var(--gold-dark); border-color:var(--gold) !important;}
.status-select{
  border:1px solid var(--line); border-radius:8px; padding:6px 10px; font-size:12px; font-weight:700;
  font-family:inherit; cursor:pointer; background:var(--surface); color:var(--ink);
}
.status-select.status-confirme{color:var(--success); border-color:rgba(74,222,128,0.4);}
.status-select.status-en_attente{color:var(--gold-dark); border-color:rgba(252,163,17,0.4);}
.status-select.status-refuse{color:var(--danger); border-color:rgba(248,113,113,0.4);}
