:root {
  --lb-red: #e3262e;
  --lb-red-dark: #b71920;
  --lb-ink: #171717;
  --lb-soft: #f6f6f7;
}

body {
  color: var(--lb-ink);
}

.task-login #layout-content {
  min-height: 100vh;
  background-image:
    linear-gradient(110deg, rgba(8, 8, 9, .78) 0%, rgba(15, 15, 16, .44) 54%, rgba(10, 10, 11, .62) 100%),
    var(--lb-login-photo, radial-gradient(circle at 18% 12%, rgba(227, 38, 46, .22), transparent 34rem)),
    linear-gradient(135deg, #0f0f10 0%, #202124 55%, #111 100%);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.task-login #logo {
  top: 12vh;
  width: min(46vw, 190px);
  max-height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.task-login #login-form {
  top: 16vh;
  max-width: 390px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  backdrop-filter: blur(16px);
}

.task-login #login-form::before {
  display: block;
  margin-bottom: 1.35rem;
  color: #555;
  content: "Accédez à votre messagerie LB Apparel";
  font-size: .92rem;
}

.task-login #login-form .form-control {
  min-height: 48px;
  border-radius: 12px;
  border-color: #d8d8da;
}

.task-login #login-form .form-control:focus {
  border-color: var(--lb-red);
  box-shadow: 0 0 0 .2rem rgba(227, 38, 46, .16);
}

.task-login .lb-password-field {
  position: relative;
}

.task-login .lb-password-field .form-control {
  padding-right: 5.5rem;
}

.task-login .lb-password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: .65rem;
  padding: .3rem .45rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  color: #555;
  background: transparent;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.task-login .lb-password-toggle:hover,
.task-login .lb-password-toggle:focus-visible {
  color: var(--lb-red-dark);
  background: #fff1f2;
  outline: 2px solid rgba(227, 38, 46, .28);
}

.task-login #rcmloginsubmit,
.btn-primary {
  border-color: var(--lb-red);
  background-color: var(--lb-red);
  border-radius: 12px;
}

.task-login #rcmloginsubmit:hover,
.task-login #rcmloginsubmit:focus,
.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--lb-red-dark);
  background-color: var(--lb-red-dark);
}

.task-login #login-footer {
  color: #6d6d70;
}

.task-login .lb-forgot-password {
  display: inline-block;
  margin: .1rem 0 .5rem;
  color: #56565a;
  font-size: .86rem;
  text-decoration: none;
}

.task-login .lb-forgot-password:hover,
.task-login .lb-forgot-password:focus {
  color: var(--lb-red-dark);
  text-decoration: underline;
}

.task-login #login-footer .support-link {
  color: #56565a;
  text-decoration: none;
}

.task-login #login-footer .support-link:hover,
.task-login #login-footer .support-link:focus {
  color: var(--lb-red-dark);
  text-decoration: underline;
}

#layout-menu {
  background: #171717;
}

#layout-menu .popover-header,
#layout-menu .special-buttons a,
#layout-menu a.selected,
#layout-menu a:hover {
  color: #fff;
}

#layout-menu a.selected,
#layout-menu a:hover {
  background-color: #2d2d2f;
}

#layout-menu .special-buttons a,
.listing li.selected,
.listing tr.selected td,
.menu a:hover {
  color: var(--lb-red);
}

.listing li.selected,
.listing tr.selected td {
  background-color: #fff1f2;
}

.quota-widget .bar span,
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--lb-red);
}

html.dark-mode .task-login #login-form {
  color: #eee;
  background: rgba(35, 35, 37, .97);
}

html.dark-mode .task-login #login-form::before,
html.dark-mode .task-login #login-footer {
  color: #bbb;
}

html.dark-mode .task-login .lb-password-toggle,
html.dark-mode .task-login .lb-forgot-password,
html.dark-mode .task-login #login-footer .support-link {
  color: #d3d3d5;
}

@media screen and (max-width: 480px) {
  .task-login #logo {
    top: 8vh;
    width: min(42vw, 155px);
    max-height: 40px;
  }

  .task-login #login-form {
    top: 12vh;
    width: calc(100% - 2rem);
    padding: 1.4rem;
  }
}

/* LB Apparel workspace — desktop and tablet */
html.layout-normal,
html.layout-large {
  --lb-sidebar: #151618;
  --lb-sidebar-soft: #222428;
  --lb-surface: #ffffff;
  --lb-surface-soft: #f7f7f8;
  --lb-line: #e7e8eb;
  --lb-muted: #74777d;
}

html.layout-normal body,
html.layout-large body {
  background: var(--lb-surface-soft);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.layout-normal #layout-menu,
html.layout-large #layout-menu {
  width: 104px;
  border-right: 0;
  background: linear-gradient(180deg, #1b1c1f 0%, #111214 100%);
  box-shadow: 4px 0 24px rgba(20, 20, 22, .12);
}

html.layout-normal #layout-menu .popover-header,
html.layout-large #layout-menu .popover-header {
  height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: transparent !important;
}

html.layout-normal #layout-menu .popover-header img,
html.layout-large #layout-menu .popover-header img {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  padding: 7px;
  object-fit: contain;
  filter: invert(1);
  opacity: .96;
}

html.layout-normal #taskmenu,
html.layout-large #taskmenu {
  padding-top: 9px;
}

html.layout-normal #taskmenu > a,
html.layout-large #taskmenu > a,
html.layout-normal #taskmenu .action-buttons a,
html.layout-large #taskmenu .action-buttons a {
  width: calc(100% - 16px);
  margin: 4px 8px;
  padding: .62rem .2rem;
  border-radius: 12px;
  color: #c7c9cd;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}

html.layout-normal #taskmenu > a:hover,
html.layout-large #taskmenu > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

html.layout-normal #taskmenu > a.selected,
html.layout-large #taskmenu > a.selected {
  color: #fff;
  background: rgba(227, 38, 46, .16);
  box-shadow: inset 3px 0 0 var(--lb-red);
}

html.layout-normal #taskmenu .action-buttons a,
html.layout-large #taskmenu .action-buttons a {
  color: #fff;
  background: linear-gradient(135deg, #eb2630, #c81720);
  box-shadow: 0 8px 20px rgba(227, 38, 46, .23);
}

html.layout-normal #taskmenu .action-buttons a:hover,
html.layout-large #taskmenu .action-buttons a:hover {
  color: #fff;
  background: linear-gradient(135deg, #f2313a, #b7131b);
  transform: translateY(-1px);
}

html.layout-normal #taskmenu .special-buttons,
html.layout-large #taskmenu .special-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 11, 12, .88);
}

html.layout-normal #taskmenu .special-buttons a,
html.layout-large #taskmenu .special-buttons a,
html.layout-normal #taskmenu .special-buttons a.logout,
html.layout-large #taskmenu .special-buttons a.logout {
  width: auto;
  height: 42px;
  margin: 0;
  padding: 0 !important;
  border-radius: 10px;
  color: #8f9399 !important;
  background: transparent;
}

html.layout-normal #taskmenu .special-buttons a::before,
html.layout-large #taskmenu .special-buttons a::before {
  float: none;
  width: 100%;
  height: 42px;
  margin: 0;
  line-height: 42px;
  font-size: 1.15rem;
}

html.layout-normal #taskmenu .special-buttons .inner,
html.layout-large #taskmenu .special-buttons .inner {
  display: none !important;
}

html.layout-normal #taskmenu .special-buttons a:hover,
html.layout-large #taskmenu .special-buttons a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, .09);
}

html.layout-normal #taskmenu .special-buttons a.logout:hover,
html.layout-large #taskmenu .special-buttons a.logout:hover {
  color: #ff6b72 !important;
  background: rgba(227, 38, 46, .13);
}

#layout > div > .header {
  border-color: var(--lb-line);
  background: rgba(250, 250, 251, .96);
  backdrop-filter: blur(12px);
}

#layout > div > .header a.button,
.menu.toolbar a {
  border-radius: 9px;
}

#layout > div > .header a.button:hover,
.menu.toolbar a:hover {
  color: var(--lb-ink);
  background: #eceef1;
}

#layout-sidebar {
  border-color: var(--lb-line);
  background: var(--lb-surface);
}

#layout-sidebar > .header {
  padding-right: .45rem;
  padding-left: .85rem;
  font-weight: 700;
}

#layout-sidebar .folderlist {
  padding: 8px;
}

#layout-sidebar .folderlist li {
  margin: 2px 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
}

#layout-sidebar .folderlist li > a {
  border: 0;
  border-radius: 10px;
  color: #3c4045;
  transition: background-color .14s ease, color .14s ease;
}

#layout-sidebar .folderlist li > a:hover {
  color: var(--lb-ink);
  background: #f1f2f4;
}

#layout-sidebar .folderlist li.selected,
#layout-sidebar .folderlist li.selected > a {
  color: #a8141b;
  background: #fff0f1 !important;
}

#layout-sidebar .folderlist li.selected > a::before {
  color: var(--lb-red);
}

#layout-list {
  border-color: var(--lb-line);
  background: var(--lb-surface);
}

#layout-list .searchbar {
  margin: 8px 10px;
  border: 1px solid var(--lb-line);
  border-radius: 12px;
  background: #f7f8f9;
}

#layout-list .searchbar:focus-within {
  border-color: rgba(227, 38, 46, .45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(227, 38, 46, .08);
}

.messagelist tr td {
  border-color: #eceef0;
  background: #fff;
}

.messagelist tr:hover td {
  background: #fafafa;
}

.messagelist tr.selected td {
  color: var(--lb-ink);
  background: #fff0f1 !important;
}

.messagelist tr.unread td.subject span.subject {
  color: #17181a;
  font-weight: 750;
}

.messagelist td.subject span.fromto,
.messagelist td.subject span.date,
.messagelist td.subject span.size {
  color: var(--lb-muted);
}

.unreadcount,
.folderlist li.mailbox .unreadcount {
  border-radius: 999px;
  background: var(--lb-red) !important;
}

#layout-content {
  background: var(--lb-surface);
}

#layout-content > .header {
  box-shadow: 0 1px 0 var(--lb-line);
}

#layout > div > .footer {
  border-color: var(--lb-line);
  color: var(--lb-muted);
  background: #fafafa;
}

.quota-widget .bar {
  border-color: #e2e4e7;
  border-radius: 999px;
  background: #eceef0;
  overflow: hidden;
}

.quota-widget .bar span {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lb-red), #f0545b);
}

html.dark-mode.layout-normal,
html.dark-mode.layout-large {
  --lb-surface: #1d1f22;
  --lb-surface-soft: #181a1d;
  --lb-line: #303238;
  --lb-muted: #999da5;
}

html.dark-mode #layout-sidebar .folderlist li > a {
  color: #d0d3d8;
}

html.dark-mode #layout-sidebar .folderlist li > a:hover {
  color: #fff;
  background: #292c31;
}

html.dark-mode #layout-sidebar .folderlist li.selected,
html.dark-mode #layout-sidebar .folderlist li.selected > a,
html.dark-mode .messagelist tr.selected td {
  color: #fff;
  background: rgba(227, 38, 46, .17) !important;
}

html.dark-mode #layout-list .searchbar {
  border-color: var(--lb-line);
  background: #24262a;
}

html.dark-mode .messagelist tr td {
  border-color: var(--lb-line);
  background: #1d1f22;
}

html.dark-mode .messagelist tr:hover td {
  background: #24262a;
}

html.dark-mode #layout > div > .header,
html.dark-mode #layout > div > .footer {
  border-color: var(--lb-line);
  background: #222428;
}

/* Signature image upload: expose Roundcube's secure native uploader. */
.lb-signature-upload {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: .45rem 0 .75rem;
  padding: .75rem .85rem;
  border: 1px solid #e1e3e6;
  border-radius: 10px;
  background: #f7f8f9;
}

.lb-signature-upload-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 38px;
  padding: .45rem .9rem !important;
  border: 1px solid var(--lb-red) !important;
  border-radius: 8px !important;
  color: #fff !important;
  background: var(--lb-red) !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(227, 38, 46, .18);
}

.lb-signature-upload-button:hover,
.lb-signature-upload-button:focus {
  color: #fff !important;
  background: #c91f27 !important;
  border-color: #c91f27 !important;
}

.lb-upload-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.lb-signature-upload-help {
  color: var(--lb-muted);
  font-size: .9rem;
}

html.dark-mode .lb-signature-upload {
  border-color: var(--lb-line);
  background: #24262a;
}

/* In-app LB Apparel help center. */
body.lb-help-open {
  overflow: hidden !important;
}

.lb-help-center {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: none;
}

.lb-help-center.is-open {
  display: block;
}

.lb-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 13, .62);
  backdrop-filter: blur(4px);
}

.lb-help-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(720px, 94vw);
  height: 100%;
  color: #25282c;
  background: #fff;
  box-shadow: -18px 0 50px rgba(0, 0, 0, .22);
  animation: lb-help-enter .22s ease-out;
}

@keyframes lb-help-enter {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.lb-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 2.25rem 1.35rem;
  color: #fff;
  background: #17181a;
}

.lb-help-kicker {
  color: #ff555c;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.lb-help-header h2 {
  margin: .35rem 0 0;
  color: #fff;
  font-size: 1.65rem;
  line-height: 1.2;
}

.lb-help-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.lb-help-close:hover,
.lb-help-close:focus {
  background: var(--lb-red);
}

.lb-help-search {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: -1px 2.25rem 0;
  padding: 1.15rem 0 .8rem;
  border-bottom: 1px solid #e5e7e9;
}

.lb-help-search > span {
  color: var(--lb-red);
  font-size: 1.8rem;
  line-height: 1;
}

.lb-help-search input {
  width: 100%;
  min-height: 42px;
  padding: .4rem 0;
  border: 0;
  outline: 0;
  color: #25282c;
  background: transparent;
  font-size: 1rem;
}

.lb-help-quick {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 2.25rem;
  overflow-x: auto;
  background: #f7f8f9;
}

.lb-help-quick > span {
  color: #6d7178;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.lb-help-quick a {
  padding: .42rem .7rem;
  border: 1px solid #dfe1e4;
  border-radius: 999px;
  color: #303338;
  background: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.lb-help-quick a:hover {
  color: #fff;
  border-color: var(--lb-red);
  background: var(--lb-red);
}

.lb-help-content {
  flex: 1;
  padding: 1rem 2.25rem 2rem;
  overflow: auto;
}

.lb-help-topic {
  border-bottom: 1px solid #e5e7e9;
}

.lb-help-topic[hidden] {
  display: none;
}

.lb-help-topic summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem .15rem;
  color: #202226;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.lb-help-topic summary::-webkit-details-marker {
  display: none;
}

.lb-help-topic summary i {
  color: var(--lb-red);
  font-size: 1.35rem;
  font-style: normal;
  transition: transform .15s ease;
}

.lb-help-topic[open] summary i {
  transform: rotate(45deg);
}

.lb-help-answer {
  padding: 0 .15rem 1.2rem;
  color: #4e5258;
  font-size: .94rem;
  line-height: 1.55;
}

.lb-help-answer p,
.lb-help-answer ul,
.lb-help-answer ol {
  margin: .25rem 0 .65rem;
}

.lb-help-answer li {
  margin: .3rem 0;
}

.lb-help-tip,
.lb-help-warning {
  padding: .7rem .8rem;
  border-radius: 7px;
}

.lb-help-tip {
  color: #256143;
  background: #edf8f2;
}

.lb-help-warning {
  color: #8b4c00;
  background: #fff5e6;
}

.lb-help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2.25rem;
  border-top: 1px solid #e2e4e7;
  background: #f7f8f9;
}

.lb-help-footer div {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .8rem;
}

.lb-help-footer div span {
  color: #71757c;
}

.lb-help-pdf {
  flex: 0 0 auto;
  padding: .72rem .95rem;
  border-radius: 7px;
  color: #fff !important;
  background: var(--lb-red);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none !important;
}

.lb-help-pdf:hover {
  background: #c91f27;
}

html.dark-mode .lb-help-panel {
  color: #e8eaed;
  background: #1d1f22;
}

html.dark-mode .lb-help-search,
html.dark-mode .lb-help-topic,
html.dark-mode .lb-help-footer {
  border-color: #35383d;
}

html.dark-mode .lb-help-search input,
html.dark-mode .lb-help-topic summary {
  color: #f2f3f4;
}

html.dark-mode .lb-help-quick,
html.dark-mode .lb-help-footer {
  background: #24262a;
}

html.dark-mode .lb-help-quick a {
  color: #e8eaed;
  border-color: #404349;
  background: #2b2e32;
}

html.dark-mode .lb-help-answer {
  color: #c6c9ce;
}

@media screen and (max-width: 600px) {
  .lb-help-panel {
    width: 100vw;
  }

  .lb-help-header {
    padding: 1.35rem 1.2rem 1rem;
  }

  .lb-help-header h2 {
    font-size: 1.35rem;
  }

  .lb-help-search,
  .lb-help-content {
    margin-left: 0;
    margin-right: 0;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .lb-help-quick {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .lb-help-footer {
    align-items: stretch;
    flex-direction: column;
    padding: .9rem 1.2rem;
  }

  .lb-help-pdf {
    text-align: center;
  }
}

@media screen and (max-width: 600px) {
  .lb-signature-upload {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media screen and (max-width: 768px) {
  #layout-menu .popover-header img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: invert(1);
  }

  #taskmenu .special-buttons a {
    color: #565a60 !important;
  }

  #taskmenu .special-buttons a.logout {
    color: #b51a22 !important;
  }
}
