/* ============================================================
   CITRAC GMAO — Design System Stylesheet
   Palette: Forest Green (#1A2E26 / #2D5F4C) + Gold (#C8953A)
   Fonts: DM Sans (body) + Instrument Serif (brand)
   Icons: Lucide
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
/*  --green-900: #1A2E26;
  --green-800: #223D33;
  --green-700: #2D5F4C;
  --green-600: #3A7D63;
  --green-500: #4A9A7A;
  --green-100: #E8F3ED;
  --green-50:  #F4FAF6;*/

    --green-900: #3e3023;
    --green-800: #483928;
    --green-700: #5f4a2d;
    --green-600: #7d5e3a;
    --green-500: #9a794a;
    --green-200: #efeeec;
    --green-100: #f3f5f3;
    --green-50: rgba(250, 248, 244, 0.7);

  --gold-600: #C8953A;
  --gold-500: #D4A54B;
  --gold-400: #E0BD6E;
  --gold-100: #FDF4E3;
  --gold-50:  #FEFAF0;
  --gray-900: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;
  --red-600:  #DC2626;
  --red-100:  #FEE2E2;
  --red-50:   #FEF2F2;
  --amber-600:#D97706;
  --amber-100:#FEF3C7;
  --blue-600: #2563EB;
  --blue-100: #DBEAFE;
  --radius:   8px;
  --no-radius:   0;
  --radius-lg:12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow:    0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: 150ms ease;
  --sidebar-w: 260px;
  --banner-h: 56px;
  /*--font-body: 'DM Sans', system-ui, -apple-system, sans-serif;*/
  --font-body: 'Century Gothic', system-ui, -apple-system, sans-serif;
  --font-brand: 'Century Gothic', Georgia, serif;
}

html { font-size: 16px; }
body { font-family: var(--font-body); color: var(--gray-700); background: var(--gray-50); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--green-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-600); }
img { max-width: 100%; }

/* --- Lucide SVG Icons (sprite) --- */
.lucide { display: inline-block; width: 24px; height: 24px; vertical-align: middle; }
.kpi-icon .lucide { width: 28px; height: 28px; }
.btn-icon .lucide { width: 18px; height: 18px; }
.brand-icon { width: 28px; height: 28px; }
.brand-icon .lucide { width: 28px; height: 28px; color: var(--gold-600); }
.alert-icon .lucide { width: 20px; height: 20px; }
.notification-bell .lucide { width: 20px; height: 20px; }

/* --- Layout --- */
.app-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--green-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar.open { transform: translateX(0); }

/* --- Sidebar Brand --- */
.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  color: var(--gold-600);
  letter-spacing: .02em;
}

.brand-sub {
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* --- Sidebar Toggle (inside sidebar brand) --- */
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  padding: 4px;
  margin-left: auto;
  transition: color var(--transition), background var(--transition);
  border-radius: var(--radius);
}
.sidebar-toggle:hover { color: var(--white); background: rgba(255,255,255,.08); }
.sidebar-toggle .lucide { width: 18px; height: 18px; }

/* --- Banner Toggle (in header, visible when sidebar collapsed) --- */
.banner-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  display: none;            /* hidden by default */
  align-items: center;
  padding: 4px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.banner-toggle:hover { color: var(--gray-700); background: var(--gray-100); }
.banner-toggle .lucide { width: 20px; height: 20px; }

/* Show banner-toggle only when sidebar is collapsed */
.sidebar.collapsed ~ .main-wrapper .banner-toggle { display: flex; }

/* --- Sidebar Navigation --- */
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { margin-bottom: 20px; }

.nav-section-title {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.4);
  padding: 0 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.nav-item .lucide { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.08); }
.nav-item.active {
  color: var(--white);
  background: var(--green-700);
  box-shadow: inset 3px 0 0 var(--gold-600);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  margin-left: auto;
  background: var(--red-600);
  color: var(--white);
  font-size: .65rem;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.4;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
}


/* --- Sidebar Submenus --- */
.nav-group { display: flex; flex-direction: column; }

/* Le déclencheur reprend exactement le style .nav-item (déjà appliqué via la classe),
   on ajuste juste le fait que c'est un <button> */
.nav-item.has-submenu {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
}

/* Chevron de dépliage */
.nav-chevron {
    width: 16px !important;
    height: 16px !important;
    margin-left: auto;
    flex-shrink: 0;
    color: rgba(255,255,255,.5);
    transition: transform var(--transition);
}
/* Quand il y a un badge, le chevron se place après lui */
.nav-item.has-submenu .nav-badge { margin-left: auto; }
.nav-item.has-submenu .nav-badge + .nav-chevron { margin-left: 8px; }

/* Rotation du chevron quand le groupe est ouvert */
.nav-group.open .nav-chevron { transform: rotate(180deg); color: var(--gold-600); }

/* Conteneur du sous-menu : fermé = hauteur 0 (animation douce) */
.nav-submenu {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .28s ease, opacity .2s ease;
    margin-left: 14px;                 /* léger retrait */
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.1);
}
.nav-group.open .nav-submenu {
    max-height: 500px;                 /* valeur haute suffisante */
    opacity: 1;
    margin-top: 2px;
    margin-bottom: 4px;
}

/* Sous-éléments */
.nav-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,.65);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}
.nav-subitem::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    flex-shrink: 0;
    transition: background var(--transition);
}
.nav-subitem:hover {
    color: var(--white);
    background: rgba(255,255,255,.06);
}
.nav-subitem:hover::before { background: var(--gold-400); }

.nav-subitem.active {
    color: var(--white);
    background: var(--green-700);
}
.nav-subitem.active::before { background: var(--gold-600); }

/* Si un sous-élément est actif, on peut mettre le parent en surbrillance légère */
.nav-item.has-submenu.has-active {
    color: var(--white);
}


.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  overflow: hidden;
}

.user-name {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: .68rem;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Main Wrapper --- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}
.main-wrapper.expanded {
  margin-left: 0;
}

/* --- Top Banner / Header --- */
.banner {
  height: var(--banner-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--gray-500);
}
.breadcrumb-sep { color: var(--gray-400); }
.breadcrumb-item a { color: var(--gray-500); }
.breadcrumb-item a:hover { color: var(--green-700); }

/* --- Banner Actions --- */
.banner-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Search Bar --- */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  cursor: text;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input {
  width: 240px;
  padding: 7px 12px 7px 34px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: .8rem;
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-700);
  transition: border-color var(--transition), width .2s ease;
}
.search-input:focus { border-color: var(--green-700); outline: none; width: 300px; }
.search-input::placeholder { color: var(--gray-400); }

.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: .6rem;
  background: var(--gray-200);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--gray-500);
  pointer-events: none;
}

/* --- Notification Bell --- */
.notification-bell {
  background: none;
  border: 1px solid var(--gray-300);
  cursor: pointer;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: var(--radius);
  position: relative;
  transition: all var(--transition);
}
.notification-bell:hover { color: var(--gray-700); border-color: var(--gray-400); }

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-600);
  border: 2px solid var(--white);
}

/* --- Main Content --- */
.main-content {
  padding: 12px 24px 24px;
  flex: 1;
}

/* --- Page header --- */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.page-title { font-family: var(--font-brand); font-size: 1.6rem; color: var(--green-900); }
.page-subtitle { font-size: .85rem; color: var(--gray-500); margin-top: 2px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .8rem; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}
.btn .lucide { width: 16px; height: 16px; vertical-align: -2px; }

.btn-primary {
  background: var(--green-700); color: var(--white); border-color: var(--green-700);
}
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); color: var(--white); }

.btn-secondary {
  background: var(--white); color: var(--green-700); border-color: var(--gray-300);
}
.btn-secondary:hover { border-color: var(--green-700); color: var(--green-700); }

.btn-gold {
  background: var(--gold-600); color: var(--white); border-color: var(--gold-600);
}
.btn-gold:hover { background: var(--gold-500); }

.btn-ghost {
  background: transparent; color: var(--gray-600);
}
.btn-ghost:hover { color: var(--gray-900); background: var(--gray-100); }

.btn-danger {
  background: var(--white); color: var(--red-600); border-color: var(--red-600);
}
.btn-danger:hover { background: var(--red-50); }

.btn-block { display: flex; justify-content: center; width: 100%; }
.btn-sm { padding: 5px 10px; font-size: .75rem; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius); border: none; background: transparent;
  color: var(--gray-500); cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--green-700); background: var(--green-100); }

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.card-title {
  font-size: .95rem; font-weight: 600; color: var(--gray-900);
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.card-body { padding: 16px 20px; }

/* --- KPI Cards (Dashboard) --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; flex-direction: column;
  border-top: 3px solid var(--green-700);
}
.kpi-card.kpi-gold { border-top-color: var(--gold-600); }
.kpi-card.kpi-red  { border-top-color: var(--red-600); }
.kpi-card.kpi-amber { border-top-color: var(--amber-600); }
.kpi-card.kpi-blue  { border-top-color: var(--blue-600); }

.kpi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 6px; }
.kpi-value { font-family: var(--font-brand); font-size: 1.7rem; color: var(--green-900); line-height: 1.1; }
.kpi-sub { font-size: .72rem; color: var(--gray-400); margin-top: 4px; }
.kpi-icon { align-self: flex-end; color: var(--gray-300); }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-100); padding: 10px 12px; text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
    background: var(--green-700);
}
/*.table tbody td {
  padding: 5px 6px; font-size: .92rem; !*border-bottom: 1px solid var(--gray-100);*!
  vertical-align: middle;
}*/
.table tbody tr:hover { background-color: #4A9A7A; cursor: pointer;border-bottom: 1px solid lightgrey;}
.table td.actions { white-space: nowrap; width: 80px; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .02em;
}
.badge-criticality-critique { background: var(--red-100); color: var(--red-600); }
.badge-criticality-majeur   { background: var(--amber-100); color: var(--amber-600); }
.badge-criticality-mineur   { background: var(--blue-100); color: var(--blue-600); }

.badge-priority-urgente { background: var(--red-100); color: var(--red-600); }
.badge-priority-haute   { background: var(--amber-100); color: var(--amber-600); }
.badge-priority-moyenne { background: var(--blue-100); color: var(--blue-600); }
.badge-priority-basse   { background: var(--gray-100); color: var(--gray-600); }

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger  { background: var(--red-100); color: var(--red-600); }

.badge.large { padding: 4px 14px; font-size: .78rem; }

/* --- Status indicators --- */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 600;
}
.status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.status-ouvert       { color: var(--blue-600); }
.status-ouvert::before       { background: var(--blue-600); }
.status-en-cours     { color: var(--green-600); }
.status-en-cours::before     { background: var(--green-600); }
.status-en-attente   { color: var(--amber-600); }
.status-en-attente::before   { background: var(--amber-600); }
.status-termine      { color: var(--gray-600); }
.status-termine::before      { background: var(--gray-400); }
.status-cloture      { color: var(--gray-500); }
.status-cloture::before      { background: var(--gray-300); }
.status-annule       { color: var(--red-600); }
.status-annule::before       { background: var(--red-600); }

.status-operationnel    { color: var(--green-600); }
.status-operationnel::before    { background: var(--green-600); }
.status-degrade        { color: var(--amber-600); }
.status-degrade::before        { background: var(--amber-600); }
.status-arrete         { color: var(--red-600); }
.status-arrete::before         { background: var(--red-600); }
.status-en-maintenance  { color: var(--blue-600); }
.status-en-maintenance::before  { background: var(--blue-600); }
.status-hors-service    { color: var(--gray-500); }
.status-hors-service::before    { background: var(--gray-400); }

.status-actif    { color: var(--green-600); }
.status-actif::before    { background: var(--green-600); }
.status-inactif  { color: var(--gray-500); }
.status-inactif::before  { background: var(--gray-400); }

.status-ok      { color: var(--green-600); }
.status-ok::before      { background: var(--green-600); }
.status-alert   { color: var(--red-600); }
.status-alert::before   { background: var(--red-600); }

.status.large::before { width: 10px; height: 10px; }

/* --- Forms --- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: 5px;
}
.span {
    min-width: 100px;
}
.input {
  width: 100%; padding: 2px 3px;
  border: 1px solid var(--gray-300);
  border-radius: var(--no-radius);
  margin-left: 5px;
  font-size: .82rem;
  font-family: var(--font-body);
  color: var(--gray-700);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
    min-width: 75px;
}
.input:focus { border-color: var(--green-700); outline: none; box-shadow: 0 0 0 3px rgba(45,95,76,.15); }
.input::placeholder { color: var(--gray-400); }
.input-search { padding-left: 34px; }

select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

textarea.input { min-height: 80px; resize: vertical; }

select {
    background: linear-gradient(#efefef, #e1e1e1);
    font-size: 14px;
    font-weight: lighter;
    min-width:200px;
    border: 1px solid lightgrey;
}

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-actions {
  display: flex; gap: 8px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

/* Symfony form errors */
.form-error { color: var(--red-600); font-size: .75rem; margin-top: 3px; }
.input.is-invalid { border-color: var(--red-600); }

/* --- Filters bar --- */
.filters-bar {
  margin-bottom: 20px;
}
.filters-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.filters-form .input { width: auto; min-width: 160px; }

/* --- Detail page --- */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;
}
.detail-list { padding: 12px 20px; }
.detail-row {
  display: flex; padding: 8px 0; border-bottom: 1px solid var(--gray-100);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 160px; flex-shrink: 0; font-size: .78rem; font-weight: 600; color: var(--gray-500); }
.detail-value { flex: 1; font-size: .82rem; color: var(--gray-900); }
.detail-value.text-alert { color: var(--red-600); font-weight: 700; }

.status-block { display: flex; gap: 12px; align-items: center; padding: 16px 20px; }

/* --- Alerts --- */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: .82rem;
  margin-bottom: 16px;
}
.alert .lucide, .flash .lucide { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -2px; }
.alert-danger  { background: var(--red-50);  color: var(--red-600);  border: 1px solid var(--red-100); }
.alert-warning { background: var(--amber-100); color: var(--amber-600); border: 1px solid #FDE68A; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }

/* --- Flash messages --- */
.flash-messages { margin-bottom: 20px; }
.flash-success { background: #ECFDF5; color: #065F46; border-left: 4px solid #059669; padding: 10px 16px; border-radius: 0 var(--radius) var(--radius) 0; display: flex; align-items: center; gap: 8px; }
.flash-error   { background: var(--red-50); color: var(--red-600); border-left: 4px solid var(--red-600); padding: 10px 16px; border-radius: 0 var(--radius) var(--radius) 0; display: flex; align-items: center; gap: 8px; }
.flash-warning { background: var(--amber-100); color: var(--amber-600); border-left: 4px solid var(--amber-600); padding: 10px 16px; border-radius: 0 var(--radius) var(--radius) 0; display: flex; align-items: center; gap: 8px; }
.flash-info    { background: var(--blue-100); color: var(--blue-600); border-left: 4px solid var(--blue-600); padding: 10px 16px; border-radius: 0 var(--radius) var(--radius) 0; display: flex; align-items: center; gap: 8px; }

/* --- Log entries --- */
.log-entry {
  padding: 10px 0; border-bottom: 1px solid var(--gray-100);
}
.log-entry:last-child { border-bottom: none; }
.log-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.log-user { font-weight: 600; font-size: .82rem; color: var(--gray-900); }
.log-date { font-size: .72rem; color: var(--gray-400); }
.log-action { font-size: .82rem; color: var(--gray-700); }
.log-notes  { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }

/* --- Plan items --- */
.plan-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.plan-item:last-child { border-bottom: none; }
.plan-info { display: flex; gap: 12px; }
.plan-name { font-weight: 600; font-size: .82rem; }
.plan-freq  { font-size: .75rem; color: var(--gray-500); }
.plan-due   { font-size: .75rem; color: var(--gray-500); }

.plan-wo-item {
  display: flex; gap: 14px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--gray-100);
  font-size: .82rem;
}

/* --- Order items --- */
.order-item {
  display: flex; gap: 14px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--gray-100);
  font-size: .82rem;
}

/* --- Empty state --- */
.empty { text-align: center; padding: 24px; color: var(--gray-400); font-size: .85rem; }

/* --- Link --- */
.link { color: var(--green-700); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; color: var(--gold-600); }

/* --- Login page --- */
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px;
  padding: 40px 36px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { font-family: var(--font-brand); font-size: 2rem; color: var(--green-900); }
.login-tagline { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form .btn { margin-top: 8px; }
.login-footer { text-align: center; margin-top: 24px; font-size: .72rem; color: var(--gray-400); }

/* --- Pagination --- */
.pagination { display: flex; gap: 4px; margin-top: 16px; justify-content: center; }
.pagination span, .pagination a {
  padding: 6px 12px; border-radius: var(--radius);
  font-size: .78rem; font-weight: 600;
  border: 1px solid var(--gray-300); color: var(--gray-700);
  text-decoration: none; transition: all var(--transition);
}
.pagination a:hover { border-color: var(--green-700); color: var(--green-700); }
.pagination .current { background: var(--green-700); color: var(--white); border-color: var(--green-700); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .banner-toggle { display: flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid   { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .filters-form { flex-direction: column; }
  .filters-form .input { width: 100%; min-width: 0; }
  .page-header { flex-direction: column; }
}

/* --- Scrollbar (subtle) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* --- Dashboard --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}
.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card-link {
  font-size: .75rem;
  font-weight: 600;
  color: var(--green-700);
  text-decoration: none;
  transition: color var(--transition);
}
.card-link:hover { color: var(--gold-600); }

.kpi-content { flex: 1; }
.kpi-trend {
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-400);
}
.kpi-trend-up { color: var(--green-600); }
.kpi-trend-down { color: var(--red-600); }

.kpi-availability { border-top-color: var(--green-700); }
.kpi-mttr         { border-top-color: var(--amber-600); }
.kpi-mtbf          { border-top-color: var(--blue-600); }
.kpi-preventive    { border-top-color: var(--gold-600); }
.kpi-open-wo       { border-top-color: var(--green-700); }
.kpi-overdue        { border-top-color: var(--red-600); }

/* --- Stock Alert Items --- */
.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.alert-item:last-child { border-bottom: none; }
.alert-part {
  font-weight: 600;
  font-size: .82rem;
  color: var(--gray-900);
}
.alert-qty {
  font-size: .75rem;
  color: var(--red-600);
  font-weight: 600;
  margin-left: auto;
}

/* --- Plan Equipment Code --- */
.plan-eq {
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.h-full { height: 100%; }

/* ===== Toast Notification ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: toastIn 0.4s ease forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { /*Success*/
    background: linear-gradient(135deg, #48bb78, #38a169);
}
.toast.warning {  /*Avertissement*/
    background: linear-gradient(135deg, #bbaa48, #a18a38);
}
.toast.info {  /*Info*/
    background: linear-gradient(135deg, #4898bb, #3887a1);
}
.toast.error {
    background: linear-gradient(135deg, #e53e3e, #c53030);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

.iddleToggleRadio{
    background: #f3c9c9;
    padding: 2px 5px;
    border-radius: 25px;
    width: 250px;
    justify-content: center;
}

.ul-elegant {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: "Segoe UI", sans-serif;
}

.ul-elegant li {
    position: relative;
    padding: 12px 20px 12px 35px; /* espace pour l’icône */
    margin: 10px 0;
    background: linear-gradient(135deg, #ffffff, #f7f9fc);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ul-elegant li::before {
    content: "⚙";                  /* roue dentée Unicode */
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #0078d7;                /* bleu moderne */
}

.ul-elegant li:hover {
    background: linear-gradient(135deg, #e6f0ff, #ffffff);
    transform: translateX(5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.success-gradient {
    background: linear-gradient(135deg,
    #d4edda,   /* vert très pâle */
    #c3e6cb,   /* vert doux */
    #28a745    /* vert succès */
    );
    color: #155724;          /* texte vert foncé */
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    font-family: "Segoe UI", sans-serif;
}

.stock-success-gradient {
    background: linear-gradient(135deg,
    #d8eae9,   /* vert très pâle */ #d4e9e8,   /* vert doux */ #37d2e0 /* vert succès */
    );
    color: #279d95;          /* texte vert foncé */
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    font-family: "Segoe UI", sans-serif;
}
.stock-error-gradient {
    background: linear-gradient(135deg,
    #eaddd8,   /* vert très pâle */ #e9dad4,   /* vert doux */ #e04e37 /* vert succès */
    );
    color: #f10202;          /* texte vert foncé */
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    font-family: "Segoe UI", sans-serif;
}
/* --- Sidebar Submenus --- */
.nav-group { display: flex; flex-direction: column; }

.nav-item.has-submenu {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
}

.nav-chevron {
    width: 16px !important;
    height: 16px !important;
    margin-left: auto;
    flex-shrink: 0;
    color: rgba(255,255,255,.5);
    transition: transform var(--transition);
}
.nav-item.has-submenu .nav-badge { margin-left: auto; }
.nav-item.has-submenu .nav-badge + .nav-chevron { margin-left: 8px; }

.nav-group.open .nav-chevron { transform: rotate(180deg); color: var(--gold-600); }

.nav-submenu {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .28s ease, opacity .2s ease;
    margin-left: 14px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.1);
}
.nav-group.open .nav-submenu {
    max-height: 500px;
    opacity: 1;
    margin-top: 2px;
    margin-bottom: 4px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,.65);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}
.nav-subitem::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    flex-shrink: 0;
    transition: background var(--transition);
}
.nav-subitem:hover {
    color: var(--white);
    background: rgba(255,255,255,.06);
}
.nav-subitem:hover::before { background: var(--gold-400); }

.nav-subitem.active {
    color: var(--white);
    background: var(--green-700);
}
.nav-subitem.active::before { background: var(--gold-600); }

.nav-item.has-submenu.has-active { color: var(--white); }

/* Forcer la largeur */
.choices {
    width: 100%;   /* adapte selon ton design */
    background-color: #f1eddc;
}

/* Ajuster la hauteur du champ */
.choices__inner {
    /*min-height: 45px;*/   /* augmente la hauteur */
    font-size: 13px;    /* texte plus lisible */
    padding: 2px 3px;  /* espace intérieur */
    font-weight: bold;
    color: black;
    background-color: #f1eddc;
}

/* Ajuster les items sélectionnés */
.choices__item {
    font-size: 14px;
    padding: 2px 4px;
    background-color: #f1eddc;
}

.btn-tooltip {
    position: relative;
    padding: 2px 3px;
    background: linear-gradient(135deg, #928a86, #625b52);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-tooltip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.btn-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 75%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.container {
    margin-left: 5%;
    width: 90%;
    background: linear-gradient(135deg, #f6f6f6, #ffffff);
}

.w-10 {
    width: 200px;
}
