:root{
  /* Light, modern SaaS palette */
  --bg: #f6f7fb;
  --bg2:#eef2ff;
  --panel: rgba(255,255,255,0.75);
  --panel2: rgba(255,255,255,0.92);
  --card: #ffffff;

  --text:#0f172a;
  --muted:#64748b;

  --line:#e5e7eb;
  --line2:#d7dbe3;

  --accent:#4f46e5;   /* indigo */
  --accent2:#06b6d4;  /* cyan */

  --shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
  --shadow2: 0 10px 25px rgba(15, 23, 42, 0.08);

  --radius: 18px;
  --radius2: 14px;
}

html, body{ height:100%; }

body.adminPage{
  margin:0;
  min-height:100vh;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(79,70,229,0.14), transparent 60%),
    radial-gradient(900px 520px at 90% 18%, rgba(6,182,212,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  display:flex;
  flex-direction:column;
}

/* Top bar */
.adminTop{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246,247,251,0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229,231,235,0.9);
}

.adminBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 18px;
  width: 100%;
  box-sizing:border-box;
}

.brand{ display:flex; align-items:center; gap:12px; }
.brandDot{
  width:12px;
  height:12px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, var(--accent2), var(--accent));
  box-shadow: 0 0 0 6px rgba(79,70,229,0.12), 0 12px 26px rgba(79,70,229,0.18);
}
.brandTitle{
  font-weight: 850;
  letter-spacing: 0.2px;
  color: var(--text);
  line-height: 1.05;
}
.brandSub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.adminNav{ display:flex; gap:10px; align-items:center; }
.adminLink{
  color: var(--text);
  text-decoration:none;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(229,231,235,0.95);
  background: rgba(255,255,255,0.75);
}
.adminLink:hover{
  border-color: rgba(215,219,227,1);
  background: #fff;
}

/* Main full */
.adminMainFull{
  flex:1;
  width:100%;
  padding: 16px 18px 18px;
  box-sizing:border-box;
}

/* Cards / Shell */
.adminCard{
  border: 1px solid rgba(229,231,235,0.95);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.70);
  box-shadow: var(--shadow);
}

.adminCardCenter{
  max-width: 520px;
  margin: 9vh auto 0;
  padding: 18px;
  background: rgba(255,255,255,0.85);
}

.adminCardFull{
  width: 100%;
  height: calc(100vh - 66px - 34px);
  padding: 14px;
  box-sizing:border-box;
  overflow: hidden;
  display:flex;
  flex-direction:column;
  background: rgba(255,255,255,0.78);
  border-color: rgba(229,231,235,0.95);
}

/* Typography */
.h2{
  margin: 0 0 10px 0;
  font-size: 18px;
  color: var(--text);
}
.h3{
  margin: 0 0 6px 0;
  font-size: 14px;
  color: var(--text);
}
.muted{ color: var(--muted); }
.small{ font-size: 12px; }

/* Inputs */
.lbl{ display:flex; flex-direction:column; gap:6px; }

input, select, textarea{
  border: 1px solid rgba(229,231,235,1);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input::placeholder, textarea::placeholder{
  color: rgba(100,116,139,0.7);
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(79,70,229,0.45);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.12);
}

/* Buttons */
.btn{
  border: 1px solid rgba(229,231,235,1);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
}
.btn:hover{
  border-color: rgba(215,219,227,1);
  box-shadow: var(--shadow2);
}
.btn.primary{
  border: 1px solid rgba(79,70,229,0.25);
  background: linear-gradient(135deg, rgba(79,70,229,1), rgba(6,182,212,0.95));
  color: #fff;
  box-shadow: 0 12px 26px rgba(79,70,229,0.18);
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:10px 0;
}

/* Head area */
.adminHead{
  display:flex;
  gap:14px;
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(229,231,235,0.95);
}
.whoName{ font-weight: 850; font-size: 14px; color: var(--text); }

/* Tabs: segmented */
.tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
  padding: 6px;
  border: 1px solid rgba(229,231,235,1);
  background: rgba(246,247,251,0.9);
  border-radius: 999px;
}
.tabBtn{
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(15,23,42,0.74);
}
.tabBtn:hover{
  background: rgba(255,255,255,0.85);
  color: var(--text);
}
.tabBtn[aria-selected="true"]{
  border-color: rgba(79,70,229,0.18);
  background: rgba(79,70,229,0.10);
  color: var(--text);
  font-weight: 850;
}

/* Panels (scroll inside) */
.tabPanels{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.tabPanel{
  display:none;
  flex:1;
  min-height:0;
  overflow:auto;
  padding-right: 2px;
}
.tabPanel.active{ display:block; }

/* Small pill */
.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(229,231,235,1);
  background: rgba(255,255,255,0.85);
  font-size: 12px;
  color: var(--muted);
}

/* Table */
.tableWrap{
  overflow:auto;
  border: 1px solid rgba(229,231,235,1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
}

.dataTable{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
}

.dataTable thead th{
  position: sticky;
  top: 0;
  background: rgba(246,247,251,0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(229,231,235,1);
  font-size: 12px;
  color: rgba(100,116,139,0.95);
  text-align:left;
  padding: 12px 12px;
  white-space: nowrap;
  z-index: 2;
}
.dataTable thead tr.filterRow th{
  top: 44px;
  padding: 10px 12px 12px;
  z-index: 1;
  background: rgba(246,247,251,0.96);
}

.dataTable tbody td{
  border-top: 1px solid rgba(229,231,235,0.8);
  padding: 12px 12px;
  font-size: 13px;
  color: rgba(15,23,42,0.92);
  vertical-align: top;
}
.dataTable tbody tr:nth-child(odd) td{ background: rgba(246,247,251,0.45); }
.dataTable tbody tr:hover td{ background: rgba(79,70,229,0.06); }

.sortable{ cursor:pointer; user-select:none; }
.sortIcon{
  font-size: 11px;
  margin-left: 6px;
  color: rgba(100,116,139,0.75);
}

.tableInput, .tableSelect{
  width: 100%;
  padding: 9px 10px;
  border-radius: 14px;
  font-size: 12px;
  border: 1px solid rgba(229,231,235,1);
  background: #fff;
  color: rgba(15,23,42,0.92);
}
.tableInput:focus, .tableSelect:focus{
  border-color: rgba(79,70,229,0.45);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.12);
}

.filter2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px;
}

.cellTitle{ font-weight: 850; color: var(--text); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(229,231,235,1);
  background: rgba(255,255,255,0.85);
  font-size: 12px;
  color: rgba(100,116,139,0.95);
}

.actionsCell{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.smallBtn{
  border: 1px solid rgba(229,231,235,1);
  background: #fff;
  border-radius: 14px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(15,23,42,0.92);
}
.smallBtn:hover{
  border-color: rgba(215,219,227,1);
  box-shadow: 0 10px 20px rgba(15,23,42,0.08);
}
.smallBtn.primary{
  border: 1px solid rgba(79,70,229,0.20);
  background: linear-gradient(135deg, rgba(79,70,229,1), rgba(6,182,212,0.95));
  color:#fff;
}
.smallBtn.link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
}

.miniSelect, .miniInput{
  border: 1px solid rgba(229,231,235,1);
  border-radius: 14px;
  padding: 8px 10px;
  font-size: 12px;
  background: #fff;
  color: rgba(15,23,42,0.92);
}
.miniInput{ width: 160px; }
.miniSelect{ width: 170px; }

/* Detail row */
.detailRow td{
  background: rgba(246,247,251,0.60);
  border-top: 1px solid rgba(229,231,235,1);
}

/* thumbs */
.thumbRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.thumbRow img{
  width: 180px;
  height: 125px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(229,231,235,1);
  box-shadow: 0 16px 35px rgba(15,23,42,0.10);
}

/* ---------- Schema / Felder: klar trennen ---------- */
.schemaHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.schemaGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
  margin-top: 14px;
}
@media(min-width: 1100px){
  .schemaGrid{ grid-template-columns: 380px 1fr; }
}

/* Left + right boxes */
.schemaBox{
  border: 1px solid rgba(229,231,235,1);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 14px 30px rgba(15,23,42,0.08);
}

/* Each Field as separate card */
.fieldRow{
  border: 1px solid rgba(229,231,235,1);
  border-radius: 18px;
  padding: 12px;
  margin-top: 12px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15,23,42,0.06);
  position: relative;
}

/* subtle accent bar */
.fieldRow::before{
  content:"";
  position:absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(79,70,229,0.95), rgba(6,182,212,0.85));
  opacity: 0.9;
}

.fieldTop{
  display:flex;
  gap:10px;
  align-items:flex-end;
  flex-wrap:wrap;
  justify-content:space-between;
  padding-left: 10px; /* room for accent bar */
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(229,231,235,0.9);
}
.fieldTop .small.muted{ margin-bottom: 2px; }

.fieldGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top: 12px;
  padding-left: 10px;
}
@media(min-width: 900px){
  .fieldGrid{ grid-template-columns: 1.2fr 1.1fr 0.7fr 0.6fr; }
}

/* action buttons in field header */
.fieldActions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.fieldActions .smallBtn{
  padding: 7px 10px;
  border-radius: 12px;
}

.code{
  border: 1px solid rgba(229,231,235,1);
  border-radius: 18px;
  padding: 12px;
  background: #0b1220;
  color: #e5e7eb;
  overflow:auto;
  max-height: 360px;
}
.schemaPreview{ margin-top: 14px; }