/* QMC shared navigation structure */
:root {
  --qmc-nav-w: 188px;
  --qmc-nav-bg: #0c1d31;
  --qmc-nav-accent: #2167ed;
}

#qmc-start-nav-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--qmc-nav-w) minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}

#qmc-start-nav-shell.compact {
  --qmc-nav-w: 58px;
}

#qmc-start-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  background: linear-gradient(180deg,#0b2038,#07182a);
  padding: 18px 10px 14px;
  display: flex;
  flex-direction: column;
  color: #fff;
  box-shadow: 8px 0 24px rgba(12,29,49,.12);
}

#qmc-start-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

#qmc-start-brandmark {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: #e33b32;
  color: #fff;
  box-shadow: 0 5px 16px rgba(227,59,50,.25);
  overflow: hidden;
}

#qmc-start-brand-r {
  position: absolute;
  left: 12px;
  bottom: 6px;
  font-family: Arial,sans-serif;
  font-size: 27px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -2px;
  color: #fff;
}

#qmc-start-brand-2 {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 1.5px solid #fff;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial,sans-serif;
  font-size: 9px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
}

#qmc-start-brandtext {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.qmc-start-navitem {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8e4f0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  margin-top: 4px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.qmc-start-navitem:hover {
  background: rgba(255,255,255,.08);
}

.qmc-start-navitem.active {
  background: var(--qmc-nav-accent);
  color: #fff;
}

.qmc-start-navicon {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.qmc-start-navicon svg {
  width: 21px;
  height: 21px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qmc-start-navlabel {
  font-size: 14px;
}

#qmc-start-nav-spacer {
  flex: 1;
}

#qmc-start-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 7px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 10px;
  min-height: 54px;
}

#qmc-start-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: #fff;
  color: #17304e;
  display: grid;
  place-items: center;
  font-weight: 800;
}

#qmc-start-usertext {
  min-width: 0;
}

#qmc-start-username {
  font-weight: 750;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#qmc-start-userrole {
  font-size: 11px;
  color: #9eb1c5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#qmc-start-collapse {
  position: absolute;
  right: -15px;
  top: 21px;
  width: 15px !important;
  height: 32px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  box-sizing: border-box;
  padding: 0 !important;
  border: 1px solid #07182a;
  border-left: 0;
  border-radius: 0 10px 10px 0 !important;
  background: #07182a;
  color: #fff;
  box-shadow: 4px 0 12px rgba(10,28,48,.14);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3;
}

#qmc-start-nav-shell.compact .qmc-start-navlabel,
#qmc-start-nav-shell.compact #qmc-start-brandtext,
#qmc-start-nav-shell.compact #qmc-start-usertext {
  display: none;
}

#qmc-start-nav-shell.compact #qmc-start-sidebar {
  padding-left: 8px;
  padding-right: 8px;
}

#qmc-start-nav-shell.compact .qmc-start-navitem {
  justify-content: center;
  padding: 0;
}

#qmc-start-nav-shell.compact #qmc-start-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

#qmc-start-nav-shell.compact #qmc-start-user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

#qmc-start-content {
  min-width: 0;
  padding: 18px 24px 26px;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed;
  background-color: #eef3f8;
}

#qmc-start-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 50px;
  padding: 0 4px 7px;
  border-bottom: 1px solid #d8e2ec;
}

#qmc-start-greeting {
  font-size: 20px;
  font-weight: 800;
}

#qmc-start-subtitle {
  font-size: 13px;
  color: #617286;
  margin-top: 4px;
}

#qmc-start-headspacer {
  flex: 1;
}

#qmc-start-weather {
  position: absolute;
  left: 34px;
  top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  color: #536579;
  font-size: 12px;
  line-height: 23px;
  white-space: nowrap;
  transform: translateX(-50%);
}

#qmc-start-sun {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  font-size: 18px;
  line-height: 23px;
}

#qmc-start-status-clock {
  position: relative;
  display: block;
  width: max-content;
  margin-left: auto;
}

#qmc-start-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

#qmc-start-time {
  font-size: 23px;
  font-weight: 800;
}

#qmc-start-date {
  font-size: 11px;
  color: #65768a;
  margin-top: 2px;
}

#qmc-start-settings {
  width: 42px;
  height: 42px;
  border: 1px solid #d1dce8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  color: #15304e;
}

#qmc-widget-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-auto-rows: 176px;
  gap: 12px;
  padding-top: 14px;
  align-items: stretch;
  max-width: 1240px;
  margin: 0 auto;
}

.qmc-widget {
  position: relative;
  background: rgba(255,255,255,.96);
  border: 1px solid #d5e0eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15,32,48,.045);
  padding: 15px;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

/* H1 - QMC connection status */
#qmc-start-weather.qmc-connection-checking #qmc-start-sun {
  color: #7b8794;
}

#qmc-start-weather.qmc-connection-online #qmc-start-sun {
  color: #2f9e44;
}

#qmc-start-weather.qmc-connection-offline #qmc-start-sun {
  color: #d64545;
}


/* QMC_RESPONSIVE_DASHBOARD_R9 */

/*
 * Responsive Dashboard.
 *
 * Desktop: urspruengliches Raster.
 * Tablet: zwei Spalten.
 * Smartphone: eine Spalte.
 *
 * Eine Rasterzeile bleibt 176 px hoch.
 * Widget-Groessen werden nicht verdoppelt.
 */

@media screen and (max-width: 820px) {

  body #qmc-widget-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 176px !important;
    grid-auto-flow: row !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-content: stretch !important;
    align-items: stretch !important;
  }

  /*
   * Desktop-Positionen nur in der
   * responsiven Ansicht aufheben.
   */

  body #qmc-widget-grid > * {
    grid-column: auto !important;
    grid-row: span 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    order: 20;
  }

  /*
   * Die ersten vier Widgets folgen der
   * urspruenglichen Desktop-Anordnung.
   */

  body #qmc-widget-grid > .qmc-widget[data-widget="tenants"] {
    order: 0 !important;
  }

  body #qmc-widget-grid > .qmc-widget[data-widget="projects"] {
    order: 1 !important;
  }

  body #qmc-widget-grid > .qmc-widget[data-widget="contacts"] {
    order: 2 !important;
  }

  body #qmc-widget-grid > .qmc-widget[data-widget="documents"] {
    order: 3 !important;
  }

  /*
   * Telefonbereich:
   *
   * TELEFON   | ANRUFLISTE
   * FAVORITEN | ANRUFLISTE
   *
   * Alle drei Elemente behalten ihre
   * urspruenglichen Rasterdimensionen.
   */

  body #qmc-widget-grid > .qmc-widget[data-widget="phone"] {
    order: 4 !important;
    grid-column: auto !important;
    grid-row: span 1 !important;
  }

  body #qmc-widget-grid > .qmc-phone-history-panel:not(.qmc-phone-switch) {
    order: 5 !important;
    grid-column: auto !important;
    grid-row: span 2 !important;
  }

  body #qmc-widget-grid > .qmc-phone-favorites-panel:not(.qmc-phone-switch) {
    order: 6 !important;
    grid-column: auto !important;
    grid-row: span 1 !important;
  }

  /*
   * Alternative Telefonkonfiguration
   * mit Umschalter.
   */

  body #qmc-widget-grid > .qmc-phone-switch {
    order: 5 !important;
    grid-column: auto !important;
    grid-row: span 1 !important;
  }

  /*
   * Breite Widgets:
   * Wetter und Fotos nutzen beide Spalten.
   */

  body #qmc-widget-grid > .qmc-widget[data-widget="weather"],
  body #qmc-widget-grid > .qmc-widget[data-widget="photos"] {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
  }

  /*
   * Lange Listen bleiben innerhalb
   * ihrer Widget-Hoehe scrollbar.
   */

  body #qmc-widget-grid .qmc-tenant-list,
  body #qmc-widget-grid .qmc-projects-live {
    min-height: 0 !important;
    overflow-y: auto !important;
  }

}

/*
 * Smartphone:
 * Eine Spalte, keine horizontalen
 * Widget-Ueberlagerungen.
 */

@media screen and (max-width: 600px) {

  body #qmc-widget-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body #qmc-widget-grid > * {
    grid-column: 1 !important;
  }

  /*
   * Telefon und Favoriten jeweils 1x1.
   * Anrufliste bleibt 1x2.
   */

  body #qmc-widget-grid > .qmc-widget[data-widget="phone"] {
    order: 4 !important;
    grid-row: span 1 !important;
  }

  body #qmc-widget-grid > .qmc-phone-favorites-panel:not(.qmc-phone-switch) {
    order: 5 !important;
    grid-row: span 1 !important;
  }

  body #qmc-widget-grid > .qmc-phone-history-panel:not(.qmc-phone-switch) {
    order: 6 !important;
    grid-row: span 2 !important;
  }

  /*
   * Wetter und Fotos von 2x1 auf 1x1.
   */

  body #qmc-widget-grid > .qmc-widget[data-widget="weather"],
  body #qmc-widget-grid > .qmc-widget[data-widget="photos"] {
    grid-column: 1 !important;
    grid-row: span 1 !important;
  }

}

/* end QMC_RESPONSIVE_DASHBOARD_R9 */

/* QMC_RECENT_DOCUMENTS_HIDDEN_SCROLLBAR */

/* Scrollen bleibt möglich, Scrollleiste wird ausgeblendet. */
.qmc-recent-documents {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.qmc-recent-documents::-webkit-scrollbar {
    display: none;
}
