/* ==========================================================================
   Portail Sous-Traitant Préven-Tech — Industrial Precision Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@500;700&display=swap');

/* Hide elements until Alpine.js processes them (prevents flash of unstyled content) */
[x-cloak] { display: none !important; }

:root {
  /* Brand */
  --pt-red: #de0a27;
  --pt-red-dark: #b80820;
  --pt-red-glow: rgba(222, 10, 39, 0.25);
  --pt-red-subtle: rgba(222, 10, 39, 0.08);
  --pt-red-light: #fef2f2;

  /* Darks */
  --pt-dark-950: #06070a;
  --pt-dark-900: #0a0c10;
  --pt-dark-850: #0d1017;
  --pt-dark-800: #111420;
  --pt-dark-700: #1a1e2e;
  --pt-dark-600: #252a3a;
  --pt-dark-500: #3a4058;

  /* Lights */
  --pt-light-50: #f8f9fb;
  --pt-light-100: #f1f3f7;
  --pt-light-200: #e4e7ee;
  --pt-light-300: #cdd2dc;
  --pt-light-400: #9ca3b4;
  --pt-light-500: #6b7490;
  --pt-light-600: #4a526b;

  /* Semantics */
  --pt-green: #10b981;
  --pt-green-light: #ecfdf5;
  --pt-yellow: #f59e0b;
  --pt-yellow-light: #fffbeb;
  --pt-blue: #3b82f6;
  --pt-blue-light: #eff6ff;
  --pt-purple: #8b5cf6;

  /* Sizing */
  --sidebar-width: 17rem;
  --topbar-height: 3.5rem;

  /* Semantic aliases (light defaults) */
  --pt-bg-page: var(--pt-light-50);
  --pt-bg-card: #fff;
  --pt-bg-card-hover: var(--pt-light-50);
  --pt-bg-input: #fff;
  --pt-bg-header: var(--pt-light-50);
  --pt-text-primary: var(--pt-dark-800);
  --pt-text-secondary: var(--pt-light-500);
  --pt-text-muted: var(--pt-light-400);
  --pt-border: var(--pt-light-200);
  --pt-border-light: var(--pt-light-100);
  --pt-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --pt-shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ===================== DARK THEME — VARIABLE OVERRIDES ===================== */

html.dark {
  --pt-bg-page: #0f1118;
  --pt-bg-card: #1a1e2e;
  --pt-bg-card-hover: #222738;
  --pt-bg-input: #1a1e2e;
  --pt-bg-header: #151825;
  --pt-text-primary: #e2e4ea;
  --pt-text-secondary: #9ca3b4;
  --pt-text-muted: #6b7490;
  --pt-border: rgba(255, 255, 255, 0.08);
  --pt-border-light: rgba(255, 255, 255, 0.04);
  --pt-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
  --pt-shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: var(--pt-bg-page);
  color: var(--pt-text-primary);
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', system-ui, sans-serif;
}

/* ===================== LOGIN PAGE — Split-Screen ===================== */

.login-scene {
  min-height: 100vh;
  display: flex;
  background: #fff;
}

/* --- Left brand panel --- */
.login-brand {
  display: none;
  width: 45%;
  min-height: 100vh;
  background: linear-gradient(160deg, #e01030 0%, var(--pt-red) 40%, #a80818 100%);
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* Geometric pattern overlay */
.login-brand-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.035) 48px,
      rgba(255, 255, 255, 0.035) 49px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.025) 48px,
      rgba(255, 255, 255, 0.025) 49px
    );
  pointer-events: none;
}

/* Subtle radial glow */
.login-brand::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-brand-logo {
  height: 3.5rem;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1);
}

.login-brand-divider {
  width: 2rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  margin-bottom: 1.25rem;
  border-radius: 1px;
}

.login-brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-brand-footer {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* --- Right form panel --- */
.login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  overflow-y: auto;
  background: var(--pt-light-50);
}

.login-form-wrapper {
  width: 100%;
  max-width: 380px;
  animation: loginFadeIn 0.4s ease-out;
}

/* Mobile header */
.login-mobile-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.login-mobile-header img {
  height: 2rem;
}

/* Typography */
.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pt-dark-800);
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--pt-light-500);
  margin-top: 0.375rem;
  line-height: 1.5;
}

/* Login form inputs — light theme */
.login-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--pt-light-200);
  border-radius: 0.5rem;
  color: var(--pt-dark-800);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input::placeholder {
  color: var(--pt-light-400);
}
.login-input:focus {
  outline: none;
  border-color: var(--pt-red);
  box-shadow: 0 0 0 3px var(--pt-red-glow);
  background: #fff;
}

.login-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pt-light-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* OTP inputs — light themed */
.otp-input {
  width: 3.25rem;
  height: 3.75rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pt-dark-800);
  background: #fff;
  border: 2px solid var(--pt-light-200);
  border-radius: 0.625rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--pt-red);
}
.otp-input:focus {
  outline: none;
  border-color: var(--pt-red);
  box-shadow: 0 0 0 3px var(--pt-red-glow);
  background: #fff;
}
.otp-input:disabled {
  opacity: 0.4;
}

/* Login button */
.login-btn {
  width: 100%;
  padding: 0.8125rem 1.5rem;
  background: var(--pt-red);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.login-btn:hover:not(:disabled) {
  background: var(--pt-red-dark);
  box-shadow: 0 4px 16px rgba(222, 10, 39, 0.25);
}
.login-btn:active:not(:disabled) {
  transform: scale(0.985);
}
.login-btn:disabled {
  background: var(--pt-light-200);
  color: var(--pt-light-400);
  cursor: not-allowed;
}

/* Method buttons — light theme */
.login-method-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8125rem 1.25rem;
  background: #fff;
  color: var(--pt-dark-800);
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--pt-light-200);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: left;
}
.login-method-btn:hover:not(:disabled) {
  background: var(--pt-light-50);
  border-color: var(--pt-red);
  box-shadow: 0 0 0 1px rgba(222, 10, 39, 0.1);
}
.login-method-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.login-method-btn svg {
  color: var(--pt-light-500);
}

/* Back link */
.login-back-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pt-light-500);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.login-back-link:hover {
  color: var(--pt-red);
}

/* Resend link */
.login-resend-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pt-red);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.login-resend-link:hover {
  color: var(--pt-red-dark);
}

/* Error box — light theme */
.login-error {
  background: var(--pt-red-light);
  border: 1px solid rgba(222, 10, 39, 0.15);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--pt-red-dark);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

/* Session expired banner */
.expired-banner {
  background: var(--pt-yellow-light);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: #92400e;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Mobile footer */
.login-mobile-footer {
  text-align: center;
  color: var(--pt-light-400);
  font-size: 0.6875rem;
  margin-top: 2rem;
  letter-spacing: 0.04em;
}

/* Fade-in animation */
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Desktop: show split-screen */
@media (min-width: 1024px) {
  .login-brand {
    display: flex;
  }
  .login-mobile-header {
    display: none;
  }
  .login-mobile-footer {
    display: none;
  }
  .login-form-panel {
    padding: 3rem;
  }
}

/* ===================== SIDEBAR ===================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--pt-dark-900);
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* Subtle vertical red accent line */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, var(--pt-red) 0%, transparent 40%, transparent 60%, var(--pt-red) 100%);
  opacity: 0.15;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-header img {
  height: 2rem;
}
.sidebar-header p {
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--pt-dark-500);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.375rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  color: var(--pt-light-400);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  position: relative;
}
.sidebar-link svg {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.sidebar-link:hover svg {
  opacity: 0.9;
}

.sidebar-link.cheque-flash {
  animation: chequeFlash 2s ease-in-out infinite;
}
@keyframes chequeFlash {
  0%, 100% { background: transparent; }
  50% { background: rgba(222, 10, 39, 0.1); }
}
.card.cheque-highlight {
  box-shadow: 0 0 0 2px rgba(222, 10, 39, 0.3), 0 4px 12px rgba(222, 10, 39, 0.1) !important;
  animation: chequeHighlight 2s ease-in-out infinite !important;
}
@keyframes chequeHighlight {
  0%, 100% { box-shadow: 0 0 0 2px rgba(222, 10, 39, 0.15), 0 4px 12px rgba(222, 10, 39, 0.05); }
  50% { box-shadow: 0 0 0 2px rgba(222, 10, 39, 0.4), 0 4px 16px rgba(222, 10, 39, 0.15); }
}
.btn.cheque-btn-flash {
  animation: chequeBtnFlash 1.5s ease-in-out infinite !important;
}
@keyframes chequeBtnFlash {
  0%, 100% { background: transparent; color: #6b7280; }
  50% { background: rgba(222, 10, 39, 0.12); color: #de0a27; border-color: #de0a27; }
}
.sidebar-link.active {
  background: var(--pt-red-subtle);
  color: #fff;
  font-weight: 600;
}
.sidebar-link.active svg {
  opacity: 1;
  color: var(--pt-red);
}
/* Active indicator bar */
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.375rem;
  bottom: 0.375rem;
  width: 3px;
  background: var(--pt-red);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--pt-red-glow);
}

.notif-sidebar-badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: var(--pt-red);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  line-height: 1;
  animation: badgePop 0.3s ease-out;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
  margin: 0.5rem 0.875rem;
}

/* Section label (ADMINISTRATION) */
.sidebar-section-label {
  padding: 0 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

/* Group toggle button */
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  color: var(--pt-light-400);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
}
.sidebar-group-toggle svg:first-child {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.sidebar-group-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.sidebar-group-toggle:hover svg:first-child {
  opacity: 0.9;
}
/* Highlight group toggle when a child is active */
.sidebar-group-toggle.has-active-child {
  color: rgba(255, 255, 255, 0.85);
}
.sidebar-group-toggle.has-active-child svg:first-child {
  opacity: 0.85;
  color: var(--pt-red);
}

/* Chevron icon */
.sidebar-chevron {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.3;
  transition: transform 0.2s ease, opacity 0.15s;
}
.sidebar-group-toggle:hover .sidebar-chevron {
  opacity: 0.6;
}

/* Sub-items: indented */
.sidebar-sublink {
  padding-left: 2.75rem !important;
  font-size: 0.8125rem !important;
}

/* User footer */
.sidebar-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pt-red), var(--pt-red-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--pt-dark-500);
}
.sidebar-logout {
  padding: 0.375rem;
  border-radius: 0.375rem;
  background: none;
  border: none;
  color: var(--pt-dark-500);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
}
.sidebar-logout:hover {
  background: rgba(222, 10, 39, 0.1);
  color: var(--pt-red);
}

/* ===================== MOBILE ===================== */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    padding-bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 40;
  }
}

/* Mobile top bar */
.mobile-topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--pt-border);
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar-height) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-topbar img { height: 1.75rem; }
.hamburger-btn:hover { background: var(--pt-light-100); }

/* ===================== MAIN CONTENT ===================== */

.main-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px) + 1rem);
  }
}
@media (min-width: 1280px) {
  .main-content { padding: 2.5rem 3rem; }
}

/* ===================== CARDS ===================== */

.card {
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--pt-shadow-card);
}

.stat-card {
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--pt-shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--pt-shadow-card-hover);
  transform: translateY(-1px);
}
.stat-card .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pt-text-secondary);
  margin-top: 0.125rem;
}

/* ===================== BADGES ===================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-draft { background: var(--pt-light-100); color: var(--pt-light-500); }
.badge-submitted { background: var(--pt-blue-light); color: var(--pt-blue); }
.badge-approved { background: var(--pt-green-light); color: var(--pt-green); }
.badge-rejected { background: var(--pt-red-light); color: var(--pt-red); }
.badge-invoiced { background: #f5f3ff; color: var(--pt-purple); }
.badge-no_time { background: var(--pt-yellow-light); color: var(--pt-yellow); }

/* ===================== BUTTONS ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--pt-red);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--pt-red-dark);
  box-shadow: 0 4px 14px rgba(222, 10, 39, 0.25);
}
.btn-secondary {
  background: var(--pt-bg-card);
  color: var(--pt-text-primary);
  border: 1px solid var(--pt-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--pt-bg-card-hover);
  border-color: var(--pt-text-muted);
}
.btn-success {
  background: var(--pt-green);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: #059669;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.btn-danger { background: var(--pt-red); color: #fff; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.9375rem; }

/* ===================== TABLES ===================== */

.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--pt-bg-header);
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pt-text-secondary);
  border-bottom: 1px solid var(--pt-border);
}
.data-table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--pt-border-light);
  font-size: 0.8125rem;
  color: var(--pt-text-primary);
}
.data-table tr:hover td { background: var(--pt-red-subtle); }

/* ===================== FORMS ===================== */

.form-input,
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pt-border);
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--pt-text-primary);
  background: var(--pt-bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus,
.input:focus {
  outline: none;
  border-color: var(--pt-red);
  box-shadow: 0 0 0 3px rgba(222, 10, 39, 0.08);
}
.form-input::placeholder,
.input::placeholder { color: var(--pt-light-400); }

.form-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pt-text-primary);
  margin-bottom: 0.25rem;
}

/* ===================== TIMESHEET ===================== */

.ts-day-row {
  border: 1px solid var(--pt-border);
  border-radius: 0.625rem;
  padding: 1rem 1.125rem;
  margin-bottom: 0.5rem;
  background: var(--pt-bg-card);
  transition: all 0.15s;
}
.ts-day-row:hover { border-color: var(--pt-light-300); }
.ts-day-row.has-data { border-left: 3px solid var(--pt-green); }
.ts-day-row.has-surplus { border-left: 3px solid var(--pt-yellow); }
.ts-day-row.has-missing-punch { border-left: 3px solid var(--pt-red); background: var(--pt-red-subtle); }

.punch-pair {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.375rem 0;
}

.punch-time-input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

@media (max-width: 480px) {
  .punch-pair {
    gap: 0.375rem;
  }
  .punch-time-input {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    font-size: 0.8125rem;
  }
}

/* ===================== WEEK NAV ===================== */

.week-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.week-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid var(--pt-border);
  background: var(--pt-bg-card);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--pt-text-primary);
}
.week-nav-btn:hover {
  background: var(--pt-light-100);
  border-color: var(--pt-light-400);
}

/* ===================== TOAST ===================== */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pt-text-primary);
  background: #fff;
  z-index: 9999;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  max-width: 26rem;
  border-left: 3px solid transparent;
}
.dark .toast {
  background: var(--pt-dark-800);
  color: #fff;
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.toast-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.toast-success { border-left-color: var(--pt-green); }
.toast-success .toast-icon { color: var(--pt-green); }
.toast-error { border-left-color: var(--pt-red); }
.toast-error .toast-icon { color: var(--pt-red); }
.toast-warning { border-left-color: var(--pt-yellow); }
.toast-warning .toast-icon { color: var(--pt-yellow); }
.toast-hidden {
  transform: translateX(-50%) translateY(1rem);
  opacity: 0;
  pointer-events: none;
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.15;
  border-radius: 0 0 0.75rem 0.75rem;
  animation: toast-progress linear forwards;
}
@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ===================== SPINNER ===================== */

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--pt-red);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== PAGE HEADERS ===================== */

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-header h1::before {
  content: '';
  width: 3px;
  height: 1.25rem;
  background: var(--pt-red);
  border-radius: 2px;
  flex-shrink: 0;
}
.page-header p {
  font-size: 0.8125rem;
  color: var(--pt-text-secondary);
  margin-top: 0.25rem;
  padding-left: 0.8125rem;
}
/* Inline variant — header with badge or buttons on same line */
.page-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.page-header-inline h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-header-inline h1::before {
  content: '';
  width: 3px;
  height: 1.25rem;
  background: var(--pt-red);
  border-radius: 2px;
  flex-shrink: 0;
}
.page-header-inline p {
  font-size: 0.8125rem;
  color: var(--pt-text-secondary);
  margin-top: 0.125rem;
}

/* (toast icons now use SVG — see .toast-icon above) */

/* ===================== SKELETON LOADING ===================== */

.skeleton {
  background: linear-gradient(90deg, var(--pt-border-light) 25%, var(--pt-border) 50%, var(--pt-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text {
  height: 0.875rem;
  width: 60%;
  margin-bottom: 0.5rem;
}
.skeleton-text-short {
  height: 0.875rem;
  width: 35%;
}
.skeleton-stat {
  height: 2.25rem;
  width: 5rem;
  margin-bottom: 0.25rem;
}
.skeleton-card {
  height: 5rem;
  border-radius: 0.75rem;
}

/* ===================== FIELD VALUE (Read-only) ===================== */

.field-value {
  padding: 0.5rem 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pt-text-primary);
  border-bottom: 1px solid var(--pt-border);
  min-height: 2rem;
}
.field-value:empty::after {
  content: '—';
  color: var(--pt-light-400);
}

/* ===================== FIELD GRID (view mode — portail employé pattern) ===================== */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
.field-grid .field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.field-grid .field.span-full {
  grid-column: 1 / -1;
}
.field-grid .field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pt-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field-grid .field-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--pt-text-primary);
  line-height: 1.4;
  border-bottom: none;
  padding: 0;
  min-height: unset;
}

/* ===================== FORM GRID (edit mode — portail employé pattern) ===================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.form-grid .form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-grid .form-field.span-full {
  grid-column: 1 / -1;
}

/* Button group (save/cancel) */
.btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--pt-border);
}

@media (max-width: 640px) {
  .field-grid, .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================== PROFILE SECTION GROUPS ===================== */

.profile-group {
  margin-bottom: 0.5rem;
}
.profile-group-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}
.profile-group-header::before {
  content: '';
  width: 3px;
  height: 1rem;
  background: var(--pt-red);
  border-radius: 2px;
  flex-shrink: 0;
}
.profile-group-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pt-text-secondary);
  white-space: nowrap;
}
.profile-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--pt-border);
}

/* ===================== CARD ANIMATIONS ===================== */

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.card {
  animation: cardFadeIn 0.3s ease-out both;
}
.stat-card {
  animation: cardFadeIn 0.3s ease-out both;
}
.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }

/* ===================== MODAL ===================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
}

/* U-P1-5 : sur mobile, ancrer en bas pour rester dans la zone du pouce */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content {
    max-height: 92vh;
    border-radius: 1rem 1rem 0 0;
    overflow-y: auto;
  }
  /* Boutons d'action en bas du modal: zone du pouce naturelle */
  .modal-content [class*="modal-footer"],
  .modal-content > div:last-child,
  .modal-content .modal-actions {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* ─── FDT — Stat Strip (résumé hebdomadaire) ─────────────────────────
   Remplace le grid de 7 cards encadrées massives par une rangée horizontale
   unifiée. Style éditorial : dot coloré subtil + valeur monospace + label
   uppercase tracking-wide. Plus dense, moins de chrome.
*/
.ts-stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 0;
  overflow: hidden;
}
.ts-stat-item {
  flex: 1 1 auto;
  min-width: 8.5rem;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  position: relative;
}
/* Divider vertical entre items (sauf dernier visible) */
.ts-stat-item + .ts-stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--pt-border);
}
.ts-stat-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.ts-stat-body {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.ts-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  letter-spacing: -0.01em;
}
.ts-stat-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pt-text-muted);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Mobile : 2 colonnes (au lieu d'une rangée full-width par item) */
@media (max-width: 640px) {
  .ts-stat-item { min-width: 50%; flex-basis: 50%; }
  .ts-stat-item + .ts-stat-item::before { display: none; }
  .ts-stat-item:nth-child(even) { border-left: 1px solid var(--pt-border); }
  .ts-stat-item:not(:nth-child(-n+2)) { border-top: 1px solid var(--pt-border); }
}

/* U-P1-8 : sticky cart bar mobile uniquement */
.cart-sticky-mobile { display: none; }
@media (max-width: 768px) {
  .cart-sticky-mobile {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 40;
    padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom)) 1rem;
    background: var(--pt-bg-card);
    border-top: 1px solid var(--pt-border);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    align-items: center;
    gap: 0.75rem;
  }
  .cart-sticky-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .cart-sticky-label {
    font-size: 0.75rem;
    color: var(--pt-text-muted);
  }
  .cart-sticky-total {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--pt-text-primary);
    font-size: 1.125rem;
  }
  .cart-sticky-btn {
    flex: 0 0 auto;
    padding: 0.625rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    min-height: 44px;
  }
  /* Espace pour ne pas masquer le contenu sous la bar */
  body[data-route="shop-cart"] {
    padding-bottom: 5rem;
  }
}

.modal-content {
  position: relative;
  background: var(--pt-bg-card);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  width: 100%;
}
.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pt-red), transparent);
  z-index: 1;
}

/* ===================== BUTTON GHOST ===================== */

.btn-ghost {
  background: transparent;
  color: var(--pt-light-500);
  border: 1px dashed var(--pt-light-300);
}
.btn-ghost:hover:not(:disabled) {
  border-style: solid;
  color: var(--pt-dark-800);
  background: var(--pt-light-50);
}

/* ===================== FOCUS VISIBLE ===================== */

:focus-visible {
  outline: 2px solid var(--pt-red);
  outline-offset: 2px;
}
.sidebar-link:focus-visible {
  outline: 2px solid var(--pt-red);
  outline-offset: -2px;
}
.form-input:focus-visible,
.input:focus-visible,
.login-input:focus-visible,
.otp-input:focus-visible {
  outline: none; /* Already has custom focus ring via box-shadow */
}

/* ===================== COGNIBOX ACCORDION ===================== */

.cb-task-row {
  position: relative;
  transition: background-color 0.15s;
}
.cb-task-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 0 3px 3px 0;
  transition: background 0.2s;
}
.cb-task-row:hover {
  background: var(--pt-red-subtle);
}
.cb-task-row.cb-expanded {
  background: var(--pt-light-50);
}
.cb-task-row.cb-expanded::before {
  background: var(--pt-red);
  box-shadow: 0 0 8px var(--pt-red-glow);
}

/* Smooth height animation via CSS grid */
.cb-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cb-accordion.cb-open {
  grid-template-rows: 1fr;
}
.cb-accordion > div {
  overflow: hidden;
}

/* Chevron rotation */
.cb-chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cb-chevron-open {
  transform: rotate(180deg);
}

/* Requirement group card */
.cb-req-group {
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: box-shadow 0.2s;
}
.cb-req-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.cb-req-group-header {
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pt-light-500);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--pt-light-100);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Requirement item */
.cb-req-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.3125rem 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.cb-req-item + .cb-req-item {
  border-top: 1px solid var(--pt-light-100);
}

/* Formation status indicator */
.cb-formation-ok {
  color: var(--pt-dark-800);
}
.cb-formation-missing {
  color: var(--pt-red);
  font-weight: 600;
}

/* Compliance ring */
.cb-compliance-ring {
  width: 2rem;
  height: 2rem;
  transform: rotate(-90deg);
}
.cb-compliance-ring circle {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}
.cb-compliance-bg { stroke: var(--pt-light-200); }

/* Expanded panel inner */
.cb-panel-inner {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--pt-light-200);
  background: linear-gradient(180deg, var(--pt-light-50) 0%, #fff 100%);
}

/* ── Feedback Floater ── */
.feedback-fab {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: all 0.2s;
}
.feedback-fab:hover {
  background: #d97706;
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45);
}
.feedback-fab:active { transform: scale(0.96); }
.feedback-fab-active {
  background: var(--pt-dark-700, #374151);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.feedback-fab-active:hover {
  background: var(--pt-dark-600, #4b5563);
}

.feedback-panel {
  position: fixed;
  bottom: 9.5rem;
  right: 1.5rem;
  width: 340px;
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 1.25rem;
  z-index: 9997;
}

/* Dark mode */
.dark .feedback-panel {
  background: var(--pt-dark-800, #1f2937);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Mobile: full width panel at bottom */
@media (max-width: 767px) {
  .feedback-fab { bottom: 5rem; right: 1rem; }
  .feedback-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 1rem 1rem 0 0;
  }
}

/* ===================== PRINT ===================== */

@media print {
  .sidebar, .no-print, .mobile-topbar { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; animation: none; }
  .stat-card { animation: none; }
  body { background: #fff; }
}

/* ===================== CHAT MATTERMOST ===================== */

.chat-bubble {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--pt-red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  box-shadow: 0 4px 16px rgba(222, 10, 39, 0.35);
  transition: all 0.2s;
}
.chat-bubble:hover {
  background: var(--pt-red-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(222, 10, 39, 0.45);
}
.chat-bubble:active {
  transform: scale(0.96);
}
.chat-bubble-active {
  background: var(--pt-dark-700);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.chat-bubble-active:hover {
  background: var(--pt-dark-600);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.chat-unread-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: var(--pt-blue);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  animation: badgePop 0.3s ease-out;
}
@keyframes badgePop {
  from { transform: scale(0); }
  50% { transform: scale(1.2); }
  to { transform: scale(1); }
}

.chat-window {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 24rem;
  max-height: 32rem;
  background: var(--pt-bg-card);
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: var(--pt-dark-900);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--pt-red);
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 12rem;
  max-height: 20rem;
}

.chat-msg-row-own {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.chat-msg-row-other {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-msg-sender {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pt-red);
  margin-bottom: 0.125rem;
  padding-left: 0.25rem;
}

.chat-msg-bubble-own {
  background: var(--pt-red);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.4;
  max-width: 85%;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg-bubble-other {
  background: var(--pt-bg-header);
  color: var(--pt-text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.4;
  max-width: 85%;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg-time {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.625rem;
  color: var(--pt-light-400);
  margin-top: 0.125rem;
  padding: 0 0.25rem;
}

.chat-input-area {
  background: var(--pt-bg-header);
  border-top: 1px solid var(--pt-border);
  padding: 0.625rem 0.75rem;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pt-border);
  border-radius: 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--pt-text-primary);
  background: var(--pt-bg-input);
  resize: none;
  min-height: 2.25rem;
  max-height: 5rem;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.chat-input:focus {
  outline: none;
  border-color: var(--pt-red);
  box-shadow: 0 0 0 3px rgba(222, 10, 39, 0.08);
}
.chat-input::placeholder {
  color: var(--pt-light-400);
}
.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--pt-red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-send-btn:hover:not(:disabled) {
  background: var(--pt-red-dark);
  box-shadow: 0 2px 8px rgba(222, 10, 39, 0.3);
}
.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===================== FILE ATTACHMENTS ===================== */
.chat-attach-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--pt-dark-700);
  color: var(--pt-light-400);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-attach-btn:hover:not(:disabled) {
  background: var(--pt-dark-600);
  color: #fff;
}
.chat-attach-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-file-preview {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--pt-dark-700);
  background: var(--pt-dark-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.chat-file-preview-img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 0.375rem;
  object-fit: cover;
}
.chat-file-preview-pdf {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: var(--pt-dark-700);
  border-radius: 0.375rem;
  max-width: 200px;
}
.chat-file-preview-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: var(--pt-dark-600);
  color: var(--pt-light-400);
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-file-preview-close:hover {
  background: var(--pt-red);
  color: #fff;
}

.chat-file-attachments {
  margin-top: 0.25rem;
}
.chat-file-img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: opacity 0.15s;
  display: block;
}
.chat-file-img:hover {
  opacity: 0.85;
}
.chat-file-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: rgba(255,255,255,0.08);
  border-radius: 0.375rem;
  color: var(--pt-light-300);
  text-decoration: none;
  max-width: 180px;
  transition: background 0.15s;
}
.chat-file-pdf:hover {
  background: rgba(255,255,255,0.15);
}

/* Lightbox */
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: default;
}
.chat-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

/* ===================== FILE ATTACHMENTS ===================== */
.chat-attach-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--pt-dark-700);
  color: var(--pt-light-400);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-attach-btn:hover:not(:disabled) {
  background: var(--pt-dark-600);
  color: #fff;
}
.chat-attach-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.chat-file-preview {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--pt-dark-700);
  background: var(--pt-dark-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.chat-file-preview-img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 0.375rem;
  object-fit: cover;
}
.chat-file-preview-pdf {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: var(--pt-dark-700);
  border-radius: 0.375rem;
  max-width: 200px;
}
.chat-file-preview-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: var(--pt-dark-600);
  color: var(--pt-light-400);
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-file-preview-close:hover {
  background: var(--pt-red);
  color: #fff;
}
.chat-file-attachments {
  margin-top: 0.25rem;
}
.chat-file-img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: opacity 0.15s;
  display: block;
}
.chat-file-img:hover {
  opacity: 0.85;
}
.chat-file-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: rgba(255,255,255,0.08);
  border-radius: 0.375rem;
  color: var(--pt-light-300);
  text-decoration: none;
  max-width: 180px;
  transition: background 0.15s;
}
.chat-file-pdf:hover {
  background: rgba(255,255,255,0.15);
}
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: default;
}
.chat-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

/* ===================== CALL UI ===================== */

/* ── Incoming Call Overlay ── */
.call-incoming-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--pt-dark-900);
}
.call-incoming-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(222, 10, 39, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(222, 10, 39, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* Concentric pulsing rings */
.call-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  pointer-events: none;
}
.call-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(222, 10, 39, 0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: callRingPulse 2.5s ease-out infinite;
}
.call-ring-1 { width: 8rem; height: 8rem; animation-delay: 0s; }
.call-ring-2 { width: 12rem; height: 12rem; animation-delay: 0.5s; }
.call-ring-3 { width: 16rem; height: 16rem; animation-delay: 1s; }

@keyframes callRingPulse {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

/* Icon */
.call-icon-container {
  position: relative;
  z-index: 2;
  margin-bottom: 1.5rem;
}
.call-icon-glow {
  position: absolute;
  inset: -0.75rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(222, 10, 39, 0.3) 0%, transparent 70%);
  animation: callIconGlow 2s ease-in-out infinite alternate;
}
@keyframes callIconGlow {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}
.call-icon-circle {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pt-red) 0%, var(--pt-red-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 0 0 3px rgba(222, 10, 39, 0.15),
    0 8px 32px rgba(222, 10, 39, 0.4);
  animation: callIconBounce 1.5s ease-in-out infinite;
}
@keyframes callIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Text */
.call-incoming-text {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 0.75rem;
}
.call-incoming-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
.call-incoming-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--pt-light-400);
  font-weight: 500;
}

/* Sound wave bars */
.call-sound-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}
.call-wave {
  width: 3px;
  height: 100%;
  background: var(--pt-red);
  border-radius: 2px;
  opacity: 0.6;
  animation: callWave 1.2s ease-in-out infinite;
}
.call-wave:nth-child(1) { animation-delay: 0s; height: 40%; }
.call-wave:nth-child(2) { animation-delay: 0.15s; height: 70%; }
.call-wave:nth-child(3) { animation-delay: 0.3s; height: 100%; }
.call-wave:nth-child(4) { animation-delay: 0.15s; height: 70%; }
.call-wave:nth-child(5) { animation-delay: 0s; height: 40%; }

@keyframes callWave {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 0.8; }
}

/* Action buttons */
.call-action-buttons {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 2;
}
.call-btn-decline,
.call-btn-accept {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.call-btn-decline:hover,
.call-btn-accept:hover {
  transform: scale(1.08);
}
.call-btn-decline:active,
.call-btn-accept:active {
  transform: scale(0.95);
}
.call-btn-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s;
}
.call-btn-decline .call-btn-icon {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.call-btn-decline:hover .call-btn-icon {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}
.call-btn-accept .call-btn-icon {
  background: #10b981;
  color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}
.call-btn-accept:hover .call-btn-icon {
  background: #059669;
  box-shadow: 0 4px 28px rgba(16, 185, 129, 0.5);
}
.call-btn-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pt-light-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Active Call Overlay ── */
.call-active-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--pt-dark-950);
  border-radius: 0.75rem;
  overflow: hidden;
}

.call-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: var(--pt-dark-900);
  flex-shrink: 0;
}
.call-status-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.call-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pt-green);
  animation: callDotPulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes callDotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}
.call-status-type {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pt-light-300);
}
.call-status-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pt-light-400);
  letter-spacing: 0.05em;
}

.call-accent-line {
  height: 2px;
  background: linear-gradient(90deg, var(--pt-red), var(--pt-red-dark));
  flex-shrink: 0;
}

/* Jitsi container */
#jitsi-container {
  width: 100%;
  height: 100%;
  min-height: 18rem;
}
#jitsi-container iframe {
  border-radius: 0;
}

.call-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  background: var(--pt-dark-900);
  flex-shrink: 0;
}
.call-btn-hangup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--pt-red);
  color: #fff;
  border: none;
  border-radius: 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.call-btn-hangup:hover {
  background: var(--pt-red-dark);
  box-shadow: 0 4px 20px rgba(222, 10, 39, 0.4);
  transform: scale(1.03);
}
.call-btn-hangup:active {
  transform: scale(0.97);
}

/* Chat window enlarged during call */
.chat-window-calling {
  width: 36rem;
  max-height: 80vh;
}

/* ── Bubble indicators ── */
.call-bubble-indicator {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pt-green);
  border: 2px solid #fff;
  z-index: 1;
}
.call-bubble-indicator-ping {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: callBubblePing 1.5s ease-out infinite;
}
@keyframes callBubblePing {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}

.call-bubble-ringing {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--pt-red);
  animation: callBubbleRing 1s ease-out infinite;
}
@keyframes callBubbleRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@media (max-width: 640px) {
  .chat-window-calling {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .call-incoming-overlay,
  .call-active-overlay {
    border-radius: 0;
  }
}

/* Mobile: full width chat window */
@media (max-width: 480px) {
  .chat-window {
    left: 0.5rem;
    right: 0.5rem;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px) + 4rem);
    width: auto;
    max-height: 60vh;
  }
  .chat-bubble {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px) + 0.75rem);
    right: 1rem;
  }
}

/* ===================== GUIDECHIMP OVERRIDES ===================== */

/* Overlay — darker for better focus */
.gc-overlay {
  z-index: 10000 !important;
}
.gc-overlay svg {
  fill: rgba(10, 12, 16, 0.72) !important;
}

/* Control — highlight ring around target element */
.gc-control {
  z-index: 10001 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 4px rgba(222, 10, 39, 0.25), 0 0 40px rgba(222, 10, 39, 0.1) !important;
}

/* Tooltip */
.gc-tooltip {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 24px 48px -12px rgba(0, 0, 0, 0.2) !important;
  max-width: 420px !important;
  min-width: 280px !important;
  z-index: 10002 !important;
  overflow: hidden !important;
  padding: 0 !important;
}
.gc-tooltip[data-guidechimp-position="top"] { margin-bottom: 14px !important; }
.gc-tooltip[data-guidechimp-position="bottom"] { margin-top: 14px !important; }
.gc-tooltip[data-guidechimp-position="left"] { margin-right: 14px !important; }
.gc-tooltip[data-guidechimp-position="right"] { margin-left: 14px !important; }

/* Red accent bar at top (progress doubles as accent) */
.gc-progressbar {
  background: linear-gradient(90deg, #de0a27, #e8354d) !important;
  height: 3px !important;
  border-radius: 0 !important;
}

/* Title */
.gc-title {
  font-family: 'Outfit', system-ui, sans-serif !important;
  font-size: 1.0625rem !important;
  font-weight: 700 !important;
  color: var(--pt-dark-800) !important;
  letter-spacing: -0.01em !important;
  padding: 22px 24px 0 24px !important;
  margin-bottom: 6px !important;
}

/* Description */
.gc-description {
  font-size: 0.875rem !important;
  color: var(--pt-light-600) !important;
  line-height: 1.6 !important;
  padding: 0 24px !important;
  margin-bottom: 0 !important;
  text-align: left !important;
  max-height: 55vh !important;
  overflow-y: auto !important;
}
.gc-description strong {
  color: var(--pt-dark-800) !important;
  font-weight: 600 !important;
}

/* Close button */
.gc-close {
  top: 18px !important;
  right: 18px !important;
  opacity: 0.3 !important;
  transition: opacity 0.15s, transform 0.15s !important;
}
.gc-close:hover {
  opacity: 0.8 !important;
  transform: scale(1.15) !important;
}

/* Navigation area */
.gc-navigation {
  padding: 16px 24px 20px !important;
  border-top: 1px solid var(--pt-light-200) !important;
  margin-top: 16px !important;
}

/* Navigation arrows — brand red on hover */
.gc-navigation-prev,
.gc-navigation-next {
  border-color: var(--pt-light-400) !important;
  border-width: 3px !important;
  width: 12px !important;
  height: 12px !important;
  transition: border-color 0.15s !important;
}
.gc-navigation-prev:hover,
.gc-navigation-next:hover {
  border-color: var(--pt-red) !important;
}

/* Pagination dots */
.gc-pagination-active,
.gc-pagination-item:hover {
  background-color: var(--pt-red) !important;
}

/* Step counter in pagination */
.gc-pagination-theme-numbers .gc-pagination-active,
.gc-pagination-theme-numbers .gc-pagination-item:hover {
  background: var(--pt-red) !important;
  color: #fff !important;
}

/* Hide copyright */
.gc-copyright {
  display: none !important;
}

/* ── Tour mobile responsive ── */
@media (max-width: 768px) {
  .gc-tooltip {
    max-width: calc(100vw - 2rem) !important;
    min-width: 0 !important;
  }
  .gc-title {
    font-size: 1rem !important;
    padding: 16px 16px 0 16px !important;
  }
  .gc-description {
    padding: 0 16px !important;
    font-size: 0.8125rem !important;
    max-height: 40vh !important;
  }
  .gc-navigation {
    padding: 12px 16px 16px !important;
  }
  .gc-close {
    top: 12px !important;
    right: 12px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .gc-navigation-prev,
  .gc-navigation-next {
    padding: 10px !important;
  }
  /* Topbar mobile sous l'overlay pendant le tour */
  body.tour-active .mobile-topbar {
    z-index: 1 !important;
  }
  /* Sidebar au-dessus de l'overlay quand le tour l'ouvre */
  body.tour-sidebar-step .sidebar.open {
    z-index: 10001 !important;
  }
  body.tour-sidebar-step .sidebar-overlay {
    display: none !important;
  }
}
@media (max-width: 380px) {
  .gc-tooltip {
    max-width: calc(100vw - 1rem) !important;
  }
  .gc-description {
    font-size: 0.75rem !important;
    max-height: 35vh !important;
  }
}

/* Sidebar highlight pendant le tour */
.tour-sidebar-highlight {
  background: rgba(222, 10, 39, 0.3) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(222, 10, 39, 0.6), 0 0 24px rgba(222, 10, 39, 0.4) !important;
  border-radius: 0.5rem;
  animation: tourSidebarPulse 1.5s ease-in-out infinite;
}
.tour-sidebar-highlight svg {
  opacity: 1 !important;
  color: #fff !important;
}
@keyframes tourSidebarPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(222, 10, 39, 0.6), 0 0 24px rgba(222, 10, 39, 0.4); }
  50% { box-shadow: 0 0 0 3px rgba(222, 10, 39, 0.8), 0 0 32px rgba(222, 10, 39, 0.6); }
}

/* ===================== BOTTOM NAV (MOBILE PWA) ===================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9997;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--pt-border);
  display: flex;
  align-items: stretch;
  height: calc(3.25rem + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  position: relative;
  color: var(--pt-light-400);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.bottom-nav-item svg {
  width: 1.375rem;
  height: 1.375rem;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item.active {
  color: var(--pt-red);
  font-weight: 600;
}

.bottom-nav-item.active svg {
  transform: scale(1.05);
}

/* Red indicator line above active item */
.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 2px;
  background: var(--pt-red);
  border-radius: 0 0 2px 2px;
}

/* Press state */
.bottom-nav-item:active {
  transform: scale(0.9);
}

.bottom-nav-badge {
  position: absolute;
  top: -0.1875rem;
  right: -0.375rem;
  min-width: 0.875rem;
  height: 0.875rem;
  border-radius: 9999px;
  background: var(--pt-red);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.1875rem;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  animation: badgePop 0.3s ease-out;
}

.bottom-nav-dot {
  position: absolute;
  top: -0.125rem;
  right: -0.125rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--pt-red);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  animation: pulse 2s ease-in-out infinite;
}

/* ===================== UTILITIES ===================== */

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===================== TAX ALERT BANNER ===================== */

.tax-alert-banner {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  padding: 0.75rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  border-bottom: 1px solid rgba(120, 53, 15, 0.15);
}

/* ===================== PUSH BANNER ===================== */

.push-banner {
  position: fixed;
  bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 0.875rem 1rem;
  background: var(--pt-dark-900);
}

/* ===================== SCROLL AFFORDANCE ===================== */

.table-container {
  position: relative;
}
.table-container::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2rem;
  background: linear-gradient(to left, var(--pt-bg-card), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.table-container.has-scroll::after {
  opacity: 1;
}

/* ===================== MOBILE PWA — REPOSITIONNEMENT ===================== */

@media (max-width: 768px) {
  .chat-bubble {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }
  .chat-window {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px) + 4rem);
  }
  .toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px) + 0.75rem);
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* ===================== TOUCH TARGETS ===================== */

@media (max-width: 768px) {
  .week-nav-btn {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* ===================== DARK THEME — TAILWIND OVERRIDES ===================== */

html.dark .bg-white { background-color: var(--pt-bg-card) !important; }
html.dark .bg-gray-50,
html.dark .bg-gray-100 { background-color: var(--pt-bg-header) !important; }

html.dark .text-gray-900,
html.dark .text-gray-800,
html.dark .text-gray-700 { color: var(--pt-text-primary) !important; }
html.dark .text-gray-600,
html.dark .text-gray-500 { color: var(--pt-text-secondary) !important; }
html.dark .text-gray-400,
html.dark .text-gray-300 { color: var(--pt-text-muted) !important; }

html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 { border-color: var(--pt-border) !important; }
html.dark .divide-gray-100 > * + *,
html.dark .divide-gray-200 > * + * { border-color: var(--pt-border) !important; }

html.dark .hover\:bg-gray-50:hover,
html.dark .hover\:bg-gray-100:hover { background-color: var(--pt-bg-card-hover) !important; }

html.dark .ring-gray-200,
html.dark .ring-gray-300 { --tw-ring-color: var(--pt-border) !important; }

/* Semantic color backgrounds — badges stay visible in dark */
html.dark .bg-red-50 { background-color: rgba(222, 10, 39, 0.12) !important; }
html.dark .bg-green-50 { background-color: rgba(16, 185, 129, 0.12) !important; }
html.dark .bg-blue-50 { background-color: rgba(59, 130, 246, 0.12) !important; }
html.dark .bg-yellow-50 { background-color: rgba(245, 158, 11, 0.12) !important; }
html.dark .bg-purple-50 { background-color: rgba(139, 92, 246, 0.12) !important; }

/* Placeholder text */
html.dark .placeholder-gray-400::placeholder,
html.dark .placeholder-gray-500::placeholder { color: var(--pt-text-muted) !important; }

/* Dark mobile topbar & bottom nav */
html.dark .mobile-topbar {
  background: rgba(15, 17, 24, 0.88) !important;
}
html.dark .bottom-nav {
  background: rgba(15, 17, 24, 0.82) !important;
}

/* Dark bottom nav badge border */
html.dark .bottom-nav-badge {
  box-shadow: 0 0 0 2px rgba(15, 17, 24, 0.9);
}
html.dark .bottom-nav-dot {
  box-shadow: 0 0 0 2px rgba(15, 17, 24, 0.9);
}

/* Cognibox panel background */
html.dark .cb-panel-inner {
  background: linear-gradient(180deg, var(--pt-bg-header) 0%, var(--pt-bg-card) 100%);
  border-top-color: var(--pt-border);
}
html.dark .cb-req-group-header {
  border-bottom-color: var(--pt-border-light);
}
html.dark .cb-req-item + .cb-req-item {
  border-top-color: var(--pt-border-light);
}
html.dark .cb-compliance-bg {
  stroke: var(--pt-border);
}

/* Cheque prompt modal in dark */
html.dark .bg-black\/40 {
  background: rgba(0, 0, 0, 0.6) !important;
}

/* ===================== DARK THEME — SMOOTH TRANSITION ===================== */

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ===================== DOCUMENT BADGES ===================== */

.badge-pending { background: var(--pt-yellow-light); color: #92400e; }
.badge-signed { background: var(--pt-green-light); color: #065f46; }
.badge-in_progress { background: var(--pt-blue-light); color: #1e40af; }
.badge-declined { background: var(--pt-red-light); color: var(--pt-red); }
.badge-expired { background: var(--pt-light-100); color: var(--pt-light-500); }

html.dark .badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
html.dark .badge-signed { background: rgba(16, 185, 129, 0.15); color: #34d399; }
html.dark .badge-in_progress { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
html.dark .badge-declined { background: rgba(222, 10, 39, 0.15); color: #f87171; }
html.dark .badge-expired { background: var(--pt-border); color: var(--pt-text-muted); }

/* ===================== DOCUMENTS — TABS ===================== */

.doc-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 0.25rem;
  box-shadow: var(--pt-shadow-card);
  overflow-x: auto;
}
.doc-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pt-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.doc-tab:hover {
  color: var(--pt-text-primary);
  background: var(--pt-bg-card-hover);
}
.doc-tab.active {
  font-weight: 600;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.doc-tab.tab-pending { background: #f59e0b; }
.doc-tab.tab-signed { background: var(--pt-green); }
.doc-tab.tab-progress { background: var(--pt-blue); }
.doc-tab.tab-declined { background: var(--pt-red); }

.doc-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}
.doc-tab:not(.active) .doc-tab-badge {
  background: var(--pt-red);
  color: #fff;
}

@media (max-width: 480px) {
  .doc-tab {
    font-size: 0.75rem;
    padding: 0.4375rem 0.5rem;
  }
  .doc-tab svg {
    display: none;
  }
}

/* ===================== DOCUMENTS — ICONS & CELLS ===================== */

.doc-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--pt-red-subtle);
  color: var(--pt-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-name-cell {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.doc-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pt-text-primary);
}
.doc-meta-row {
  font-size: 0.75rem;
  color: var(--pt-text-secondary);
}

/* ===================== DOCUMENTS — EMPTY STATE ===================== */

.doc-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--pt-light-100);
  color: var(--pt-light-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}
html.dark .doc-empty-icon {
  background: var(--pt-border);
  color: var(--pt-text-muted);
}
.doc-empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pt-text-primary);
  margin-bottom: 0.25rem;
}
.doc-empty-sub {
  font-size: 0.8125rem;
  color: var(--pt-text-secondary);
}

/* ===================== DOCUMENTS — MOBILE CARD ===================== */

.doc-mobile-card {
  padding: 1rem;
}

/* ===================== DOCUMENT-SIGN — BACK LINK ===================== */

.doc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pt-text-secondary);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}
.doc-back-link:hover {
  color: var(--pt-red);
}

/* ===================== DOCUMENT-SIGN — COMPLETION STATE ===================== */

.doc-sign-complete {
  background: var(--pt-bg-card);
  border: 2px solid var(--pt-green);
  border-radius: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1), var(--pt-shadow-card);
}
html.dark .doc-sign-complete {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), var(--pt-shadow-card);
}
.doc-sign-complete-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--pt-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.doc-sign-complete-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  margin-bottom: 0.375rem;
}
.doc-sign-complete-sub {
  font-size: 0.875rem;
  color: var(--pt-text-secondary);
}

/* ===================== DOCUMENT-SIGN — HEADER ===================== */

.doc-sign-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.doc-sign-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  letter-spacing: -0.01em;
}

/* ===================== DOCUMENT-SIGN — IFRAME ===================== */

.doc-sign-iframe-wrap {
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--pt-shadow-card);
}
.doc-sign-iframe {
  width: 100%;
  height: 80vh;
  min-height: 500px;
  border: none;
  display: block;
}

/* ===================== ADMIN DOCUMENTS — STAT CARD OVERRIDES ===================== */

.doc-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}
.doc-stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pt-text-secondary);
  margin-top: 0.375rem;
}
.doc-stat-sub {
  font-size: 0.6875rem;
  color: var(--pt-text-muted);
  margin-top: 0.125rem;
}

/* ===================== ADMIN DOCUMENTS — DETAIL ROW ===================== */

.doc-detail-row {
  background: var(--pt-bg-header);
}
.doc-detail-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.doc-detail-value {
  font-size: 0.75rem;
  color: var(--pt-text-primary);
  margin-top: 0.125rem;
}

/* ===================== ADMIN SEND — STEPS ===================== */

.doc-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.doc-step {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pt-text-muted);
  transition: color 0.2s;
}
.doc-step.active {
  color: var(--pt-text-primary);
  font-weight: 600;
}
.doc-step.done {
  color: var(--pt-green);
}
.doc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-family: 'Outfit', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--pt-light-100);
  color: var(--pt-text-muted);
  transition: all 0.2s;
}
.doc-step.active .doc-step-num {
  background: var(--pt-light-200);
  color: var(--pt-text-primary);
}
.doc-step.done .doc-step-num {
  background: var(--pt-green-light);
  color: var(--pt-green);
}
html.dark .doc-step-num {
  background: var(--pt-border);
}
html.dark .doc-step.active .doc-step-num {
  background: var(--pt-dark-600);
  color: var(--pt-text-primary);
}
html.dark .doc-step.done .doc-step-num {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.doc-step-line {
  width: 1.5rem;
  height: 1px;
  background: var(--pt-border);
}

/* ===================== ADMIN SEND — RECIPIENT CHIP ===================== */

.doc-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--pt-light-100);
  color: var(--pt-text-primary);
  border: 1px solid var(--pt-border);
}
html.dark .doc-recipient-chip {
  background: var(--pt-dark-600);
}
.doc-recipient-chip .doc-chip-email {
  font-size: 0.6875rem;
  color: var(--pt-text-muted);
}
.doc-recipient-chip .doc-chip-remove {
  display: flex;
  padding: 0;
  border: none;
  background: none;
  color: var(--pt-text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.doc-recipient-chip .doc-chip-remove:hover {
  color: var(--pt-red);
}

/* ===================== ADMIN SEND — SEARCH DROPDOWN ===================== */

.doc-search-dropdown {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--pt-bg-card);
  border: 1px solid var(--pt-border);
  border-radius: 0.5rem;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.15);
  max-height: 12rem;
  overflow-y: auto;
}
.doc-search-item {
  width: 100%;
  text-align: left;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--pt-border-light);
}
.doc-search-item:last-child {
  border-bottom: none;
}
.doc-search-item:hover {
  background: var(--pt-bg-card-hover);
}
.doc-search-item-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pt-text-primary);
}
.doc-search-item-email {
  font-size: 0.6875rem;
  color: var(--pt-text-secondary);
}

/* ===================== ADMIN SEND — SUMMARY ===================== */

.doc-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.doc-summary-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-summary-icon-blue {
  background: var(--pt-blue-light);
  color: var(--pt-blue);
}
.doc-summary-icon-purple {
  background: #f5f3ff;
  color: var(--pt-purple);
}
html.dark .doc-summary-icon-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
html.dark .doc-summary-icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* ===================== ONBOARDING — FORM ENHANCEMENTS ===================== */

.onb-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--pt-text-primary);
  margin-bottom: 1rem;
}

.onb-radio-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--pt-border);
  transition: all 0.15s;
}
.onb-radio-card:hover {
  border-color: var(--pt-light-300);
}
.onb-radio-card.selected {
  border-color: var(--pt-red);
  background: var(--pt-red-subtle);
}
.onb-radio-card input[type="radio"],
.onb-radio-card input[type="checkbox"] {
  accent-color: var(--pt-red);
}

.onb-tpl-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--pt-bg-header);
  border-radius: 0.5rem;
}
.onb-tpl-badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--pt-light-200);
  color: var(--pt-text-secondary);
  flex-shrink: 0;
}
html.dark .onb-tpl-badge {
  background: var(--pt-dark-600);
}

/* ===================== DISTRIBUTION GRID MOBILE ===================== */

@media (max-width: 640px) {
  .dist-grid-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .dist-grid-mobile .dist-task-col {
    width: 100%;
  }
  .dist-grid-mobile .dist-hours-row {
    display: flex;
    gap: 0.5rem;
    align-items: end;
  }
  .dist-grid-mobile .dist-hours-row > :first-child {
    flex: 1;
  }
  .dist-grid-mobile .dist-hours-row > :last-child {
    flex-shrink: 0;
  }
}

/* Desktop: keep grid */
@media (min-width: 641px) {
  .dist-grid-mobile {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: end;
  }
  .dist-grid-mobile .dist-task-col {
    grid-column: span 9 / span 9;
  }
  .dist-grid-mobile .dist-hours-row {
    display: contents;
  }
  .dist-grid-mobile .dist-hours-col {
    grid-column: span 2 / span 2;
  }
  .dist-grid-mobile .dist-del-col {
    grid-column: span 1 / span 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Tooltip portail — déclenché par .pt-tooltip-trigger au hover/focus */
.pt-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.pt-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  z-index: 60;
  background: var(--pt-dark-800);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  width: max-content;
  max-width: 260px;
  text-align: left;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  white-space: normal;
}
.pt-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--pt-dark-800) transparent transparent transparent;
}
.pt-tooltip-wrap:hover .pt-tooltip,
.pt-tooltip-wrap:focus-within .pt-tooltip,
.pt-tooltip-wrap.is-open .pt-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.pt-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  color: var(--pt-text-muted);
  cursor: help;
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 1px;
}
.pt-tooltip-trigger:hover,
.pt-tooltip-trigger:focus-visible {
  color: var(--pt-red);
  background-color: var(--pt-red-subtle);
  outline: none;
}
@media (max-width: 640px) {
  .pt-tooltip {
    max-width: 220px;
    left: auto;
    right: -8px;
    transform: translateY(4px);
  }
  .pt-tooltip::after {
    left: auto;
    right: 12px;
    transform: none;
  }
  .pt-tooltip-wrap:hover .pt-tooltip,
  .pt-tooltip-wrap:focus-within .pt-tooltip,
  .pt-tooltip-wrap.is-open .pt-tooltip {
    transform: translateY(0);
  }
}

/* ===================== CONFIRM MODAL — variants typés ===================== */

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: confirmFadeIn 0.18s ease-out;
}

.confirm-modal {
  position: relative;
  background: var(--pt-bg-card, #ffffff);
  border-radius: 1rem;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 30rem;
  padding: 1.5rem 1.5rem 1.25rem;
  animation: confirmSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Variant accent line at top */
.confirm-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--pt-text-tertiary, #94a3b8);
  opacity: 0.7;
}
.confirm-modal--info::before    { background: #3b82f6; }
.confirm-modal--success::before { background: #10b981; }
.confirm-modal--warning::before { background: #f59e0b; }
.confirm-modal--confirm::before { background: #f59e0b; }
.confirm-modal--error::before   { background: var(--pt-red, #de0a27); }
.confirm-modal--danger::before  { background: var(--pt-red, #de0a27); }

.confirm-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.75rem;
}

.confirm-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.12);
  color: var(--pt-text-secondary, #64748b);
}
.confirm-icon svg { width: 1.5rem; height: 1.5rem; }

.confirm-icon--info    { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.confirm-icon--success { background: rgba(16, 185, 129, 0.12); color: #059669; }
.confirm-icon--warning,
.confirm-icon--confirm { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.confirm-icon--error   { background: rgba(222, 10, 39, 0.10); color: var(--pt-red, #de0a27); }
.confirm-icon--danger  { background: rgba(222, 10, 39, 0.10); color: var(--pt-red, #de0a27); }

.confirm-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pt-text-primary, #0f172a);
  margin: 0;
  padding-top: 0.5rem;
  line-height: 1.3;
}

.confirm-message {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--pt-text-secondary, #475569);
  line-height: 1.55;
  white-space: pre-line;
  margin: 0 0 1rem;
  padding-left: 3.625rem; /* aligné sous le titre */
}

/* Details : tableau clé/valeur structuré */
.confirm-details {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  background: var(--pt-light-50, #f8fafc);
  border: 1px solid var(--pt-border, #e2e8f0);
  border-radius: 0.625rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
}
.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.375rem 0;
  border-bottom: 1px dashed var(--pt-border, #e2e8f0);
}
.confirm-detail-row:last-child { border-bottom: none; }
.confirm-detail-row.is-emphasis {
  font-weight: 700;
  margin-top: 0.25rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--pt-border, #cbd5e1);
  border-bottom: none;
}
.confirm-detail-label {
  color: var(--pt-text-secondary, #475569);
  flex: 1;
}
.confirm-detail-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--pt-text-primary, #0f172a);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.confirm-detail-row.is-emphasis .confirm-detail-value {
  font-size: 0.9375rem;
}
.confirm-modal--info     .confirm-detail-row.is-emphasis .confirm-detail-value { color: #2563eb; }
.confirm-modal--success  .confirm-detail-row.is-emphasis .confirm-detail-value { color: #059669; }
.confirm-modal--warning  .confirm-detail-row.is-emphasis .confirm-detail-value,
.confirm-modal--confirm  .confirm-detail-row.is-emphasis .confirm-detail-value { color: #d97706; }
.confirm-modal--error    .confirm-detail-row.is-emphasis .confirm-detail-value,
.confirm-modal--danger   .confirm-detail-row.is-emphasis .confirm-detail-value { color: var(--pt-red, #de0a27); }

/* Footer : phrase d'avertissement finale */
.confirm-footer {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0 0 1.25rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  border-left: 3px solid;
}
.confirm-footer--info    { background: rgba(59, 130, 246, 0.08);  border-left-color: #3b82f6; color: #1e40af; }
.confirm-footer--success { background: rgba(16, 185, 129, 0.08);  border-left-color: #10b981; color: #047857; }
.confirm-footer--warning,
.confirm-footer--confirm { background: rgba(245, 158, 11, 0.08);  border-left-color: #f59e0b; color: #92400e; }
.confirm-footer--error,
.confirm-footer--danger  { background: rgba(222, 10, 39, 0.06);   border-left-color: var(--pt-red, #de0a27); color: var(--pt-red-dark, #b50820); }

.confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.confirm-btn {
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: -0.005em;
}
.confirm-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}
.confirm-btn:active { transform: translateY(1px) scale(0.98); }

.confirm-btn-cancel {
  background: transparent;
  color: var(--pt-text-secondary, #475569);
  border-color: var(--pt-border, #e2e8f0);
}
.confirm-btn-cancel:hover {
  background: var(--pt-light-50, #f8fafc);
  color: var(--pt-text-primary, #0f172a);
  border-color: var(--pt-text-tertiary, #94a3b8);
}

.confirm-btn-ok {
  background: var(--pt-red, #de0a27);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.confirm-btn-ok:hover {
  background: var(--pt-red-dark, #b50820);
  box-shadow: 0 4px 10px -2px rgba(222, 10, 39, 0.35);
}

/* Variants du bouton OK selon type */
.confirm-modal--info     .confirm-btn-ok { background: #3b82f6; }
.confirm-modal--info     .confirm-btn-ok:hover { background: #2563eb; box-shadow: 0 4px 10px -2px rgba(59, 130, 246, 0.4); }
.confirm-modal--success  .confirm-btn-ok { background: #10b981; }
.confirm-modal--success  .confirm-btn-ok:hover { background: #059669; box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.4); }
.confirm-modal--warning  .confirm-btn-ok,
.confirm-modal--confirm  .confirm-btn-ok { background: #f59e0b; }
.confirm-modal--warning  .confirm-btn-ok:hover,
.confirm-modal--confirm  .confirm-btn-ok:hover { background: #d97706; box-shadow: 0 4px 10px -2px rgba(245, 158, 11, 0.4); }

@keyframes confirmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes confirmSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

@media (max-width: 480px) {
  .confirm-modal { padding: 1.25rem 1.25rem 1rem; max-width: 100%; }
  .confirm-message { padding-left: 0; margin-top: 0.25rem; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .confirm-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .confirm-overlay, .confirm-modal { animation-duration: 0.01ms; }
  .confirm-btn:active { transform: none; }
}

/* ── U-P0-3 : focus visible global pour accessibilité clavier ─────────────────
   Sans cette règle, les outline:none locaux faisaient disparaître l'indicateur
   de focus pour les utilisateurs clavier (WCAG 2.4.7).
   Note : focus-visible ne s'applique qu'au focus clavier (pas mouse), donc UI
   souris reste propre. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--pt-red, #de0a27);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── U-P1-6 : respect des préférences réduites de mouvement ───────────────────
   Désactive les animations Pulsar holographiques (mix-blend-mode + conic-gradient)
   coûteuses sur GPU faible (Zebra TC, mobiles bas de gamme) et pour les utilisateurs
   sensibles au mouvement (vertige). */
@media (prefers-reduced-motion: reduce) {
  .pulsar-pill::before,
  .pulsar-pill::after,
  [class*="pulsar"]::before,
  [class*="pulsar"]::after,
  [class*="holo"]::before,
  [class*="holo"]::after {
    animation: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── U-P0-2 : Touch target minimum WCAG/Apple HIG ─────────────────────────────
   Applique min 44×44 sur tous les éléments interactifs petits (Retirer, +/-,
   close modal). Améliore l'usage sur Zebra TC22, mobiles. */
button, a[role="button"], a.btn,
.btn-touch, .btn-icon, .stepper-btn, .icon-btn,
[role="button"] {
  min-height: 44px;
  min-width: 44px;
}
/* Exceptions : éléments inline qui ne sont pas des cibles principales */
.recv-counter button, .pill button, .badge button,
button.inline-toggle, .x-mark, .close-x,
/* Toggles/switches Tailwind (h-5 w-9, h-6 w-11, etc.) — gardent leur taille native */
button[role="switch"],
button.relative.inline-flex.rounded-full {
  min-height: auto;
  min-width: auto;
}

/* Masquer les FAB (clavardage rouge + signaler ambre) quand l'utilisateur a
   scrollé au bas de la page, pour ne pas cacher le bas du contenu. Garde la
   bulle visible si son panneau est déjà ouvert. */
body.scrolled-bottom .chat-bubble:not(.chat-bubble-active),
body.scrolled-bottom .feedback-fab:not(.feedback-fab-active) {
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem) scale(0.85);
}
