/* ============================================================
   Alexium Core Studio — base.css (Mock UI Kit)
   ------------------------------------------------------------
   Purpose:
   - Single shared stylesheet for all mock pages:
     index.html, contexts.html, blocks.html, templates.html,
     assets.html, media.html, system.html
   - Dark, neutral “admin UI” aesthetic
   - Minimal dependencies; no fonts required
   ============================================================ */

/* -----------------------------
   1) Design tokens
   ----------------------------- */
:root{
  /* Backgrounds */
  --bg: #0b0f16;
  --bg-2: #0f1623;
  --panel: rgba(255,255,255,.04);
  --panel-2: rgba(255,255,255,.06);

  /* Borders / lines */
  --line: rgba(255,255,255,.10);
  --line-2: rgba(255,255,255,.14);

  /* Text */
  --fg: rgba(255,255,255,.92);
  --fg-2: rgba(255,255,255,.72);
  --fg-3: rgba(255,255,255,.55);

  /* Accents */
  --accent: #7aa6ff;
  --accent-2: #a0ffd5;
  --danger: #ff5e6a;
  --warn: #ffcf5a;
  --ok: #65e08a;

  /* Shadows */
  --shadow: 0 8px 30px rgba(0,0,0,.45);

  /* Radii */
  --r-xs: 10px;
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 18px;

  /* Spacing */
  --p-1: 10px;
  --p-2: 14px;
  --p-3: 18px;

  /* Layout */
  --topbar-h: 62px;
  --sidebar-w: 280px;

  /* Typography */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

  /* Focus */
  --focus: 0 0 0 0px rgba(122,166,255,.50);

  /* Ax token aliases (new canonical tokens) */
  --ax-bg: var(--bg);
  --ax-bg-2: var(--bg-2);
  --ax-surface: var(--panel);
  --ax-surface-2: var(--panel-2);
  --ax-border: var(--line);
  --ax-border-2: var(--line-2);
  --ax-fg: var(--fg);
  --ax-fg-2: var(--fg-2);
  --ax-fg-3: var(--fg-3);
  --ax-accent: var(--accent);
  --ax-accent-2: var(--accent-2);
  --ax-danger: var(--danger);
  --ax-warn: var(--warn);
  --ax-ok: var(--ok);
  --ax-shadow: var(--shadow);
  --ax-r-xs: var(--r-xs);
  --ax-r-sm: var(--r-sm);
  --ax-r-md: var(--r-md);
  --ax-r-lg: var(--r-lg);
  --ax-p-1: var(--p-1);
  --ax-p-2: var(--p-2);
  --ax-p-3: var(--p-3);
  --ax-topbar-h: var(--topbar-h);
  --ax-sidebar-w: var(--sidebar-w);
  --ax-mono: var(--mono);
  --ax-sans: var(--sans);
  --ax-focus: var(--focus);

}

/* -----------------------------
   2) Reset / base
   ----------------------------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  color: var(--fg);
  background:
    radial-gradient(900px 500px at 30% 0%, rgba(122,166,255,.10), transparent 60%),
    radial-gradient(700px 400px at 90% 10%, rgba(160,255,213,.08), transparent 60%),
    var(--bg);
  background-attachment: fixed
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:none; }
button, input, select, textarea{ font:inherit; }
img{ max-width:100%; display:block; }

::selection{
  background: rgba(122,166,255,.25);
}

/* -----------------------------
   3) Utilities
   ----------------------------- */
.ax-spacer{ flex:1; }
.row{ display:flex; align-items:center; }
.ax-small{ font-size:12px; color: var(--fg-2); line-height:1.35; }
.hint{ color: var(--fg-3); }
.mono{ font-family: var(--mono); }
.hr{
  height:1px;
  background: var(--line);
  margin: 12px 0;
}
kbd{
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--fg);
}

/* -----------------------------
   4) App layout
   ----------------------------- */
.ax-app, .ax-app{
  min-height:100vh;
  display:grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
}

.ax-topbar, .ax-topbar{
  grid-area: topbar;
  height: var(--topbar-h);
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  backdrop-filter: blur(10px);
}

.ax-sidebar, .ax-sidebar{
  grid-area: sidebar;
  border-right: 1px solid var(--line);
  padding: 14px;
  overflow:auto;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
}

.main, .ax-main{
  grid-area: main;
  padding: 18px 18px 28px;
  overflow:auto;
}

/* Responsive: collapse sidebar */
@media (max-width: 980px){
  .ax-app, .ax-app{
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .ax-sidebar, .ax-sidebar{ display:none; }
  .main, .ax-main{ padding: 14px; }
}

/* -----------------------------
   5) Brand / topbar elements
   ----------------------------- */
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 220px;
}

.brand-mark{
  width: 45px;
  height: 45px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

.brand-title b{
  display:block;
  line-height:1.1;
  letter-spacing:.2px;
}
.brand-title span{
  display:block;
  font-size:12px;
  color: var(--fg-3);
  margin-top:2px;
}

/* pills */
.ax-pills{ display:flex; align-items:center; gap:10px; }
.ax-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--fg-2);
  font-size: 12px;
}
.ax-pill strong{ font-weight:600; }
.dot{
  width: 8px; height: 8px; border-radius: 99px;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(101,224,138,.15);
}

.ax-pill.env.is-stage { 
  color: var(--danger);
}

.ax-pill.env.is-live { 
  color: var(--ok);
}

/* search */
.search{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.10);
  min-width: 280px;
  max-width: 520px;
  flex: 1;
}
.search .icon{ opacity:.7; }
.search input{
  width:100%;
  border:0;
  outline:0;
  background: transparent;
  color: var(--fg);
}
.search .hint{ margin-left:auto; display:flex; gap:6px; align-items:center; }

/* user */
.ax-user{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.avatar{
  width: 30px; height: 30px;
  border-radius: 999px;
  background: radial-gradient(16px 16px at 30% 30%, rgba(255,255,255,.55), transparent 60%),
              rgba(122,166,255,.20);
  border: 1px solid rgba(255,255,255,.12);
}
.ax-user .meta b{ display:block; font-size:13px; }
.ax-user .meta span{ display:block; font-size:12px; color: var(--fg-3); margin-top:1px; }

/* -----------------------------
   6) Sidebar nav
   ----------------------------- */
.project-card{
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom: 12px;
}
.project-card h3{
  margin:0;
  font-size: 13px;
  letter-spacing:.2px;
}
.project-card p{
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--fg-3);
}

.nav-section{ margin: 14px 0 0; }
.ax-nav-title{
  font-size: 12px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 8px;
}
.ax-nav{ display:flex; flex-direction:column; gap:6px; }
.ax-nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--fg-2);
}
.ax-nav a .left{
  display:flex;
  align-items:center;
  gap: 10px;
}
.ax-nav a .icon{
  width: 22px; height: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: var(--fg);
}
.ax-nav a:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: var(--fg);
}
.ax-nav a.active{
  background: rgba(122,166,255,.12);
  border-color: rgba(122,166,255,.24);
  color: var(--fg);
}

/* -----------------------------
   7) Page head
   ----------------------------- */
.page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.page-title h1{
  margin:0;
  font-size: 22px;
  letter-spacing:.2px;
}
.page-title p{
  margin:6px 0 0;
  color: var(--fg-3);
  font-size: 13px;
}

/* -----------------------------
   8) Buttons / badges
   ----------------------------- */
.actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.ax-btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .04s ease, background .12s ease, border-color .12s ease;
}
.ax-btn:hover{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
}
.ax-btn:active{ transform: translateY(1px); }
.ax-btn.primary, .ax-btn.ax-btn--primary {
  background: rgba(122,166,255,.18);
  border-color: rgba(122,166,255,.28);
}
.ax-btn.primary:hover, .ax-btn.ax-btn--primary:hover {
  background: rgba(122,166,255,.22);
  border-color: rgba(122,166,255,.38);
}
.ax-btn.danger, .ax-btn.ax-btn--danger {
  background: rgba(255,94,106,.12);
  border-color: rgba(255,94,106,.26);
}
.ax-btn.danger:hover, .ax-btn.ax-btn--danger:hover {
  background: rgba(255,94,106,.16);
  border-color: rgba(255,94,106,.34);
}

.iconbtn{
  width: 30px;
  height: 30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--fg);
  cursor:pointer;
}
.iconbtn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}

.ax-badge, .ax-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--fg-2);
}
.ax-badge.mono{ font-family: var(--mono); }

/* -----------------------------
   9) Cards, split, grids
   ----------------------------- */
.ax-card{
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.03));
}
.card-head h2{
  margin:0;
  font-size: 16px;
  letter-spacing:.2px;
}
.card-body{ padding: 14px 16px; }

.split{
  display:grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  align-items:start;
}
@media (max-width: 980px){
  .split{ grid-template-columns: 1fr; }
}

/* dashboard helper */
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 680px){
  .grid2{ grid-template-columns: 1fr; }
}
.stat{
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.stat .k{ font-size: 12px; color: var(--fg-3); }
.stat .v{ font-size: 22px; font-weight:700; margin-top:4px; }

/* list (system dashboard) */
.list{ display:flex; flex-direction:column; gap:10px; }
.list-item{
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 10px 12px;
}
.list-item.ok{ border-color: rgba(101,224,138,.22); }
.list-item.warn{ border-color: rgba(255,207,90,.22); }
.list-item b{ display:block; }
.list-item .hint{ margin-top:2px; }

/* -----------------------------
   10) Forms
   ----------------------------- */
.form{ display:flex; flex-direction:column; gap: 12px; }
.field label{
  display:block;
  font-size: 12px;
  color: var(--fg-3);
  margin-bottom: 6px;
}
select, textarea{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  color: var(--fg);
  outline:none;
}
textarea{ resize: vertical; min-height: 90px; }
.ax-input:focus, select:focus, textarea:focus{
  box-shadow: var(--focus);
  border-color: rgba(122,166,255,.35);
}

/* -----------------------------
   11) Tabs
   ----------------------------- */
.ax-tabs{
  display:flex;
  gap: 6px;
  padding: 10px 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ax-tab{
  padding: 8px 10px;
  border-radius: 12px 12px 0 0;
  color: var(--fg-2);
  cursor:pointer;
  border: 1px solid transparent;
  border-bottom: 0;
}
.ax-tab:hover{
  color: var(--fg);
  background: rgba(255,255,255,.03);
}
.ax-tab.active, .ax-tab.is-active {
  color: var(--fg);
  background: rgba(122,166,255,.10);
  border-color: rgba(122,166,255,.22);
}

/* -----------------------------
   12) Tables
   ----------------------------- */
.ax-table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.12);
}
.ax-table th td{
  text-align:left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: top;
}
.ax-table th{
  font-size: 12px;
  color: var(--fg-3);
  background: rgba(255,255,255,.03);
  letter-spacing:.02em;
}
.ax-table tbody tr:hover{
  background: rgba(255,255,255,.03);
}
.ax-table tbody tr.active{
  background: rgba(122,166,255,.10);
}

/* -----------------------------
   13) Tree (contexts)
   ----------------------------- */
.tree{
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.tree-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.tree-tools{ display:flex; gap:8px; }
.tree-body{ padding: 10px 12px 14px; }
.tree-body ul{ list-style:none; margin:0; padding:0; }
.tree-body li{ margin: 0; padding: 0; }
.tree-body .indent{ padding-left: 18px; margin-top: 4px; }

.node{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--fg-2);
  cursor:pointer;
  user-select:none;
}
.node .left{ display:flex; align-items:center; gap: 10px; }
.node .icon{
  width: 22px; height: 22px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: var(--fg);
}
.node:hover{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
  color: var(--fg);
}
.node.active{
  background: rgba(122,166,255,.12);
  border-color: rgba(122,166,255,.26);
  color: var(--fg);
}
.tree-body .hr{
  margin: 10px 0;
  background: rgba(255,255,255,.08);
}

/* -----------------------------
   14) Block editor (contexts/blocks)
   ----------------------------- */
.block-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.block-list{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.block{
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  overflow:hidden;
}
.bh{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.bh .left{
  display:flex;
  align-items:center;
  gap: 12px;
}
.bh .meta{
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 2px;
}
.bh .tools{
  display:flex;
  align-items:center;
  gap: 6px;
}
.bb{ padding: 12px 12px 14px; }

/* -----------------------------
   15) Toast (notifications)
   ----------------------------- */
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 320px;
  padding: 12px 12px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,14,20,.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events:none;
  transition: opacity .16s ease, transform .16s ease;
}
.toast b{ display:block; }
.toast p{ margin: 4px 0 0; color: var(--fg-2); font-size: 12px; }
.toast.show{
  opacity: 1;
  transform: translateY(0);
}

/* -----------------------------
   16) Accessibility
   ----------------------------- */
.ax-btn:focus, .iconbtn:focus, .node:focus:focus, a:focus{
  outline: none;
  box-shadow: var(--focus);
}

/* -----------------------------
   17) Minor polishing
   ----------------------------- */
select{
  cursor:pointer;
}
input[type="checkbox"]{
  accent-color: var(--accent);
}


/* ============================================================
   Topbar dropdown (Login/User) — Alexium base.css aligned
   Requires markup:
   - container: .ax-user[data-user]
   - toggle: .ax-user-btn (button)
   - dropdown: .ax-user-menu (with [hidden])
   - optional: .hint.error
   ============================================================ */

.ax-user[data-user]{
  position: relative; /* anchor for dropdown */
}

/* make the toggle button look like part of the existing .ax-user chip */
.ax-user .ax-user-btn{
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;

  display: flex;
  align-items: center;
  gap: 10px;
}

.ax-user .ax-user-btn:focus{
  outline: none;
  box-shadow: var(--focus);
  border-radius: 12px;
}

/* If you render name/role inside the button, keep typography consistent */
.ax-user .ax-user-btn b{
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.ax-user .ax-user-btn span{
  display: block;
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 1px;
}

/* Dropdown panel */
.ax-user .ax-user-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1200;

  min-width: 260px;
  padding: 12px;

  border-radius: var(--r-md);
  border: 1px solid var(--line);

  /* ALT (entfernen):
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  backdrop-filter: blur(10px);
  */

  /* NEU: opaker Hintergrund */
  background: var(--bg);
  box-shadow: var(--shadow);

  color: var(--fg);
}

.ax-user .ax-user-menu[hidden]{
  display: none;
}

/* small arrow */
.ax-user .ax-user-menu::before{
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;

  width: 12px;
  height: 12px;

  background: rgba(255,255,255,.05);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);

  transform: rotate(45deg);
}

/* Forms inside dropdown */
.ax-user .ax-user-menu form{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ax-user .ax-user-menu label.small{
  display: block;
  font-size: 12px;
  color: var(--fg-3);
  margin: 0 0 6px;
}

/* Inputs should match existing form styling but be a bit tighter for dropdowns */
.ax-user .ax-user-menu .ax-user .ax-user-menu input[type="text"],
.ax-user .ax-user-menu input[type="password"]{
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  color: var(--fg);
  outline: none;
}

.ax-user .ax-user-menu .ax-input:focus,
.ax-user .ax-user-menu input[type="text"]:focus,
.ax-user .ax-user-menu input[type="password"]:focus{
  box-shadow: var(--focus);
  border-color: rgba(122,166,255,.35);
}

/* Button row (if you use a flex container) */
.ax-user .ax-user-menu .actions,
.ax-user .ax-user-menu .menu-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

/* Error / hint line consistent with tokens */
.ax-user .ax-user-menu .hint{
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.35;
}

.ax-user .ax-user-menu .hint.error{
  color: var(--danger);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,94,106,.26);
  background: rgba(255,94,106,.10);
}

/* Optional: menu separators / items */
.ax-user .ax-user-menu .menu-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--fg-2);
  cursor: pointer;
}

.ax-user .ax-user-menu .menu-item:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: var(--fg);
}

/* Prevent dropdown from spilling off small screens */
@media (max-width: 520px){
  .ax-user .ax-user-menu{
    right: -6px;
    min-width: 240px;
  }
  .ax-user .ax-user-menu::before{
    right: 22px;
  }
}


/* ============================================================
   Sidebar Accordion — Alexium base.css aligned
   Requires markup:
   - .ax-acc-item [data-acc-item]
   - button.acc-trigger [data-acc-trigger]
   - .ax-acc-panel [data-acc-panel]
   - optional admin separator: .ax-nav-sep, .nav-group-label
   ============================================================ */

/* Accordion item container */
.ax-acc-item{ border-radius: 14px; }

.ax-acc-trigger{
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-2);
  width: 100%;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 9px 10px;
  border-radius: 12px;
  text-align: left;
}
.ax-acc-trigger:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: var(--fg);
}
.ax-acc-trigger:focus{
  outline: none;
  box-shadow: var(--focus);
}

/* caret */
.ax-acc-trigger::after{
  content: "";
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border-right: 2px solid rgba(255,255,255,.35);
  border-bottom: 2px solid rgba(255,255,255,.35);
  transform: rotate(-45deg);
  transition: transform .12s ease, border-color .12s ease;
}
.ax-acc-trigger[aria-expanded="true"]::after{
  transform: rotate(45deg);
  border-color: rgba(122,166,255,.55);
}

.ax-acc-panel{
  display:flex;
  flex-direction:column;
  gap: 6px;
  padding: 6px 0 8px 0;
}
.ax-acc-panel a{ margin-left: 12px; font-size: 13px; }

/* IMPORTANT: make hidden actually hide (fix for display:flex) */
.ax-acc-panel[hidden]{ display:none !important; }

.ax-nav-sep{ height: 1px; background: var(--line); margin: 12px 0 10px; }
.nav-group-label{
  font-size: 12px; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 8px;
}


.ax-acc-trigger .left{
  display:flex;
  align-items:center;
  gap: 10px;
}

.ax-acc-trigger .icon{
  width: 22px;
  height: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: var(--fg);
}

/* ============================================================
   Sidebar – Submenu Accordions
   ============================================================ */

/* --------
   Ebene 2 (Sub-Akkordeon-Container)
   -------- */
.ax-acc-sub{
  margin-left: 14px;                 /* visuelle Einrückung */
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

/* --------
   Trigger wie normale Links stylen
   -------- */
.ax-acc-sub-trigger{
  appearance: none;
  border: 1px solid transparent;
  background: transparent;

  /* exakt wie .ax-nav a */
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding: 9px 10px;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 400;
  color: var(--fg-2);

  cursor: pointer;
  width: 100%;
  text-align: left;
}

.ax-acc-sub-trigger:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: var(--fg);
}

.ax-acc-sub-trigger:focus{
  outline: none;
  box-shadow: var(--focus);
}

/* --------
   Caret kleiner & subtiler als Top-Level
   -------- */
.ax-acc-sub-trigger::after{
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 8px;

  border-right: 2px solid rgba(255,255,255,.30);
  border-bottom: 2px solid rgba(255,255,255,.30);
  transform: rotate(-45deg);
  transition: transform .12s ease;
}

.ax-acc-sub-trigger[aria-expanded="true"]::after{
  transform: rotate(45deg);
}

/* --------
   Panel Einrückung (Ebene 3)
   -------- */
.ax-acc-sub-panel{
  display:flex;
  flex-direction:column;
  gap: 6px;

  margin-left: 16px;   /* weitere Einrückung */
  padding: 6px 0 6px;
}

/* Endpunkte bleiben normale Links, aber eingerückt */
.ax-acc-sub-panel a{
  padding-left: 6px;
  font-size: 14px;     /* identisch zu .ax-nav a */
}

/* --------
   Sicherheit: hidden muss immer greifen
   -------- */
.ax-acc-sub-panel[hidden]{
  display:none !important;
}

.ax-acc-panel{
  overflow: hidden;
  transition: height 0.3s ease;
}

/* während Animation kein display:none erzwingen */
.ax-acc-panel.is-animating{
  display: block !important;
}


.ax-acc-panel{
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.ax-acc-panel > .ax-acc-inner{
  overflow: hidden;
}

/* Closed state: no clicks inside */
.ax-acc-item:not(.is-open) > .ax-acc-panel{
  pointer-events: none;
}

/* Open state */
.ax-acc-item.is-open > .ax-acc-panel{
  grid-template-rows: 1fr;
  pointer-events: auto;
}

/* Optional: reduce motion */
@media (prefers-reduced-motion: reduce){
  .ax-acc-panel{ transition: none; }
}




/* Debug Classes*/
/* debug.css — Styling for DebugView listings (Alexium)
   Scope: keep it safe; only touch debug view / pre blocks. */

.ax-page .ax-card pre {
  /* Layout */
  display: block;
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;

  /* Typography */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.35;

  /* Colors */
  color: #e6e6e6;
  background: #0f1115;

  /* Borders / depth */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);

  /* Overflow behaviour */
  overflow: auto;
  max-height: 70vh;

  /* Print_r output is irregular: allow wrapping but keep indentation readable */
  white-space: pre-wrap;
  word-break: break-word;

  /* Nice scrolling on touch devices */
  -webkit-overflow-scrolling: touch;
}

/* Optional: add a subtle top "label" bar effect for the pre blocks */
.ax-page .ax-card pre::selection {
  background: rgba(255, 255, 255, 0.18);
}

/* Improve card spacing specifically on debug page */
.ax-page .ax-card.ax-mt {
  margin-top: 1rem;
}

/* Headline spacing in debug view */
.ax-page .ax-card h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.2px;
}

/* Make large arrays easier to navigate */
.ax-page .ax-card pre {
  scrollbar-width: thin;                  /* Firefox */
  scrollbar-color: rgba(255,255,255,0.25) rgba(255,255,255,0.06);
}

/* Chromium/WebKit scrollbars (optional but helps) */
.ax-page .ax-card pre::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.ax-page .ax-card pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.ax-page .ax-card pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.06);
}
.ax-page .ax-card pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.30);
}

/* Small hint text on debug page */
.ax-page .ax-muted {
  opacity: 0.75;
}


.ax-shell-debug {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(820px, calc(100vw - 32px));
  max-height: 75vh;
  overflow: hidden;

  background: #0f1115;
  color: #e6e6e6;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  z-index: 99999;
}

.ax-shell-debug__bar {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;

  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

.ax-shell-debug__hint {
  opacity: 0.75;
  font-size: 0.85rem;
  margin-left: auto;
}

.ax-shell-debug__close {
  color: inherit;
  opacity: 0.85;
  text-decoration: underline;
  font-size: 0.9rem;
  margin-left: 12px;
}

.ax-shell-debug__pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  max-height: calc(75vh - 48px);

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.35;

  white-space: pre-wrap;
  word-break: break-word;

  -webkit-overflow-scrolling: touch;
}


.ax-shell-debug__close{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: inherit;
  opacity: 0.9;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none; /* falls <a> */
}
.ax-shell-debug__close:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}


.ax-shell-debug__body{
  padding: 12px;
  overflow: auto;
  max-height: calc(75vh - 48px);
}

.ax-shell-debug__section{
  margin-bottom: 14px;
}

.ax-shell-debug__section h3{
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  letter-spacing: .2px;
  opacity: 0.9;
}

/* pre im Overlay nicht doppelt paddings geben */
.ax-shell-debug__section .ax-shell-debug__pre{
  max-height: none; /* body scrollt */
}


.ax-user .ax-user-menu{
  padding-top: 34px; /* Platz für das X */
}

.ax-user .ax-user-menu__close{
  position: absolute;
  top: 8px;
  right: 8px;

  width: 28px;
  height: 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  border-radius: 10px;

  color: var(--fg);
  font-size: 18px;
  font-weight: 700;

  cursor: pointer;
  z-index: 1300;
}

.ax-user .ax-user-menu__close:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.26);
}


.ax-topbar, .ax-topbar{
  position: relative;
  z-index: 1000;
  overflow: visible;
}

/* User-Chip als sicherer Anchor + nach vorne holen */
.ax-user[data-user]{
  position: relative;
  z-index: 2000;
}

/* Dropdown: immer ganz oben + klickbar */
.ax-user .ax-user-menu{
  position: absolute;
  z-index: 3000;
  pointer-events: auto;
}

/* Der kleine Pfeil darf nie Events abfangen */
.ax-user .ax-user-menu::before{
  pointer-events: none;
}


/* ===========================================================
   Ax UI v1 — Canonical classnames (new)
   These classes are the contract for all Partial Views.
   Legacy classnames remain as aliases where practical.
   =========================================================== */

/* ---- Typography helpers ---- */
.ax-title{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0;
}
.ax-subtitle{
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--ax-fg-3);
}

/* ---- Card ---- */
.ax-card__header, .card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.ax-card__body{
  padding: 14px 16px;
}

/* ---- Toolbar / Field ---- */
.ax-toolbar{
  display:flex;
  gap: 12px;
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap:wrap;
  padding: 12px 16px;
}
.ax-field, .field{
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 220px;
}
.ax-label{
  display:block;
  font-size: 12px;
  color: var(--ax-fg-3);
}
.ax-input{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  color: var(--ax-fg);
  outline: none;
}
.ax-select{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  color: var(--ax-fg);
  outline: none;
}

/* ---- Buttons ---- */
.ax-btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--ax-fg);
  padding: 8px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .04s ease, background .12s ease, border-color .12s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  text-decoration:none;
  line-height: 1.1;
}
.ax-btn:hover:hover{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
}
.ax-btn:active:active{
  transform: translateY(1px);
}
.ax-btn--primary.primary{
  background: rgba(122,166,255,.18);
  border-color: rgba(122,166,255,.28);
}
.ax-btn--primary:hover.primary:hover{
  background: rgba(122,166,255,.22);
  border-color: rgba(122,166,255,.38);
}
.ax-btn--danger.danger{
  background: rgba(255,94,106,.12);
  border-color: rgba(255,94,106,.26);
}
.ax-btn--danger:hover.danger:hover{
  background: rgba(255,94,106,.16);
  border-color: rgba(255,94,106,.34);
}
.ax-btn--ghost{
  background: transparent;
  border-color: rgba(255,255,255,.14);
}
.ax-btn--ghost:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.22);
}
.ax-btn--sm{
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

/* ---- Badges ---- */
.ax-badge, .ax-badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--ax-fg-2);
  line-height: 1;
}
.ax-badge--ok{
  background: rgba(54,214,143,.10);
  border-color: rgba(54,214,143,.24);
  color: rgba(200,255,230,.92);
}
.ax-badge--muted{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
  color: var(--ax-fg-3);
}
.ax-badge--warn{
  background: rgba(255,200,102,.10);
  border-color: rgba(255,200,102,.22);
  color: rgba(255,238,208,.92);
}
.ax-badge--danger{
  background: rgba(255,94,106,.10);
  border-color: rgba(255,94,106,.22);
  color: rgba(255,220,224,.92);
}

/* ---- Table helpers ---- */
.ax-tablewrap{
  overflow:auto;
  padding: 0 16px 16px 16px;
}
.ax-empty{
  text-align:center;
  color: var(--ax-fg-3);
  padding: 16px;
}
.ax-strong{
  font-weight: 700;
}
.ax-actions, .actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* ---- Focus (accessibility) ---- */
.ax-btn:focus,
.ax-input:focus,
.ax-select:focus,
.ax-tab:focus,
a:focus{
  outline: none;
  box-shadow: var(--ax-focus);
}
