/* ============================================================
   TimesheetApp — Feuille de style globale
   Palette : bleu ardoise #2C3E6B · accentuation #3B82F6
             fond doux #F5F7FA · texte sombre #1E293B
   ============================================================ */

:root {
  --brand-dark:   #2C3E6B;
  --brand-mid:    #3B5998;
  --brand-accent: #3B82F6;
  --brand-light:  #EBF0FB;
  --sidebar-w:    230px;
  --bg:           #F5F7FA;
  --surface:      #FFFFFF;
  --text:         #1E293B;
  --text-muted:   #64748B;
  --border:       #E2E8F0;
  --danger:       #EF4444;
  --success:      #22C55E;
  --warning:      #F59E0B;
  --radius:       6px;
  --shadow:       0 1px 4px rgba(0,0,0,.08);
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--brand-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

#sidebar .brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
#sidebar .brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
#sidebar .brand span {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  display: block;
  margin-top: 2px;
}

#sidebar nav { flex: 1; padding: 12px 0; }

#sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
#sidebar nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
#sidebar nav a.active {
  background: rgba(59,130,246,.2);
  color: #fff;
  border-left-color: var(--brand-accent);
}
#sidebar nav a svg { flex-shrink: 0; }

#sidebar .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 16px 20px 6px;
}

#sidebar .user-bar {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
#sidebar .user-bar .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
#sidebar .user-bar .info { flex: 1; overflow: hidden; }
#sidebar .user-bar .info strong {
  display: block; font-size: 13px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#sidebar .user-bar .info a {
  font-size: 11px; color: rgba(255,255,255,.45); text-decoration: none;
}
#sidebar .user-bar .info a:hover { color: #fff; }

/* ── Main ── */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
}
.page-header .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── Forms ── */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }

input[type="text"], input[type="password"], input[type="datetime-local"],
input[type="date"], input[type="number"], select, textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary   { background: var(--brand-accent); color: #fff; }
.btn-primary:hover { background: #2563EB; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-success   { background: var(--success); color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--brand-light); }
table.data-table .actions { display: flex; gap: 6px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-blue   { background: var(--brand-light); color: var(--brand-accent); }
.badge-green  { background: #DCFCE7; color: #16A34A; }
.badge-orange { background: #FEF3C7; color: #D97706; }
.badge-red    { background: #FEE2E2; color: #DC2626; }

/* ── Alerts ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-success { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.alert-danger  { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-info    { background: var(--brand-light); color: var(--brand-dark); border: 1px solid #BFDBFE; }

/* ── Chrono timer ── */
#chronoDisplay {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-dark);
  letter-spacing: 2px;
}

/* ── Rapport stats ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card .label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--brand-dark); margin-top: 4px; }
.stat-card .sub   { font-size: 12px; color: var(--text-muted); }

/* ── Login page ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-dark);
}
.login-box {
  background: var(--surface);
  border-radius: 10px;
  padding: 38px 40px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.login-box .logo { text-align: center; margin-bottom: 24px; }
.login-box .logo h1 { font-size: 24px; font-weight: 800; color: var(--brand-dark); }
.login-box .logo span { font-size: 12px; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #main-content { margin-left: 0; padding: 16px; }
}
