*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #f5f6f4;
  -webkit-font-smoothing: antialiased;
  color: #10120f;
}

a { color: #0f6b56; text-decoration: none; }
a:hover { color: #0a4f3f; }
input, select, button, textarea { font-family: 'Inter', sans-serif; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cdd3cf; border-radius: 10px; }

h1, h2, h3, .font-display { font-family: 'Poppins', sans-serif; font-weight: 800; }

button { cursor: pointer; }

/* ---------- Login ---------- */
.login-screen {
  height: 100vh; display: flex; position: relative; overflow: hidden;
  background: radial-gradient(1100px 700px at 85% 15%, #12503f 0%, transparent 60%),
    linear-gradient(160deg, #0a2b22 0%, #06140f 65%, #050e0b 100%);
}
.login-left {
  position: relative; z-index: 2; flex: 1 1 560px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; padding: 64px 72px; min-width: 0;
}
.login-tag { font-style: italic; font-size: 16px; font-weight: 600; color: #34d399; margin-bottom: 20px; }
.login-tag::before { content: "\2022"; margin-right: 8px; }
.login-wordmark { font-family: 'Poppins', sans-serif; font-weight: 800; text-transform: uppercase;
  font-size: clamp(46px, 6.2vw, 92px); line-height: 0.98; letter-spacing: 0.5px; margin: 0 0 24px; }
.login-wordmark span { display: block; }
.login-wordmark .fill { color: #fff; }
.login-wordmark .outline { color: transparent; -webkit-text-stroke: 1.5px #fff; }
.login-subline { font-size: 16px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #6ee7b7; margin-bottom: 32px; }
.login-error { background: rgba(220,38,38,0.14); border: 1px solid rgba(220,38,38,0.35); border-radius: 10px;
  padding: 12px 16px; font-size: 15px; color: #fca5a5; margin-bottom: 18px; max-width: 500px; width: 100%; }
.login-form { max-width: 500px; width: 100%; text-align: left; }
.login-field { position: relative; margin-bottom: 16px; }
.login-field-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  font-size: 17px; opacity: 0.55; pointer-events: none; }
.login-field input { width: 100%; padding: 16px 50px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; font-size: 17px; color: #fff; outline: none;
  transition: border-color 0.15s; }
.login-field input::placeholder { color: rgba(255,255,255,0.4); }
.login-field input:focus { border-color: #34d399; }
.login-field-toggle { position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 17px; opacity: 0.55; cursor: pointer; background: none; border: none; padding: 0; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 24px;
  font-size: 15px; color: rgba(255,255,255,0.55); flex-wrap: wrap; gap: 8px; }
.login-remember { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.login-remember input { accent-color: #0f6b56; width: 16px; height: 16px; }
.login-row a { color: rgba(255,255,255,0.55); font-size: 15px; }
.login-row a:hover { color: #6ee7b7; }
.login-submit { width: 100%; max-width: 500px; padding: 17px; background: #22c55e; color: #06140f; border: none;
  border-radius: 999px; font-size: 16px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.login-submit:hover { background: #34d399; }
.login-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.login-footer { margin-top: 26px; font-size: 13px; color: rgba(255,255,255,0.35); }
.login-right { position: relative; z-index: 1; flex: 1 1 620px; display: flex; align-items: flex-end;
  justify-content: center; min-width: 0; }
@media (max-width: 860px) { .login-right { display: none; } .login-left { padding: 48px 28px; } }
.login-mascot-wrap { position: relative; width: 100%; max-width: 640px; height: 100%;
  display: flex; align-items: flex-end; justify-content: center; }
.login-mascot-wrap::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -12%; top: 22%;
  background: radial-gradient(circle at 60% 30%, rgba(52,211,153,0.16) 0%, transparent 65%); border-radius: 50%; }
.login-mascot { position: relative; z-index: 1; max-height: 122vh; width: auto; max-width: 100%;
  object-fit: contain; filter: drop-shadow(0 30px 50px rgba(0,0,0,0.5)); }

/* ---------- App shell ---------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar { width: 220px; min-width: 220px; background: #101110; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding-bottom: 16px; }
.sidebar-brand { padding: 22px 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 6px; }
.sidebar-brand img { height: 77px; width: 171px; object-fit: contain; }
.nav-section { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #4b5350; padding: 16px 18px 6px; }
.nav-item { padding: 9px 18px; cursor: pointer; font-size: 13px; font-weight: 500; color: #8a9490;
  display: block; }
.nav-item:hover { color: #d7dbd5; }
.nav-item.active { font-weight: 700; color: #fff; background: #0f6b56; }
.sidebar-footer { margin-top: auto; padding: 16px 18px 0; border-top: 1px solid rgba(255,255,255,0.07); }
.logout-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px;
  background: transparent; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: #8a9490;
  font-size: 12px; margin-top: 12px; }
.logout-btn:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.sidebar-copyright { font-size: 10px; color: #33372f; text-align: center; margin-top: 10px; }
.sidebar-user { padding: 0 18px; font-size: 11px; color: #6b756f; margin-top: 2px; }

.main { flex: 1; overflow-y: auto; background: #f5f6f4; }

.topbar { background: #fff; border-bottom: 1px solid #e3e6e2; padding: 18px 32px; display: flex;
  align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.page-title { font-family: 'Poppins', sans-serif; font-size: 19px; font-weight: 800; color: #10120f; }
.page-subtitle { font-size: 12px; color: #8b928c; margin-top: 1px; }

.segmented { display: flex; gap: 2px; background: #f0f1ef; border-radius: 10px; padding: 3px; }
.segmented button { padding: 6px 16px; border-radius: 7px; font-size: 12px; font-weight: 500; border: none;
  background: transparent; color: #4b5350; }
.segmented button.active { font-weight: 700; background: #101110; color: #fff; }

.page-body { padding: 24px 32px; }

/* ---------- Cards / KPI ---------- */
.card { background: #fff; border: 1px solid #e3e6e2; border-radius: 14px; padding: 20px; }
.card-tight { padding: 18px 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8b928c; margin-bottom: 8px; }
.kpi-value { font-family: 'Poppins', sans-serif; font-size: 26px; font-weight: 800; color: #10120f; }
.kpi-delta { font-size: 11px; font-weight: 600; margin-top: 4px; color: #16a34a; }
.kpi-note { font-size: 11px; color: #8b928c; font-weight: 600; margin-top: 4px; }
.kpi-card-profit { background: #0f6b56; border: 1px solid #0f6b56; }
.kpi-card-profit .kpi-label { color: rgba(255,255,255,0.75); }
.kpi-card-profit .kpi-value { color: #fff; }
.kpi-card-profit .kpi-note { color: rgba(255,255,255,0.8); }

.kpi-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1300px) { .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); } }

.section-title { font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700; color: #10120f; margin-bottom: 16px; }

/* ---------- Recherche globale (tableau de bord) ---------- */
.dash-search { position: relative; width: 460px; flex-shrink: 0; }
.dash-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 16px; opacity: 0.55; pointer-events: none; }
.dash-search input { width: 100%; padding: 13px 16px 13px 44px; font-size: 14px; border: 1px solid #e3e6e2;
  border-radius: 10px; background: #f8f9f8; color: #10120f; outline: none; transition: border-color 0.15s, background 0.15s; }
.dash-search input:focus { border-color: #0f6b56; background: #fff; }
.dash-search input::placeholder { color: #9aa19c; }
.dash-search-results { position: absolute; top: calc(100% + 6px); left: 0; width: 100%; max-height: 360px;
  overflow-y: auto; background: #fff; border: 1px solid #e3e6e2; border-radius: 12px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.14); z-index: 30; }
.dash-search-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: #8b928c; padding: 10px 14px 4px; }
.dash-search-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; }
.dash-search-row:hover { background: #f5f6f4; }
.dash-search-empty { padding: 14px; font-size: 12px; color: #8b928c; text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead tr { background: #101110; color: #fff; }
table.data-table thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.4px; }
table.data-table thead th:first-child { border-radius: 8px 0 0 8px; }
table.data-table thead th:last-child { border-radius: 0 8px 8px 0; }
table.data-table tbody td { padding: 10px 14px; }
table.data-table tbody tr { border-bottom: 1px solid #eef0ee; }
table.plain-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain-table thead tr { background: #f5f6f4; }
table.plain-table thead th { padding: 9px 16px; text-align: left; font-size: 11px; color: #8b928c; font-weight: 600; }
table.plain-table tbody tr { border-top: 1px solid #eef0ee; }
table.plain-table tbody td { padding: 9px 16px; }

.badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; display: inline-block; }

/* ---------- Forms ---------- */
.field-label { font-size: 11px; font-weight: 600; color: #8b928c; margin-bottom: 5px; }
.field-value { font-size: 13px; color: #10120f; padding: 8px 0; }
.field-input { width: 100%; padding: 8px 10px; border: 1px solid #e3e6e2; border-radius: 8px; font-size: 13px; color: #10120f; background: #fff; }
.field-input[readonly] { background: #f8f9f8; color: #4b5350; }

/* Saisie manuelle heure/minute (feuille de temps) : un "pill" groupant
   heure + minute, comme dans Oolong — deux cases par groupe (début / fin),
   flèches natives de <input type="number"> masquées pour éviter qu'elles
   ne grignotent la largeur et coupent les chiffres. */
.hm-group { display: inline-flex; align-items: center; gap: 4px; background: #f5f6f4;
  border: 1px solid #e3e6e2; border-radius: 8px; padding: 6px 10px; }
.hm-group span { font-size: 11px; color: #8b928c; font-weight: 600; }
.hm-input { width: 22px; border: none; background: transparent; font-size: 14px; font-weight: 700;
  text-align: center; color: #10120f; padding: 0; -moz-appearance: textfield; }
.hm-input::-webkit-outer-spin-button, .hm-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hm-input:focus { outline: none; }

.btn { padding: 8px 14px; border-radius: 8px; border: 1px solid #e3e6e2; background: #fff; font-size: 12px;
  font-weight: 600; color: #4b5350; }
.btn:hover { background: #f5f6f4; }
.btn-primary { background: #0f6b56; color: #fff; border-color: #0f6b56; }
.btn-primary:hover { background: #0a4f3f; }
.btn-danger-text { color: #dc2626; cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.file-drop { border: 1px dashed #cdd3cf; border-radius: 10px; padding: 16px; text-align: center; }
.file-drop-label { font-size: 12px; font-weight: 600; color: #4b5350; margin-bottom: 8px; }
.file-drop-action { font-size: 11px; color: #0f6b56; cursor: pointer; }

.warning-banner { background: #fffaf0; padding: 9px 20px; font-size: 12px; color: #92400e; border-bottom: 1px solid #fde8c4; }
.stat-box-warning { background: #fffaf0; border: 1px solid #fde8c4; border-radius: 10px; padding: 12px 14px; }
.stat-box-success { background: #f0fdf4; border: 1px solid #bbf0cf; border-radius: 10px; padding: 12px 14px; }
.stat-box-danger { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; }
.stat-box-label { font-size: 10px; font-weight: 700; margin-bottom: 5px; }
.stat-box-value { font-size: 18px; font-weight: 800; }

.dark-panel { background: #101110; border-radius: 10px; padding: 14px 18px; display: flex; justify-content: space-between; }
.dark-panel-label { font-size: 10px; color: #8a9490; letter-spacing: 0.5px; }
.dark-panel-value { font-size: 20px; font-weight: 800; }

.empty-state { padding: 14px; text-align: center; color: #8b928c; font-size: 12px; border: 1px solid #eef0ee; border-radius: 0 0 8px 8px; }

/* ---------- Diagramme à bandes (tableau de bord) ---------- */
.bar-chart { position: relative; display: flex; align-items: flex-end; gap: 22px; height: 230px;
  padding: 14px 4px 0; border-bottom: 1px solid #eef0ee; }
.bar-chart-month { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; min-width: 0; }
.bar-chart-bars { width: 100%; display: flex; gap: 5px; align-items: flex-end; height: 100%; }
.bar-chart-bar { flex: 1; border-radius: 5px 5px 2px 2px; min-height: 3px;
  transition: filter 0.15s ease, transform 0.15s ease; transform-origin: bottom center; cursor: default; }
.bar-chart-bar:hover { filter: brightness(1.1); transform: scaleX(1.15); }
.bar-chart-month-label { font-size: 11px; font-weight: 600; color: #8b928c; margin-top: 10px; }

.donut { border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.donut-hole { border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.legend-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; }

/* ---------- List / master-detail ---------- */
.list-detail { display: flex; }
.list-panel { width: 250px; min-width: 250px; border-right: 1px solid #e3e6e2; background: #fff;
  height: calc(100vh - 65px); overflow-y: auto; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
  border-left: 3px solid transparent; }
.list-row.active { background: #eef6f3; border-left-color: #0f6b56; }
.list-row-title { font-size: 13px; font-weight: 600; color: #10120f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-sub { font-size: 11px; color: #8b928c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; background: #0f6b56; }
.detail-panel { flex: 1; background: #f5f6f4; height: calc(100vh - 65px); overflow-y: auto; padding: 24px 28px; }
.detail-stack { display: flex; flex-direction: column; gap: 18px; }

.loading-row { padding: 40px; text-align: center; color: #8b928c; font-size: 13px; }
.error-banner { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.25); color: #b91c1c;
  border-radius: 10px; padding: 10px 14px; font-size: 12px; margin-bottom: 16px; }

/* ---------- Calendrier de travail hebdomadaire (page Employés) ---------- */
.cal-nav-btn { background: rgba(255,255,255,0.18); border: none; color: #fff; padding: 6px 12px;
  border-radius: 7px; font-size: 12px; font-weight: 600; }
.cal-nav-btn:hover { background: rgba(255,255,255,0.3); }
.cal-legend { display: flex; gap: 14px; font-size: 11px; color: rgba(255,255,255,0.85); }

.cal-grid { display: grid; grid-template-columns: 46px repeat(7, 1fr); }
.cal-head-cell { text-align: center; padding: 8px 2px; border-left: 1px solid #eef0ee; }
.cal-head-day { font-size: 11px; font-weight: 700; color: #10120f; }
.cal-head-date { font-size: 10px; color: #8b928c; margin-top: 1px; }
.cal-add-cell { display: flex; align-items: center; justify-content: center; padding: 4px 0 8px; border-left: 1px solid #eef0ee; }
.cal-add-btn { background: #f5f6f4; border: 1px solid #e3e6e2; color: #4b5350; width: 22px; height: 22px;
  border-radius: 50%; font-size: 13px; line-height: 1; padding: 0; }
.cal-add-btn:hover { background: #0f6b56; color: #fff; border-color: #0f6b56; }

.cal-hours-col { position: relative; }
.cal-hour-label { position: absolute; right: 6px; transform: translateY(-6px); font-size: 10px; color: #8b928c; }

.cal-day-col { position: relative; border-left: 1px solid #eef0ee;
  background-image: repeating-linear-gradient(to bottom, #f2f3f1 0, #f2f3f1 1px, transparent 1px, transparent var(--cal-row-h, 34px));
  cursor: pointer; }
.cal-day-col:hover { background-color: #fafbfa; }

.cal-event { position: absolute; border-radius: 7px; padding: 3px 7px; color: #fff; overflow: hidden;
  cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.cal-event:hover { filter: brightness(1.08); }
.cal-event-title { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event-time { font-size: 9px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Votre journée (tableau de bord) ---------- */
.today-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.today-event-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #eef0ee;
  border-left: 4px solid #2563eb; border-radius: 8px; }
.today-event-time { font-size: 12px; font-weight: 700; color: #10120f; white-space: nowrap; min-width: 92px; }
.today-event-title { font-size: 13px; font-weight: 600; color: #10120f; }
.today-event-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 99px; color: #fff; flex-shrink: 0; margin-left: auto; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(16,17,16,0.55); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 30px 70px rgba(0,0,0,0.35); }
.modal-header { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
.modal-close { background: rgba(255,255,255,0.18); border: none; color: #fff; width: 26px; height: 26px;
  border-radius: 50%; font-size: 14px; cursor: pointer; line-height: 1; flex-shrink: 0; }
.modal-body { padding: 20px 24px 24px; }
.feature-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feature-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #4b5350; }
.feature-list li::before { content: "✓"; color: #16a34a; font-weight: 700; flex-shrink: 0; }
