:root {
  --bg: #f3f6f8;
  --card: rgba(255, 255, 255, 0.92);
  --text: #12343c;
  --muted: #6e8188;
  --navy: #173247;
  --navy-deep: #122b3e;
  --sea: #5f7f84;
  --sea-soft: #dbe4e6;
  --green: #8cc63f;
  --green-dark: #6ea62d;
  --turquoise: #6fc7d1;
  --turquoise-dark: #56b7c2;
  --line: rgba(216, 224, 227, 0.9);
  --danger: #cf4c3f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #f8fbfc 0%, #eef3f5 48%, #e8eef1 100%);
  color: var(--text);
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}
.hero-panel {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: white;
  padding: 30px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}
.compact-hero {
  padding: 22px 18px 16px;
}
.sidebar-home-btn {
  margin-top: 14px;
  width: 100%;
}
.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(111, 199, 209, 0.16) 0%, transparent 40%, rgba(140, 198, 63, 0.18) 100%);
  pointer-events: none;
}
.hero-panel > * { position: relative; z-index: 1; }
.logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.logo-image {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  background: white;
  border-radius: 12px;
  padding: 8px;
}
.logo-text strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}
.logo-text span {
  display: block;
  color: rgba(255,255,255,0.72);
  margin-top: 2px;
  font-size: 0.92rem;
}
.home-panel {
  display: grid;
  gap: 18px;
}
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.hero-panel h1 {
  margin: 10px 0 0;
  font-size: 24px;
  line-height: 1.08;
}
.hero-panel p,
.hero-panel li {
  color: rgba(255,255,255,0.88);
  line-height: 1.45;
  font-size: 0.92rem;
}
.hero-panel ul {
  padding-left: 16px;
  margin-top: 14px;
}
.main-panel {
  padding: 22px;
  background: linear-gradient(180deg, #f3f7f7 0%, #edf3f4 100%);
}
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 12px 28px rgba(18, 43, 62, 0.06), 0 2px 8px rgba(18, 43, 62, 0.03);
  backdrop-filter: blur(6px);
}
.grid {
  display: grid;
  gap: 12px;
}
.grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
input, select, button, .button-link {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(111, 199, 209, 0.2);
  border-color: var(--turquoise);
}

select.site-visual-green {
  background: rgba(140, 198, 63, 0.14);
  border-color: rgba(140, 198, 63, 0.5);
  color: #2f5f12;
  font-weight: 700;
}

select.site-visual-blue {
  background: rgba(111, 199, 209, 0.16);
  border-color: rgba(95, 127, 132, 0.45);
  color: var(--navy);
  font-weight: 700;
}

select.site-visual-default {
  background: white;
}

.planning-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.planning-legend-item,
.planning-cell {
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  text-align: center;
}

.planning-cell {
  min-width: 38px;
  font-size: 12px;
}

#leavePlanningTable th.planning-saturday,
#leavePlanningTable td.planning-saturday {
  background: rgba(122, 132, 142, 0.08);
}

#leavePlanningTable th.planning-sunday,
#leavePlanningTable td.planning-sunday {
  background: rgba(122, 132, 142, 0.14);
}

#leavePlanningTable th.planning-holiday,
#leavePlanningTable td.planning-holiday {
  box-shadow: inset 0 0 0 9999px rgba(214, 74, 74, 0.08);
}

#leavePlanningTable td.planning-cell.planning-holiday,
#leavePlanningTable td.planning-cell.planning-saturday,
#leavePlanningTable td.planning-cell.planning-sunday {
  background-blend-mode: multiply;
}

#teamPlanningTable,
#teamPlanningEmployeeTable {
  font-size: 0.82rem;
  table-layout: fixed;
}

#teamPlanningTable select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 6px 7px;
  border-radius: 8px;
  font-size: 0.78rem;
}

#teamPlanningTable th,
#teamPlanningTable td,
#teamPlanningEmployeeTable th,
#teamPlanningEmployeeTable td {
  white-space: nowrap;
  vertical-align: top;
  padding: 6px 6px;
}

.planning-team-name-head,
.planning-team-name {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(247, 250, 251, 0.98);
}

.planning-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-day-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
}

.planning-day-head span {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #6b7a85;
  letter-spacing: 0.02em;
}

.planning-day-head strong {
  font-size: 0.78rem;
}

.planning-read-cell {
  min-width: 82px;
  max-width: 82px;
  width: 82px;
  font-weight: 500;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-manager-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-card-action {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: block;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(18, 43, 62, 0.06), 0 2px 8px rgba(18, 43, 62, 0.03);
}

.dashboard-card-action:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 14px 30px rgba(18, 43, 62, 0.08), 0 4px 10px rgba(18, 43, 62, 0.04);
}

.dashboard-card-action h4,
.dashboard-card-action p {
  margin: 0;
}

.dashboard-card-action p {
  margin-top: 8px;
}

.row-highlight-unread td {
  background: rgba(111, 199, 209, 0.12);
}

.planning-address-btn-filled {
  border-color: rgba(140, 198, 63, 0.5);
  color: #335b14;
  background: rgba(140, 198, 63, 0.12);
}

.planning-site-chip {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 8px 9px;
  border-radius: 10px;
  background: linear-gradient(180deg, #eef7fb 0%, #e2f1f6 100%);
  color: var(--navy);
  border: 1px solid rgba(111, 199, 209, 0.35);
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.planning-site-chip:hover {
  background: linear-gradient(180deg, #e8f4f9 0%, #dceef4 100%);
  box-shadow: none;
}

.planning-site-chip-self {
  background: linear-gradient(180deg, #f2f9e8 0%, #e7f3d7 100%);
  border-color: rgba(140, 198, 63, 0.38);
  color: #335b14;
}

.planning-empty-chip {
  display: inline-flex;
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(122, 132, 142, 0.09);
  color: #687883;
  font-size: 0.74rem;
  font-weight: 600;
}

.planning-row-self th,
.planning-row-self td {
  background: rgba(140, 198, 63, 0.06);
}

.planning-employee-name {
  font-weight: 700;
  color: var(--navy);
}

.planning-self-badge {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(140, 198, 63, 0.16);
  color: #335b14;
  font-size: 0.7rem;
  font-weight: 700;
}

#teamPlanningTable td,
#teamPlanningEmployeeTable td {
  min-width: 82px;
  max-width: 82px;
  width: 82px;
}

@media (max-width: 900px) {
  #teamPlanningTable,
  #teamPlanningEmployeeTable {
    font-size: 0.74rem;
  }

  #teamPlanningTable th,
  #teamPlanningTable td,
  #teamPlanningEmployeeTable th,
  #teamPlanningEmployeeTable td {
    padding: 4px 4px;
  }

  .planning-team-name-head,
  .planning-team-name {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
  }

  #teamPlanningTable select {
    padding: 4px 5px;
    font-size: 0.72rem;
  }

  .planning-day-head {
    min-width: 52px;
  }

  .planning-day-head span {
    font-size: 0.62rem;
  }

  .planning-day-head strong {
    font-size: 0.7rem;
  }

  .planning-read-cell,
  #teamPlanningTable td,
  #teamPlanningEmployeeTable td {
    min-width: 68px;
    max-width: 68px;
    width: 68px;
    font-size: 0.72rem;
  }
}

.planning-legend-item.cp,
.planning-cell.cp {
  background: rgba(140, 198, 63, 0.18);
  color: #2f5f12;
}

.planning-legend-item.rtt,
.planning-cell.rtt {
  background: rgba(111, 199, 209, 0.18);
  color: var(--navy);
}

.planning-legend-item.maladie,
.planning-cell.maladie {
  background: rgba(214, 74, 74, 0.16);
  color: #8a1f1f;
}

.planning-legend-item.formation,
.planning-cell.formation {
  background: rgba(238, 194, 63, 0.22);
  color: #7b5b00;
}

.planning-legend-item.default,
.planning-cell.default {
  background: rgba(122, 132, 142, 0.16);
  color: #42505b;
}

.site-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-visual-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 12px;
  background: #c7d2d7;
  box-shadow: inset 0 0 0 1px rgba(18, 52, 60, 0.08);
}

.site-visual-dot.site-visual-green {
  background: var(--green);
}

.site-visual-dot.site-visual-blue {
  background: var(--turquoise-dark);
}

.site-visual-dot.site-visual-default {
  background: #c7d2d7;
}
button, .button-link {
  border: 0;
  border-radius: 12px;
  padding: 10px 15px;
  background: linear-gradient(180deg, #91cb46 0%, #7fba37 100%);
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(140, 198, 63, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
button:hover, .button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(140, 198, 63, 0.22);
  background: linear-gradient(180deg, #97d14d 0%, #84c03a 100%);
}
button.secondary, .tab.secondary {
  background: rgba(255,255,255,0.86);
  color: var(--navy);
  border: 1px solid rgba(216, 224, 227, 0.95);
  box-shadow: 0 6px 14px rgba(18, 43, 62, 0.05);
}
button.secondary:hover, .tab.secondary:hover {
  background: rgba(255,255,255,0.96);
}
button.small {
  padding: 8px 12px;
  font-size: 14px;
}
button.danger { background: var(--danger); }
.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 6px solid var(--green);
}
.tabbar { display: flex; gap: 8px; }
.multi-tabs { flex-wrap: wrap; }
.workspace-switcher {
  align-items: center;
  justify-content: flex-start;
}
.workspace-switcher .tab {
  min-width: 145px;
}
.tab {
  min-width: 145px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(216, 224, 227, 0.8);
  box-shadow: 0 4px 10px rgba(18, 43, 62, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab.active {
  background: var(--navy);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(23, 50, 71, 0.18);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d83b34;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.period-card {
  background: linear-gradient(135deg, rgba(219, 228, 230, 0.7) 0%, rgba(247, 250, 251, 0.95) 100%);
  border: 1px solid rgba(216, 224, 227, 0.9);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.period-card span,
.period-card small { color: var(--muted); }
.period-card strong {
  font-size: 18px;
  margin: 4px 0;
  color: var(--navy);
}
.days-container {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.day-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
}
.day-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.day-header h3 {
  margin: 0;
  color: var(--navy);
}
.day-header p {
  margin: 4px 0 0;
  color: var(--sea);
}
.entry-list {
  display: grid;
  gap: 10px;
}
.entry-row {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 12px;
  padding: 12px;
  background: white;
}
.row-bottom {
  margin-top: 10px;
  align-items: end;
}
.row-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--sea);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: rgba(247, 250, 251, 0.9);
}
tr:hover td {
  background: rgba(252, 253, 253, 0.88);
}
.summary-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.summary-card {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0f7e6 0%, #f9fcf5 100%);
  border: 1px solid #dce9c8;
}
.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}
.summary-card strong {
  font-size: 22px;
  color: var(--navy);
}
.infos-list {
  display: grid;
  gap: 14px;
}
.employee-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.profile-hero-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--navy) 0%, #204865 100%);
  color: white;
  margin-bottom: 18px;
  box-shadow: 0 18px 34px rgba(23, 50, 71, 0.18);
}
.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-hero-card h3 {
  margin: 6px 0;
  font-size: 28px;
}
.profile-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .75;
  font-size: 12px;
}
.profile-subtitle {
  margin: 0;
  opacity: .88;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  font-weight: 700;
}
.badge-pill-green {
  background: rgba(140, 198, 63, 0.18);
  border-color: rgba(140, 198, 63, 0.35);
}
.badge-pill-muted {
  background: rgba(255,255,255,0.08);
}
.profile-section-card {
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(18, 43, 62, 0.05);
  backdrop-filter: blur(5px);
}
.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.profile-section-header h4 {
  margin: 0;
  color: var(--navy);
}
.profile-section-header span {
  color: var(--muted);
  font-size: 13px;
}
.profile-contact-card {
  border-left: 6px solid var(--turquoise);
}
.profile-edit-card input {
  margin-top: 8px;
}
.profile-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 16px;
}
.employee-filters {
  margin-bottom: 16px;
}
.admin-section {
  margin-bottom: 24px;
}
.admin-section > h3 {
  color: var(--navy);
  margin-bottom: 12px;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.export-card {
  margin-bottom: 0;
}
.info-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--turquoise);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdfe;
}
.info-card strong {
  display: inline-block;
  margin-right: 6px;
}
.info-card h3 {
  margin: 10px 0 8px;
  color: var(--navy);
}
.info-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.badge,
.priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.badge {
  background: var(--navy-soft);
  color: var(--navy);
}
.priority {
  background: var(--green-soft);
  color: var(--green-dark);
}
.priority.haute {
  background: #fff2d9;
  color: #9a6500;
}
.info-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdfe;
}
.info-block h3 {
  margin-top: 0;
  color: var(--navy);
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-line input {
  width: auto;
}
.compliance-panel h3 {
  color: var(--navy);
}
.muted, .help { color: var(--muted); }
.error { color: var(--danger); }
.success { color: var(--green-dark); }
.hidden { display: none; }

.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: #f5fafb;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 33, 0.45);
}
.modal-card {
  position: relative;
  max-width: 900px;
  margin: 40px auto;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  padding: 20px;
  z-index: 2;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.modal-content {
  max-height: 70vh;
  overflow: auto;
}
.detail-box {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  white-space: pre-wrap;
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .hero-panel { padding: 24px 18px; }
  .main-panel { padding: 14px; }
  .day-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-hero-card,
  .profile-hero-main {
    flex-direction: column;
    align-items: flex-start;
  }
}
