/* Corrections de deux défauts de SOGo lui-même — LeWeboskop, 30/09/2026.
 *
 * Le thème vient désormais de theme-kino.css, engendré depuis le thème Material
 * compilé par SOGo. Ce fichier ne le complète que là où SOGo se contredit :
 *
 * 1. Le message sélectionné reçoit « md-accent md-bg md-hue-2 ». SOGo déclare cette
 *    nuance dans contrastLightColors, donc il y écrit en BLANC, alors qu'elle est
 *    CLAIRE : contraste 1.99, illisible. Le défaut existait déjà dans le thème
 *    d'origine (blanc sur #88c781, 1.9). On repasse le texte en sombre.
 * 2. « Aucun message sélectionné » est en #9E9E9E sur #EEEEEE, soit 2.31.
 */
.sg-message-list-item.md-accent.md-bg.md-hue-2,
.sg-message-list-item.md-accent.md-bg.md-hue-2 *,
md-list-item.md-accent.md-bg.md-hue-2 .md-list-item-text,
md-list-item.md-accent.md-bg.md-hue-2 .md-list-item-text * {
  color: rgba(0, 0, 0, .82) !important;
}
.sg-message-list-item.md-accent.md-bg.md-hue-2 .sg-tile-from,
.sg-message-list-item.md-accent.md-bg.md-hue-2 span:first-child {
  color: rgba(0, 0, 0, .90) !important;
  font-weight: 600 !important;
}
.sg-message-list-item.md-accent.md-bg.md-hue-2 .sg-tile-date,
.sg-message-list-item.md-accent.md-bg.md-hue-2 .sg-tile-size,
.sg-message-list-item.md-accent.md-bg.md-hue-2 .sg-tile-subject {
  color: rgba(0, 0, 0, .66) !important;
}
.sg-message-list-item.md-accent.md-bg.md-hue-2 md-icon { color: rgba(0, 0, 0, .58) !important; }

/* ⚠️ uniquement dans les zones CLAIRES : la même classe sert au nom du compte,
   qui est posé sur l'en-tête vert, et le griser le rendait illisible (1.1). */
md-content .sg-md-title, .view-detail .sg-md-title, md-content div.sg-md-title {
  color: #6E6E6E !important;
}
md-toolbar .sg-md-title, md-sidenav md-toolbar .sg-md-title { color: #FFFFFF !important; }


/* ================================================================== *
 * Personnalisation SOGo — Wali / LeWeboskop, 03/10/2026.
 * (A) page de connexion : carte Material + logo. (B) barre du haut fine.
 * On garde toute la mecanique SOGo, on ne change que l'apparence.
 * ================================================================== */

/* =============== (A) PAGE DE CONNEXION : carte Material =============== */
[ui-view="login"], [ui-view="login"] > md-content, [ui-view="login"] md-content {
  background: linear-gradient(135deg, #028d87 0%, #004d49 100%) !important;
}
#loginContent {
  flex: 0 0 auto !important; width: 92% !important; max-width: 400px !important;
  margin: auto !important; margin-top: 10px !important;
  background: #ffffff !important; border-radius: 14px !important;
  box-shadow: 0 14px 50px rgba(0,0,0,.30) !important;
  overflow: hidden !important; flex-direction: column !important;
}
#loginContent > div:first-child { display: none !important; }       /* logo SOGo masque */
#loginContent .sg-login {
  max-width: none !important; width: 100% !important; background: #fff !important;
  flex: 1 1 auto !important; transform: none !important; opacity: 1 !important;
}
#loginContent .sg-login-content { width: auto !important; max-width: none !important; margin: 0 !important; padding: 30px 34px 16px !important; }
#login::before {
  content: ""; display: block; height: 74px; margin: 2px auto 22px;
  background: url("/SOGo.woa/WebServerResources/local/wali-logo.png") center / contain no-repeat;
}
.sg-login label, .sg-login .md-input-container label { color: rgba(0,0,0,.55) !important; }
.sg-login input.md-input {
  color: rgba(0,0,0,.87) !important; background: transparent !important;
  border: 0 !important; border-bottom: 1px solid rgba(0,0,0,.28) !important;
  border-radius: 0 !important; padding: 4px 2px !important;
}
.sg-login .md-input-container.md-input-focused input.md-input { border-bottom: 2px solid #028d87 !important; }
.sg-login input.md-input::placeholder { color: rgba(0,0,0,.38) !important; }
.sg-login input.md-input:-webkit-autofill,
.sg-login input.md-input:-webkit-autofill:hover,
.sg-login input.md-input:-webkit-autofill:focus {
  -webkit-text-fill-color: rgba(0,0,0,.87) !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: #000 !important; transition: background-color 9999s ease-in-out 0s;
}
.sg-login .md-subhead, .sg-login span, .sg-login a,
.sg-login md-checkbox .md-label, .sg-login .md-label,
.sg-login .md-select-value, .sg-login .md-select-value span { color: rgba(0,0,0,.72) !important; }
.sg-login md-icon { color: #028d87 !important; }
.sg-login .md-button.md-fab { background: #028d87 !important; box-shadow: 0 4px 14px rgba(2,141,135,.45) !important; }
.sg-login .md-button.md-fab md-icon { color: #fff !important; }
.sg-login .md-button:not(.md-fab) md-icon { color: rgba(0,0,0,.40) !important; }
/* "Se souvenir de moi" MASQUE : SOGo ne maintient pas la session, l'option induit en erreur. */
[ui-view="login"] #login div[layout-align="center center"] { display: none !important; }
/* La rangee langue (dernier champ) reserve 18px de marge Material en bas (zone
   de messages d'erreur), inutile ici -> creux avant les boutons : on la resorbe. */
[ui-view="login"] #login div[layout-align="start end"] md-input-container { margin-bottom: 4px !important; }
/* boutons (info + connexion) a droite, colles sous le selecteur de langue */
[ui-view="login"] div[layout-align="space-between center"] { justify-content: flex-end !important; }
[ui-view="login"] div[layout-align="space-between center"] > .md-button:not(.md-fab) { margin-right: 6px !important; }
[ui-view="login"] #login div[layout-align="space-between center"] { margin-top: 2px !important; margin-bottom: 0 !important; }

/* =============== (B) BARRE DU HAUT FINE (64px, uniforme) =============== */
/* la barre du haut ET l'en-tete de la colonne gauche a la meme hauteur 64px.
   La barre du haut = .toolbar-main dans Courrier, mais .md-tall (sans sg-padded)
   dans Preferences/Agenda/Contacts -> on cible les deux. */
md-toolbar.toolbar-main,
md-toolbar.md-tall:not(.sg-padded) { min-height: 64px !important; height: 64px !important; max-height: 64px !important; }
md-toolbar.sg-padded.md-tall {
  min-height: 64px !important; height: 64px !important; max-height: 64px !important;
  flex-direction: row !important; align-items: center !important;   /* avatar + texte COTE A COTE, pas empiles */
  padding-top: 0 !important; padding-bottom: 0 !important;
}
md-toolbar.sg-padded.md-tall > div[layout="row"] { flex: 1 1 auto !important; margin-left: 12px !important; }
md-toolbar.sg-padded.md-tall .md-tile-left { align-self: center !important; margin: 0 !important; }
md-toolbar.sg-padded.md-tall .sg-md-title,
md-toolbar.sg-padded.md-tall .md-caption { line-height: 1.25 !important; margin: 0 !important; }
/* date du jour sur UNE ligne (SOGo l'empile en colonne par defaut) */
.sg-date-group { flex-direction: row !important; align-items: baseline !important; }
.sg-date-group > * { margin-left: 5px !important; }
.sg-date-today { font-size: 26px !important; line-height: 1 !important; margin-left: 12px !important; font-weight: 300 !important; }

/* Bouton d'enregistrement flottant (classe md-fab-overlap-bottom) : par defaut
   il CHEVAUCHE le bas de la barre du haut (bottom:-36px). On annule le
   chevauchement pour qu'il passe entierement sous la barre (petit espace). */
.md-button.md-fab.md-fab-overlap-bottom,
[sg-toggle-grid] md-grid-tile.md-fab.md-fab-overlap-bottom.sg-icon-button {
  bottom: -64px !important;
}
