:root {
  --bg: #f7f9f8;
  --surface: #ffffff;
  --surface-strong: #eef3f1;
  --text: #17211e;
  --muted: #65736e;
  --line: #dfe7e3;
  --primary: #216e5d;
  --primary-strong: #175246;
  --primary-soft: #e2f3ed;
  --accent: #8b5a2b;
  --danger: #b83a3a;
  --danger-soft: #f8e3e3;
  --warn: #a56500;
  --warn-soft: #fff0d6;
  --ok: #237a48;
  --ok-soft: #e3f4e8;
  --blue: #3169a8;
  --blue-soft: #e5eef8;
  --shadow: 0 18px 48px rgba(24, 34, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  padding: 0 2px 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3.subhead {
  margin: 26px 0 10px;
  font-size: 1rem;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions,
.report-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.date-field,
.report-controls label,
.manual-form label,
#employeeForm label,
.search-box {
  display: grid;
  gap: 6px;
}

label span,
.date-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: pre-line;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 110, 93, 0.14);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  min-width: 96px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface-strong);
  font-weight: 700;
  white-space: nowrap;
}

.button.link-button {
  text-decoration: none;
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
}

.button.action {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tab {
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 9px 16px;
  font-weight: 800;
}

.tab.active {
  border-color: var(--primary);
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.employee-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  width: min(280px, 100%);
}

.attendance-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.attendance-controls label {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.attendance-controls .search-box {
  min-width: 220px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px 12px;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap.compact {
  max-height: 380px;
}

.data-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6f5;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover,
.data-table tbody tr.selected {
  background: #edf7f3;
}

.data-table tbody tr.clickable {
  cursor: pointer;
}

.employee-name {
  display: grid;
  gap: 2px;
}

.employee-name strong {
  line-height: 1.2;
}

.employee-name span {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.absent {
  background: #edf0ef;
  color: #4e5b57;
}

.status-badge.present {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-badge.break {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-badge.left {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-badge.work_stopped {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-badge.inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

.detail-panel {
  position: sticky;
  top: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.location-card {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px 12px;
}

.location-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.location-card p {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.map-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

.location-coords {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
}

.location-detail {
  display: grid;
  gap: 4px;
  min-width: 220px;
  max-width: 360px;
}

.location-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #eef2ff;
  color: #3730a3;
}

.location-status.accepted {
  background: #dcfce7;
  color: #166534;
}

.location-status.refused {
  background: #fee2e2;
  color: #991b1b;
}

.manual-form {
  display: grid;
  gap: 14px;
}

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

.full-field {
  display: grid;
  gap: 6px;
}

.worker-field.is-hidden {
  display: none !important;
}

.form-actions,
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.report-head {
  align-items: flex-end;
}

.dialog {
  width: min(620px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(11, 20, 17, 0.45);
}

#employeeForm,
#pinForm {
  padding: 18px;
}

.pin-dialog {
  width: min(420px, calc(100% - 28px));
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.compact-toggle {
  margin-top: 0;
  white-space: nowrap;
}

.dialog-actions {
  margin-top: 18px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mini-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 9px;
  color: var(--text);
  font-weight: 700;
}

.mini-button.danger {
  border-color: #efcccc;
  color: var(--danger);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 4000;
  width: min(420px, calc(100% - 36px));
  max-height: min(220px, calc(100vh - 36px));
  transform: translateY(20px);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  padding: 12px 14px;
  opacity: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  pointer-events: none;
  white-space: pre-line;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.6rem);
}

.login-form {
  display: grid;
  gap: 14px;
}

.section-gap {
  margin-top: 24px;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
}

.positive {
  color: var(--ok);
  font-weight: 800;
}

.negative {
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 14px;
  }

  h1 {
    font-size: 2.1rem;
  }

  .panel {
    padding: 14px;
  }

  .panel-head,
  .report-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .report-controls {
    width: 100%;
    align-items: stretch;
  }

  .topbar-actions > *,
  .report-controls > * {
    flex: 1 1 160px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .quick-actions,
  .location-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }
}

.company-active-select {
  min-width: 260px;
}

.company-active-select select {
  width: 100%;
}

.company-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 150px;
}

.company-links a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.company-links a:hover {
  text-decoration: underline;
}

/* Titre d'en-tete sur une seule ligne */
.topbar > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.topbar h1 {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.35rem, 2.6vw, 2.35rem);
  line-height: 1.08;
}

.topbar .eyebrow {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .topbar > div:first-child {
    width: 100%;
  }

  .topbar h1 {
    font-size: clamp(1.2rem, 5vw, 1.85rem);
  }
}

@media (max-width: 720px) {
  .topbar h1 {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
  }
}

/* En-tetes stables : titre clair sur une seule ligne */
.topbar,
.employee-header {
  flex-wrap: nowrap;
  overflow: hidden;
}

.topbar > div:first-child,
.employee-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.topbar h1,
.employee-header h1 {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.topbar .eyebrow,
.employee-header p {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions,
.header-actions {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .topbar,
  .employee-header {
    align-items: center;
    gap: 8px;
  }

  .topbar h1,
  .employee-header h1 {
    font-size: clamp(0.92rem, 4.2vw, 1.25rem);
    line-height: 1.12;
  }

  .topbar .eyebrow,
  .employee-header p {
    font-size: 0.68rem;
  }
}

@media (max-width: 520px) {
  .topbar-actions .link-button,
  .employee-header .ghost-button[hidden] {
    display: none !important;
  }
}

/* Correction lisibilite titre : evite de couper le bas des lettres comme g, j, y, p, q */
h1,
.topbar h1,
.employee-header h1,
.login-panel h1 {
  line-height: 1.22 !important;
  padding-top: 0.02em;
  padding-bottom: 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.topbar,
.employee-header {
  align-items: center;
  padding-bottom: 18px;
}

.topbar > div:first-child,
.employee-header > div:first-child {
  padding-top: 2px;
  padding-bottom: 3px;
}

.topbar .eyebrow,
.employee-header p,
.login-panel .eyebrow {
  line-height: 1.35 !important;
  padding-top: 0.02em;
  padding-bottom: 0.08em;
}

.login-panel .eyebrow {
  display: block;
  overflow: visible;
  text-transform: none;
}


.audit-table {
  min-width: 980px;
}

.audit-table td,
.audit-table th {
  vertical-align: top;
}

.audit-filters {
  margin: 12px 0 14px;
}


.sick-leave-admin-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.sick-leave-filters {
  margin-bottom: 14px;
}

.status-badge.pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-badge.approved {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-badge.rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.attachment-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.export-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.export-toggle::after {
  content: " ▾";
  font-size: 0.85em;
}

.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 8px;
  z-index: 50;
}

.export-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 800;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.export-option:hover,
.export-option:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
  outline: none;
}

/* Interface Paramètres : menu vertical gauche + contenu dynamique droite */
.settings-panel {
  overflow: visible;
}

.settings-head {
  align-items: center;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-home.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 14px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%);
  padding: 12px;
  box-shadow: 0 14px 32px rgba(24, 34, 31, 0.07);
}

.settings-sidebar-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-content {
  min-width: 0;
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  padding: 16px;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-section-title h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.settings-section-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 1.2rem;
}

.settings-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.settings-main-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(24, 34, 31, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.settings-main-button::after {
  content: "⌄";
  margin-left: auto;
  color: var(--muted);
  font-weight: 900;
  transition: transform 0.16s ease;
}

.settings-main-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.settings-main-button:hover,
.settings-main-button.active {
  transform: translateY(-1px);
  border-color: rgba(33, 110, 93, 0.36);
  background: var(--primary-soft);
  box-shadow: 0 14px 30px rgba(24, 34, 31, 0.09);
}

.settings-button-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-strong);
  font-size: 1.08rem;
}

.settings-sub-panel {
  display: none;
}

.settings-feature-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(24, 34, 31, 0.05);
}

.settings-feature-panel + .settings-feature-panel {
  margin-top: 0;
}

.settings-empty-state {
  display: block;
  min-height: 170px;
  background: linear-gradient(135deg, #ffffff 0%, #f3fbf7 100%);
}

.settings-empty-state[hidden] {
  display: none;
}

.settings-accordion-panel {
  display: grid;
  gap: 8px;
  margin: 2px 0 8px 0;
  padding: 8px;
  border: 1px solid rgba(33, 110, 93, 0.16);
  border-radius: 14px;
  background: rgba(33, 110, 93, 0.045);
}

.settings-accordion-title {
  margin: 0 2px 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.settings-sub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.settings-sub-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  font-weight: 800;
}

.settings-sub-button:hover,
.settings-sub-button.active {
  border-color: rgba(33, 110, 93, 0.36);
  background: #ecf7f1;
}

.settings-sub-button span {
  flex: 0 0 auto;
}

.settings-feature-panel .subhead {
  margin-top: 0;
}

@media (max-width: 980px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-home.settings-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .settings-feature-panel {
    padding: 14px;
  }

  .settings-section {
    padding: 13px;
  }

  .settings-section-title {
    align-items: flex-start;
  }

  .settings-button-grid,
  .settings-sub-grid {
    grid-template-columns: 1fr;
  }

  .settings-main-button {
    min-height: 52px;
  }
}


.location-settings-panel {
  margin-top: 1rem;
}

.compact-status {
  margin-top: .35rem;
  min-height: 1.2rem;
}

.compact-label {
  min-width: min(280px, 100%);
}

.settings-location-company {
  margin: .75rem 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.location-type-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin: 1rem 0;
}

.location-type-button {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 78px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 10px 30px rgba(24, 34, 31, 0.06);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.location-type-button:hover,
.location-type-button.active {
  transform: translateY(-1px);
  border-color: rgba(33, 110, 93, .38);
  background: var(--primary-soft);
  box-shadow: 0 14px 34px rgba(33, 110, 93, .12);
}

.location-type-button strong,
.location-type-button small {
  display: block;
}

.location-type-button small {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.location-type-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

.location-settings-workspace {
  margin-top: 1rem;
}

.location-subbutton-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.location-summary-table th,
.location-summary-table td {
  vertical-align: top;
}

.location-summary-table .compact-cell {
  font-size: .82rem;
  white-space: nowrap;
}

.location-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .85rem;
}

.location-control-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 34, 31, .06);
}

.location-control-card h5 {
  margin: 0 0 .45rem;
  font-size: 1rem;
}

.location-control-card p {
  margin: .25rem 0;
}

.location-control-card ul {
  margin: .75rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 760px) {
  .location-summary-table .compact-cell {
    white-space: normal;
    word-break: break-word;
  }
}


.location-form-panel[hidden] {
  display: none !important;
}

.location-setting-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.location-setting-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
}

.location-setting-head h4 {
  margin: 0 0 .2rem;
}


.location-address-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: end;
  margin: .9rem 0 .3rem;
}

.location-address-tools label {
  display: grid;
  gap: .35rem;
}

.location-real-map {
  width: 100%;
  min-height: 280px;
  border: 1px solid rgba(33, 110, 93, .22);
  border-radius: 20px;
  background: #eef7f3;
  margin-bottom: .75rem;
}

@media (max-width: 680px) {
  .location-address-tools {
    grid-template-columns: 1fr;
  }
}

.location-map-wrapper {
  margin: .95rem 0 .75rem;
}

.location-map-box {
  position: relative;
  min-height: 235px;
  overflow: hidden;
  border: 1px solid rgba(33, 110, 93, .22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 22% 24%, rgba(33, 110, 93, .14), transparent 22%),
    radial-gradient(circle at 76% 62%, rgba(139, 90, 43, .12), transparent 24%),
    linear-gradient(135deg, #eef7f3 0%, #f8fbfa 52%, #eef3f1 100%);
  cursor: crosshair;
}

.location-map-box:focus-visible {
  outline: 3px solid rgba(33, 110, 93, .25);
  outline-offset: 3px;
}

.location-map-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(33, 110, 93, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 110, 93, .08) 1px, transparent 1px);
  background-size: 34px 34px;
}

.location-map-marker {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 32px rgba(24, 34, 31, .18);
  font-size: 1.7rem;
}

.location-map-box.has-location .location-map-marker {
  background: var(--primary-soft);
}

.location-map-copy {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: .2rem;
  padding: .8rem .95rem;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 16px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(6px);
}

.location-map-copy strong,
.location-map-copy span,
.location-map-copy small {
  display: block;
}

.location-map-copy span,
.location-map-copy small {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}

.checkline {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .75rem 0;
  font-weight: 700;
}

.location-map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 1rem;
}

.mini-button.ghost {
  background: transparent;
}

.location-settings-note {
  margin-top: 1rem;
}

.pulse-focus {
  outline: 3px solid rgba(33, 110, 93, .25);
  transition: outline .2s ease;
}

@media (max-width: 900px) {
  .location-type-choice {
    grid-template-columns: 1fr;
  }

  .location-map-box {
    min-height: 210px;
  }
}

/* Carte de localisation fiable sur Render : Leaflet + OpenStreetMap, sans iframe Google/OSM bloquee. */
.location-leaflet-map {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 320px;
  height: 320px;
  border: 1px solid rgba(33, 110, 93, .22);
  border-radius: 20px;
  overflow: hidden;
  background: #eef7f3;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
  touch-action: pan-x pan-y;
}

.location-leaflet-map .leaflet-container,
.location-leaflet-map .leaflet-pane,
.location-leaflet-map .leaflet-tile-pane,
.location-leaflet-map .leaflet-marker-pane {
  z-index: auto;
}

.location-map-fallback {
  margin-top: .65rem;
  padding: .8rem .95rem;
  border: 1px dashed rgba(139, 90, 43, .35);
  border-radius: 14px;
  background: rgba(255, 247, 235, .82);
  color: #7a5229;
  font-weight: 700;
}

.location-map-coords {
  display: block;
  margin-top: .55rem;
  color: var(--muted);
  font-weight: 800;
}

.location-leaflet-map .leaflet-control-attribution {
  font-size: .7rem;
}

@media (max-width: 680px) {
  .location-leaflet-map {
    min-height: 260px;
    height: 260px;
  }
}


/* Carte OpenStreetMap autonome : fonctionne sans Leaflet/CDN, avec clic, zoom et marqueur. */
.location-leaflet-map.simple-osm-map {
  cursor: crosshair;
  user-select: none;
  touch-action: none;
  background: #dfeee9;
}
.simple-osm-tiles {
  position: absolute;
  inset: 0;
}
.simple-osm-tiles img {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  border: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.simple-osm-marker {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -100%);
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.25));
  pointer-events: none;
}
.simple-osm-controls {
  position: absolute;
  z-index: 8;
  top: .7rem;
  left: .7rem;
  display: grid;
  gap: .35rem;
}
.simple-osm-controls button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(26, 90, 76, .22);
  border-radius: .75rem;
  background: rgba(255,255,255,.95);
  color: var(--primary-700);
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
  cursor: pointer;
}
.simple-osm-controls button:hover {
  background: #fff;
}
.simple-osm-attribution {
  position: absolute;
  right: .5rem;
  bottom: .4rem;
  z-index: 8;
  padding: .2rem .45rem;
  border-radius: .5rem;
  background: rgba(255,255,255,.86);
  color: #31524b;
  font-size: .72rem;
  font-weight: 700;
}

.location-compact {
  min-width: 170px;
  max-width: 260px;
  gap: 3px;
}

.location-compact strong {
  color: var(--text);
  font-size: 0.86rem;
}

.location-compact .map-link {
  font-size: 0.78rem;
}


/* Affichage compact des localisations dans la fiche de pointage */
.location-card,
.gps-result-card {
  min-width: 0;
  overflow: hidden;
}

.location-card p,
.gps-result-card p {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.location-detail {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.location-detail strong,
.gps-result-card p strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
}

.location-coords,
.gps-result-card .location-coords {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
  line-height: 1.25;
}

.location-detail .map-link,
.gps-result-card .map-link {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.25;
  vertical-align: top;
}

.location-compact {
  min-width: 0;
  max-width: 100%;
  gap: 2px;
}

.location-compact strong {
  font-size: 0.8rem;
}

.location-compact .map-link {
  font-size: 0.72rem;
}

.data-table td .location-detail {
  max-width: clamp(145px, 22vw, 240px);
}

@media (max-width: 760px) {
  .location-coords,
  .gps-result-card .location-coords {
    font-size: 0.66rem;
  }

  .location-detail .map-link,
  .gps-result-card .map-link {
    font-size: 0.7rem;
  }
}

/* Presence du jour : colonne Temps lisible et prioritaire */
.roster-panel .data-table {
  table-layout: fixed;
  min-width: 820px;
}

.roster-panel .attendance-person-col,
.roster-panel .data-table td:first-child {
  width: 20%;
}

.roster-panel .attendance-service-col,
.roster-panel .attendance-service-cell {
  width: 11%;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-panel .attendance-status-col,
.roster-panel .attendance-status-cell {
  width: 10%;
  white-space: nowrap;
}

.roster-panel .attendance-hour-col,
.roster-panel .attendance-hour-cell {
  width: 9%;
  white-space: nowrap;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.roster-panel .attendance-location-col,
.roster-panel .attendance-location-cell {
  width: 23%;
  min-width: 0;
}

.roster-panel .attendance-location-cell .location-detail {
  max-width: 100%;
}

.roster-panel .attendance-time-col,
.roster-panel .attendance-time-cell {
  width: 9%;
  min-width: 86px;
  white-space: nowrap;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.roster-panel .attendance-time-cell {
  color: var(--text);
}

@media (max-width: 760px) {
  .roster-panel .data-table {
    min-width: 760px;
  }

  .roster-panel .data-table th,
  .roster-panel .data-table td {
    padding-left: 8px;
    padding-right: 8px;
  }

  .roster-panel .attendance-time-col,
  .roster-panel .attendance-time-cell {
    min-width: 82px;
    font-size: 0.86rem;
  }

  .roster-panel .attendance-hour-col,
  .roster-panel .attendance-hour-cell,
  .roster-panel .attendance-service-cell {
    font-size: 0.78rem;
  }
}

.location-specific-card {
  margin-top: 1rem;
  border: 1px solid rgba(33, 110, 93, .16);
  border-radius: 22px;
  padding: 1rem;
  background: linear-gradient(180deg, #fff, #f7fbfa);
  box-shadow: var(--shadow);
}

.location-setting-head.compact {
  margin-bottom: .75rem;
}

.location-restriction-form select[multiple] {
  min-height: 8.5rem;
  border-radius: 14px;
  padding: .5rem;
  background: #fff;
}

.location-restriction-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem .85rem;
  font: inherit;
  resize: vertical;
}

.location-restrictions-table td,
.location-restrictions-table th {
  vertical-align: top;
}

.location-restrictions-table .compact-cell {
  font-size: .82rem;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .location-restrictions-table .compact-cell {
    white-space: normal;
    word-break: break-word;
  }
}

/* Paramètres > Sécurité et accès : sections alimentées */
.settings-access-panel {
  border: 1px solid #dbe7f3;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.settings-access-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-access-body {
  display: grid;
  gap: 16px;
}

.settings-access-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-access-summary > div {
  border: 1px solid #e3edf7;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  min-width: 0;
}

.settings-access-summary strong,
.settings-access-summary span {
  display: block;
}

.settings-access-summary strong {
  color: #35516c;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.settings-access-summary span {
  color: #102a43;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.settings-access-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.settings-access-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid #dbe7f3;
  border-radius: 18px;
  background: #fff;
  min-width: 0;
}

.settings-access-card-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #edf6ff;
  font-size: 1.2rem;
}

.settings-access-card h4 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: #102a43;
}

.settings-access-card p {
  margin: 0 0 10px;
  color: #52677a;
  font-size: 0.9rem;
  line-height: 1.45;
}

.settings-access-action.primary {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}

.settings-link-list {
  display: grid;
  gap: 12px;
}

.settings-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #dbe7f3;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.settings-link-row strong,
.settings-link-row small,
.settings-link-row code {
  display: block;
}

.settings-link-row strong {
  color: #102a43;
  margin-bottom: 3px;
}

.settings-link-row small {
  color: #52677a;
  margin-bottom: 8px;
  line-height: 1.35;
}

.settings-link-row code {
  color: #1f3a56;
  background: #f4f8fc;
  border: 1px solid #e3edf7;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-link-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 720px) {
  .settings-access-head,
  .settings-link-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .settings-access-summary {
    grid-template-columns: 1fr;
  }

  .settings-link-actions {
    justify-content: flex-start;
  }
}

/* Paramètres > Sociétés : section allégée et redirection des tâches vers les bons boutons */
.company-admin-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  min-width: 8.5rem;
}

.settings-accounts-management {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 1rem;
}

.settings-access-management-head {
  margin-bottom: 0.75rem;
}

.settings-access-management-head h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
@media (max-width: 720px) {
  .settings-link-input-row {
    grid-template-columns: 1fr;
  }
  .inline-actions > button {
    width: 100%;
  }
}


/* Logo application */
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 16px;
  display: block;
  box-shadow: 0 12px 30px rgba(23, 82, 70, 0.18);
}

.brand-text {
  min-width: 0;
  flex: 1 1 auto;
}

.login-logo {
  width: 84px;
  height: 84px;
  display: block;
  margin: 0 auto 16px;
  border-radius: 24px;
  box-shadow: 0 14px 36px rgba(23, 82, 70, 0.2);
}

@media (max-width: 760px) {
  .app-brand {
    gap: 8px;
  }

  .app-logo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 13px;
  }
}


/* Logo officiel LeyGa Project */
.app-logo {
  width: 172px;
  height: 58px;
  flex: 0 0 172px;
  object-fit: contain;
  object-position: center;
  padding: 4px 8px;
  border-radius: 14px;
  background: #ffffff;
}

.login-logo {
  width: min(280px, 88vw);
  height: 92px;
  object-fit: contain;
  object-position: center;
  padding: 6px 12px;
  border-radius: 16px;
  background: #ffffff;
}

@media (max-width: 760px) {
  .app-logo {
    width: 138px;
    height: 48px;
    flex-basis: 138px;
    padding: 3px 6px;
    border-radius: 12px;
  }
}


/* Logos société cadrés automatiquement */
.company-context .app-logo,
.company-context .login-logo {
  aspect-ratio: 1 / 1;
  width: 66px;
  height: 66px;
  max-width: 66px;
  max-height: 66px;
  flex: 0 0 66px;
  display: block;
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
  padding: 8px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(33, 110, 93, 0.16);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(23, 82, 70, 0.16);
}

.company-context .login-logo {
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  margin: 0 auto 16px;
  padding: 12px;
}

@media (max-width: 760px) {
  .company-context .app-logo {
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
    flex-basis: 52px;
    padding: 6px;
  }

  .company-context .login-logo {
    width: 84px;
    height: 84px;
    max-width: 84px;
    max-height: 84px;
    padding: 10px;
  }
}

.company-logo-field input[type="file"] {
  width: 100%;
}

.company-logo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px dashed rgba(33, 110, 93, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.company-logo-preview-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.company-logo-preview-box span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.company-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  max-width: 68px;
  max-height: 68px;
  aspect-ratio: 1 / 1;
  flex: 0 0 68px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(33, 110, 93, 0.16);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 82, 70, 0.12);
}

.company-logo-frame--preview {
  width: 112px;
  height: 112px;
  max-width: 112px;
  max-height: 112px;
  flex-basis: 112px;
}

.company-logo-frame--thumb {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  flex-basis: 48px;
  vertical-align: middle;
}

.company-logo-img,
.company-logo-preview,
.company-logo-thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.company-logo-frame--thumb .company-logo-img,
.company-logo-frame--thumb .company-logo-thumb {
  padding: 5px;
}

.company-logo-empty {
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(33, 110, 93, 0.08);
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 760px) {
  .company-logo-preview-wrap {
    align-items: stretch;
    flex-direction: column;
  }
}

.section-gap-small {
  margin-top: 10px;
  margin-bottom: 10px;
}

#subscriptionSummary.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

#subscriptionPanel textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

/* Tableaux de bord par rôle */
.dashboard-panel {
  display: grid;
  gap: 1.25rem;
}
.dashboard-head {
  align-items: flex-start;
}

.dashboard-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.filter-inline {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 210px;
  font-weight: 800;
  color: #38504a;
}
.filter-inline span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6a7b76;
}
.filter-inline select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-color, #d9e5e1);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: #0b2f27;
}
@media (max-width: 760px) {
  .dashboard-head {
    gap: 1rem;
  }
  .dashboard-actions {
    width: 100%;
    justify-content: stretch;
  }
  .dashboard-actions .button,
  .filter-inline {
    width: 100%;
  }
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.dashboard-card {
  min-height: 120px;
  border: 1px solid var(--border-color, #d9e5e1);
  border-radius: 18px;
  background: #ffffff;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 30px rgba(14, 64, 52, 0.06);
}
.dashboard-card span {
  color: var(--muted-color, #5f6f6b);
  font-weight: 700;
}
.dashboard-card strong {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: #072c25;
}
.dashboard-card small {
  color: #60736e;
  font-weight: 600;
}
.dashboard-card-success {
  background: linear-gradient(145deg, #eefaf5, #ffffff);
}
.dashboard-card-warning {
  background: linear-gradient(145deg, #fff7e7, #ffffff);
}
.dashboard-card-danger {
  background: linear-gradient(145deg, #fff0f0, #ffffff);
}
.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.dashboard-section-card {
  border: 1px solid var(--border-color, #d9e5e1);
  border-radius: 18px;
  background: #ffffff;
  padding: 1rem;
  min-height: 240px;
}
.dashboard-section-card h3 {
  margin: 0 0 0.8rem;
  color: #07352d;
}
.dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.dashboard-list-item,
.dashboard-list-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 14px;
  background: #f5faf8;
  padding: 0.8rem;
}
.dashboard-list-item div {
  display: grid;
  gap: 0.15rem;
}
.dashboard-list-item strong {
  color: #0b2f28;
}
.dashboard-list-item span,
.dashboard-list-empty {
  color: #60736e;
  font-weight: 600;
}
.dashboard-badge {
  font-style: normal;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-weight: 800;
  font-size: 0.82rem;
  background: #eaf2ef;
  color: #315c52;
}
.dashboard-badge-success { background: #dff6ec; color: #0b6b45; }
.dashboard-badge-warning { background: #fff0ca; color: #835700; }
.dashboard-badge-danger { background: #ffe0e0; color: #9b1c1c; }
@media (max-width: 1100px) {
  .dashboard-metrics,
  .dashboard-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .dashboard-metrics,
  .dashboard-sections {
    grid-template-columns: 1fr;
  }
  .dashboard-list-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Inscription autonome des sociétés */
.registration-shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.registration-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}

.registration-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.registration-header .login-logo {
  flex: 0 0 auto;
}

.registration-header h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  margin-bottom: 8px;
}

.registration-form {
  display: block;
}

.registration-form .settings-card {
  padding: 20px;
}

.registration-plan-card {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft);
  padding: 12px 14px;
}

.registration-plan-card > span,
.registration-plan-card > small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.registration-plan-card > strong {
  color: var(--primary-strong);
  font-size: 1.1rem;
}

.registration-password-policy {
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: var(--surface-strong);
  border-radius: 6px;
}

.registration-terms {
  margin-top: 18px;
  align-items: flex-start;
}

.registration-actions {
  margin-top: 18px;
}

.registration-notice {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.registration-success {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  border-color: var(--ok);
  background: var(--ok-soft);
  padding: 24px;
}

.registration-success[hidden] {
  display: none;
}

.registration-success-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.auth-switch {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.auth-switch a {
  color: var(--primary-strong);
  font-weight: 800;
}

@media (max-width: 680px) {
  .registration-header {
    align-items: flex-start;
  }

  .registration-header .login-logo {
    width: 58px;
    height: 58px;
  }

  .registration-actions {
    display: grid;
  }

  .registration-actions .button {
    width: 100%;
  }
}


/* Abonnements et paiements */
.billing-settings-form { border: 1px solid var(--border, #d9dee7); border-radius: 16px; padding: 18px; }
.billing-pricing-table input, .billing-limits-table input { min-width: 105px; width: 100%; }
.billing-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.billing-plan-card { border: 1px solid var(--border, #d9dee7); border-radius: 16px; padding: 18px; background: var(--panel, #fff); display: flex; flex-direction: column; gap: 10px; }
.billing-plan-card.current { border-width: 2px; }
.billing-plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.billing-plan-card h4 { margin: 0; }
.billing-plan-card p { min-height: 42px; margin: 4px 0; }
.billing-price { font-size: 1.35rem; }
.billing-checkout-controls { max-width: 760px; }
@media (max-width: 760px) {
  .billing-pricing-table, .billing-limits-table { min-width: 760px; }
}

/* Portail commun de connexion des Administrateurs et RH société. */
.login-heading-block {
  display: grid;
  gap: 6px;
}

.login-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.company-code-field small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.company-staff-notice {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #cfe6dd;
  border-radius: 10px;
  background: #f1faf6;
  color: var(--primary-strong);
}

.company-staff-notice strong {
  font-size: 0.86rem;
}

.company-staff-notice span {
  color: #527068;
  font-size: 0.78rem;
  line-height: 1.45;
}

.login-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-submit-button {
  width: 100%;
  min-height: 46px;
}

.login-message:not(:empty) {
  padding: 11px 12px;
  border: 1px solid #f0d7d7;
  border-radius: 8px;
  background: #fff7f7;
  color: var(--danger);
}

body.company-staff-portal {
  background:
    radial-gradient(circle at 12% 12%, rgba(33, 110, 93, 0.10), transparent 30%),
    linear-gradient(145deg, #f5f9f7 0%, #eef5f2 100%);
}

body.company-staff-portal .login-shell {
  padding: 32px 20px;
}

body.company-staff-portal .login-panel {
  width: min(510px, 100%);
  gap: 20px;
  padding: clamp(26px, 5vw, 40px);
  border-color: rgba(33, 110, 93, 0.15);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(25, 67, 56, 0.13);
}

body.company-staff-portal .login-panel h1 {
  max-width: 420px;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.08 !important;
}

body.company-staff-portal .login-panel .eyebrow {
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.company-staff-portal .login-form {
  gap: 16px;
}

body.company-staff-portal .login-form label {
  display: grid;
  gap: 7px;
}

body.company-staff-portal .login-form label > span {
  color: var(--text);
  font-size: 0.82rem;
}

body.company-staff-portal .login-form input {
  min-height: 48px;
  border-radius: 10px;
  padding: 11px 13px;
}

@media (max-width: 560px) {
  body.company-staff-portal .login-shell {
    align-items: start;
    padding: 18px 12px;
  }

  body.company-staff-portal .login-panel {
    padding: 24px 18px;
    border-radius: 14px;
  }
}


/* Phase 9 — contours complets et zones tactiles homogènes */
input:not([type="checkbox"]):not([type="radio"]),select,textarea{border-style:solid;border-width:1px;border-color:color-mix(in srgb,var(--text) 20%,var(--line));transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}
input:not([type="checkbox"]):not([type="radio"]):hover,select:hover,textarea:hover{border-color:color-mix(in srgb,var(--text) 32%,var(--line))}
input:not([type="checkbox"]):not([type="radio"]):focus-visible,select:focus-visible,textarea:focus-visible{outline:0;border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 16%,transparent)}
input:disabled,select:disabled,textarea:disabled,input[readonly],textarea[readonly]{background:color-mix(in srgb,var(--surface) 87%,var(--text) 13%);border-color:color-mix(in srgb,var(--text) 13%,var(--line));color:color-mix(in srgb,var(--text) 70%,var(--muted));opacity:1}
input[type="checkbox"],input[type="radio"]{width:19px;height:19px;min-height:19px;border:1px solid color-mix(in srgb,var(--text) 30%,var(--line));accent-color:var(--primary);cursor:pointer}
input[type="checkbox"]:focus-visible,input[type="radio"]:focus-visible{outline:0;box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 16%,transparent)}
@media(max-width:900px){button,input,select,textarea{touch-action:manipulation}input:not([type="checkbox"]):not([type="radio"]),select{min-height:44px}}
