/* Design system — Espace Client Tickets */
:root {
    --app-font: 'DM Sans', system-ui, sans-serif;
    --app-primary: #2563eb;
    --app-primary-soft: #eff4ff;
    --app-success: #16a34a;
    --app-success-soft: #f0fdf4;
    --app-warning: #d97706;
    --app-warning-soft: #fffbeb;
    --app-danger: #dc2626;
    --app-danger-soft: #fef2f2;
    --app-muted: #64748b;
    --app-border: #e2e8f0;
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-radius: 0.625rem;
    --app-radius-lg: 0.875rem;
    --app-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --app-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
  
  * { font-family: var(--app-font); }
  
  body {
    background: var(--app-bg);
    color: #1e293b;
    font-size: 0.9375rem;
    line-height: 1.6;
  }
  
  /* Navbar */
  .app-navbar {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    padding: 0.75rem 0;
  }
  .app-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: #0f172a;
    letter-spacing: -0.01em;
  }
  .app-navbar .navbar-brand .brand-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--app-primary);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
  }
  .app-navbar .nav-link {
    color: var(--app-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--app-radius);
    transition: all 0.15s;
  }
  .app-navbar .nav-link:hover,
  .app-navbar .nav-link.active {
    color: var(--app-primary);
    background: var(--app-primary-soft);
  }
  .user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--app-muted);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
  }
  .user-pill .avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
  }
  
  /* Page structure — responsive padding */
  .page-section {
    padding: 1.5rem 1rem 2rem;
  }
  @media (min-width: 576px) {
    .page-section {
      padding-left: 1.25rem;
      padding-right: 1.25rem;
    }
  }
  @media (min-width: 768px) {
    .page-section {
      padding: 2rem 1.5rem;
    }
  }
  @media (min-width: 992px) {
    .page-section {
      padding-left: 2rem;
      padding-right: 2rem;
    }
  }
  
  .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }
  .page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.02em;
  }
  .page-header .subtitle {
    font-size: 0.875rem;
    color: var(--app-muted);
    margin-top: 0.125rem;
  }
  
  .section-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
  }
  
  .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }
  
  /* Cards */
  .app-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-sm);
  }
  .app-card-body { padding: 1.5rem; }

  /* KPI cards (dashboard) */
  .kpi-card { transition: box-shadow 0.15s ease; border: none !important; }
  .kpi-card:hover { box-shadow: var(--app-shadow); }
  .kpi-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
  }
  .kpi-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
  }
  .kpi-card--todo { background: #fef2f2; color: #991b1b; }
  .kpi-card--todo .kpi-card__label { color: #b91c1c; }
  .kpi-card--progress { background: #fff7ed; color: #c2410c; }
  .kpi-card--progress .kpi-card__label { color: #ea580c; }
  .kpi-card--review { background: #fefce8; color: #a16207; }
  .kpi-card--review .kpi-card__label { color: #ca8a04; }
  .kpi-card--validated { background: #f0fdf4; color: #166534; }
  .kpi-card--validated .kpi-card__label { color: #16a34a; }
  .kpi-card--billed { background: #f0f9ff; color: #0369a1; }
  .kpi-card--billed .kpi-card__label { color: #0284c7; }
  .kpi-card--cancelled { background: #f1f5f9; color: #475569; }
  .kpi-card--cancelled .kpi-card__label { color: #64748b; }

  .dashboard-column-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .dashboard-column-list .ticket-card {
    flex-shrink: 0;
  }

  /* Badges */
  .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    letter-spacing: 0.01em;
  }
  .badge-status .status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .badge-todo        { background: #f1f5f9; color: #475569; }
  .badge-todo .status-dot { background: #94a3b8; }
  .badge-inprogress  { background: #dbeafe; color: #1d4ed8; }
  .badge-inprogress .status-dot { background: #3b82f6; }
  .badge-review      { background: var(--app-warning-soft); color: #92400e; }
  .badge-review .status-dot { background: var(--app-warning); }
  .badge-validated   { background: var(--app-success-soft); color: #166534; }
  .badge-validated .status-dot { background: var(--app-success); }
  .badge-billed      { background: #f3e8ff; color: #6b21a8; }
  .badge-billed .status-dot { background: #9333ea; }
  .badge-canceled    { background: #f1f5f9; color: #64748b; }
  .badge-canceled .status-dot { background: #94a3b8; }
  
  .badge-type {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
  }
  .badge-urgent {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--app-danger-soft);
    color: var(--app-danger);
  }
  
  /* Filter bar — compact */
  .filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    margin-bottom: 1rem;
  }
  .filter-bar .filter-bar__label {
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
  }
  .filter-bar .form-select,
  .filter-bar .form-control {
    font-size: 0.8125rem;
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    height: 32px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    min-width: 0;
  }
  @media (min-width: 576px) {
    .filter-bar .form-select,
    .filter-bar .form-control {
      width: auto;
      max-width: 160px;
    }
  }
  .filter-bar .form-check {
    margin-bottom: 0;
    margin-left: auto;
  }
  .filter-bar .form-check-input {
    width: 0.875rem;
    height: 0.875rem;
    margin-top: 0;
  }
  .filter-bar .form-check-label {
    font-size: 0.75rem;
    color: var(--app-muted);
    padding-left: 0.25rem;
  }
  .filter-bar__form {
    display: contents;
  }
  .filter-bar__form .filter-bar__field {
    display: flex;
    min-width: 0;
  }
  .filter-bar__form .filter-bar__field .form-control,
  .filter-bar__form .filter-bar__field .form-select {
    width: 100%;
  }
  .filter-bar__btn-icon {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .filter-bar__btn-icon.bi::before {
    font-size: 1.125rem;
  }

  /* Navbar secondaire client (Profil / Utilisateurs / Paramètres) */
  .client-internal-nav {
    padding: 0.75rem 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
  }
  .client-internal-nav .nav-pills .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.875rem;
    border-radius: var(--app-radius);
    color: var(--app-muted);
  }
  .client-internal-nav .nav-pills .nav-link:hover {
    color: var(--app-primary);
    background: var(--app-primary-soft);
  }
  .client-internal-nav .nav-pills .nav-link.active {
    background: var(--app-primary);
    color: #fff;
  }

  /* Ticket table */
  .ticket-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }
  .ticket-table thead th {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--app-border);
    white-space: nowrap;
    background: var(--app-surface);
  }
  .ticket-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.875rem;
  }
  .ticket-table tbody tr { transition: background 0.1s; }
  .ticket-table tbody tr:hover { background: #f8fafc; }
  .ticket-table .ticket-title-cell a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
  }
  .ticket-table .ticket-title-cell a:hover { color: var(--app-primary); }
  .ticket-table .text-muted-sm {
    color: var(--app-muted);
    font-size: 0.8125rem;
  }
  
  /* Mobile ticket cards */
  .ticket-card-mobile {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1rem 1.125rem;
    margin-bottom: 0.625rem;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
  }
  .ticket-card-mobile:hover {
    box-shadow: var(--app-shadow);
    color: inherit;
  }
  .ticket-card-mobile .tc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }
  .ticket-card-mobile .tc-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0f172a;
    line-height: 1.35;
  }
  .ticket-card-mobile .tc-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  
  /* Ticket cards (dashboard) */
  .ticket-cards-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, 1fr);
  }
  @media (min-width: 576px) {
    .ticket-cards-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  @media (min-width: 992px) {
    .ticket-cards-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  .ticket-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1.25rem 1.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .ticket-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
    color: inherit;
  }
  .ticket-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: -1.25rem -1.375rem 0.875rem -1.375rem;
    background: #f1f5f9;
    border-radius: 0.375rem 0.375rem 0 0;
  }
  .ticket-card__project {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
  }
  .ticket-card__client-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #0f172a;
    color: #fff;
    border-radius: 0.25rem;
  }
  .ticket-card__title {
    font-weight: 600;
    font-size: 1rem;
    color: #0f172a;
    line-height: 1.4;
    margin: 0;
  }
  .ticket-card:hover .ticket-card__title {
    color: var(--app-primary);
  }
  .ticket-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }
  .ticket-card__priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--app-muted);
  }
  .ticket-card__priority--urgent {
    color: var(--app-danger, #dc2626);
  }
  .ticket-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  .ticket-card__meta-item {
    display: inline-flex;
    align-items: center;
  }
  .ticket-card__meta-item i {
    opacity: 0.85;
  }
  .ticket-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  .ticket-card__time {
    font-weight: 600;
    color: #334155;
  }
  .ticket-card__body-comment {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .ticket-card__comment-message {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .ticket-card__comment-message p:first-child { margin-top: 0; }
  .ticket-card__comment-message p:last-child { margin-bottom: 0; }
  .ticket-card__comment-message--badge {
    background: var(--app-primary-soft);
    color: #1e40af;
    padding: 0.625rem 0.875rem;
    border-radius: var(--app-radius);
    border-left: 3px solid var(--app-primary);
    font-weight: 500;
    max-height: none;
    -webkit-line-clamp: unset;
    display: block;
  }
  .ticket-card__comment-message--badge p { margin: 0.25em 0; }
  .ticket-card__comment-message--badge p:first-child { margin-top: 0; }
  .ticket-card__comment-message--badge p:last-child { margin-bottom: 0; }

  /* Internal — cards opérationnelles (dashboard) */
  .internal-operational-cards .internal-ticket-card {
    display: flex;
    flex-direction: column;
  }
  .internal-ticket-card .internal-ticket-card__body {
    padding: 1.25rem 1.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    flex: 1;
  }
  .internal-ticket-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  .internal-ticket-card__meta i { opacity: 0.85; }
  .internal-ticket-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
  }
  .internal-ticket-card__actions .btn { flex: 1; min-width: 120px; }
  .internal-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
  }
  .internal-empty-state__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  .internal-empty-state__text {
    font-size: 0.9375rem;
    color: var(--app-muted);
    margin: 0;
  }
  
  /* Buttons */
  .btn-app-primary {
    background: var(--app-primary);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--app-radius);
    transition: all 0.15s;
  }
  .btn-app-primary:hover {
    background: #1d4ed8;
    color: #fff;
  }
  .btn-app-outline {
    background: var(--app-surface);
    color: #334155;
    border: 1px solid var(--app-border);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--app-radius);
    transition: all 0.15s;
  }
  .btn-app-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
  }
  .btn-app-success {
    background: var(--app-success);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--app-radius);
  }
  .btn-app-success:hover {
    background: #15803d;
    color: #fff;
  }
  .btn-app-warning {
    background: var(--app-surface);
    color: var(--app-warning);
    border: 1px solid var(--app-warning);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--app-radius);
  }
  .btn-app-warning:hover { background: var(--app-warning-soft); }
  
  /* Login page — 2 zones (branding | formulaire) */
  .login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--app-surface);
  }
  /* Quand la page login est dans un .container (ex: connect), repasser en pleine largeur */
  .container .login-page {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  @media (max-width: 991.98px) {
    .login-page {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
    }
  }
  
  .login-branding {
    background: linear-gradient(145deg, #2d2463 0%, #1e3a5f 50%, var(--app-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }
  @media (max-width: 991.98px) {
    .login-branding { padding: 2.5rem 1.5rem; min-height: 220px; }
  }
  .login-branding-inner {
    text-align: center;
    max-width: 360px;
  }
  .login-logo {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
  }
  @media (max-width: 991.98px) {
    .login-logo { width: 80px; margin-bottom: 1rem; }
  }
  .login-portal-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
  }
  @media (max-width: 991.98px) {
    .login-portal-name { font-size: 1.25rem; }
  }
  .login-tagline {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin: 0;
  }
  
  .login-form-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--app-bg);
  }
  @media (max-width: 991.98px) {
    .login-form-col { padding: 2rem 1.5rem; justify-content: flex-start; padding-top: 2.5rem; }
  }
  .login-form-card {
    width: 100%;
    max-width: 400px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
    padding: 2.5rem 2rem;
  }
  .login-form-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1.75rem;
    letter-spacing: -0.02em;
  }
  .login-btn-submit {
    padding: 0.75rem !important;
    display: inline-block;
    text-align: center;
    text-decoration: none;
  }
  .login-link-forgot {
    font-size: 0.8125rem;
    color: var(--app-primary);
    font-weight: 500;
    text-decoration: none;
  }
  .login-link-forgot:hover { color: #1d4ed8; }
  .login-link-back {
    font-size: 0.8125rem;
    color: var(--app-muted);
    font-weight: 500;
    text-decoration: none;
  }
  .login-link-back:hover { color: var(--app-primary); }
  .login-reset-intro {
    font-size: 0.875rem;
    color: var(--app-muted);
    text-align: center;
    margin-bottom: 1.5rem;
  }
  .login-success-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--app-success-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
  }
  .login-success-icon i { font-size: 1.25rem; color: var(--app-success); }
  .login-success-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
  }
  .login-success-text {
    font-size: 0.8125rem;
    color: var(--app-muted);
    margin-bottom: 1.5rem;
  }
  
  .login-form-card .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
  }
  .login-form-card .form-control {
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }
  .login-form-card .form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }
  
  .login-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--app-muted);
  }
  .login-footer-sep {
    margin: 0 0.5rem;
    opacity: 0.6;
  }
  .login-footer-name {
    font-weight: 600;
    color: #475569;
  }
  .login-footer-contact {
    color: var(--app-muted);
    text-decoration: none;
  }
  .login-footer-contact:hover { color: var(--app-primary); }
  
  /* Ticket detail */
  .detail-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
    margin-bottom: 0.25rem;
  }
  .detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
  }
  
  /* Comments */
  .comment-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
  }
  .comment-item:last-child { border-bottom: none; }
  .comment-body {
    order: 1;
    flex: 1;
    min-width: 0;
  }
  .comment-avatar {
    order: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
  }
  .comment-avatar.is-client {
    background: var(--app-primary-soft);
    color: var(--app-primary);
  }
  .comment-avatar.is-team {
    background: #f0fdf4;
    color: var(--app-success);
  }
  .comment-meta { font-size: 0.8125rem; margin-bottom: 0.25rem; }
  .comment-meta strong { color: #0f172a; }
  .comment-meta time {
    color: var(--app-muted);
    font-size: 0.75rem;
    margin-left: 0.5rem;
  }
  .comment-text {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.55;
  }
  .comment-avatar.is-internal {
    background: #f1f5f9;
    color: #475569;
  }
  .comment-item--internal .comment-body { border-left: 3px solid #e2e8f0; padding-left: 0.5rem; }
  
  /* Internal — fiche ticket */
  .internal-ticket-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.35;
  }
  .internal-ticket-id {
    color: var(--app-muted);
    font-weight: 600;
    margin-right: 0.25rem;
  }
  .internal-ticket-meta {
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  .internal-info-cards {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, 1fr);
  }
  @media (min-width: 576px) {
    .internal-info-cards { grid-template-columns: repeat(3, 1fr); }
  }
  @media (min-width: 768px) {
    .internal-info-cards { grid-template-columns: repeat(6, 1fr); }
  }
  .internal-info-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--app-shadow-sm);
  }
  .internal-info-card__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
    margin-bottom: 0.25rem;
  }
  .internal-info-card__value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
  }
  .internal-info-card__value .badge-status,
  .internal-info-card__value .badge-urgent { font-weight: 600; }
  .internal-description {
    font-size: 0.9375rem;
    color: #334155;
    line-height: 1.65;
  }
  .internal-timelog-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .internal-timelog-card {
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 0.875rem 1rem;
  }
  .internal-timelog-card__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
  }
  .internal-timelog-card__date {
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  .internal-timelog-card__duration {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--app-primary);
  }
  .internal-timelog-card__actions {
    margin-left: auto;
    white-space: nowrap;
  }
  .internal-timelog-card__desc {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 0.375rem;
  }
  .internal-timelog-card__user {
    font-size: 0.75rem;
    color: var(--app-muted);
  }
  .internal-timelog-form {
    background: #f8fafc;
    border: 1px solid var(--app-border);
  }
  
  /* Time summary */
  .time-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
  }
  .time-summary .time-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
  }
  .time-summary .time-label {
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  
  /* Attachments */
  .attachment-grid {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
  }
  .attachment-thumb {
    width: 72px; height: 72px;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .attachment-thumb:hover { border-color: var(--app-primary); }
  .attachment-thumb i {
    font-size: 1.5rem;
    color: var(--app-muted);
  }
  .attachment-thumb-preview { outline: none; }
  .attachment-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  /* Upload zone */
  .upload-zone {
    border: 2px dashed var(--app-border);
    border-radius: var(--app-radius);
    padding: 1.5rem;
    text-align: center;
    color: var(--app-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
  }
  .upload-zone:hover {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
    color: var(--app-primary);
  }
  
  /* Intervention detail (legacy rows, e.g. client _card_time) */
  .intervention-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
  }
  .intervention-row:last-child { border-bottom: none; }
  .intervention-date { color: var(--app-muted); min-width: 80px; }
  .intervention-desc { flex: 1; padding: 0 0.75rem; color: #334155; }
  .intervention-time { font-weight: 600; color: #0f172a; white-space: nowrap; }

  /* Time log cards (fiche admin / internal) */
  .time-log-cards { margin-top: 0.5rem; }
  .time-log-card {
    display: block;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.8125rem;
    cursor: default;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
  }
  .time-log-card--editable { cursor: pointer; }
  .time-log-card--editable:hover,
  .time-log-card--editable:focus-visible {
    background: #f8fafc;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 1px var(--app-primary);
    outline: none;
  }
  .time-log-card__header {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .time-log-card__date {
    color: var(--app-muted);
    font-size: 0.75rem;
  }
  .time-log-card__badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
  }
  .time-log-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
  }
  .time-log-badge--duration {
    background: var(--app-primary-soft);
    color: var(--app-primary);
  }
  .time-log-badge--user {
    background: #e2e8f0;
    color: #475569;
  }
  .time-log-card__body { }
  .time-log-card__desc {
    color: #334155;
    line-height: 1.4;
    font-size: 0.8125rem;
  }
  
  /* Form */
  .app-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
  }
  .app-form .form-control,
  .app-form .form-select {
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }
  .app-form .form-control:focus,
  .app-form .form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }
  .app-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
  }
  
  /* Breadcrumb */
  .breadcrumb-app {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
  }
  .breadcrumb-app a {
    color: var(--app-muted);
    text-decoration: none;
  }
  .breadcrumb-app a:hover { color: var(--app-primary); }
  .breadcrumb-app .sep { color: #cbd5e1; margin: 0 0.375rem; }
  .breadcrumb-app .current { color: #334155; font-weight: 500; }
  
  /* Action bar */
  .action-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
  }
  
  /* Responsive */
  .desktop-table { display: block; }
  .mobile-cards { display: none; }
  @media (max-width: 575.98px) {
    .page-header h1 { font-size: 1.25rem; }
    .filter-bar .form-select,
    .filter-bar .form-control {
      flex: 1 1 120px;
      max-width: 100%;
    }
    .ticket-cards-grid { gap: 0.75rem; }
    .ticket-card { padding: 1rem 1.125rem; }
  }
  @media (max-width: 767.98px) {
    .desktop-table { display: none; }
    .mobile-cards { display: block; }
  }
  
  /* === Admin back-office === */
  .admin-badge {
    font-size: 0.625rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    margin-left: 0.25rem;
    vertical-align: middle;
  }
  .admin-counter-card {
    display: block;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
  }
  .admin-counter-card:hover {
    box-shadow: var(--app-shadow);
    border-color: #cbd5e1;
    color: inherit;
  }
  .admin-counter-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
  .admin-counter-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }
  .admin-counter-card__label {
    font-size: 0.8125rem;
    color: var(--app-muted);
    margin-top: 0.25rem;
  }
  .admin-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .admin-section-title .badge { font-size: 0.75rem; font-weight: 600; }
  .badge-active {
    background: var(--app-success-soft);
    color: #166534;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
  }
  .badge-inactive {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
  }
  .admin-user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
  }
  .admin-user-row:last-child { border-bottom: none; }
  .admin-user-row .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
  }
  .admin-user-row__body { flex: 1; min-width: 0; }
  .admin-user-row__name { font-weight: 600; font-size: 0.875rem; color: #0f172a; }
  .admin-user-row__email { font-size: 0.8125rem; color: var(--app-muted); }
  .admin-user-row__actions { display: flex; align-items: center; gap: 0.5rem; }
  .admin-empty-state {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8125rem;
    color: var(--app-muted);
  }
  
  /* Admin : menu accordéon mobile */
  .admin-nav-collapse {
    border-top: 1px solid var(--app-border);
    background: var(--app-bg);
  }
  .admin-nav-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }
  .admin-nav-accordion__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    border-radius: var(--app-radius);
    transition: background 0.15s, color 0.15s;
  }
  .admin-nav-accordion__item:hover {
    background: var(--app-primary-soft);
    color: var(--app-primary);
  }
  .admin-nav-accordion__item.active {
    background: var(--app-primary-soft);
    color: var(--app-primary);
  }
  .admin-nav-accordion__item i {
    font-size: 1.125rem;
    opacity: 0.9;
  }
  .admin-nav-toggle {
    padding: 0.375rem 0.625rem;
  }
  
  /* ── Landing (page d'accueil) ── */
  .landing-nav {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .landing-nav .nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .landing-nav .brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: #0f172a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
  }
  .landing-nav .brand:hover { color: #0f172a; }
  .landing-nav .brand-dot {
    width: 8px; height: 8px;
    background: var(--app-primary);
    border-radius: 50%;
    flex-shrink: 0;
  }
  .btn-landing-login {
    background: var(--app-primary);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--app-radius);
    text-decoration: none;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
  }
  .btn-landing-login:hover { background: #1d4ed8; color: #fff; }
  
  .landing-hero {
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
  }
  .landing-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--app-primary);
    background: var(--app-primary-soft);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
  }
  .landing-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 1rem;
  }
  .landing-hero p {
    font-size: 1.0625rem;
    color: var(--app-muted);
    line-height: 1.7;
    margin: 0 0 2rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing-hero .btn-landing-login {
    padding: 0.75rem 2rem;
    font-size: 1rem;
  }
  @media (max-width: 575.98px) {
    .landing-hero { padding: 3rem 1.25rem 2.5rem; }
    .landing-hero h1 { font-size: 1.75rem; }
    .landing-hero p { font-size: 0.9375rem; }
  }
  
  .landing-features {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
  }
  .landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  @media (max-width: 767.98px) {
    .landing-features-grid { grid-template-columns: 1fr; }
  }
  .landing-feature-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--app-shadow-sm);
    transition: box-shadow 0.2s;
  }
  .landing-feature-card:hover { box-shadow: var(--app-shadow); }
  .landing-feature-icon {
    width: 40px; height: 40px;
    border-radius: var(--app-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
  }
  .landing-feature-card h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.375rem;
    letter-spacing: -0.01em;
  }
  .landing-feature-card p {
    font-size: 0.8125rem;
    color: var(--app-muted);
    margin: 0;
    line-height: 1.6;
  }
  
  .landing-steps {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
  }
  .landing-steps-title {
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
  }
  .landing-steps-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    counter-reset: step;
  }
  @media (max-width: 767.98px) {
    .landing-steps-row { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  }
  @media (max-width: 479.98px) {
    .landing-steps-row { grid-template-columns: 1fr; }
  }
  .landing-step-item {
    text-align: center;
    counter-increment: step;
  }
  .landing-step-number {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.875rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
  }
  .landing-step-item h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
  }
  .landing-step-item p {
    font-size: 0.8125rem;
    color: var(--app-muted);
    margin: 0;
    line-height: 1.55;
  }
  
  .landing-cta-section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
  }
  .landing-cta-box {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-sm);
    padding: 3rem 2rem;
    text-align: center;
  }
  .landing-cta-box h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
  }
  .landing-cta-box p {
    font-size: 0.9375rem;
    color: var(--app-muted);
    margin: 0 0 1.5rem;
  }
  
  .landing-footer {
    border-top: 1px solid var(--app-border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--app-muted);
  }
  