/* =============================================================
   MOE Traceability — ERPNext Custom Branding (Frappe v16)
   Couleurs : mauritaniaoctopusexport.com
   oceanDeep  : #0F2A44
   marineBlue : #1E4E79
   iceBlue    : #5FA8D3
   exportCoral: #FF7A45
   ============================================================= */

/* ---- Variables CSS Frappe v16 (espresso design system) ---- */
:root,
[data-theme="light"] {
  /* Palette bleue → remplacée par MOE */
  --blue-50:  #f0f7ff;
  --blue-100: #dceeff;
  --blue-200: #b8daff;
  --blue-300: #5FA8D3;
  --blue-400: #5FA8D3;
  --blue-500: #1E4E79;
  --blue-600: #1E4E79;
  --blue-700: #0F2A44;
  --blue-800: #0F2A44;
  --blue-900: #091d30;

  /* Surface & ink bleues utilisées par sidebar-card et icônes */
  --surface-blue-1: #f0f7ff;
  --surface-blue-2: #dceeff;
  --surface-blue-3: #1E4E79;
  --ink-blue-1:     #f0f7ff;
  --ink-blue-2:     #1E4E79;
  --ink-blue-3:     #1E4E79;
  --ink-blue-link:  #5FA8D3;

  /* Navbar */
  --navbar-bg: #0F2A44;

  /* Bouton primaire */
  --btn-primary: #1E4E79;

  /* Couleur de sélection sidebar */
  --sidebar-select-color: #dceeff;

  /* Focus / highlight */
  --highlight-shadow: 1px 1px 10px rgba(95,168,211,0.3), 0px 0px 4px #5FA8D3;

  /* Brand */
  --brand-color: #1E4E79;
  --primary-color: #1E4E79;

  /* Background & surfaces — donne une teinte bleue subtile au desk */
  --bg-color: #eef4fa;
  --fg-color: #ffffff;
  --subtle-bg: #e6f0f8;
  --card-bg: #ffffff;

  /* Sidebar */
  --sidebar-bg-color:     #0F2A44;
  --sidebar-hover-color:  rgba(255,255,255,0.08);
  --sidebar-active-color: rgba(255,255,255,0.15);
  --sidebar-border-color: rgba(255,255,255,0.12);
  --sidebar-text-color:   rgba(255,255,255,0.85);
}

/* ---- BACKGROUND PRINCIPAL — dégradé bleuté MOE ---- */
body.desk,
.page-container,
.layout-main,
.desk-page,
.layout-main-section-wrapper {
  background: linear-gradient(160deg, #eaf3fb 0%, #f0f6fc 50%, #e8f2f9 100%) !important;
  min-height: 100vh;
}

/* ---- SIDEBAR GAUCHE (navigation desk uniquement) ---- */
/* :has() cible .layout-side-section QUE quand il contient .desk-sidebar (nav gauche)
   et non quand il contient .form-sidebar (panel droit des formulaires) */
.desk-sidebar,
.layout-side-section:has(.desk-sidebar) {
  background-color: #0F2A44 !important;
  border-right: 1px solid rgba(255,255,255,0.10) !important;
}

/* Texte et liens sidebar — blanc sur fond sombre */
.desk-sidebar .standard-sidebar-item a,
.desk-sidebar .standard-sidebar-item span,
.desk-sidebar .standard-sidebar-item,
.desk-sidebar .sidebar-item-label,
.desk-sidebar .sidebar-group-header,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item a,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item span,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item {
  color: rgba(255,255,255,0.85) !important;
}

/* Hover sidebar */
.desk-sidebar .standard-sidebar-item:hover,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item:hover {
  background-color: rgba(255,255,255,0.08) !important;
  color: #ffffff !important;
  border-left: 3px solid #5FA8D3 !important;
}
.desk-sidebar .standard-sidebar-item:hover a,
.desk-sidebar .standard-sidebar-item:hover span,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item:hover a,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item:hover span {
  color: #ffffff !important;
}

/* Élément sélectionné sidebar */
.desk-sidebar .standard-sidebar-item.selected,
.desk-sidebar .standard-sidebar-item.selected a,
.desk-sidebar .standard-sidebar-item.selected span,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item.selected,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item.selected a,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item.selected span {
  background-color: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
  border-left: 3px solid #5FA8D3 !important;
}

/* Titre de groupe sidebar */
.desk-sidebar .desk-sidebar-item.standard-sidebar-item .sidebar-item-label,
.desk-sidebar .sidebar-group-header,
.layout-side-section:has(.desk-sidebar) .sidebar-group-header,
.sidebar-menu-title,
.workspace-sidebar .sidebar-header {
  color: rgba(255,255,255,0.50) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

/* ---- PANNEAU DROIT FORMULAIRES (form-sidebar) — fond clair ---- */
.form-sidebar,
.layout-side-section {
  background-color: #ffffff !important;
  border-left: 1px solid #e2ecf5 !important;
}

.form-sidebar .sidebar-label,
.form-sidebar .sidebar-item-label,
.form-sidebar h5,
.form-sidebar .form-sidebar-stats .sidebar-stat-label {
  color: #0F2A44 !important;
}

.form-sidebar .list-unstyled a,
.form-sidebar a {
  color: #1E4E79 !important;
}

.form-sidebar .list-unstyled a:hover,
.form-sidebar a:hover {
  color: #0F2A44 !important;
}

/* ---- NAVBAR ---- */
.navbar,
header.navbar {
  background: #0F2A44 !important;
  border-bottom: 2px solid #1E4E79 !important;
}

.navbar .navbar-nav .nav-link,
.navbar .navbar-nav .nav-item a,
.navbar-home,
.navbar .search-bar,
.navbar .notifications-icon,
.navbar .navbar-brand {
  color: rgba(255, 255, 255, 0.9) !important;
}

.navbar svg.icon use,
.navbar .icon use {
  stroke: rgba(255, 255, 255, 0.9) !important;
}

/* Icône ERPNext/logo dans navbar */
.navbar .app-logo,
.navbar-brand img,
.navbar img.app-logo {
  filter: brightness(0) invert(1);
}

/* ---- BOUTONS PRIMAIRES ---- */
.btn-primary,
button.btn-primary,
.btn.btn-primary {
  background-color: #1E4E79 !important;
  border-color: #1E4E79 !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #0F2A44 !important;
  border-color: #0F2A44 !important;
  box-shadow: 0 0 0 0.2rem rgba(30,78,121,0.35) !important;
}

/* Bouton secondaire hover */
.btn-default:hover,
.btn-secondary:hover {
  border-color: #1E4E79 !important;
  color: #1E4E79 !important;
}

/* ---- LIENS ---- */
a { color: #1E4E79; }
a:hover { color: #0F2A44; }

/* Liens dans la sidebar gauche : blanc sur fond sombre */
.desk-sidebar a,
.desk-sidebar a:visited,
.layout-side-section:has(.desk-sidebar) a,
.layout-side-section:has(.desk-sidebar) a:visited {
  color: rgba(255,255,255,0.85) !important;
}
.desk-sidebar a:hover,
.layout-side-section:has(.desk-sidebar) a:hover {
  color: #ffffff !important;
}

/* ---- SIDEBAR DESK (layout-side-section — formulaires/listes) ---- */
.layout-side-section .sidebar-menu a,
.layout-side-section .sidebar-menu a:visited {
  color: rgba(255,255,255,0.80) !important;
}
.layout-side-section .sidebar-menu a.selected,
.layout-side-section .sidebar-menu a:hover {
  color: #ffffff !important;
  background-color: rgba(255,255,255,0.15) !important;
  border-left: 3px solid #5FA8D3;
}
.sidebar-item.selected > a {
  color: #ffffff !important;
}

/* Icônes SVG dans la sidebar (stroke) */
.desk-sidebar svg.icon use,
.desk-sidebar .icon use,
.body-sidebar svg.icon use {
  stroke: rgba(255,255,255,0.75) !important;
}
.desk-sidebar .standard-sidebar-item.selected svg.icon use,
.desk-sidebar .standard-sidebar-item:hover svg.icon use {
  stroke: #ffffff !important;
}

/* ---- WORKSPACE CARDS (page d'accueil) ---- */
.desk-page .widget,
.desk-page .widget-group .widget.shortcut-widget-box,
.desk-page .widget.card-widget {
  background-color: #ffffff !important;
  border: 1px solid #e2ecf5 !important;
  box-shadow: 0 1px 4px rgba(14,42,68,0.07) !important;
}

.desk-page .widget-group .widget.shortcut-widget-box:hover,
.desk-page .widget.card-widget:hover {
  border-color: #5FA8D3 !important;
  box-shadow: 0 4px 12px rgba(95,168,211,0.22) !important;
  transform: translateY(-1px);
}

/* Zone de contenu principal (cards formulaires) */
.layout-main-section,
.page-content,
.form-page .page-content {
  background: linear-gradient(160deg, #f8fbff 0%, #f3f8fd 100%) !important;
  border: 1px solid #ddeaf5 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(14,42,68,0.07) !important;
}

/* Cards sections (frappe sections dans les formulaires) */
.form-section,
.form-section .section-body,
.frappe-card {
  background: linear-gradient(160deg, #f8fbff 0%, #f2f7fc 100%) !important;
  border: 1px solid #ddeaf5 !important;
  border-radius: 8px !important;
  margin-bottom: 12px !important;
}

/* Page head (bandeau titre + breadcrumb) */
.page-head,
.page-head .container {
  background: linear-gradient(90deg, #edf4fb 0%, #f5f9fd 100%) !important;
  border-bottom: 1px solid #d6e8f5 !important;
}

/* Couleur des titres de modules dans le workspace */
.desk-page .widget .widget-head .widget-title,
.workspace-container .page-title {
  color: #0F2A44;
}

/* ---- SIDEBAR CARD (modules boutons) ---- */
.sidebar-card-button {
  background-color: #dceeff !important;
  color: #1E4E79 !important;
  border: 1px solid #5FA8D3 !important;
}

.sidebar-card-button:hover {
  background-color: #1E4E79 !important;
  color: #ffffff !important;
}

/* ---- FORMULAIRES — inputs ---- */
/* Tous les champs : fond blanc propre (pas gris) */
.form-control,
.frappe-control .form-control,
input.form-control,
textarea.form-control,
select.form-control,
.form-control[readonly],
.form-control:disabled,
.frappe-control input[type="text"],
.frappe-control input[type="number"],
.frappe-control input[type="email"],
.frappe-control textarea {
  background-color: #ffffff !important;
  border-color: #c8dff0 !important;
  color: #1a2e42 !important;
}

/* Read-only : légèrement teinté mais pas gris */
.form-control[readonly],
.frappe-control .form-control[readonly] {
  background-color: #f5f9fd !important;
  color: #3a5a7a !important;
}

/* Focus */
.form-control:focus,
.frappe-control .form-control:focus,
input:focus,
textarea:focus {
  background-color: #ffffff !important;
  border-color: #5FA8D3 !important;
  box-shadow: 0 0 0 0.15rem rgba(95,168,211,0.28) !important;
}

/* ---- ONGLETS ACTIFS ---- */
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: #1E4E79 !important;
  border-bottom: 2px solid #1E4E79 !important;
}

/* ---- BADGE / INDICATOR ---- */
.indicator.blue,
.indicator-pill.blue,
.badge-primary {
  background-color: #1E4E79 !important;
  color: #ffffff !important;
}

.indicator.orange,
.indicator-pill.orange {
  background-color: #FF7A45 !important;
  color: #ffffff !important;
}

/* ---- PAGE TITLE ---- */
.page-title .title-text,
h1.page-title,
.form-page .page-head .title-text {
  color: #0F2A44;
}

/* ---- LISTE — ligne sélectionnée ---- */
.list-row.checked,
.list-row-checkbox:checked ~ .list-row-cols {
  background-color: #f0f7ff !important;
}

/* ---- KPI / SUMMARY WIDGET ---- */
.widget.summary-widget .widget-head .widget-title { color: #0F2A44; }
.number-card .number { color: #1E4E79; }

/* ---- BREADCRUMB ---- */
.breadcrumb-container a,
.breadcrumb-container .breadcrumb-item a {
  color: #1E4E79;
}

/* ---- LOGIN PAGE ---- */

/* Fond dégradé bleu marine sur toute la page de connexion */
body.login-page,
.login-page,
.page-login {
  background: linear-gradient(145deg, #0F2A44 0%, #1E4E79 60%, #2a6399 100%) !important;
  min-height: 100vh;
}

/* Carte de connexion : blanche, arrondie, ombre douce */
.login-content,
.login-content .card,
.for-login {
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25) !important;
}

/* Titre de la carte */
.login-content h4,
.login-content .login-title,
.for-login h4 {
  color: #0F2A44 !important;
  font-weight: 700 !important;
}

/* Sous-titre / description */
.login-content .login-description,
.login-content p.text-muted {
  color: #5FA8D3 !important;
}

/* Logo : forcer une hauteur raisonnable et colorer en bleu marine */
.login-content .website-image-lazy,
.login-content img[alt="ERP"],
.login-content .navbar-brand img {
  height: 60px !important;
  width: auto !important;
  object-fit: contain !important;
  max-width: 220px !important;
}

/* Si le logo n'existe pas (image cassée), masquer proprement */
.login-content img:not([src]),
.login-content img[src=""] {
  display: none !important;
}

/* Champ email / mot de passe sur la page de login */
.login-content .form-control,
.for-login input[type="email"],
.for-login input[type="password"],
.for-login input[type="text"] {
  background: #f7fbff !important;
  border: 1.5px solid #b8daff !important;
  border-radius: 8px !important;
  color: #0F2A44 !important;
}
.login-content .form-control:focus,
.for-login input:focus {
  border-color: #5FA8D3 !important;
  box-shadow: 0 0 0 3px rgba(95,168,211,0.2) !important;
}

/* Bouton Login principal */
.login-content .btn-login-option,
.for-login .btn-primary,
.login-content .btn-primary {
  background: linear-gradient(90deg, #1E4E79, #2a6399) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  padding: 10px 20px !important;
  transition: opacity 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(30,78,121,0.35) !important;
}

.login-content .btn-login-option:hover,
.for-login .btn-primary:hover,
.login-content .btn-primary:hover {
  background: linear-gradient(90deg, #0F2A44, #1E4E79) !important;
  opacity: 0.95 !important;
}

/* Lien "Login with Email Link" et autres liens secondaires */
.login-content a:not(.btn),
.for-login a:not(.btn) {
  color: #1E4E79 !important;
}
.login-content a:not(.btn):hover,
.for-login a:not(.btn):hover {
  color: #5FA8D3 !important;
}

/* Ligne de séparation "or" */
.login-content .or-section,
.login-content .login-divider {
  color: #1E4E79 !important;
}

/* Footer copyright */
.login-content .copyright {
  color: #8aaccc !important;
  font-size: 11px;
}

/* ---- SPLASH / LOADING SCREEN ---- */
.splash {
  background-color: #ffffff !important;
}

.splash img {
  max-width: 160px !important;
  width: auto !important;
}

/* ---- WORKSPACE MODULE ICONS ---- */
/* .icon-container reçoit un background-color inline via frappe.utils.desktop_icon()
   !important surclasse les styles inline selon la cascade CSS */
.icon-container {
  background-color: rgba(30, 78, 121, 0.10) !important; /* marineBlue 10% */
}
.icon-container svg.desktop-alphabet {
  color: #1E4E79 !important;
}

/* Mode Solid (frappe.boot.desktop_icon_style == "Solid") */
body[data-icon-style="Solid"] .icon-container,
.icon-container.solid {
  background-color: #1E4E79 !important;
}
body[data-icon-style="Solid"] .icon-container svg.desktop-alphabet,
.icon-container.solid svg.desktop-alphabet {
  color: #ffffff !important;
}

/* =============================================================
   MOE PREMIUM UI — Composants avancés
   ============================================================= */

/* ---- AVATARS & INITIALES ---- */
.avatar .standard-image,
.avatar-medium .standard-image,
.avatar-small .standard-image,
.avatar-frame,
.user-image-wrapper .standard-image {
  background-color: #1E4E79 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Avatar indicateur de présence (pastille verte) → coral MOE */
.avatar .avatar-small.online::after,
.user-avatar .online::after {
  background-color: #5FA8D3 !important;
  border-color: #0F2A44 !important;
}

/* ---- DROPDOWN MENUS & MENUS CONTEXTUELS ---- */
.dropdown-menu,
.dropdown-list,
.awesomplete ul,
.frappe-list .dropdown-menu {
  border-radius: 10px !important;
  border: 1px solid #d0e6f5 !important;
  box-shadow: 0 8px 28px rgba(14,42,68,0.14), 0 2px 8px rgba(14,42,68,0.07) !important;
  overflow: hidden;
  padding: 4px !important;
}

.dropdown-item,
.dropdown-menu li > a,
.frappe-list .dropdown-item {
  border-radius: 6px !important;
  padding: 7px 14px !important;
  color: #1a3a5a !important;
  font-size: 0.875rem !important;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-menu li > a:hover {
  background-color: #edf4fb !important;
  color: #0F2A44 !important;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: #1E4E79 !important;
  color: #ffffff !important;
}

/* Séparateurs dropdown */
.dropdown-divider {
  border-color: #e2ecf5 !important;
  margin: 4px 0 !important;
}

/* ---- MODALS — header gradient premium ---- */
.modal-content {
  border-radius: 12px !important;
  border: none !important;
  box-shadow: 0 20px 60px rgba(14,42,68,0.18), 0 4px 16px rgba(14,42,68,0.10) !important;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, #0F2A44 0%, #1E4E79 100%) !important;
  border-bottom: none !important;
  padding: 16px 22px !important;
}

.modal-title,
.modal-header h4,
.modal-header h5,
.modal-header .title {
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
}

.modal-header .close,
.modal-header [data-dismiss="modal"],
.modal-header .btn-modal-close {
  color: rgba(255,255,255,0.75) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

.modal-header .close:hover {
  color: #ffffff !important;
  opacity: 1 !important;
}

.modal-footer {
  border-top: 1px solid #e2ecf5 !important;
  padding: 12px 20px !important;
}

/* ---- LIST VIEW — headers et lignes ---- */
.list-row-head,
.frappe-list .list-row-head {
  background: linear-gradient(90deg, #edf4fb 0%, #f3f8fd 100%) !important;
  border-bottom: 2px solid #cce0f0 !important;
}

.list-row-head .list-header-subject span,
.list-row-head .column-header,
.list-row-head .list-row-col .column-title {
  color: #0F2A44 !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}

/* Lignes */
.list-row,
.frappe-list .list-row {
  border-bottom: 1px solid #edf3f9 !important;
  transition: background-color 0.10s ease;
}

.list-row:hover,
.frappe-list .list-row:hover {
  background-color: #f0f7fc !important;
}

.list-row.checked,
.list-row-checkbox:checked ~ .list-row-cols {
  background-color: #e8f2fb !important;
}

/* ---- SECTIONS FORMULAIRE — titres ---- */
.form-section > .section-head,
.section-head {
  color: #0F2A44 !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  padding-bottom: 8px !important;
  border-bottom: 2px solid #d0e6f5 !important;
  margin-bottom: 14px !important;
}

/* ---- ONGLETS FORMULAIRE — plus définis ---- */
.form-tabs .nav-tabs,
.nav-tabs {
  border-bottom: 2px solid #d8eaf5 !important;
  gap: 4px;
}

.form-tabs .nav-link,
.nav-tabs .nav-link {
  color: #5a7a9a !important;
  font-weight: 500 !important;
  padding: 9px 16px !important;
  border: none !important;
  border-radius: 6px 6px 0 0 !important;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.form-tabs .nav-link:hover,
.nav-tabs .nav-link:hover {
  color: #1E4E79 !important;
  background-color: rgba(30,78,121,0.06) !important;
}

.form-tabs .nav-link.active,
.nav-tabs .nav-link.active {
  color: #0F2A44 !important;
  font-weight: 700 !important;
  background-color: rgba(30,78,121,0.08) !important;
  border-bottom: 3px solid #1E4E79 !important;
}

/* ---- BOUTONS PAGE ACTIONS ---- */
.page-actions .btn,
.standard-actions .btn,
.page-actions .btn-secondary,
.standard-actions .btn-secondary,
.page-actions .btn-default,
.standard-actions .btn-default {
  border-radius: 7px !important;
  font-weight: 500 !important;
  font-size: 0.84rem !important;
  transition: all 0.15s ease;
}

.page-actions .btn-secondary,
.standard-actions .btn-secondary,
.page-actions .btn-default {
  border-color: #c0d8ee !important;
  color: #1E4E79 !important;
  background: #ffffff !important;
}

.page-actions .btn-secondary:hover,
.standard-actions .btn-secondary:hover {
  background: #edf4fb !important;
  border-color: #5FA8D3 !important;
}

/* ---- BREADCRUMB — hiérarchie visuelle ---- */
.breadcrumb-container a,
.breadcrumb-container .breadcrumb-item a {
  color: #6a8faa !important;
  font-weight: 500 !important;
}

.breadcrumb-container .breadcrumb-item:last-child,
.breadcrumb-container .breadcrumb-item.active {
  color: #0F2A44 !important;
  font-weight: 600 !important;
}

/* Séparateur breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
  color: #9ab8cc !important;
}

/* ---- EMPTY STATE ---- */
.no-result .text-muted,
.frappe-list .no-result p,
.empty-state .title {
  color: #7a9ab5 !important;
}

.frappe-list .no-result .btn,
.empty-state .btn-primary {
  background-color: #1E4E79 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 7px !important;
  padding: 8px 20px !important;
  font-weight: 500 !important;
}

/* ---- GETTING STARTED WIDGET ---- */
.onboarding-success,
.widget.onboarding-widget-box {
  border-radius: 12px !important;
  border: 1px solid #d0e6f5 !important;
  box-shadow: 0 4px 16px rgba(14,42,68,0.10) !important;
}

/* Progress bar — couleurs MOE */
.progress-bar,
.progress .progress-bar {
  background: linear-gradient(90deg, #1E4E79 0%, #5FA8D3 100%) !important;
}

/* ---- NOTIFICATION PANEL ---- */
.notifications-list,
.notification-list-header {
  border-radius: 12px !important;
  border: 1px solid #d0e6f5 !important;
  box-shadow: 0 8px 28px rgba(14,42,68,0.14) !important;
}

/* ---- TOOLTIPS ---- */
.tooltip-inner {
  background-color: #0F2A44 !important;
  border-radius: 6px !important;
  font-size: 0.78rem !important;
  padding: 5px 10px !important;
  box-shadow: 0 2px 8px rgba(14,42,68,0.20) !important;
}

.bs-tooltip-top .arrow::before { border-top-color: #0F2A44 !important; }
.bs-tooltip-bottom .arrow::before { border-bottom-color: #0F2A44 !important; }
.bs-tooltip-left .arrow::before { border-left-color: #0F2A44 !important; }
.bs-tooltip-right .arrow::before { border-right-color: #0F2A44 !important; }

/* ---- SCROLLBAR CUSTOM ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f0f6fc; }
::-webkit-scrollbar-thumb { background: #b8d4e8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5FA8D3; }

/* ---- SEARCH MODAL (Ctrl+K) ---- */
.search-dialog .modal-body,
.awesomplete .search-results {
  border-radius: 12px !important;
}

.search-dialog .modal-header {
  background: linear-gradient(135deg, #0F2A44 0%, #1E4E79 100%) !important;
}

/* ---- TRANSITIONS GÉNÉRALES ---- */
.btn, .form-control, .list-row, .dropdown-item {
  transition: all 0.15s ease;
}

/* ---- PRINT ---- */
@media print {
  .navbar {
    background-color: #0F2A44 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* =============================================================
   MOE PREMIUM REFINEMENTS — desktop polish
   Applique une interface plus premium sans casser les patterns Frappe
   ============================================================= */

:root,
[data-theme="light"] {
  --moe-deep: #0F2A44;
  --moe-mid: #1E4E79;
  --moe-sky: #5FA8D3;
  --moe-soft: #EAF3FB;
  --moe-card-shadow: 0 18px 38px rgba(15,42,68,0.08), 0 4px 12px rgba(15,42,68,0.06);
  --moe-card-border: 1px solid rgba(95,168,211,0.14);
}

body.desk,
.page-container,
.layout-main,
.desk-page,
.layout-main-section-wrapper {
  background:
    radial-gradient(circle at top left, rgba(95,168,211,0.16) 0, rgba(95,168,211,0) 30%),
    radial-gradient(circle at top right, rgba(30,78,121,0.1) 0, rgba(30,78,121,0) 26%),
    linear-gradient(180deg, #eef5fb 0%, #f8fbfe 58%, #f2f7fc 100%) !important;
}

.navbar,
header.navbar {
  min-height: 68px;
  background: linear-gradient(90deg, #0B2239 0%, #123A61 42%, #1E4E79 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 14px 34px rgba(10, 29, 47, 0.18) !important;
  backdrop-filter: blur(16px);
}

.navbar .container,
.navbar .navbar-nav {
  min-height: 68px;
}

.navbar .navbar-brand,
.navbar .app-logo,
.navbar-brand img,
.navbar img.app-logo {
  height: 40px !important;
}

.navbar .search-bar,
.navbar .navbar-nav .nav-link,
.navbar .navbar-nav .nav-item a {
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.layout-side-section:has(.desk-sidebar) {
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(245,250,255,0.98) 100%) !important;
  border-right: 1px solid rgba(188,214,234,0.72) !important;
  border-left: none !important;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.8);
}

.desk-sidebar {
  background: transparent !important;
  padding: 12px 12px 18px !important;
}

.desk-sidebar .standard-sidebar-item,
.desk-sidebar .desk-sidebar-item,
.desk-sidebar-item.standard-sidebar-item {
  border-radius: 16px !important;
  margin-bottom: 6px;
  border-left: none !important;
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.desk-sidebar .standard-sidebar-item a,
.desk-sidebar .standard-sidebar-item span,
.desk-sidebar .standard-sidebar-item,
.desk-sidebar .sidebar-item-label,
.desk-sidebar .sidebar-group-header {
  color: rgba(15,42,68,0.82) !important;
}

.desk-sidebar .standard-sidebar-item:hover,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item:hover {
  background: linear-gradient(135deg, rgba(95,168,211,0.12) 0%, rgba(95,168,211,0.05) 100%) !important;
  transform: translateX(2px);
  box-shadow: 0 8px 18px rgba(95,168,211,0.12);
  border-left: none !important;
}

.desk-sidebar .standard-sidebar-item.selected,
.desk-sidebar .standard-sidebar-item.selected a,
.desk-sidebar .standard-sidebar-item.selected span,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item.selected,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item.selected a,
.layout-side-section:has(.desk-sidebar) .standard-sidebar-item.selected span {
  background: linear-gradient(135deg, rgba(15,42,68,0.96) 0%, rgba(30,78,121,0.96) 100%) !important;
  color: #ffffff !important;
  border-left: none !important;
  box-shadow: 0 14px 28px rgba(15,42,68,0.2);
}

.desk-sidebar .standard-sidebar-item.selected svg.icon use,
.desk-sidebar .standard-sidebar-item:hover svg.icon use {
  stroke: currentColor !important;
}

.desk-sidebar .sidebar-item-label,
.desk-sidebar .standard-sidebar-item .sidebar-item-label {
  font-weight: 600 !important;
  font-size: 0.98rem !important;
}

.desk-sidebar .desk-sidebar-item.standard-sidebar-item .sidebar-item-label,
.desk-sidebar .sidebar-group-header,
.sidebar-menu-title,
.workspace-sidebar .sidebar-header {
  color: rgba(15,42,68,0.48) !important;
  font-size: 0.7rem !important;
}

.layout-main-section,
.page-content,
.form-page .page-content,
.frappe-card,
.desk-page .widget,
.desk-page .widget-group .widget.shortcut-widget-box,
.desk-page .widget.card-widget {
  border-radius: 20px !important;
  border: var(--moe-card-border) !important;
  box-shadow: var(--moe-card-shadow) !important;
}

.layout-main-section,
.page-content,
.form-page .page-content {
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(247,251,255,0.98) 100%) !important;
}

.page-head,
.page-head .container {
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(241,247,252,0.96) 100%) !important;
  border-bottom: 1px solid rgba(95,168,211,0.18) !important;
  backdrop-filter: blur(10px);
}

.page-title .title-text,
h1.page-title,
.form-page .page-head .title-text,
.workspace-container .page-title {
  color: var(--moe-deep) !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em;
}

.page-actions .btn,
.standard-actions .btn,
.page-actions .btn-secondary,
.standard-actions .btn-secondary,
.page-actions .btn-default,
.standard-actions .btn-default,
.page-actions .btn-primary,
.standard-actions .btn-primary {
  min-height: 44px;
  border-radius: 14px !important;
  padding: 0.7rem 1rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.page-actions .btn-primary,
.standard-actions .btn-primary,
.btn-primary,
button.btn-primary,
.btn.btn-primary {
  background: linear-gradient(135deg, #123A61 0%, #1E4E79 58%, #2A86C8 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 14px 28px rgba(30,78,121,0.18) !important;
}

.page-actions .btn-primary:hover,
.standard-actions .btn-primary:hover,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(30,78,121,0.22) !important;
}

.form-control,
.frappe-control .form-control,
input.form-control,
textarea.form-control,
select.form-control,
.form-control[readonly],
.form-control:disabled,
.frappe-control input[type="text"],
.frappe-control input[type="number"],
.frappe-control input[type="email"],
.frappe-control textarea {
  min-height: 44px;
  border-radius: 14px !important;
  border-color: rgba(95,168,211,0.28) !important;
  box-shadow: inset 0 1px 2px rgba(15,42,68,0.03);
}

.frappe-list .list-row-head,
.list-row-head {
  border-radius: 18px 18px 0 0 !important;
}

.list-row,
.frappe-list .list-row {
  background: rgba(255,255,255,0.7) !important;
}

.list-row:hover,
.frappe-list .list-row:hover {
  background: linear-gradient(90deg, rgba(240,247,252,0.92) 0%, rgba(250,252,255,0.96) 100%) !important;
}

.list-row-head .list-header-subject span,
.list-row-head .column-header,
.list-row-head .list-row-col .column-title {
  font-size: 0.69rem !important;
  letter-spacing: 0.09em !important;
}

.form-section,
.form-section .section-body,
.frappe-card {
  border-radius: 18px !important;
  padding: 10px 12px !important;
}

.form-section > .section-head,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #123A61 !important;
}

.form-section > .section-head::before,
.section-head::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #123A61 0%, #5FA8D3 100%);
}

.number-card,
.widget.summary-widget,
.widget.onboarding-widget-box,
.onboarding-success {
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(246,250,254,0.98) 100%) !important;
  border: var(--moe-card-border) !important;
  box-shadow: var(--moe-card-shadow) !important;
}

.icon-container {
  border-radius: 16px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65), 0 8px 20px rgba(30,78,121,0.08);
}

.dropdown-menu,
.dropdown-list,
.awesomplete ul,
.frappe-list .dropdown-menu,
.notifications-list,
.notification-list-header {
  border-radius: 16px !important;
  border: 1px solid rgba(95,168,211,0.18) !important;
  box-shadow: 0 24px 50px rgba(15,42,68,0.14), 0 6px 18px rgba(15,42,68,0.08) !important;
}

@media (max-width: 1100px) {
  .layout-side-section:has(.desk-sidebar) {
    background: rgba(255,255,255,0.96) !important;
  }

  .desk-sidebar {
    padding: 10px !important;
  }

  .layout-main-section,
  .page-content,
  .form-page .page-content,
  .frappe-card,
  .desk-page .widget,
  .desk-page .widget-group .widget.shortcut-widget-box,
  .desk-page .widget.card-widget {
    border-radius: 16px !important;
  }
}

/* =============================================================
   MOE PREMIUM REFINEMENTS — list/form/detail pass
   ============================================================= */

.page-head {
  padding: 10px 18px !important;
}

.page-head .page-head-content,
.page-head .container {
  max-width: none !important;
}

.page-head .page-actions,
.page-head .standard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-actions .btn:not(.btn-primary),
.standard-actions .btn:not(.btn-primary),
.list-sidebar-button,
.sort-selector-button,
.filter-button {
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid rgba(95,168,211,0.18) !important;
  color: #123A61 !important;
}

.page-actions .btn:not(.btn-primary):hover,
.standard-actions .btn:not(.btn-primary):hover,
.list-sidebar-button:hover,
.sort-selector-button:hover,
.filter-button:hover {
  background: #f2f8fd !important;
  border-color: rgba(95,168,211,0.3) !important;
}

.layout-side-section:has(.desk-sidebar) {
  width: 320px !important;
  min-width: 320px !important;
  padding: 8px 10px 16px !important;
}

.desk-sidebar::before {
  content: "";
  display: block;
  height: 118px;
  margin: 0 2px 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 18%, rgba(95,168,211,0.28) 0, rgba(95,168,211,0) 22%),
    linear-gradient(135deg, #0B2239 0%, #123A61 52%, #2A86C8 100%);
  box-shadow: 0 22px 40px rgba(15,42,68,0.18);
}

.desk-sidebar .standard-sidebar-item,
.desk-sidebar .desk-sidebar-item,
.desk-sidebar-item.standard-sidebar-item {
  min-height: 48px;
  padding: 0 10px !important;
}

.desk-sidebar .sidebar-item-label,
.desk-sidebar .standard-sidebar-item .sidebar-item-label {
  font-size: 1.02rem !important;
  letter-spacing: -0.01em;
}

.layout-main-section {
  padding: 18px !important;
}

.frappe-list,
.frappe-list .result,
.frappe-list .list-row-container {
  background: transparent !important;
}

.frappe-list .list-row-head,
.list-row-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 14px !important;
  box-shadow: inset 0 -1px 0 rgba(95,168,211,0.12);
}

.list-row,
.frappe-list .list-row {
  margin: 0 0 8px !important;
  border: 1px solid rgba(95,168,211,0.1) !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 18px rgba(15,42,68,0.04);
}

.list-row-col,
.frappe-list .list-row-col {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

.list-subject a,
.list-row-container .level-item.bold,
.list-row .ellipsis,
.list-row .list-row-col a {
  color: #20364d !important;
}

.list-row .level-item.bold,
.list-row .list-subject {
  font-weight: 600 !important;
}

.list-row .modified,
.list-row .comment-count,
.list-row .avatar {
  opacity: 0.9;
}

.form-dashboard-section,
.form-dashboard,
.form-layout {
  gap: 16px;
}

.form-section,
.form-section .section-body,
.frappe-card {
  padding: 16px 18px !important;
}

.form-page .form-layout .form-column,
.form-grid-container,
.form-dashboard-section .form-dashboard {
  gap: 16px;
}

.form-section .section-body {
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(247,251,255,0.95) 100%) !important;
}

.form-sidebar {
  border-radius: 20px !important;
  border: 1px solid rgba(95,168,211,0.14) !important;
  box-shadow: 0 16px 30px rgba(15,42,68,0.07) !important;
  padding: 12px !important;
}

.form-sidebar .list-unstyled a,
.form-sidebar a,
.form-sidebar .sidebar-label,
.form-sidebar .form-sidebar-stats .sidebar-stat-label {
  font-weight: 500 !important;
}

.widget.number-widget-box,
.widget.shortcut-widget-box,
.widget.links-widget-box,
.widget.chart-widget-box {
  border-radius: 22px !important;
  overflow: hidden;
}

.widget.number-widget-box .widget-head,
.widget.chart-widget-box .widget-head,
.widget.links-widget-box .widget-head {
  padding-bottom: 10px !important;
}

.number-card .number,
.widget.summary-widget .widget-head .widget-title,
.widget .widget-head .widget-title {
  letter-spacing: -0.02em;
}

.icon-container {
  width: 52px !important;
  height: 52px !important;
}

.standard-sidebar-item .item-anchor,
.standard-sidebar-item > a {
  border-radius: inherit !important;
}

@media (max-width: 1360px) {
  .layout-side-section:has(.desk-sidebar) {
    width: 286px !important;
    min-width: 286px !important;
  }
}
