/*
 * WEYNE — compléments de charte et composants propres à la plateforme,
 * chargés après weyne-theme.css (le gabarit SmartHR recoloré).
 *
 * CHARTE WEYNE (les logos fournis, resources/brand) : le bleu Weyne #006BA6
 * pour le logo, l'action (boutons, liens, menu actif) et les fonds (favicon,
 * icône de l'appli) ; le bleu vif #2C7BE5 pour les accents.
 * Le gabarit est recoloré par scripts/theme/recolor.php "#006BA6" ; les
 * logos et icônes viennent de resources/brand (scripts/brand/exporter.py).
 */
:root {
  --wy-primary: #006BA6;
  --wy-primary-hover: #005685;
  --wy-primary-tint: #E6F0F6;
  --wy-accent: #2C7BE5;
  --wy-accent-ring: rgba(44, 123, 229, .25);
  --wy-ink: #0B2A3F;
  --wy-muted: #6B7280;
  --wy-line: #E5E7EB;
  /* Les étapes d'une commande (App\Enums\OrderStatus::color). */
  --wy-success: #03A94D;
  --wy-warning: #E89A00;
  --wy-danger: #D92D20;
  /* Variables du gabarit qui pilotent le menu actif et quelques bordures. */
  --primary-rgb: 0, 107, 166;
  --primary-transparent: #E6F0F6;
  --primary-linear-gradient: linear-gradient(270deg, rgba(0, 107, 166, 0.2) 0%, #FFFFFF 100%);
}

/* ---------- Logo ---------- */
.sidebar .sidebar-logo .logo img,
.header .header-left .logo img,
.header .header-left .dark-logo img { width: auto; height: 38px; max-width: 100%; }
.sidebar .sidebar-logo .logo-small img,
.logo-small img { width: auto; height: 34px; }

/* ---------- Menu latéral : fond blanc, logo bleu, rubrique active en bleu ---------- */
.sidebar .sidebar-logo { display: flex; align-items: center; padding-top: 0; }
.sidebar .sidebar-menu > ul { padding-bottom: 28px; }
.mini-sidebar .sidebar .sidebar-logo { justify-content: center; }
@media (max-width: 991.98px) {
  .sidebar .sidebar-logo { display: none; }
}
.sidebar .sidebar-menu > ul > li > ul > li > a:hover { background: #F2F7FA; }
.sidebar .sidebar-menu > ul > li ul li a.active,
.sidebar .sidebar-menu > ul > li ul > li.active a { background: var(--wy-primary-tint); border-radius: 5px; }
.sidebar .sidebar-menu > ul > li ul li a.active span,
.sidebar .sidebar-menu > ul > li ul li a.active i,
.sidebar .sidebar-menu > ul > li ul > li.active a span,
.sidebar .sidebar-menu > ul > li ul > li.active a i { color: var(--wy-primary); }
.sidebar .sidebar-menu > ul > li ul li a.active span,
.sidebar .sidebar-menu > ul > li ul > li.active a span { font-weight: 600; }

/* ---------- Page de connexion : le panneau de marque ---------- */
.wy-auth-panel { background: linear-gradient(160deg, #F6FAFD 0%, #E5EFF6 100%); color: var(--wy-muted); }
.wy-auth-logo { height: 170px; width: auto; margin-bottom: 30px; }
/* Le sélecteur de langue de la page de connexion : deux boutons dans une pilule, la langue en cours en bleu. */
.wy-lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--wy-line); border-radius: 999px; background: #F3F5F7; }
.wy-lang-switch button { border: 0; background: transparent; color: var(--wy-muted); font-size: 13px; font-weight: 500; line-height: 1.2; padding: 6px 16px; border-radius: 999px; transition: background .15s, color .15s; }
.wy-lang-switch button:hover { color: var(--wy-ink); }
.wy-lang-switch button[aria-pressed="true"] { background: var(--wy-primary); color: #FFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.wy-lang-switch button:focus-visible { outline: 2px solid var(--wy-primary); outline-offset: 2px; }

/* ---------- Boutons, liens, champs ---------- */
.btn-primary, .btn.btn-primary { background-color: var(--wy-primary); border-color: var(--wy-primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn.btn-primary:hover, .btn.btn-primary:focus { background-color: var(--wy-primary-hover) !important; border-color: var(--wy-primary-hover) !important; color: #fff; }
.btn-outline-primary { color: var(--wy-primary); border-color: var(--wy-primary); }
.btn-outline-primary:hover { background-color: var(--wy-primary); border-color: var(--wy-primary); color: #fff; }
.bg-primary { background-color: var(--wy-primary) !important; }
.text-primary { color: var(--wy-primary) !important; }
a:hover { color: var(--wy-primary); }
.form-control:focus, .form-select:focus { border-color: var(--wy-accent); box-shadow: 0 0 0 .2rem var(--wy-accent-ring); }
.form-check-input:checked { background-color: var(--wy-primary); border-color: var(--wy-primary); }
.page-link.active, .active > .page-link { background-color: var(--wy-primary); border-color: var(--wy-primary); }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--wy-primary); border-bottom-color: var(--wy-primary); }
.form-label .req { color: var(--wy-danger); margin-left: 2px; }
.form-text { font-size: 12.5px; }

/* ---------- En-tête de page ---------- */
.wy-page-head { gap: 12px; }
.wy-page-head h2 { font-size: 22px; }
.wy-page-head .breadcrumb { font-size: 13px; }

/* ---------- Tuiles de chiffres clés ---------- */
.wy-kpi { position: relative; border: 1px solid var(--wy-line); border-radius: 10px; background: #fff; padding: 16px 18px; height: 100%; display: flex; align-items: center; gap: 14px; }
.wy-kpi .wy-kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.wy-kpi .wy-kpi-value { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--wy-ink); }
.wy-kpi .wy-kpi-label { font-size: 13px; color: var(--wy-muted); }
.wy-tone-primary { background: var(--wy-primary-tint); color: var(--wy-primary); }
.wy-tone-success { background: #E8FAF0; color: #038A3F; }
.wy-tone-warning { background: #FEF0C7; color: #B54708; }
.wy-tone-danger { background: #FDE7E7; color: #B00B0B; }
.wy-tone-secondary { background: #F1F3F5; color: #4B5563; }
.wy-tone-info { background: #E7F1FF; color: #1B6FD1; }

/* ---------- Les étapes d'une commande : la frise ---------- */
.wy-steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; overflow-x: auto; }
.wy-steps li { flex: 1 1 0; min-width: 96px; text-align: center; position: relative; padding-top: 34px; font-size: 12.5px; color: var(--wy-muted); }
.wy-steps li::before { content: ""; position: absolute; top: 13px; left: 0; right: 0; height: 3px; background: var(--wy-line); }
.wy-steps li:first-child::before { left: 50%; }
.wy-steps li:last-child::before { right: 50%; }
.wy-steps li .wy-step-dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--wy-line); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; z-index: 1; }
.wy-steps li.is-done { color: var(--wy-ink); }
.wy-steps li.is-done::before { background: var(--wy-primary); }
.wy-steps li.is-done .wy-step-dot { background: var(--wy-primary); border-color: var(--wy-primary); color: #fff; }
.wy-steps li.is-current { color: var(--wy-primary); font-weight: 600; }
.wy-steps li.is-current .wy-step-dot { border-color: var(--wy-primary); color: var(--wy-primary); box-shadow: 0 0 0 4px var(--wy-accent-ring); }
.wy-steps .wy-step-time { display: block; font-weight: 400; color: var(--wy-muted); font-size: 11.5px; }
/* Sur un téléphone, les étapes se lisent de haut en bas. */
@media (max-width: 575.98px) {
  .wy-steps { flex-direction: column; overflow: visible; }
  .wy-steps li { flex: none; min-width: 0; text-align: left; padding: 4px 0 16px 40px; }
  .wy-steps li::before { top: 0; bottom: 0; left: 12px; right: auto; width: 3px; height: auto; }
  .wy-steps li:first-child::before { top: 14px; left: 12px; }
  .wy-steps li:last-child::before { right: auto; bottom: auto; height: 14px; }
  .wy-steps li .wy-step-dot { left: 13.5px; }
  .wy-steps .wy-step-time { display: inline; margin-left: 6px; }
}

/* ---------- L'historique d'une commande ---------- */
.wy-history { list-style: none; padding: 0; margin: 0; }
.wy-history li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #F1F3F5; }
.wy-history li:last-child { border-bottom: 0; }
.wy-history .wy-history-icon { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.wy-history .wy-history-time { font-size: 12px; color: var(--wy-muted); white-space: nowrap; }

/* ---------- Les points A et B ---------- */
.wy-point { display: flex; gap: 12px; }
.wy-point-badge { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px; }
.wy-point-badge.is-a { background: var(--wy-primary); }
.wy-point-badge.is-b { background: var(--wy-success); }

/* ---------- Cartes ---------- */
.wy-map { height: 460px; border-radius: 10px; border: 1px solid var(--wy-line); z-index: 0; }
.wy-map.is-small { height: 300px; }
.wy-map.is-tall { height: calc(100vh - 240px); min-height: 420px; }
.wy-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; }
.wy-pin span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 13px; }
.wy-pin.is-a { background: var(--wy-primary); }
.wy-pin.is-b { background: var(--wy-success); }
.wy-pin.is-place { background: var(--wy-accent); }
/* Le camion : bleu vif en direct (avec son halo), gris quand sa position date. */
.wy-truck { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--wy-accent); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; }
.wy-truck.is-live::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--wy-accent); animation: wy-pulse 1.8s ease-out infinite; pointer-events: none; }
.wy-truck.is-stale { background: #9CA3AF; }
.wy-truck.is-assigned { background: #6B7280; }
@keyframes wy-pulse { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wy-truck.is-live::before { animation: none; opacity: .5; } }

/* Les listes courtes du tableau de bord (orders._compact). */
.wy-compact { list-style: none; margin: 0; padding: 0; }
.wy-compact li { position: relative; padding: 12px 20px; border-bottom: 1px solid var(--wy-line); }
.wy-compact li:last-child { border-bottom: 0; }
.wy-compact li:hover { background: #F7FAFC; }
.wy-compact .wy-compact-route { font-size: 13px; color: #4B5563; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaflet-popup-content h6 { margin-bottom: 4px; }

/* ---------- Signature et photos des preuves ---------- */
.wy-signature { max-width: 260px; max-height: 120px; border: 1px solid var(--wy-line); border-radius: 8px; background: #fff; padding: 4px; }
.wy-photo { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--wy-line); }

/* ---------- Tableaux ---------- */
.table td, .table th { vertical-align: middle; }
.table .wy-mono, .wy-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: .02em; }
.table-hover tbody tr.is-link { cursor: pointer; }
.wy-filters .form-control, .wy-filters .form-select { min-width: 150px; }

/* ---------- États vides et messages ---------- */
.wy-empty { text-align: center; padding: 36px 16px; color: var(--wy-muted); }
.wy-empty i { font-size: 34px; color: #C2CAD3; display: block; margin-bottom: 8px; }
.wy-text-danger { color: var(--wy-danger); }
.wy-text-warning { color: #B54708; }
.wy-text-info { color: #1B84FF; }
.wy-secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--wy-ink); color: #E3EAF2; padding: 10px 12px; border-radius: 8px; word-break: break-all; }

/* ---------- La page de suivi du destinataire (sans compte) ---------- */
.wy-public { background: #F4F8FB; min-height: 100vh; }
.wy-public-head { background: #fff; border-bottom: 1px solid var(--wy-line); padding: 14px 20px; }
.wy-public-head img { height: 40px; width: auto; }

@media print {
  .header, .sidebar, .footer, .wy-no-print, .sidebar-overlay { display: none !important; }
  .page-wrapper { margin: 0 !important; padding: 0 !important; }
  .page-wrapper .content { padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; }
  body { background: #fff !important; }
}
