/* CRM Design System - Modern HSL Variables */

[v-cloak] {
  display: none !important;
}

/* Modal de confirmation globale */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

a{
  text-decoration: none;
}

.confirm-modal {
  background: hsl(var(--card));
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid hsl(var(--border));
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  flex-shrink: 0;
}

.confirm-modal-icon.warning {
  background: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

.confirm-modal-icon.success {
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}

.confirm-modal-icon.info {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.confirm-modal-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0 0 8px 0;
  text-align: center;
}

.confirm-modal-message {
  color: hsl(var(--muted-foreground));
  margin: 0 0 24px 0;
  text-align: center;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-modal-actions .btn {
  min-width: 100px;
}

@layer base {
  :root {
    --background: 0 0% 98%;
    --foreground: 230 15% 15%;

    --card: 0 0% 100%;
    --card-foreground: 230 15% 15%;

    --popover: 0 0% 100%;
    --popover-foreground: 230 15% 15%;

    --primary: 230 85% 20%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 230 85% 15%;
    --primary-light: 230 85% 96%;


    --secondary: 230 10% 96%;
    --secondary-foreground: 230 15% 25%;

    --muted: 230 10% 95%;
    --muted-foreground: 230 10% 45%;

    --accent: 230 85% 20%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --success: 142 71% 45%;
    --success-foreground: 0 0% 100%;
    --success-light: 142 71% 96%;

    /* Indigo/violet for reader/comment blocks - #9548E8 */
    --comment: 269 78% 60%;
    --comment-light: 269 78% 96%;

    /* Theming aliases for easy tuning across pages */
    --accent-reader: var(--comment);
    --accent-reader-light: var(--comment-light);
    --accent-staff: var(--primary);
    --accent-staff-light: var(--primary-light);

    --warning: 38 92% 50%;
    --warning-foreground: 0 0% 100%;
    --warning-light: 38 92% 96%;

    --border: 230 15% 92%;
    --input: 230 15% 92%;
    --ring: 230 85% 20%;

    --radius: 0.75rem;
    
    --sidebar-width: 220px;
    --sidebar-padding: 0.5rem;

    --sidebar-background: 0 0% 100%;
    --sidebar-foreground: 230 15% 25%;
    --sidebar-primary: 230 85% 20%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 230 85% 96%;
    --sidebar-accent-foreground: 230 85% 20%;
    --sidebar-border: 230 15% 92%;
    --sidebar-ring: 230 85% 20%;

    --gradient-primary: linear-gradient(135deg, hsl(230 85% 20%), hsl(230 85% 30%));
    --gradient-card: linear-gradient(180deg, hsl(0 0% 100%), hsl(230 10% 98%));
    
    --shadow-sm: 0 1px 2px 0 hsl(230 15% 15% / 0.05);
    --shadow-md: 0 4px 6px -1px hsl(230 15% 15% / 0.1);
    --shadow-lg: 0 10px 15px -3px hsl(230 15% 15% / 0.1);
    --shadow-primary: 0 8px 24px -4px hsl(230 85% 20% / 0.25);
  }

  .dark {
    --background: 230 20% 8%;
    --foreground: 230 10% 95%;

    --card: 230 20% 10%;
    --card-foreground: 230 10% 95%;

    --popover: 230 20% 10%;
    --popover-foreground: 230 10% 95%;

    --primary: 230 85% 20%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 230 75% 64%;
    --primary-light: 230 75% 20%;

    --secondary: 230 20% 15%;
    --secondary-foreground: 230 10% 85%;

    --muted: 230 20% 15%;
    --muted-foreground: 230 10% 60%;

    --accent: 230 85% 20%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --success: 142 71% 45%;
    --success-foreground: 0 0% 100%;
    --success-light: 142 71% 20%;

    --warning: 38 92% 50%;
    --warning-foreground: 0 0% 100%;
    --warning-light: 38 92% 20%;

    --border: 230 20% 20%;
    --input: 230 20% 20%;
    --ring: 230 85% 20%;

    --sidebar-background: 230 20% 10%;
    --sidebar-foreground: 230 10% 85%;
    --sidebar-primary: 230 85% 20%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 230 75% 20%;
    --sidebar-accent-foreground: 230 85% 20%;
    --sidebar-border: 230 20% 20%;
    --sidebar-ring: 230 85% 20%;

    --gradient-primary: linear-gradient(135deg, hsl(230 85% 20%), hsl(230 85% 30%));
    --gradient-card: linear-gradient(180deg, hsl(230 20% 10%), hsl(230 20% 12%));
    
    --shadow-sm: 0 1px 2px 0 hsl(0 0% 0% / 0.2);
    --shadow-md: 0 4px 6px -1px hsl(0 0% 0% / 0.3);
    --shadow-lg: 0 10px 15px -3px hsl(0 0% 0% / 0.4);
    --shadow-primary: 0 8px 24px -4px hsl(230 85% 20% / 0.4);
  }
}

/* Global flash messages */
.flash-message {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  animation: slideInRight 0.4s ease;
  max-width: 400px;
}

.flash-success {
  background: hsl(var(--success-light));
  color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.3);
}

.flash-error {
  background: hsl(var(--warning-light));
  color: hsl(var(--warning));
  border: 1px solid hsl(var(--warning) / 0.3);
}

.flash-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.25rem;
  opacity: 0.8;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
  }

  h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: hsl(var(--foreground));
  }
}

*{
  margin: 0;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: hsl(var(--background));
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: hsl(var(--background));
  margin-left: var(--sidebar-width);
}

.page-content {
  flex: 1;
  padding: 0.75rem;
  max-width: calc(100vw - var(--sidebar-width) - 3rem);
  margin: 0 auto;
  width: 100%;
}

.page-content--full {
  max-width: none;
  padding: 0;
}

/* Utility Classes */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}
/* PAS EN DESSOUS  */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: hsl(var(--primary)); }
.text-secondary { color: hsl(var(--secondary-foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-success { color: hsl(var(--success)); }
.text-warning { color: hsl(var(--warning)); }
.text-destructive { color: hsl(var(--destructive)); }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.opacity-0 { opacity: 0; }
.opacity-20 { opacity: 0.2; }
.opacity-40 { opacity: 0.4; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }
.opacity-100 { opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease-out;
  text-decoration: none;
  font-family: inherit;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover {
  background-color: hsl(var(--primary-hover));
  border-color: hsl(var(--primary-hover));
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}

.btn-secondary:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--border));
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.btn-ghost:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--border));
}

.btn-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
  border-color: hsl(var(--success));
}

.btn-success:hover {
  background-color: hsl(142 71% 40%);
  border-color: hsl(142 71% 40%);
  box-shadow: 0 4px 12px hsl(var(--success) / 0.25);
}

.btn-error {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.btn-error:hover {
  background-color: hsl(0 84% 55%);
  border-color: hsl(0 84% 55%);
  box-shadow: 0 4px 12px hsl(var(--destructive) / 0.25);
}

.btn-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}

.card__header {
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.card__body {
  padding: 1rem;
}

.card__footer {
  padding: 1.2rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
  margin-bottom: 0.5rem;
}

/* Form Elements */
.field {
  margin-bottom: 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.form-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.form-row .field {
  flex: 1;
  min-width: 0;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
  background-color: hsl(var(--background));
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.7;
  border-color: hsl(var(--border));
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.75rem;
}

/* Alerts */
.alert {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
}

.alert-success {
  background-color: hsl(var(--success-light));
  color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.3);
}

.alert-error {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border: 1px solid hsl(var(--destructive) / 0.3);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-info {
  background-color: hsl(var(--primary-light));
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.alert-warning {
  background-color: hsl(var(--warning-light));
  color: hsl(var(--warning));
  border: 1px solid hsl(var(--warning) / 0.3);
}

.text-error {
  display: block;
  color: hsl(var(--destructive));
  font-size: 0.8125rem;
  margin-top: 0.375rem;
  padding: 0.5rem 0.75rem;
  background-color: hsl(var(--destructive) / 0.1);
  border-left: 3px solid hsl(var(--destructive));
  border-radius: 0.25rem;
}

/* Badges - Système outlined standardisé */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.badge-primary {
  background-color: hsl(var(--primary-light));
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.badge-success {
  background-color: hsl(var(--success-light));
  color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.3);
}

.badge-warning {
  background-color: hsl(var(--warning-light));
  color: hsl(var(--warning));
  border: 1px solid hsl(var(--warning) / 0.3);
}

.badge-secondary {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.badge-light {
  background-color: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.badge-admin {
  background-color: hsl(270 75% 96%);
  color: hsl(270 75% 45%);
  border: 1px solid hsl(270 75% 85%);
}

.badge-user {
  background-color: hsl(var(--primary-light));
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.badge-disabled {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border: 1px solid hsl(var(--destructive) / 0.3);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th,
.table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

.table th {
  background-color: hsl(var(--muted));
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: hsl(var(--muted) / 0.5);
}

.table tbody tr.disabled {
  opacity: 0.6;
  background-color: hsl(var(--muted) / 0.3);
  color: hsl(var(--muted-foreground));
}

/* Modal Components */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.modal-overlay-transparent {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

.modal-content {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
  margin: 0;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
}

/* Confirmation Modal */
.confirm-modal {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  text-align: center;
}

.confirm-modal-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.confirm-modal-icon.warning {
  background-color: hsl(var(--warning-light));
  color: hsl(var(--warning));
}

.confirm-modal-icon svg {
  width: 2rem;
  height: 2rem;
}

.confirm-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
  margin-bottom: 0.5rem;
}

.confirm-modal-message {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-modal-actions .btn {
  min-width: 100px;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: hsl(var(--sidebar-background));
  border-right: 1px solid hsl(var(--sidebar-border));
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
}

.sidebar-brand {
  padding: var(--sidebar-padding);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-brand-icon {
  background: #020649eb;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(2, 6, 73, 0.15);
  padding: 0.5rem;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand-text {
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 700;
  color: hsl(var(--sidebar-foreground));
}

.sidebar-nav {
  flex: 1;
  padding: 0.8rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  color: hsl(var(--sidebar-foreground));
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}

.nav-item.active {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
  border-left-color: hsl(var(--sidebar-primary));
}

.nav-item-icon {
  width: 1.125rem;
  height: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-text {
  font-weight: 500;
  font-size: 0.8125rem;
}

.sidebar-footer {
  padding: 0.8rem 0;
  border-top: 1px solid hsl(var(--sidebar-border));
}

.nav-item--logout {
  color: hsl(var(--destructive));
}

.nav-item--logout:hover {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* Navbar */
.navbar {
  background-color: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
  padding: 0.4rem var(--sidebar-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}

.navbar-start {
  flex: 1;
}

.navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 2rem;
}

.navbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.navbar-end {
  display: flex;
  align-items: center;
}

/* Global Search */
.global-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.global-search {
  position: relative;
}

.global-search-input {
  width: 100%;
}

/* Search Modern Styles (réutilisés depuis readers.css) */
.search-modern {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search-icon-modern {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  width: 18px;
  height: 18px;
  z-index: 1;
}

.search-input-modern {
  width: 100%;
  padding: 0.625rem 2.25rem 0.625rem 2.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: 2rem;
  font-size: 0.875rem;
  background: hsl(var(--background));
  transition: all 0.2s;
  box-sizing: border-box;
}

.search-input-modern:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  z-index: 1;
}

.search-clear:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
}

.global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.1);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}

.global-search-list {
  display: flex;
  flex-direction: column;
}

.global-search-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.15s ease;
}

.global-search-item:last-child {
  border-bottom: none;
}

.global-search-item:hover {
  background: hsl(var(--muted) / 0.5);
}

.global-search-item-more {
  font-weight: 500;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.05);
}

.global-search-item-more:hover {
  background: hsl(var(--primary) / 0.1);
}

.global-search-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.global-search-item-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.global-search-item-email {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.global-search-item-company {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.global-search-loading,
.global-search-error {
  padding: 1rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  line-height: 0.8;
}

.user-avatar {
  position: relative;
}

.avatar-circle {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 0.6875rem;
  box-shadow: 0 2px 4px hsl(var(--primary) / 0.2);
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.6875rem;
}

.user-role {
  margin-top: 0.25rem;
}

/* User Menu Dropdown */
.user-menu {
  position: relative;
  cursor: pointer;
}

.chevron-icon {
  transition: transform 0.2s ease;
  color: hsl(var(--muted-foreground));
}

.user-menu:hover .chevron-icon {
  transform: rotate(180deg);
}
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.1);
  min-width: 200px;
  z-index: 50;
  overflow: hidden;
}

.user-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: background 0.2s;
  font-size: 0.875rem;
}

.user-dropdown a:hover {
  background: hsl(var(--muted));
}

.dropdown-divider {
  height: 1px;
  background: hsl(var(--border));
  margin: 0.5rem 0;
}

/* Profile specific styles */
.profile-page {
  max-width: 1000px;
  margin: 0 auto;
}

.profile-header {
  background: var(--gradient-card);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid hsl(var(--border));
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-primary);
}

.profile-info {
  text-align: center;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--card-foreground));
  margin-bottom: 0.5rem;
}

.profile-email {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  margin-bottom: 1rem;
}

.profile-role {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--primary-light));
  color: hsl(var(--primary));
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid hsl(var(--primary) / 0.3);
}

.profile-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.account-info {
  height: fit-content;
}

.info-grid {
  display: grid;
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.info-value {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.role-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.role-note {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* Users specific styles */
.users-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.header-content {
  flex: 1;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.page-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Header uniforme pour les pages de gestion (Prospections, Secteurs & Activités, Utilisateurs) */
.gestion-header {
  margin-bottom: 2rem;
}

.gestion-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.gestion-header .btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

.gestion-header .btn-secondary svg {
  width: 16px;
  height: 16px;
}

.gestion-header-content {
  flex: 1;
}

.gestion-header .page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gestion-header .page-title svg {
  width: 28px;
  height: 28px;
  color: hsl(var(--primary));
}

.gestion-header .page-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  margin-top: 0.375rem;
  font-weight: 400;
}

.users-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-section {
  margin-bottom: 1rem;
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.search-input {
  padding-left: 3rem;
}

.table-container {
  overflow-x: auto;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-primary);
}

.user-name {
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.75rem;
}

.user-id {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.user-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-online { background: hsl(var(--success)); }
.status-recent { background: hsl(var(--warning)); }
.status-offline, .status-never { background: hsl(var(--muted-foreground)); }

.status-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.user-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-updated {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
}

/* Nouveaux styles pour le design professionnel */

.filters-pro {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-modern {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-input-modern {
  width: 100%;
  padding: 0.625rem 2.25rem 0.625rem 2.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: 2rem;
  font-size: 0.875rem;
  background: hsl(var(--background));
  transition: all 0.2s;
  box-sizing: border-box;
}

.search-input-modern:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.search-icon-modern {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  width: 18px;
  height: 18px;
}

.search-clear {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
}

.filters-compact {
  display: flex;
  gap: 0.5rem;
}

.filter-modern {
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  background: hsl(var(--background));
  cursor: pointer;
  min-width: 120px;
}

.btn-reset-filters {
  padding: 0.5rem 0.75rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: hsl(var(--foreground));
  transition: all 0.2s;
}

.btn-reset-filters:hover {
  background: hsl(var(--muted-hover));
  border-color: hsl(var(--border-hover));
}

.user-cell-clean {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.user-avatar-clean {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-dark)));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name-primary {
  font-weight: 500;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.125rem;
}

.user-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-email-preview {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-connection-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.75rem;
  font-weight: 500;
}

.user-connection-status.status-online {
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}

.user-connection-status.status-recent {
  background: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

.user-connection-status.status-offline,
.user-connection-status.status-never {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
}

.status-dot-small {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.user-connection-status.status-online .status-dot-small {
  background: hsl(var(--success));
}

.user-connection-status.status-recent .status-dot-small {
  background: hsl(var(--warning));
}

.user-connection-status.status-offline .status-dot-small,
.user-connection-status.status-never .status-dot-small {
  background: hsl(var(--muted-foreground));
}

.date-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.date-info {
  display: flex;
  align-items: center;
  color: hsl(var(--foreground));
}

.date-value {
  font-size: 0.875rem;
  font-weight: 500;
}

.date-type {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-weight: 500;
  text-align: center;
}

.date-type.created {
  background: hsl(var(--muted) / 0.3);
  color: hsl(var(--muted-foreground));
}

.date-type.modified {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.email-cell {
  display: flex;
  align-items: center;
  color: hsl(var(--foreground));
}

.date-cell {
  display: flex;
  align-items: center;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
}

.table-header {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.loading-spinner svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 2rem;
}

/* Login specific styles */
.auth-brand {
  text-align: center;
}

.auth-logo {
  width: 3rem;
  height: 3rem;
  background: var(--gradient-primary);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-primary);
}

.form-section {
  text-align: center;
  margin-bottom: 2rem;
}

.form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--card-foreground));
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
    --sidebar-padding: 1rem;
  }
  
  .profile-content {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .users-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    min-width: auto;
  }
  
  .pagination {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 640px) {
  .search-filters {
    padding: 1rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.75rem;
  }
  
  .badge {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
  }
  
  .profile-header {
    padding: 1.5rem;
  }
  
  .profile-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .profile-name {
    font-size: 1.25rem;
  }
  
  .profile-email {
    font-size: 0.875rem;
  }
  
  .profile-role {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
  }
}


/* Commentaires */
.comment-item {
  padding: 1rem;
  border-left: 3px solid hsl(var(--border));
  margin-bottom: 1rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-date {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Timeline */
.timeline-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-created { background: hsl(var(--success) / 0.2); }
.event-updated { background: hsl(var(--info) / 0.2); }
.event-title_attached { background: hsl(var(--primary) / 0.2); }
.event-comment_added { background: hsl(var(--warning) / 0.2); }



.titles-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.info-item span {
  color: hsl(var(--foreground));
}

.comment-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.comment-form .textarea {
  width: 100%;
  min-height: 80px;
  margin-bottom: 0.75rem;
}

.timeline-content {
  flex: 1;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.timeline-date {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.timeline-author {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.timeline-data {
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

.reader-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid hsl(var(--border));
  border-top: 3px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}