:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

.page {
  min-height: 100vh;
}
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.auth-brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--accent);
  margin-bottom: 8px;
}
h1 {
  margin: 0 0 16px;
  font-size: 24px;
}
label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
}
input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  width: 100%;
  /* margin-top: 16px; */
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), #3b82f6);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
button:hover {
  filter: brightness(1.02);
}

.alert {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 10px 0 14px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.brand {
  font-weight: 800;
}
.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}
.chip {
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}
.link {
  color: var(--text);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 18px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}
.page-head h1 {
  margin: 0;
}
.quick {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.btn:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tile {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
.tile:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}
.tile h3 {
  margin: 0 0 6px;
}
.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.brand-link {
  color: inherit;
  text-decoration: none;
}
.brand-link:hover {
  text-decoration: underline;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent), #3b82f6);
  color: #fff;
  border: 0;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}
.status.ok {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}
.status.off {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.25);
  color: #334155;
}

.alert.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}
.alert.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.checkbox-row {
  display: flex;
  align-items: flex-end;
}
.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.filters label {
  margin-top: 0;
}
.filters-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.filters-actions {
  display: flex;
  gap: 10px;
}
@media (max-width: 900px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
  .filters-actions {
    justify-content: flex-start;
  }
}

.code {
  display: inline-block;
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.timeline-day {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-date {
  font-weight: 800;
  color: var(--text);
  padding: 0 2px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
.timeline-time {
  color: var(--muted);
  font-size: 13px;
  padding-top: 2px;
}
.timeline-title {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.timeline-meta {
  margin-top: 6px;
}
.timeline-json {
  margin-top: 8px;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

@media (max-width: 700px) {
  .brand-logo {
    height: 30px;
  }
}

/* Dashboard Hub */
.hub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 64px;
  background: linear-gradient(
    90deg,
    rgba(52, 98, 172, 0.14),
    rgba(229, 36, 33, 0.08)
  );
  pointer-events: none;
}

.module-card.admin::before {
  background: linear-gradient(
    90deg,
    rgba(52, 98, 172, 0.18),
    rgba(36, 57, 126, 0.1)
  );
}

.module-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.module-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.module-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.module-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.action-tile {
  display: block;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
  position: relative;
}

.action-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(52, 98, 172, 0.35);
}

.action-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 4px;
}

.action-desc {
  font-size: 13px;
  color: var(--muted);
}

.action-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(52, 98, 172, 0.06);
  color: var(--muted);
}

/* small pill in header section */
.pill {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

/* responsive */
@media (max-width: 1050px) {
  .hub {
    grid-template-columns: 1fr;
  }
}

/* --- LOGIN / AUTH PAGE (VibaHub) --- */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(
      1200px 800px at 15% 20%,
      rgba(52, 98, 172, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 700px at 85% 70%,
      rgba(36, 57, 126, 0.14),
      transparent 55%
    ),
    radial-gradient(
      700px 500px at 70% 20%,
      rgba(229, 36, 33, 0.09),
      transparent 60%
    ),
    linear-gradient(180deg, #f6f8fc 0%, #eef3fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: min(980px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
}

/* Left: form */
.auth-panel {
  background: rgba(255, 255, 255, 0.92);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.auth-logo img {
  height: 38px;
  width: auto;
  display: block;
  margin-bottom: 6px;
}

.auth-panel h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.auth-panel form {
  margin-top: 6px;
}

.auth-panel input {
  width: 100%;
}

button.w-full {
  width: 100%;
  margin-top: 2rem;
}

/* Right: modern mechanical visual */
.auth-visual {
  position: relative;
  background:
    radial-gradient(
      280px 280px at 30% 35%,
      rgba(52, 98, 172, 0.22),
      transparent 60%
    ),
    radial-gradient(
      260px 260px at 70% 65%,
      rgba(229, 36, 33, 0.12),
      transparent 65%
    ),
    linear-gradient(135deg, rgba(36, 57, 126, 0.12), rgba(52, 98, 172, 0.06));
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: -80px;
  background:
    radial-gradient(
      circle at 50% 50%,
      transparent 0 34%,
      rgba(52, 98, 172, 0.22) 35% 36%,
      transparent 37% 48%,
      rgba(36, 57, 126, 0.18) 49% 50%,
      transparent 51% 63%,
      rgba(52, 98, 172, 0.14) 64% 65%,
      transparent 66%
    ),
    conic-gradient(
      from 20deg,
      rgba(52, 98, 172, 0.18),
      rgba(36, 57, 126, 0.12),
      rgba(52, 98, 172, 0.18),
      rgba(229, 36, 33, 0.06),
      rgba(52, 98, 172, 0.18)
    );
  filter: blur(0.2px);
  opacity: 0.85;
  transform: rotate(-8deg);
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    120deg,
    rgba(15, 23, 42, 0.06) 0 1px,
    transparent 1px 16px
  );
  opacity: 0.25;
  mix-blend-mode: multiply;
}

.auth-visual-inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 22px;
}

.auth-badge {
  width: min(320px, 90%);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(52, 98, 172, 0.22);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

.auth-badge-title {
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #3462ac;
  font-size: 18px;
  margin-bottom: 2px;
}

.auth-badge-sub {
  color: var(--muted);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-panel {
    padding: 26px 22px;
  }
}

/* --- HEADER USER CHIP --- */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(52, 98, 172, 0.35);
  background: #fff;
  color: #24397e;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease,
    color 0.25s ease;
}

.user-chip-name {
  font-weight: 800;
}

.user-chip-role {
  opacity: 0.9;
  font-weight: 600;
}

/* Hover Vibatech gradient */
.user-chip:hover {
  color: #fff;
  background: linear-gradient(135deg, #3462ac 0%, #24397e 70%);
  box-shadow: 0 10px 26px rgba(36, 57, 126, 0.35);
  transform: translateY(-1px);
  border-color: transparent;
}

/* --- LOGOUT ICON BUTTON --- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 18px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.icon-btn:hover {
  background: #fff;
  color: #e52421;
  box-shadow: 0 10px 26px rgba(229, 36, 33, 0.25);
  transform: translateY(-1px);
}

/* =========================
   Suivi matériel (VibaHub)
   ========================= */

/* Head de section (cohérent intranet) */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.section-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-left h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.section-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Tables: look intranet */
.sm-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.sm-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}

.sm-table thead th {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 12px 10px;
  color: #fff;
  background: linear-gradient(135deg, #3462ac 0%, #24397e 70%);
}

.sm-table thead th:first-child {
  border-top-left-radius: 18px;
}
.sm-table thead th:last-child {
  border-top-right-radius: 18px;
}

.sm-table tbody td {
  padding: 12px 10px;
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  vertical-align: middle;
}

.sm-table tbody tr:hover td {
  background: rgba(52, 98, 172, 0.04);
}

/* Liens dans table */
.sm-table a {
  color: #24397e;
  font-weight: 700;
  text-decoration: none;
}
.sm-table a:hover {
  text-decoration: underline;
}

/* Image “avatar produit” */
.sm-item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f1f5f9;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

/* Petits badges dans la table si tu veux */
.sm-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(52, 98, 172, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

img.item-img {
  width: 64px;
  height: 64px;
}

a.bg-blue-linear, button.bg-blue-linear {
  background: linear-gradient(135deg, #3462ac 0%, #24397e 70%);
  color: #fff;
}

a.bg-blue-linear:hover, button.bg-blue-linear:hover {
  color: #fff;
  background: linear-gradient(135deg, #3462ac 0%, #24397e 70%);
  box-shadow: 0 10px 26px rgba(36, 57, 126, 0.35);
  transform: translateY(-1px);
  border-color: transparent;
}

a.bg-red-linear,
button.bg-red-linear {
  background: linear-gradient(135deg, #ac3434 0%, #7e2424 70%);
  color: #fff;
}

a.bg-red-linear:hover,
button.bg-red-linear:hover {
  color: #fff;
  background: linear-gradient(135deg, #ac3434 0%, #7e2424 70%);
  box-shadow: 0 10px 26px rgba(126, 36, 36, 0.35);
  transform: translateY(-1px);
  border-color: transparent;
}

/* Par défaut : texte + icône visibles */
.responsive-btn .icon {
  display: none;
}

/* À partir de 485px : uniquement le + */
@media (max-width: 485px) {
  .responsive-btn .label {
    display: none;
  }

  .responsive-btn .icon {
    display: inline-block;
    font-size: 20px;
  }

  .responsive-btn {
    padding: 6px 10px; /* bouton compact */
    min-width: 38px;
    text-align: center;
  }
}

/* =========================
   Vibatech portal shell
   ========================= */
:root {
  --viba-blue-950: #06245a;
  --viba-blue-900: #082f73;
  --viba-blue-800: #0d459a;
  --viba-blue-700: #1559bd;
  --viba-red: #ef1d21;
  --viba-soft: #f5f7fb;
}

body.dash {
  background:
    radial-gradient(900px 520px at 64% -12%, rgba(21, 89, 189, 0.08), transparent 58%),
    linear-gradient(180deg, #f8fafc 0%, #eef3fa 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  background:
    linear-gradient(180deg, rgba(8, 47, 115, 0.98), rgba(5, 31, 78, 0.98)),
    radial-gradient(260px 220px at 20% 90%, rgba(255, 255, 255, 0.2), transparent 65%);
  color: #fff;
  z-index: 1500;
}

.app-sidebar::after {
  content: "";
  position: absolute;
  left: -74px;
  bottom: -84px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 22px rgba(255, 255, 255, 0.03),
    inset 0 0 0 46px rgba(255, 255, 255, 0.025),
    0 0 0 22px rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.sidebar-brand {
  display: block;
  color: #fff;
  text-decoration: none;
  margin: 20px 0 44px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.sidebar-brand img {
  width: min(190px, 100%);
  height: auto;
  display: block;
  margin: 0 auto;
}

.sidebar-brand-main {
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0.5px;
  line-height: 1;
}

.sidebar-brand-main span {
  color: var(--viba-red);
}

.sidebar-brand-sub {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
}

.sidebar-nav,
.sidebar-footer {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 750;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    color 0.18s ease;
}

.sidebar-link i {
  width: 24px;
  font-size: 20px;
  text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(42, 110, 220, 0.92), rgba(20, 82, 176, 0.9));
  color: #fff;
  transform: translateX(2px);
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 112px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 48px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: var(--viba-blue-900);
  padding: 0;
}

.nav-search {
  width: min(680px, 100%);
  position: relative;
}

.nav-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  z-index: 2;
}

.nav-search-input {
  width: 100%;
  min-height: 54px;
  padding: 0 20px 0 54px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f6f7fb;
  color: #111827;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.nav-search-input:focus {
  border-color: rgba(21, 89, 189, 0.28);
  box-shadow: 0 0 0 4px rgba(21, 89, 189, 0.1);
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
  z-index: 2000;
}

.nav-search-results.open {
  display: block;
}

.nav-search-item {
  padding: 12px 16px;
  cursor: pointer;
}

.nav-search-item:hover,
.nav-search-item.active {
  background: #f1f5fb;
}

.nav-search-title {
  font-weight: 900;
}

.nav-search-sub {
  color: #64748b;
  font-size: 12px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.notification-btn {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #0f172a;
  box-shadow: none;
}

.notification-btn i {
  font-size: 22px;
}

.notification-btn span {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--viba-red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #0f172a;
  text-decoration: none;
}

.user-avatar {
  width: 48px;
  height: 48px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #1c5cc4, #1747a4);
  color: #fff;
  font-weight: 900;
  overflow: hidden;
  flex: 0 0 48px;
}

.user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.user-meta {
  display: grid;
  gap: 2px;
}

.user-meta strong {
  font-size: 15px;
}

.user-meta small {
  color: #6b7280;
}

.icon-btn {
  width: 40px;
  height: 40px;
  margin-left: 0;
  color: #6b7280;
  border: 0;
  box-shadow: none;
}

.container {
  max-width: none;
  padding: 28px 34px 48px;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  margin: -28px -34px -48px;
  padding: 0 34px 48px;
}

.portal-main {
  min-width: 0;
}

.portal-hero {
  min-height: 365px;
  margin: 0 -34px 0 0;
  padding: 76px 48px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.99) 0 47%, rgba(255, 255, 255, 0.9) 47% 59%, transparent 59%),
    linear-gradient(135deg, rgba(10, 57, 130, 0.94), rgba(16, 84, 190, 0.96)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 20px);
}

.portal-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background:
    radial-gradient(circle at 22% 35%, transparent 0 34px, rgba(8, 47, 115, 0.08) 35px 36px, transparent 37px),
    radial-gradient(circle at 18% 70%, transparent 0 58px, rgba(8, 47, 115, 0.06) 59px 60px, transparent 61px);
  opacity: 0.65;
}

/* .portal-hero::after {
  content: "";
  position: absolute;
  right: 18%;
  bottom: 48px;
  width: 170px;
  height: 20px;
  transform: skewX(-24deg);
  background: var(--viba-red);
  box-shadow: 0 12px 24px rgba(226, 0, 26, .24);
} */

.hero-accueil {
  position: relative;
  z-index: 2;
  width: min(620px, 58%);
  padding: 24px 26px;
  border-left: 5px solid var(--viba-red);
  background: linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.82) 72%, rgba(255,255,255,0));
  filter: drop-shadow(0 18px 34px rgba(15, 23, 42, .08));
}

.hero-accueil h1 {
  margin: 0 0 16px;
  color: #082f73;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-accueil h1 span {
  color: var(--viba-red);
}

.hero-accueil p {
  margin: 0;
  max-width: 480px;
  color: #111827;
  font-size: 18px;
  line-height: 1.55;
}

.hero-machine {
  position: absolute;
  right: 3%;
  top: 22px;
  width: min(520px, 45%);
  height: 320px;
  transform: none;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-machine img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 28px 38px rgba(0, 22, 70, .35));
}

.gear {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle, #f8fbff 0 9%, #205cc2 10% 17%, #d7e0ec 18% 27%, #0b2b5e 28% 35%, #c8d1de 36% 48%, #174b9f 49% 58%, #0b244b 59% 66%, transparent 67%),
    repeating-conic-gradient(from 0deg, #e8eef7 0 5deg, #7d8da3 5deg 9deg, #0d3576 9deg 12deg, transparent 12deg 18deg);
  box-shadow:
    0 28px 54px rgba(0, 0, 0, 0.28),
    inset 0 0 0 12px rgba(255,255,255,.3),
    inset 0 0 42px rgba(4, 22, 54, .45);
}

.gear::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #f8fafc 0 24%, #174b9f 25% 36%, #dae2ee 37% 58%, #0d2c62 59% 100%);
  box-shadow: inset 0 0 18px rgba(0,0,0,.28);
}

.gear-large {
  width: 230px;
  height: 230px;
  right: 52px;
  top: 12px;
}

.gear-small {
  width: 132px;
  height: 132px;
  right: 265px;
  top: 128px;
  opacity: .96;
}

.shaft {
  position: absolute;
  right: 8px;
  top: 142px;
  width: 345px;
  height: 56px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #0b234f 0%, #4e78b6 20%, #eaf1fb 42%, #1f5cbf 63%, #0b2c63 100%);
  box-shadow:
    0 24px 42px rgba(0, 0, 0, 0.25),
    inset 0 8px 16px rgba(255,255,255,.45),
    inset 0 -12px 20px rgba(4,22,54,.35);
}

.portal-section {
  padding: 38px 0 0;
}

.portal-section h2,
.side-card h2 {
  margin: 0;
  color: #111827;
  font-size: 21px;
}

.section-title-row,
.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.section-title-row a,
.side-card-head a {
  color: #1559bd;
  font-weight: 800;
  text-decoration: none;
  font-size: 13px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.quick-card {
  min-height: 220px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 24px 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.14);
}

.quick-card > i {
  color: #1559bd;
  font-size: 58px;
  margin-bottom: 14px;
}

.quick-card.red > i,
.app-chip.red {
  color: var(--viba-red);
}

.quick-card strong {
  font-size: 18px;
}

.quick-card span {
  color: #6b7280;
  line-height: 1.45;
}

.quick-card em {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: #0f172a;
  font-style: normal;
  font-size: 24px;
}

.app-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
}

.app-chip {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  color: #1559bd;
  text-decoration: none;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-chip i {
  font-size: 24px;
}

.portal-aside {
  padding-top: 26px;
  display: grid;
  align-content: start;
  gap: 26px;
  margin-left: 26px;
}

.side-card {
  padding: 26px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
}

.news-list,
.shortcut-list {
  display: grid;
}

.news-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.news-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.news-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.news-icon.blue {
  background: #eef4ff;
  color: #1559bd;
}

.news-icon.red {
  background: #fff0f0;
  color: var(--viba-red);
}

.news-item strong {
  display: block;
  margin-bottom: 6px;
}

.news-item p {
  margin: 0 0 7px;
  color: #6b7280;
  line-height: 1.35;
}

.news-item small {
  color: #9ca3af;
}

.shortcut-list a {
  display: grid;
  grid-template-columns: 24px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  color: #374151;
  text-decoration: none;
}

.shortcut-logo {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.shortcut-logo img {
  max-width: 22px;
  max-height: 22px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.shortcut-list a + a {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.shortcut-list a i:last-child {
  color: #6b7280;
  font-size: 14px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: #64748b;
  text-align: center;
  font-weight: 800;
}

.empty-state-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef4ff;
  color: #1559bd;
  font-size: 24px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.preference-form {
  display: grid;
  gap: 18px;
}

.preference-list {
  display: grid;
  gap: 10px;
}

.preference-item {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e3e9f3;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.preference-item input {
  width: 18px;
  height: 18px;
}

.preference-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  color: #1559bd;
  font-size: 18px;
}

.preference-item strong,
.preference-item em {
  display: block;
}

.preference-item em {
  margin-top: 3px;
  color: #64748b;
  font-style: normal;
  font-size: 13px;
  line-height: 1.35;
}

.planning-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.planning-toolbar h2 {
  margin: 0;
  color: #102a5e;
}

.planning-filter {
  min-width: min(260px, 100%);
}

.planning-filter select {
  margin: 0;
}

.planning-grid-card {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #e3e9f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 37, 74, 0.08);
}

.planning-weekdays,
.planning-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.planning-weekdays {
  background: #f3f6fb;
  border-bottom: 1px solid #e3e9f3;
}

.planning-weekdays div {
  padding: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.planning-day {
  min-height: 132px;
  padding: 10px;
  border-right: 1px solid #edf1f7;
  border-bottom: 1px solid #edf1f7;
  background: #fff;
}

.planning-day:nth-child(7n) {
  border-right: 0;
}

.planning-day.muted-day {
  background: #f8fafc;
  color: #94a3b8;
}

.planning-day.today {
  box-shadow: inset 0 0 0 2px #1559bd;
}

.planning-day-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  color: #102a5e;
  font-weight: 900;
}

.planning-day.today .planning-day-number {
  background: #1559bd;
  color: #fff;
}

.planning-day-events {
  display: grid;
  gap: 6px;
}

.planning-event {
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  border-radius: 8px;
  color: #12305f;
  background: #eef4ff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-event span {
  display: inline-block;
  margin-right: 4px;
  color: #1559bd;
  font-size: 10px;
  text-transform: uppercase;
}

.planning-event.maintenance {
  background: #fff5eb;
  color: #793d00;
}

.planning-event.maintenance span {
  color: #b85f00;
}

.planning-event.location {
  background: #eef4ff;
}

.planning-event.mapro {
  background: #ecfdf5;
  color: #065f46;
}

.planning-event.mapro span {
  color: #047857;
}

.planning-list {
  display: grid;
  gap: 10px;
}

.planning-list-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e3e9f3;
  border-left: 4px solid #1559bd;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.planning-list-item.maintenance {
  border-left-color: #ef7d00;
}

.planning-list-item.mapro {
  border-left-color: #10b981;
}

.planning-list-date {
  color: #102a5e;
  font-weight: 900;
}

.planning-list-main strong,
.planning-list-main em {
  display: block;
}

.planning-list-main em {
  margin-top: 3px;
  color: #64748b;
  font-style: normal;
  font-size: 13px;
}

.planning-list-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1559bd;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1380px) {
  .quick-grid,
  .app-chip-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .portal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    width: min(300px, 86vw);
    transition: transform 0.2s ease;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .topbar {
    height: auto;
    min-height: 82px;
    padding: 14px 18px;
  }

  .topbar-right {
    gap: 10px;
  }

  .user-meta,
  .user-profile > i,
  .notification-btn,
  .icon-btn {
    display: none;
  }

  .portal-layout {
    margin: -28px -18px -34px;
    padding: 0 18px 34px;
  }

  .portal-hero {
    min-height: 320px;
    margin-right: -18px;
    padding: 54px 24px;
  }

  .hero-accueil {
    width: min(620px, 70%);
  }

  .hero-accueil h1 {
    font-size: 34px;
  }

  .hero-machine {
    opacity: 0.5;
    right: -80px;
    top: 50px;
    width: 390px;
  }

  .app-chip-grid,
  .portal-aside {
    grid-template-columns: 1fr;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .planning-toolbar,
  .planning-list-item {
    grid-template-columns: 1fr;
  }

  .planning-toolbar {
    display: grid;
  }

  .planning-weekdays {
    display: none;
  }

  .planning-calendar {
    grid-template-columns: 1fr;
  }

  .planning-day {
    min-height: auto;
    border-right: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav-search {
    order: 3;
    width: 100%;
  }

  .quick-card {
    min-height: 150px;
    padding: 20px 18px 18px;
  }

  .portal-hero {
    min-height: 360px;
    padding: 38px 18px;
  }

  .hero-accueil {
    width: 100%;
    padding: 20px 18px;
    background: rgba(255, 255, 255, .93);
  }

  .hero-accueil h1 {
    font-size: 30px;
  }

  .hero-accueil p {
    font-size: 16px;
  }

  .hero-machine {
    right: -170px;
    top: 105px;
    opacity: .16;
    transform: scale(.82);
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .quick-card > i {
    font-size: 40px;
    margin-bottom: 6px;
  }

  .quick-card strong {
    font-size: 16px;
  }

  .quick-card span {
    font-size: 13px;
  }

  .portal-section {
    padding-top: 26px;
  }

  .portal-aside {
    gap: 16px;
  }

  .side-card {
    padding: 20px;
  }

  .section-title-row,
  .side-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
