body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f8f6f1;
  height: 90px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);

  /* -- Inhalt zentrieren -- */
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.layout-header-logo {
  width: 45px;
  height: 45px;
  margin-right: 26px;
}

.layout-header-logo img {
  max-width: 100%;
  height: auto;
}

.layout-header-text {
  font-size: 24px;
  font-weight: 900;
  color: #3a5547;
}

.layout-header-startseite {
  margin-left: auto;
  margin-right: 16px;
}

.startseite-button {
  background: #486959;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  width: 108px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  margin: 5px;
}

.layout-seitenleiste {
  display: flex;
  flex-direction: row;
  flex: 1;
  margin-top: 90px;
  height: calc(100vh - 90px);
}

aside {
  flex: 0 0 320px;
  background: #ebe2d3;
  transition: flex-basis 0.25s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  padding: 10px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #3a5547;
}

#sidebar-schliessen {
  margin-left: auto;
}

aside.collapsed {
  width: 0 !important;
  overflow: hidden;
  flex: 0 0 0;
}

.widget-oberthemen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 8px;
  justify-items: center;
}

.oberthemen-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 70px;
  height: 70px;
  align-items: center;
  gap: 5px;
  background: #d9e2d8;
  border: 1px solid #c3cec3;
  border-radius: 7px;
  cursor: pointer;
  color: #446556;
  font-size: 12px;
}

.oberthemen-button:hover {
  background: #e4ece2;
  color: #3e5e50;
  border: 1px solid #b8c7ba;
}

.oberthemen-button.aktiv {
  background: #bdd0c0;
  color: #355346;
  border: 1px solid #9fb6a3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.oberthemen-button svg {
  width: 36px;
  height: 36px;
}

.widget-unterthemen-hintergrund {
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
  display: flex;
}

.widget-unterthemen-planung {
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
  display: none;
}

.widget-unterthemen-klasse {
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
  display: none;
}

.widget-unterthemen-werkzeuge {
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
  display: none;
}

.unterthemen-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #4f6470;
  font-size: 14px;
  cursor: pointer;
  background: #f3eee4;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.unterthemen-button:hover {
  background: #e7ecef;
  border-color: #d6dee3;
}

.unterthemen-button.aktiv {
  background: #dce4e8;
  border-color: #c4d2da;
  color: #3f5561;
}

.panel-bereich {
  display: none;
  overflow-y: auto;
  flex: 1;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #cec8bb;
}

.canvas-bereich {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #cec8bb;
}

.canvas {
  width: 1280px;
  height: 720px;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
}

.canvas-toolbar {
  background: #f3eee4;
  height: 48px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}

#tafelbildname {
  background: #e8e2d6;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #3a5547;
  width: 160px;
  padding: 0 8px;
  height: 28px;
}

#speicher-status {
  font-size: 12px;
  color: #8a7f72;
  white-space: nowrap;
}

.button-toolbar {
  background: transparent;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  cursor: pointer;
  height: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a5547;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
}

.button-toolbar:hover {
  background: #e8e2d6;
}

.toolbar-strich {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.4);
}

.strich {
  display: none;
  width: 100%;
  height: 2px;
  background: rgba(0, 0, 0, 0.2);
}

.strich.aktiv {
  display: block;
}

.canvas-toolbarunten {
  background: #f3eee4;
  height: 48px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}

.seiten-auswahl {
  background: #486959;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  width: 68px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
}

.neueseite {
  background: transparent;
  border: 1.5px dashed rgba(0, 0, 0, 0.12);
  border-radius: 50px;
  cursor: pointer;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #666;
}

.canvas-objekt {
  cursor: move;
  box-sizing: border-box;
  padding: 4px;
}

.canvas-objekt.ausgewaehlt {
  border: 2px solid #3b82f6;
}

.canvas-objekt.ausgewaehlt .btn-loeschen {
  display: flex;
}

.btn-loeschen {
  position: absolute;
  display: none;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background-color: red;
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.btn-resize {
  position: absolute;
  display: none;
  bottom: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background-color: green;
  border-radius: 50%;
  cursor: se-resize;
}

.canvas-objekt.ausgewaehlt .btn-resize {
  display: block;
}

.sidebar-toggle {
  background: transparent;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

#sidebar-oeffnen {
  display: none;
}

#fullscreen-oeffnen {
  margin-left: auto;
}

#fullscreen-schliessen {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #333;
}

/* Vollbildmodus (eigene Implementierung) */
body.vollbild-modus nav,
body.vollbild-modus aside,
body.vollbild-modus .canvas-toolbar {
  display: none;
}

body.vollbild-modus .layout-seitenleiste {
  margin-top: 0;
  height: 100vh;
}

body.vollbild-modus .canvas-bereich {
  padding: 0;
}

body.vollbild-modus #fullscreen-schliessen {
  display: flex;
}