/* ==========================================================
   HDJ Planner — Thème "Platine Graphite" (gris + bleu design)
   Gris un peu plus foncé + nuances bleues, effet premium moderne
   (fichier complet, prêt à remplacer styles.css)
   ========================================================== */

/* ---------------------------
   Tokens
---------------------------- */
:root{
  /* Base Graphite */
  --bg:#e6e9ef;          /* gris platine plus foncé */
  --bg2:#dfe4ec;         /* nuance froide */
  --card:rgba(255,255,255,.72);
  --card2:rgba(255,255,255,.55);
  --text:#0a1020;
  --muted:#465064;

  /* Blues (nuances) */
  --blue-50:#eef6ff;
  --blue-100:#dbeafe;
  --blue-200:#bfdbfe;
  --blue-300:#93c5fd;
  --blue-400:#60a5fa;
  --blue-500:#3b82f6;
  --blue-600:#2563eb;
  --blue-700:#1d4ed8;
  --blue-800:#1e40af;

  --primary: var(--blue-600);
  --primary2: var(--blue-700);
  --accent: var(--blue-300);

  /* UI */
  --border:rgba(15,23,42,.12);
  --border2:rgba(15,23,42,.08);
  --shadow: 0 22px 70px rgba(15,23,42,.14);
  --shadow2: 0 12px 32px rgba(15,23,42,.10);
  --radius: 20px;

  /* Focus */
  --focus: 0 0 0 4px rgba(37,99,235,.20);
}

/* ---------------------------
   Base
---------------------------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);

  /* Background "designed" */
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(96,165,250,.32), transparent 58%),
    radial-gradient(1100px 520px at 88% -10%, rgba(37,99,235,.16), transparent 58%),
    radial-gradient(950px 520px at 50% 108%, rgba(15,23,42,.08), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg2));

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  line-height: 1.55;
  font-size: 15px;
}

p{margin:0 0 10px; line-height:1.6}
small,.small{font-size:12.5px; line-height:1.35; color:var(--muted)}
.muted{color:var(--muted)}
.spacer{flex:1}
.row{display:flex; gap:10px; align-items:center}

label{
  display:block;
  font-weight: 975;
  font-size: 12.5px;
  letter-spacing: .25px;
  margin: 0 0 6px;
  opacity:.92;
}

.h1{font-size:20px;line-height:1.15;letter-spacing:.2px;font-weight:990;margin:0 0 8px}
.h2{font-size:15px;line-height:1.2;letter-spacing:.18px;font-weight:975;margin:0 0 8px}

::selection{ background: rgba(147,197,253,.45); }

/* ---------------------------
   Layout
---------------------------- */
.wrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
#view{
  flex:1;
  padding:16px;
}

/* ---------------------------
   Topbar — Graphite glass
---------------------------- */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;

  background:
    linear-gradient(180deg, rgba(255,255,255,.52), rgba(255,255,255,.30));
  border-bottom:1px solid rgba(15,23,42,.12);
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(18px);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:990;
  letter-spacing:.2px;
  font-size:14px;
}
.brand .dot{
  width:12px;height:12px;border-radius:999px;
  background: linear-gradient(180deg, var(--blue-300), var(--blue-800));
  box-shadow: 0 0 0 4px rgba(147,197,253,.24), 0 12px 24px rgba(29,78,216,.14);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,.36);
  border:1px solid rgba(15,23,42,.12);
  color: var(--text);
  border-radius:999px;
  padding:6px 10px;
  font-size:13px;
  font-weight:975;
  backdrop-filter: blur(10px);
}

/* Navigation */
.nav{display:flex;gap:8px;flex-wrap:wrap}
.nav button{
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.30);
  color: var(--text);
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:975;
  letter-spacing:.1px;
  transition: transform .06s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  backdrop-filter: blur(12px);
}
.nav button:hover{
  background: rgba(255,255,255,.46);
  border-color: rgba(15,23,42,.16);
  box-shadow: 0 16px 34px rgba(15,23,42,.10);
}
.nav button:active{transform: translateY(1px)}
.nav button.active{
  background: linear-gradient(180deg, rgba(191,219,254,.55), rgba(255,255,255,.58));
  border-color: rgba(37,99,235,.28);
  box-shadow: 0 18px 38px rgba(29,78,216,.12);
}

/* Sous-onglets */
.subtabs{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.subtab.active{
  border-color: rgba(37,99,235,.30);
  box-shadow:0 0 0 2px rgba(37,99,235,.10) inset;
}

/* ---------------------------
   Cards / Sections
---------------------------- */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,255,255,.52));
  border:1px solid rgba(15,23,42,.12);
  box-shadow: var(--shadow2);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  position:relative;
}
.card::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(135deg, rgba(191,219,254,.55), rgba(255,255,255,0), rgba(37,99,235,.22));
  opacity:.45;
  filter: blur(10px);
  z-index:-1;
}
.section{padding:14px}

.grid{display:grid;gap:12px}
.grid.cols-2{grid-template-columns:1fr 1fr}
.grid.cols-3{grid-template-columns:1fr 1fr 1fr}
@media(max-width:900px){
  .grid.cols-2,.grid.cols-3{grid-template-columns:1fr}
}

/* ---------------------------
   Tables
---------------------------- */
.table, table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.table th,.table td, table th, table td{
  padding:12px 10px;
  text-align:left;
  vertical-align:middle;
}
.table th, table th{
  font-size:11.5px;
  font-weight:975;
  color:var(--muted);
  text-transform: uppercase;
  letter-spacing: .45px;
  padding-bottom:8px;
}
.table tr, table tr{
  background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.54));
  border:1px solid rgba(15,23,42,.10);
  box-shadow: 0 12px 28px rgba(15,23,42,0.09);
  border-radius: 18px;
}
.table tr:hover td, table tr:hover td{
  background: rgba(191,219,254,.18);
}
th.col-hour, td.col-hour{white-space:nowrap}
th.col-type, td.col-type, th.col-state, td.col-state{text-align:center}
th.col-actions, td.col-actions{text-align:right}

.td-hour{font-weight:975;font-variant-numeric:tabular-nums}
.event-title{font-weight:975}
.actions button{opacity:.65;transition:opacity .15s ease}
tr:hover .actions button{opacity:1}

/* ---------------------------
   Inputs & Buttons
---------------------------- */
.btn{
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.40);
  padding:10px 12px;
  border-radius:18px;
  cursor:pointer;
  font-weight:975;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  backdrop-filter: blur(14px);
}
.btn:hover{
  border-color: rgba(37,99,235,.24);
  box-shadow: 0 18px 38px rgba(15,23,42,.12);
  background: rgba(255,255,255,.56);
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(180deg, rgba(147,197,253,.92), rgba(37,99,235,.72));
  border-color: rgba(37,99,235,.30);
  color:#071021;
}
.btn.primary:hover{ box-shadow: 0 22px 44px rgba(29,78,216,.16); }
.btn.small{padding:7px 9px;font-size:13px}

.input,.select,.textarea{
  width:100%;
  border:1px solid rgba(15,23,42,.12);
  padding:10px 12px;
  border-radius:18px;
  background: rgba(255,255,255,.46);
  outline:none;
  transition: box-shadow .12s ease, border-color .12s ease, background .12s ease;
  font-size:14.5px;
  line-height:1.35;
  backdrop-filter: blur(14px);
}
.input::placeholder,.textarea::placeholder{color: rgba(70,80,100,.75)}
.input:focus,.select:focus,.textarea:focus{
  border-color: rgba(37,99,235,.34);
  box-shadow: var(--focus);
  background: rgba(255,255,255,.66);
}
.textarea{min-height:90px}

.badge{
  display:inline-flex;align-items:center;gap:6px;
  border-radius:999px;padding:6px 10px;
  font-weight:975;font-size:12px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.34);
  color: var(--primary2);
  backdrop-filter: blur(14px);
}

/* ---------------------------
   Modal
---------------------------- */
.modal{
  position:fixed;inset:0;
  background: rgba(15,23,42,.48);
  display:none;align-items:center;justify-content:center;
  padding:18px;z-index:1000;
  backdrop-filter: blur(4px);
}
.modal.open{display:flex}
.modal .panel{
  max-height: calc(100vh - 36px);
  display:flex;
  flex-direction:column;

  width:min(860px,100%);
  background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.52));
  border-radius:24px;
  overflow:hidden;
  border:1px solid rgba(37,99,235,.18);
  box-shadow: 0 30px 78px rgba(15,23,42,.24);
  backdrop-filter: blur(18px);
}
.modal .panel .head,
.modal .panel .foot{
  padding:12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(191,219,254,.14));
  border-bottom:1px solid rgba(15,23,42,.08);
}
.modal .panel .foot{border-top:1px solid rgba(15,23,42,.08);border-bottom:none}
.modal .panel .body{padding:14px; overflow:auto; flex:1 1 auto}

/* Icon buttons */
.iconbtn{
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.44);
  border-radius:16px;
  padding:6px 8px;
  cursor:pointer;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  backdrop-filter: blur(14px);
}
.iconbtn:hover{
  border-color: rgba(37,99,235,.22);
  box-shadow: 0 18px 38px rgba(15,23,42,.12);
  background: rgba(255,255,255,.60);
}
.iconbtn:active{transform: translateY(1px)}
.iconbtn.iconbtn-sm{
  width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;
  padding:0;border-radius:16px;font-size:14px;line-height:1;
}

/* Links */
a{color:var(--primary2);text-decoration:none;font-weight:975}
a:hover{text-decoration:underline}

/* ---------------------------
   Agenda Board
---------------------------- */
.agenda-board{
  padding: 10px 2px 14px;
  display:grid;
  grid-template-columns: repeat(var(--agenda-cols, 7), minmax(0, 1fr));
  gap:12px;
  overflow-x:hidden;
  overflow-y:visible;
  direction:ltr;
}
.daycol{
  min-width:0;
  border:1px solid rgba(15,23,42,.12);
  border-radius:24px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.42));
  box-shadow: 0 22px 55px rgba(15,23,42,.12);
  backdrop-filter: blur(16px);
  position:relative;
}
.daycol::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:26px;
  background: linear-gradient(135deg, rgba(191,219,254,.45), rgba(255,255,255,0), rgba(37,99,235,.22));
  opacity:.48;
  filter: blur(10px);
  z-index:-1;
}
.daycol-head{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px;border-bottom:1px solid rgba(15,23,42,.07)}
.daycol-date{font-weight:990;letter-spacing:.2px}
.daycol-count{
  min-width:34px;height:28px;display:flex;align-items:center;justify-content:center;
  border-radius:999px;font-weight:990;
  border:1px solid rgba(37,99,235,.22);
  background: rgba(191,219,254,.22);
  color: var(--primary2);
}
.daycol-body{padding:10px 12px 12px;min-height:140px}

.eventcard{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.62);
  border-radius:20px;
  padding:10px 10px 12px;
  margin-bottom:10px;
  backdrop-filter: blur(14px);
}
.eventcard:last-child{margin-bottom:0}
.eventcard-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.eventcard-time{font-weight:990;white-space:nowrap;font-variant-numeric:tabular-nums}
.eventcard-title{
  font-weight:990;line-height:1.2;flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.eventcard-foot{margin-top:10px;display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.eventcard-badges{display:flex;gap:8px;flex-wrap:wrap}
.eventcard-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

.hr{height:1px;background:rgba(15,23,42,.09);margin:10px 0;border-radius:999px}

/* ---------------------------
   Month
---------------------------- */
.month-wrap{direction:ltr}
.month-head{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;margin-bottom:10px}
.month-head-cell{text-align:center;font-size:12px;font-weight:990;letter-spacing:.35px;color:var(--muted);text-transform:uppercase}
.month-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}
.month-cell{
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.50);
  border-radius: 20px;
  padding:10px;
  min-height: 120px;
  backdrop-filter: blur(16px);
}
.month-cell.off{opacity:.55;background:rgba(255,255,255,.38)}
.month-cell.today{
  border-color: rgba(37,99,235,.26);
  box-shadow: 0 22px 55px rgba(29,78,216,.12);
}
.month-cell-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.month-daynum{font-weight:990}
.month-count{
  min-width:22px;height:22px;border-radius:999px;display:flex;align-items:center;justify-content:center;
  background: rgba(191,219,254,.22);
  border:1px solid rgba(37,99,235,.18);
  font-weight:990;color: var(--primary2);font-size:12px;
}
.month-items{display:flex;flex-direction:column;gap:6px}
.month-item{
  display:flex;align-items:center;gap:8px;width:100%;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(191,219,254,.16);
  border-radius: 16px;
  padding:6px 8px;
  cursor:pointer;
  font-weight:975;
  text-align:left;
}
.month-item:hover{background: rgba(191,219,254,.20)}
.month-item-time{font-variant-numeric:tabular-nums;opacity:.88}
.month-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------------------------
   Notes
---------------------------- */
.notes-layout{display:grid;grid-template-columns:320px 1fr;gap:14px;align-items:stretch}
.notes-side{
  background: rgba(255,255,255,.44);
  border:1px solid rgba(15,23,42,.12);
  border-radius:24px;
  padding:12px;
  box-shadow: 0 22px 55px rgba(15,23,42,.12);
  backdrop-filter: blur(16px);
}
.notes-side-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.notes-side-divider{height:1px;background:rgba(15,23,42,0.09);margin:12px 0;border-radius:999px}

.notes-notebooks,.notes-notes{
  display:flex;flex-direction:column;gap:8px;
  max-height:320px;overflow:auto;padding-right:4px;
}
.notes-side .item{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 10px;
  border:1px solid rgba(15,23,42,0.10);
  border-radius:18px;
  cursor:pointer;
  background: rgba(255,255,255,.50);
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  backdrop-filter: blur(16px);
}
.notes-side .item:hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(15,23,42,.12);
  border-color: rgba(37,99,235,.16);
  background: rgba(255,255,255,.62);
}
.notes-side .item.active{
  outline:2px solid rgba(37,99,235,0.16);
  background: linear-gradient(180deg, rgba(191,219,254,.28), rgba(255,255,255,.52));
}
.notes-side .item .name{
  font-weight:975;font-size:13px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;
}
.row-actions{display:flex;gap:6px}

.notes-editor{
  background: rgba(255,255,255,.44);
  border:1px solid rgba(15,23,42,.12);
  border-radius:24px;
  padding:12px;
  display:flex;flex-direction:column;
  min-height:520px;
  box-shadow: 0 22px 55px rgba(15,23,42,.12);
  backdrop-filter: blur(16px);
}
.notes-toolbar{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;
  padding:10px;
  border:1px solid rgba(15,23,42,0.12);
  border-radius:18px;
  background: rgba(255,255,255,.48);
  backdrop-filter: blur(16px);
}
.notes-toolbar .tool{
  border:1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,.60);
  border-radius:16px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:990;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.notes-toolbar .tool:hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(15,23,42,.12);
  border-color: rgba(37,99,235,.16);
}
.notes-toolbar .sep{width:1px;height:26px;background:rgba(15,23,42,0.16);margin:0 2px}
.notes-toolbar .colors{display:flex;gap:6px;align-items:center}
.notes-toolbar .color{width:26px;height:26px;border-radius:14px;border:1px solid rgba(15,23,42,0.18);cursor:pointer}

.notes-meta{display:flex;align-items:center;gap:12px;margin-top:10px}
.notes-meta .input{flex:1}
.notes-status{font-size:12px;font-weight:990;color:var(--muted);white-space:nowrap}

.notes-area{
  margin-top:10px;flex:1;
  padding:14px;
  border:1px solid rgba(15,23,42,0.12);
  border-radius:18px;
  background: rgba(255,255,255,.56);
  overflow:auto;
  backdrop-filter: blur(16px);
}
.notes-area:focus{outline:2px solid rgba(37,99,235,0.14)}

@media (max-width: 980px){
  .notes-layout{grid-template-columns:1fr}
  .notes-notebooks,.notes-notes{max-height:240px}
}

/* ---------------------------
   Scrollbars
---------------------------- */
::-webkit-scrollbar{height:10px;width:10px}
::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.18);
  border-radius: 999px;
  border:3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover{
  background: rgba(15,23,42,.26);
  border:3px solid transparent;
  background-clip: content-box;
}

/* Logo topbar */
.brand-logo{width:34px;height:34px;border-radius:12px;object-fit:cover;box-shadow:0 10px 22px rgba(29,78,216,.12), 0 0 0 4px rgba(191,219,254,.20);}


/* ==========================================================
   Range Picker (Accueil + Plans) — compact + responsive
   ========================================================== */
.range-picker{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
  justify-content:flex-start;
}
.range-picker > div{
  min-width: 180px;
  flex: 0 1 220px;
}
.range-picker label{
  margin-bottom:6px;
}
.range-picker .btn.small{
  height:44px;
  padding:10px 14px;
  border-radius:999px;
}

/* In cards, keep it tight */
.card .range-picker{
  padding-top:4px;
}

/* Responsive: stack nicely */
@media (max-width: 900px){
  .range-picker{
    gap:10px;
  }
  .range-picker > div{
    flex: 1 1 220px;
    min-width: 220px;
  }
}
@media (max-width: 520px){
  .range-picker{
    flex-direction:column;
    align-items:stretch;
  }
  .range-picker > div{
    min-width: 100%;
    flex: 1 1 auto;
  }
  .range-picker .btn.small{
    width:100%;
  }
}


/* ==========================================================
   Range Picker — layout fix (force 3 blocs alignés)
   ========================================================== */
.range-picker{
  width:100%;
  margin-top:12px;
  padding:10px 12px;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.42);
  backdrop-filter: blur(14px);
}
.range-picker > div{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.range-picker > div:last-child{
  min-width:auto;
  flex: 0 0 auto;
}
.range-picker .btn.small{
  white-space:nowrap;
}

/* When inside a "row wrap" container, prevent drifting to the right */
.row


/* Sous-étapes : tableau d'analyse */
.step-analysis-wrap{ margin-top:10px; }
.step-analysis{ width:100%; border-collapse:collapse; }
.step-analysis th, .step-analysis td{ border:1px solid var(--border); padding:8px; vertical-align:top; }
.step-analysis th{ background:rgba(0,0,0,.03); text-align:left; font-weight:800; }
.btn.link{ background:transparent; border:none; color:inherit; cursor:pointer; }
.btn.link:hover{ text-decoration:underline; }
