* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: #f8fafc;
  color: #0f172a;
}

/* Layout */
.layout {
  display: grid;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  grid-template-columns: 240px 1fr;
  grid-template-rows: 64px 1fr;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: #0f172a;
  color: #94a3b8;
  padding: 20px;
  transition: 0.3s;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .label {
  display: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Links */
.sidebar a {
  display: block;
  padding: 10px;
  border-radius: 10px;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 5px;
}

.sidebar a:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.sidebar a.active {
  background: #6366f1;
  color: white;
}

/* Dropdown Menü */
.menu-parent {
  width: 100%;
  background: none;
  border: none;
  color: #94a3b8;
  text-align: left;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.menu-parent:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.arrow {
  font-size: 12px;
  transition: transform 0.2s;
}

.submenu {
  display: none;
  flex-direction: column;
  margin-left: 10px;
}

.submenu a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
}

.submenu a:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.menu-group.open .submenu {
  display: flex;
}

.menu-group.open .arrow {
  transform: rotate(90deg);
}

/* Topbar */
.topbar {
  grid-area: topbar;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid #e2e8f0;
}

.search {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main */
.main {
  grid-area: main;
  padding: 30px;
}

/* Cards */
.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

/* Buttons */
.button {
  background: #6366f1;
  color: white;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

/* Forms */
input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table td, .table th {
  padding: 10px;
  border-top: 1px solid #f1f5f9;
}

/* =========================
   CKEditor Tabellen FIX
   ========================= */

.ck-editor__editable table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.ck-editor__editable table,
.ck-editor__editable th,
.ck-editor__editable td {
  border: 1px solid #333; /* bewusst sichtbar */
}

.ck-editor__editable th {
  background: #eee;
  font-weight: bold;
}

.ck-editor__editable td,
.ck-editor__editable th {
  padding: 8px;
}

/* TinyMCE Content Styling */
.tox .tox-edit-area__iframe {
  background: #fff;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.media-item {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eee;
}

.media-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}