:root{
  --bg:#0b1220;
  --card:#111b2e;
  --border:#22304a;
  --text:#e7eefc;
  --muted:#9fb0d0;
  --blue:#38bdf8;
  --green:#22c55e;
  --white:#ffffff;
  --danger:#ef4444;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 10%, #13244a 0%, var(--bg) 55%) no-repeat;
  color:var(--text);
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 24px;
}

.app{ width: 100%; max-width: 860px; }

.card{
  background: rgba(17,27,46,0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
  padding: 22px;
}

.header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.title{
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--blue);
}
.subtitle{
  color: var(--muted);
  font-size: 13px;
}

.row{
  display:flex;
  gap: 10px;
  align-items:end;
  flex-wrap: wrap;
}

.selectors{
  margin-top: 8px;
  margin-bottom: 8px;
}

select, input[type="time"], input[type="text"]{
  background: #0b1426;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

select{ min-width: 160px; }
#day{ min-width: 110px; }

.btn{
  border: 0;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #06101f;
  font-weight: 800;
  border-radius: 10px;
  padding: 10px 14px;
  cursor:pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:hover{ opacity: .92; }
.btn:active{ transform: translateY(1px); }

.btn.green{
  background: linear-gradient(135deg, #22c55e, #86efac);
  color:#062012;
}

.btn.red{
  background: linear-gradient(135deg, #ef4444, #fca5a5);
  color:#240508;
  padding: 9px 12px;
}

.date-human{
  margin: 10px 0 2px 0;
  font-size: 18px;
  font-weight: 700;
  color: #dbeafe;
}

.section{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(34,48,74,0.8);
}

.section-title{
  font-weight: 800;
  color: #dbeafe;
  margin-bottom: 8px;
}

textarea{
  width:100%;
  min-height: 120px;
  background: #070f1d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  resize: vertical;
}

.right{ justify-content:flex-end; }

.timeline-wrap{
  margin-top: 10px;
}

.timeline{
  position: relative;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: var(--white); /* temps de rien = blanc */
  overflow: hidden;
}

.segment{
  position:absolute;
  top:0; bottom:0;
  background: var(--green); /* travail = vert */
  border-right: 1px solid rgba(0,0,0,0.08);
}

.timeline-scale{
  display:flex;
  justify-content:space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.work-total{
  margin-top: 8px;
  font-weight: 800;
  color: #bbf7d0;
}

.work-form{
  margin-top: 12px;
  padding: 12px;
  background: rgba(11,20,38,0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.field label{
  font-size: 12px;
  color: var(--muted);
}
.field.grow{ flex: 1; min-width: 220px; }

.blocks{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.block-row{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(7,15,29,0.6);
}

.badge{
  background: rgba(34,197,94,0.18);
  border: 1px solid rgba(34,197,94,0.4);
  color: #86efac;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.block-text{
  flex: 1;
  display:flex;
  flex-direction:column;
  gap: 2px;
}
.block-text span{
  color: var(--muted);
  font-size: 12px;
}

.empty{
  color: var(--muted);
  font-style: italic;
}

.status{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15,23,42,0.35);
  border: 1px solid var(--border);
  color: var(--muted);
}
.status.ok{ color: #bbf7d0; }
.status.bad{ color: #fecaca; border-color: rgba(239,68,68,0.5); }

@media (max-width: 640px){
  select{ min-width: 120px; }
  .header{ flex-direction:column; align-items:flex-start; }
}
