/* ============================================================
   Feuilles de temps — Groupe Écorécréo
   Feuille de style principale (v2 — refonte UX/UI)
   ============================================================ */

/* --------------------------------------------------------
   Variables
   -------------------------------------------------------- */
:root {
  --accent:        #0e7490;
  --accent-dark:   #155e75;
  --accent-darker: #164e63;
  --accent-light:  #cffafe;
  --accent-pale:   #ecfeff;

  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --error:         #dc2626;
  --error-bg:      #fef2f2;
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --info:          #2563eb;
  --info-bg:       #eff6ff;

  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;

  --bg-page:       #f1f5f9;
  --bg-card:       #ffffff;
  --bg-input:      #ffffff;
  --bg-hover:      #f8fafc;
  --bg-subtle:     #f8fafc;

  --border:        #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus:  var(--accent);

  --radius-sm:     0.5rem;
  --radius:        0.875rem;
  --radius-lg:     1.125rem;

  --shadow-sm:     0 1px 2px rgba(15,23,42,.06);
  --shadow:        0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
  --shadow-md:     0 4px 6px rgba(15,23,42,.05), 0 10px 24px rgba(15,23,42,.08);
  --shadow-lg:     0 8px 16px rgba(15,23,42,.06), 0 20px 48px rgba(15,23,42,.12);

  --font:          system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:     'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  --line-height:   1.6;

  --transition:    .18s cubic-bezier(.4, 0, .2, 1);

  --header-h:      7.25rem;   /* rangée marque 4rem + rangée nav 3.25rem */
  --container-max: 1320px;
  --container-narrow: 560px;
}

/* --------------------------------------------------------
   Reset & base
   -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 1600px) {
  html { font-size: 17px; }
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button { font-family: var(--font); }

/* --------------------------------------------------------
   Typographie
   -------------------------------------------------------- */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

/* --------------------------------------------------------
   En-tête — rangée 1 : marque + utilisateur
   -------------------------------------------------------- */
.app-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: .875rem;
  min-width: 0;
}

.app-header__logo {
  height: 2.625rem;
  width: auto;
  object-fit: contain;
}

.app-header__title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.app-header__user {
  display: flex;
  align-items: center;
  gap: .875rem;
  flex-shrink: 0;
}

.user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.app-header__user-name {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* --------------------------------------------------------
   En-tête — rangée 2 : barre de navigation
   -------------------------------------------------------- */
.app-header__nav-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.app-nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.app-nav__list {
  list-style: none;
  display: flex;
  gap: .375rem;
  height: 3.25rem;
  align-items: stretch;
}

.app-nav__item { display: flex; }

.app-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1.125rem;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition), background var(--transition);
}

.app-nav__link::after {
  content: '';
  position: absolute;
  left: .875rem;
  right: .875rem;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  transition: background var(--transition);
}

.app-nav__link:hover {
  color: var(--accent);
  background: var(--accent-pale);
  text-decoration: none;
}

.app-nav__item--active .app-nav__link {
  color: var(--accent);
  font-weight: 600;
}

.app-nav__item--active .app-nav__link::after {
  background: var(--accent);
}

.nav-icon { font-style: normal; font-size: 1.0625rem; line-height: 1; }

/* Burger mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: .5rem;
  transition: border-color var(--transition);
}

.nav-toggle:hover { border-color: var(--accent); }

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition);
}

@media (max-width: 767px) {
  :root { --header-h: 4rem; }
  .nav-toggle { display: flex; }
  .app-header__title { display: none; }
  .app-header__user-name { display: none; }
  .app-header__nav-bar {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0; right: 0;
    background: #fff;
    box-shadow: var(--shadow-md);
  }
  .app-header__nav-bar.is-open { display: block; }
  .app-nav { padding: .5rem .75rem; }
  .app-nav__list { flex-direction: column; height: auto; gap: .125rem; }
  .app-nav__item { display: block; }
  .app-nav__link {
    padding: .875rem 1rem;
    border-radius: var(--radius-sm);
  }
  .app-nav__link::after { display: none; }
  .app-nav__item--active .app-nav__link { background: var(--accent-pale); }
}

/* --------------------------------------------------------
   Mise en page
   -------------------------------------------------------- */
.app-main {
  flex: 1;
  padding: 2.5rem 1.5rem 3rem;
}

@media (max-width: 767px) {
  .app-main { padding: 1.25rem 1rem 2rem; }
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.container--narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

/* --------------------------------------------------------
   Cartes
   -------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card__title { font-size: 1.1875rem; font-weight: 650; }
.card__subtitle { font-size: .9375rem; color: var(--text-secondary); margin-top: .375rem; }

.card__body { padding: 1.5rem 1.75rem 1.75rem; }

.card + .card { margin-top: 1.5rem; }

/* --------------------------------------------------------
   Formulaires
   -------------------------------------------------------- */
.form-group { margin-bottom: 1.375rem; }

.form-label {
  display: block;
  font-size: .9375rem;
  font-weight: 550;
  color: var(--text-primary);
  margin-bottom: .4375rem;
}

.form-label--required::after {
  content: ' *';
  color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover { border-color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(14,116,144,.14);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .625rem center;
  padding-right: 2.25rem;
}

.form-textarea {
  resize: vertical;
  min-height: 4rem;
  line-height: 1.5;
}

.form-hint {
  display: block;
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: .3125rem;
}

.form-error {
  display: block;
  font-size: .8125rem;
  color: var(--error);
  margin-top: .3125rem;
}

.form-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 2.75rem; }
.input-toggle-btn {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: .25rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------
   Boutons
   -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4375rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 550;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(14,116,144,.3);
}
.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(14,116,144,.35);
  text-decoration: none;
  color: #fff;
}

.btn--secondary {
  background: var(--accent-pale);
  color: var(--accent-dark);
  border-color: var(--accent-light);
}
.btn--secondary:hover {
  background: var(--accent-light);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
  text-decoration: none;
}

.btn--danger {
  background: var(--error-bg);
  color: var(--error);
  border-color: #fecaca;
}
.btn--danger:hover {
  background: #fee2e2;
  border-color: var(--error);
  text-decoration: none;
}

.btn--sm { padding: .375rem .875rem; font-size: .875rem; }
.btn--lg { padding: .8125rem 1.625rem; font-size: 1.0625rem; }
.btn--full { width: 100%; }

/* Bouton icône (flèches de date, etc.) */
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.btn-icon:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

.btn-icon:disabled { opacity: .35; cursor: default; }

/* --------------------------------------------------------
   Alertes
   -------------------------------------------------------- */
.alert {
  padding: .9375rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  border-left: 4px solid;
  margin-bottom: 1.25rem;
}

.alert--success { background: var(--success-bg); border-color: var(--success); color: #15803d; }
.alert--error   { background: var(--error-bg);   border-color: var(--error);   color: #b91c1c; }
.alert--warning { background: var(--warning-bg); border-color: var(--warning); color: #b45309; }
.alert--info    { background: var(--info-bg);    border-color: var(--info);    color: #1d4ed8; }

/* --------------------------------------------------------
   Tableaux
   -------------------------------------------------------- */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}

.table th {
  background: var(--bg-subtle);
  font-size: .75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  padding: .8125rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--bg-hover); }

.table--compact th, .table--compact td { padding: .5625rem .875rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: .1875rem .625rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .02em;
}

.badge--green  { background: #dcfce7; color: #15803d; }
.badge--red    { background: #fee2e2; color: #dc2626; }
.badge--blue   { background: #dbeafe; color: #2563eb; }
.badge--amber  { background: #fef3c7; color: #b45309; }
.badge--gray   { background: #f1f5f9; color: #64748b; }
.badge--teal   { background: var(--accent-light); color: var(--accent-dark); }

/* Tables responsives : empilement en cartes sur mobile */
@media (max-width: 767px) {
  .table--responsive thead { display: none; }
  .table--responsive tbody,
  .table--responsive tr,
  .table--responsive td {
    display: block;
    width: 100%;
  }
  .table--responsive tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 0 0 .875rem;
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
  }
  .table--responsive td {
    padding: .625rem .875rem;
    border-bottom: 1px solid var(--border);
  }
  .table--responsive td:last-child { border-bottom: none; }
  .table--responsive td::before {
    content: attr(data-label);
    display: block;
    font-size: .6875rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: .1875rem;
  }
  .table--responsive td[data-label=""]::before { display: none; }
}

/* --------------------------------------------------------
   Page de connexion
   -------------------------------------------------------- */
.page-login {
  background: linear-gradient(150deg, #ecfeff 0%, #f0f9ff 45%, #f0fdf4 100%);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.login-container {
  width: 100%;
  max-width: 430px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.75rem 2.5rem 2.25rem;
}

@media (max-width: 480px) {
  .login-card { padding: 2rem 1.5rem 1.75rem; }
}

.login-card__header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  height: 4rem;
  width: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.015em;
}

.login-subtitle {
  font-size: .9375rem;
  color: var(--text-secondary);
  margin-top: .3125rem;
}

.login-form .form-group { margin-bottom: 1.375rem; }

.login-help {
  font-size: .8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1.5rem;
}

.page-login .app-header,
.page-login .app-footer { display: none; }

/* --------------------------------------------------------
   Pied de page
   -------------------------------------------------------- */
.app-footer {
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: .8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* --------------------------------------------------------
   Saisie du temps — tableau multi-lignes
   -------------------------------------------------------- */
.time-entry-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.time-entry-header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.time-entry-header h2 { font-size: 1.1875rem; }

.date-selector-group {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.date-selector-group label {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: .25rem;
}

.date-selector-group .form-input {
  width: auto;
  min-width: 10.5rem;
  height: 2.5rem;
  padding: .375rem .75rem;
}

/* Tableau de saisie */
.entry-table-wrapper { overflow-x: auto; }

.entry-table {
  width: 100%;
  border-collapse: collapse;
}

.entry-table thead th {
  background: var(--bg-subtle);
  font-size: .75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  padding: .8125rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.entry-table thead th:first-child { padding-left: 1.5rem; }
.entry-table thead th:last-child  { padding-right: 1.5rem; }

.entry-group { border-bottom: 1px solid var(--border); }

.entry-row-main td {
  padding: 1rem .5rem .4375rem;
  vertical-align: middle;
}

.entry-row-details td {
  padding: 0 .5rem 1rem;
}

.entry-row-main td:first-child { padding-left: 1.5rem; }
.entry-row-main td:last-child  { padding-right: 1.5rem; }

.entry-table .form-input,
.entry-table .form-select {
  font-size: .9375rem;
  padding: .5rem .625rem;
  height: 2.5rem;
}

.entry-table .form-textarea {
  font-size: .9375rem;
  padding: .5rem .625rem;
  min-height: 0;
}

.entry-table .col-num     { width: 56px; }
.entry-table .col-site    { min-width: 170px; }
.entry-table .col-location{ min-width: 150px; }
.entry-table .col-activity{ min-width: 190px; }
.entry-table .col-hours   { width: 190px; }
.entry-table .col-actions { width: 56px; text-align: center; }

.row-number {
  text-align: center;
  vertical-align: middle;
}

.entry-num {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-pale);
  border: 1px solid var(--accent-light);
  color: var(--accent-dark);
  font-size: .8125rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.hours-wrap {
  display: flex;
  align-items: center;
  gap: .375rem;
}

.hours-wrap .entry-hours { width: 5.25rem; flex-shrink: 0; }

.entry-table-footer {
  padding: 1.125rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .875rem;
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius) var(--radius);
}

.total-hours-display {
  font-size: 1rem;
  color: var(--text-secondary);
}

.total-hours-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent);
}

.btn-remove-row {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: .875rem;
  transition: all var(--transition);
  width: 2.125rem;
  height: 2.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-row:hover {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

/* Minuterie */
.btn-timer {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3125rem;
  padding: 0 .5625rem;
  font-size: .8125rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  height: 2.5rem;
  white-space: nowrap;
}

.btn-timer:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

.btn-timer--active {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
  animation: timerPulse 1.4s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.25); }
  50%       { box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
}

.timer-display {
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 600;
}

.timer-display:empty { display: none; }

.timer-icon { font-size: 1rem; line-height: 1; }

/* Mobile : chaque entrée devient une carte */
@media (max-width: 767px) {
  .entry-table thead { display: none; }
  .entry-table,
  .entry-table tbody,
  .entry-table tr,
  .entry-table td {
    display: block;
    width: 100%;
  }
  .entry-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: .875rem 1rem;
    padding: .875rem;
    box-shadow: var(--shadow-sm);
  }
  .entry-row-main td,
  .entry-row-details td,
  .entry-row-main td:first-child,
  .entry-row-details td:first-child,
  .entry-row-main td:last-child {
    padding: .4375rem .25rem;
  }
  .entry-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .6875rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: .25rem;
  }
  .entry-table .row-number { display: none; }
  .entry-table .col-actions { text-align: right; padding-top: 0; }
  .entry-table-wrapper { overflow: visible; }
  .entry-table-footer { border-radius: 0 0 var(--radius) var(--radius); }
}

/* --------------------------------------------------------
   Mes entrées — liste
   -------------------------------------------------------- */
.entries-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.entries-filters .form-group { margin-bottom: 0; }

.entries-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.5rem 1.75rem;
}

.summary-card {
  background: var(--accent-pale);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 1.125rem 1rem;
  text-align: center;
}

.summary-card__value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.summary-card__label {
  font-size: .8125rem;
  color: var(--text-secondary);
  margin-top: .375rem;
}

/* Bascule liste / calendrier */
.view-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .1875rem;
  gap: .1875rem;
}

.view-toggle .btn {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: .375rem .875rem;
  font-size: .875rem;
  color: var(--text-secondary);
}

.view-toggle .btn:hover { background: var(--bg-card); color: var(--text-primary); }

.view-toggle .btn.active {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------
   Calendrier mensuel
   -------------------------------------------------------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
}

.cal-month-label {
  font-weight: 650;
  font-size: 1.0625rem;
  min-width: 11rem;
  text-align: center;
  text-transform: capitalize;
}

.cal-grid { padding: .25rem 1.75rem 1.75rem; }

.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.cal-dow span {
  text-align: center;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .375rem 0;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .625rem;
  min-height: 4.25rem;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.cal-day--empty {
  background: transparent;
  border-color: transparent;
}

.cal-day--has-entries {
  background: var(--accent-pale);
  border-color: var(--accent-light);
  cursor: pointer;
}

.cal-day--has-entries:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.cal-day--today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cal-day__num {
  font-size: .75rem;
  font-weight: 650;
  color: var(--text-secondary);
}

.cal-day--today .cal-day__num { color: var(--accent); }

.cal-day__hours {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent);
  margin: auto;
  text-align: center;
  line-height: 1.1;
}

.cal-day__hours-unit {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 1px;
}

@media (max-width: 600px) {
  .cal-grid { padding: .25rem 1rem 1.25rem; }
  .cal-day { min-height: 3rem; padding: .25rem .375rem; }
  .cal-day__hours { font-size: .8125rem; }
  .cal-dow span { font-size: .625rem; }
}

/* --------------------------------------------------------
   Tableau de bord analytique
   -------------------------------------------------------- */
.dashboard-filters {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.375rem 1.75rem;
  margin-bottom: 1.5rem;
}

.dashboard-filters h3 {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  align-items: flex-end;
}

.filter-row .form-group { margin-bottom: 0; min-width: 150px; }

.period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: 1rem;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.625rem;
  display: flex;
  flex-direction: column;
  gap: .3125rem;
}

.kpi-card__value {
  font-size: 2.125rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.kpi-card__label {
  font-size: .875rem;
  color: var(--text-secondary);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1023px) {
  .charts-grid { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.625rem;
}

.chart-card h3 {
  font-size: .9375rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.chart-card canvas { max-height: 280px; }

.chart-card--wide { grid-column: 1 / -1; }

.overtime-flag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  font-weight: 650;
  color: var(--warning);
  background: var(--warning-bg);
  border-radius: 9999px;
  padding: .125rem .5625rem;
}

/* --------------------------------------------------------
   Admin — panneau de configuration
   -------------------------------------------------------- */
.admin-layout {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1023px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
}

.admin-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.admin-sidebar__title {
  padding: 1.0625rem 1.375rem;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-sidebar__menu {
  list-style: none;
  padding: .5rem 0;
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6875rem 1.375rem;
  font-size: .9375rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.admin-sidebar__link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.admin-sidebar__link--active {
  background: var(--accent-pale);
  color: var(--accent-dark);
  border-left-color: var(--accent);
  font-weight: 600;
}

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

/* --------------------------------------------------------
   Pagination
   -------------------------------------------------------- */
.pagination {
  display: flex;
  gap: .25rem;
  justify-content: center;
  padding: 1rem 0;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 .5rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background var(--transition);
}

.pagination a:hover { background: var(--bg-hover); text-decoration: none; }
.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --------------------------------------------------------
   Journal de connexions
   -------------------------------------------------------- */
.login-log-success { color: var(--success); font-weight: 600; }
.login-log-fail    { color: var(--error);   font-weight: 600; }

/* --------------------------------------------------------
   Utilitaires
   -------------------------------------------------------- */
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-success  { color: var(--success); }
.text-error    { color: var(--error); }
.text-warning  { color: var(--warning); }
.text-accent   { color: var(--accent); }

.mt-1  { margin-top: .25rem; }
.mt-2  { margin-top: .5rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* --------------------------------------------------------
   Spinner
   -------------------------------------------------------- */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------
   Toast
   -------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------
   Barre de période (presets + flèches)
   -------------------------------------------------------- */
.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}

.period-bar .period-presets { margin-bottom: 0; }

.period-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.period-label {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 11rem;
  text-align: center;
  white-space: nowrap;
}

/* --------------------------------------------------------
   Minuterie globale (style Toggl)
   -------------------------------------------------------- */
.timer-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .875rem;
  padding: .875rem 1.75rem;
  background: var(--accent-pale);
  border-bottom: 1px solid var(--border);
}

.timer-elapsed {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--error);
  min-height: 1.5rem;
}

.timer-elapsed:empty { display: none; }

.timer-running { animation: timerPulse 1.4s ease-in-out infinite; }

.timer-hint {
  font-size: .8125rem;
  color: var(--text-muted);
}

@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.25); }
  50%       { box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
}

/* Aide à la conversion des minutes */
.hours-help { position: relative; margin-left: auto; }

.hours-help summary {
  list-style: none;
  cursor: pointer;
  font-size: .8125rem;
  color: var(--accent);
  font-weight: 550;
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
  user-select: none;
}

.hours-help summary::-webkit-details-marker { display: none; }
.hours-help summary::before { content: '? '; font-weight: 700; }
.hours-help summary:hover { background: var(--accent-light); }

.hours-help__panel {
  position: absolute;
  right: 0;
  top: calc(100% + .375rem);
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: .875rem 1rem;
  width: 230px;
  font-size: .875rem;
}

.hours-help__panel table { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.hours-help__panel td { padding: .1875rem 0; border-bottom: 1px solid var(--border); }
.hours-help__panel td:last-child { text-align: right; color: var(--accent); }
.hours-help__panel tr:last-child td { border-bottom: none; }
.hours-help__panel p { font-size: .8125rem; color: var(--text-secondary); }
.hours-help__panel code {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  padding: 0 .25rem;
  border-radius: 3px;
}

.th-help {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: .6875rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  cursor: help;
  vertical-align: text-top;
}

/* --------------------------------------------------------
   Indicateur de progression de semaine
   -------------------------------------------------------- */
.week-progress {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-top: .375rem;
}

.week-progress__bar {
  width: 140px;
  height: 8px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  flex-shrink: 0;
}

.week-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width .4s ease;
}

.week-progress__fill--done { background: var(--success); }

.week-progress__text {
  font-size: .8125rem;
  color: var(--text-secondary);
}

.week-progress__text strong { color: var(--accent); }

/* --------------------------------------------------------
   Barres de progression génériques (rapports)
   -------------------------------------------------------- */
.progress {
  flex: 1;
  height: 10px;
  background: var(--bg-page);
  border-radius: 9999px;
  overflow: hidden;
  min-width: 80px;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #06b6d4 100%);
  border-radius: 9999px;
  transition: width .4s ease;
}

.report-line {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .4375rem 0;
}

.report-line__label {
  width: 38%;
  min-width: 140px;
  font-size: .9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-line__value {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

@media (max-width: 600px) {
  .report-line { flex-wrap: wrap; gap: .375rem; }
  .report-line__label { width: 100%; }
}

/* --------------------------------------------------------
   Conformité
   -------------------------------------------------------- */
.compliance-table th { white-space: nowrap; }
.compliance-table .badge { min-width: 3.75rem; justify-content: center; }

/* --------------------------------------------------------
   Mon compte
   -------------------------------------------------------- */
.account-profile { display: flex; flex-direction: column; }

.account-profile__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9375rem;
}

.account-profile__row:last-child { border-bottom: none; }

.account-profile__label {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

/* --------------------------------------------------------
   Onglets d'administration (remplace la sidebar)
   -------------------------------------------------------- */
.admin-layout { display: block; }

.admin-tabs {
  display: flex;
  gap: .25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .375rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tabs__link {
  padding: .5625rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.admin-tabs__link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.admin-tabs__link--active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.admin-tabs__link--active:hover {
  background: var(--accent-dark);
  color: #fff;
}

/* --------------------------------------------------------
   Barre d'outils de table (recherche + exports)
   -------------------------------------------------------- */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-wrap: wrap;
}

.table-toolbar .form-input { width: 220px; }

.table-toolbar__actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
