
/* Base safety to prevent theme overrides / overflow */
.mk-ent-float, .mk-ent-float *,.mk-ent-popover, .mk-ent-popover *, .mk-ent-dashboard, .mk-ent-dashboard *{
  box-sizing:border-box;
}
.mk-ent-user-icon{width:18px;height:18px;display:inline-block;flex:0 0 18px;background-repeat:no-repeat!important;background-position:center!important;background-size:contain!important;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23111" d="M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5Zm0 2c-4.418 0-8 2.239-8 5v1h16v-1c0-2.761-3.582-5-8-5Z"/></svg>')!important}
.mk-ent-initials{width:18px;height:18px;display:flex;align-items:center;justify-content:center;font-weight:800;letter-spacing:.5px;line-height:1}

/* Floating icon -> hover expands to 'Konto' */
.mk-ent-float{position:fixed;right:18px;z-index:9998}
.mk-ent-float-btn{
  display:flex;align-items:center;gap:10px;
  height:44px;
  width:44px;
  padding:0 14px 0 13px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.15);
  background:#fff;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.10);
  overflow:hidden;
  transition:width .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mk-ent-float-btn:hover{width:118px;transform:translateY(-1px);justify-content:flex-start;padding:0 14px 0 13px}
.mk-ent-float-text{
  white-space:nowrap;
  opacity:0;
  transform:translateX(-6px);
  transition:opacity .16s ease, transform .16s ease;
  font-weight:800;
}
.mk-ent-float-btn:hover .mk-ent-float-text{opacity:1;transform:translateX(0)}

/* Floating badge (Neuigkeiten count) */
/* Badge is positioned on the wrapper (.mk-ent-float) so it never gets clipped */
.mk-ent-float-badge{
  position:absolute;
  top:0;
  right:0;
  transform:translate(55%,-55%);
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#d63638;
  color:#fff;
  font-size:12px;
  font-weight:800;
  display:none;
  align-items:center;
  justify-content:center;
  line-height:20px;
  z-index:9999;
  box-shadow:0 6px 16px rgba(0,0,0,.18);
}

/* Small popover (rectangle block) */
.mk-ent-popover{position:fixed;inset:0;z-index:10001;pointer-events:none;display:none}
.mk-ent-popover.is-open{pointer-events:auto;display:block}
.mk-ent-popover-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.06);opacity:0;transition:opacity .18s ease}
.mk-ent-popover.is-open .mk-ent-popover-backdrop{opacity:1}
.mk-ent-popover-box{
  position:absolute;
  top:72px;
  right:18px;
  width:260px;
  max-width:92vw;
  background:#fff;
  border:1px solid rgba(0,0,0,.15);
  border-radius:12px;
  box-shadow:0 10px 26px rgba(0,0,0,.10);
  padding:8px;
  opacity:0;
  transform:translateY(-6px);
  transition:opacity .18s ease, transform .18s ease;
;overflow:hidden}
.mk-ent-popover.is-open .mk-ent-popover-box{opacity:1;transform:translateY(0)}
.mk-ent-popover-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.mk-ent-popover-title{font-size:14px;font-weight:900}
.mk-ent-close{border:none;background:transparent;font-size:22px;cursor:pointer;line-height:1}
.mk-ent-popover-body{margin-top:8px;max-height:60vh;overflow:auto;padding-right:2px;overflow-x:hidden}

/* Tabs + forms (fix overlap) */
.mk-ent-tabs{display:flex;gap:6px;margin-top:4px}
.mk-ent-tab{border:1px solid rgba(0,0,0,.15);background:#f7f7f7;border-radius:10px;padding:6px 10px;cursor:pointer}
.mk-ent-tab.active{background:#111;color:#fff;border-color:#111}
.mk-ent-tab-body{display:none}
.mk-ent-tab-body.active{display:block}

.mk-ent-form label{display:block;font-size:12px;color:#444;margin:10px 0 4px}
.mk-ent-form input,.mk-ent-form select{max-width:100%;display:block;width:100%;padding:8px;border:1px solid rgba(0,0,0,.15);border-radius:8px}
.mk-ent-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mk-ent-grid .full{grid-column:1/-1}
.mk-ent-primary{margin-top:12px;width:100%;padding:10px 12px;border-radius:12px;border:1px solid #111;background:#111;color:#fff;font-weight:700;cursor:pointer}
.mk-ent-secondary{padding:7px 10px;border-radius:10px;border:1px solid rgba(0,0,0,.2);background:#fff;cursor:pointer}
.mk-ent-danger{padding:7px 10px;border-radius:10px;border:1px solid rgba(160,0,0,.3);background:#fff;color:#a00;cursor:pointer}
.mk-ent-msg{margin-top:10px;font-size:13px}
.mk-ent-msg.is-error{color:#a00}
.mk-ent-msg.is-ok{color:#0a6}
.mk-ent-hint{font-size:12px;color:#666;margin-top:6px}

/* Buttons (modern) */
.mk-ent-btn{appearance:none;border:1px solid rgba(0,0,0,.18);background:#fff;color:#111;border-radius:10px;padding:8px 12px;font-size:13px;font-weight:700;cursor:pointer;line-height:1;display:inline-flex;align-items:center;gap:8px}
.mk-ent-btn:hover{background:#f3f4f6}
.mk-ent-btn:active{transform:translateY(1px)}
.mk-ent-btn-primary{background:#111;color:#fff;border-color:#111}
.mk-ent-btn-primary:hover{background:#000}

/* Dashboard */
.mk-ent-dashboard{margin:12px 0}
.mk-ent-tiles{display:grid;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));gap:12px}
.mk-ent-tile{border:1px solid rgba(0,0,0,.12);border-radius:16px;padding:12px;background:#fff}
.mk-ent-tile-title{font-size:12px;color:#666}
.mk-ent-tile-val{margin-top:6px;font-size:16px;font-weight:800}

.mk-ent-mandant-select{width:100%;padding:10px 12px;border-radius:12px;border:1px solid rgba(0,0,0,.2);background:#fff;font-weight:700}

.mk-ent-layout{display:grid;grid-template-columns:260px 1fr;gap:12px;margin-top:12px}
.mk-ent-nav{border:1px solid rgba(0,0,0,.12);border-radius:12px;padding:8px;background:#fff;height:fit-content}
.mk-ent-nav-item{display:flex;width:100%;align-items:center;justify-content:space-between;gap:10px;text-align:left;padding:8px 10px;border-radius:10px;border:1px solid transparent;background:transparent;cursor:pointer;font-weight:800}
.mk-ent-nav-item.active{background:#111;color:#fff}
.mk-ent-content{min-width:0}
.mk-ent-pane{display:none}
.mk-ent-pane.active{display:block}

/* Pane header (e.g. Neuigkeiten) */
.mk-ent-pane-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px 0}
.mk-ent-pane-title{font-size:20px;font-weight:700;letter-spacing:.2px}
.mk-ent-pane-head .mk-ent-btn{white-space:nowrap}

.mk-ent-card{border:1px solid rgba(0,0,0,.12);border-radius:16px;padding:14px;background:#fff}
.mk-ent-flex{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mk-ent-small{font-size:12px;color:#666;margin-top:6px}

.mk-ent-table table{width:100%;border-collapse:collapse;margin-top:10px}
.mk-ent-table th,.mk-ent-table td{padding:10px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}
.mk-ent-loading{color:#666;font-size:13px;padding:10px}

/* Dokumentationen: Details */
.mk-ent-doc-details td{background:#fafafa}
.mk-ent-doc-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;margin:2px 0 12px}
.mk-ent-doc-files{margin:6px 0 0 18px;list-style:disc}
.mk-ent-doc-content{margin-top:10px;padding-top:10px;border-top:1px solid rgba(0,0,0,.08)}
@media (max-width: 700px){
  .mk-ent-doc-detail-grid{grid-template-columns:1fr}
}

/* Dokumentationen: Tabellen-Text links & Inhalte umbrechen */
.mk-ent-docs th,.mk-ent-docs td{text-align:left}
.mk-ent-docs td{white-space:normal}
.mk-ent-docs a{overflow-wrap:anywhere;word-break:break-word}

/* Dokumentationen: Details-Row im Mobile-Card-Layout nicht "zerflexen" */
@media (max-width: 700px){
  .mk-ent-docs tr.mk-ent-doc-details{border:none;background:transparent;padding:0;margin:0 0 12px 0}
  .mk-ent-docs tr.mk-ent-doc-details td{display:block;justify-content:flex-start;padding:10px 8px;white-space:normal}
  .mk-ent-docs tr.mk-ent-doc-details td::before{content:none;display:none}
  .mk-ent-doc-detail-grid{grid-template-columns:1fr;gap:10px}
  .mk-ent-doc-detail-grid > div{min-width:0}
  .mk-ent-doc-files{margin-left:18px}
  .mk-ent-doc-content{overflow-wrap:anywhere;word-break:break-word;line-height:1.5}
}

/* Credentials modal (dashboard) */
.mk-ent-modal{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:10000;display:flex;align-items:center;justify-content:center;padding:12px}
.mk-ent-modal-box{width:520px;max-width:95vw;background:#fff;border-radius:16px;border:1px solid rgba(0,0,0,.12);padding:12px}
.mk-ent-modal-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}

@media (max-width: 900px){
  .mk-ent-tiles{grid-template-columns:repeat(2, minmax(0, 1fr))}
  .mk-ent-layout{grid-template-columns:1fr}
  .mk-ent-float-btn:hover{width:44px}
  .mk-ent-float-text{display:none}
}

/* Popover registration grid: prevent overlap on narrow widths */
.mk-ent-grid > div{min-width:0}
.mk-ent-popover-box .mk-ent-grid{grid-template-columns:1fr 1fr}
@media (max-width: 520px){
  .mk-ent-popover-box .mk-ent-grid{grid-template-columns:1fr}
}

.mk-ent-hint{overflow-wrap:anywhere;word-break:break-word}

.mk-ent-welcome{margin:14px 2px 2px;font-size:clamp(16px,1.6vw,22px);font-weight:800;letter-spacing:.2px;color:#111}

.mk-ent-search{margin-top:10px;display:flex;gap:8px;align-items:center}
.mk-ent-search input{width:100%;padding:10px;border:1px solid rgba(0,0,0,.15);border-radius:12px}
.mk-ent-table table{table-layout:fixed}
.mk-ent-table th,.mk-ent-table td{text-align:center}
.mk-ent-table th{font-size:clamp(11px,1vw,13px)}
.mk-ent-table td{font-size:clamp(11px,1.05vw,14px)}
.mk-ent-table td, .mk-ent-table th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Dokumentationen: Tabelle NICHT zentriert/nowrap (sonst zerlegt es Details & Links) */
.mk-ent-table table.mk-ent-docs th,
.mk-ent-table table.mk-ent-docs td{ 
  text-align:left;
  white-space:normal;
  overflow:visible;
  text-overflow:unset;
}
.mk-ent-table table.mk-ent-docs a{overflow-wrap:anywhere;word-break:break-word}

/* Dokumentationen: Tabelle NICHT zentriert/nowrap (sonst zerlegt es Details & Links) */
.mk-ent-table table.mk-ent-docs th,
.mk-ent-table table.mk-ent-docs td{
  text-align:left;
  white-space:normal;
  overflow:visible;
  text-overflow:unset;
}
.mk-ent-table table.mk-ent-docs a{overflow-wrap:anywhere;word-break:break-word}

/* Dokumentationen: Details-Row darf im Mobile Card Layout nicht als "Label/Value" Flex behandelt werden */
@media (max-width: 700px){
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details{border:none;background:transparent;padding:0;margin:0 0 12px 0}
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details td{display:block;justify-content:flex-start;padding:10px 8px;white-space:normal}
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details td::before{content:none;display:none}
  .mk-ent-table table.mk-ent-docs .mk-ent-doc-detail-grid{grid-template-columns:1fr;gap:10px}
  .mk-ent-table table.mk-ent-docs .mk-ent-doc-detail-grid > div{min-width:0}
  .mk-ent-table table.mk-ent-docs .mk-ent-doc-content{overflow-wrap:anywhere;word-break:break-word;line-height:1.5}
}

/* Dokumentationen: Tabelle NICHT zentriert/nowrap (sonst zerlegt es Details & Links auf Mobile) */
.mk-ent-table table.mk-ent-docs th,.mk-ent-table table.mk-ent-docs td{text-align:left}
.mk-ent-table table.mk-ent-docs td{white-space:normal}
.mk-ent-table table.mk-ent-docs a{overflow-wrap:anywhere;word-break:break-word}

/* Tables: allow horizontal scroll container (safety net) */
.mk-ent-table{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Mobile table -> card layout (Invoices / Contracts / Zugangsdaten) */
@media (max-width: 700px){
  .mk-ent-table table{table-layout:auto;width:100%}
  .mk-ent-table thead{display:none}
  .mk-ent-table tr{display:block;margin:0 0 12px 0;background:#fff;border:1px solid rgba(0,0,0,.10);border-radius:16px;padding:8px 10px}
  .mk-ent-table td{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;text-align:left;white-space:normal;overflow:visible;text-overflow:unset;padding:7px 2px}
  .mk-ent-table td::before{content:attr(data-label);flex:0 0 44%;font-weight:800;color:#666}
  .mk-ent-table td:last-child{justify-content:flex-end}
}

/* Dokumentationen: Override global table defaults (kommt später in der Datei) */
.mk-ent-table table.mk-ent-docs th,.mk-ent-table table.mk-ent-docs td{ text-align:left; white-space:normal; overflow:visible; text-overflow:unset; }
.mk-ent-table table.mk-ent-docs td, .mk-ent-table table.mk-ent-docs th{ word-break:break-word; overflow-wrap:anywhere; }
@media (max-width: 700px){
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details{border:none;background:transparent;padding:0;margin:0 0 12px 0}
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details td{display:block;justify-content:flex-start;padding:10px 8px}
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details td::before{content:none;display:none}
}

/* Docs table: keep readable even with global table rules (must come AFTER global .mk-ent-table td nowrap rules) */
.mk-ent-table table.mk-ent-docs th,
.mk-ent-table table.mk-ent-docs td{ text-align:left; white-space:normal; overflow:visible; text-overflow:unset; }
.mk-ent-table table.mk-ent-docs a{ overflow-wrap:anywhere; word-break:break-word; }
@media (max-width:700px){
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details{padding:0;border:none;background:transparent}
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details td{display:block;padding:10px 8px}
  .mk-ent-table table.mk-ent-docs tr.mk-ent-doc-details td::before{content:none;display:none}
}

.mk-ent-float-link{text-decoration:none;color:inherit;}

.mk-ent-form label{display:block}
.mk-ent-form label input[type=checkbox]{margin-right:8px;transform:translateY(1px)}

/* Icon buttons (Zugangsdaten) */
.mk-ent-icon-btn{
  width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;border:1px solid rgba(0,0,0,.14);
  background:#fff;cursor:pointer;
}
.mk-ent-icon-edit{
  background-repeat:no-repeat;background-position:center;background-size:18px 18px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23111" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zm2.92 2.83H5v-.92l9.06-9.06.92.92L5.92 20.08zM20.71 7.04a1.003 1.003 0 0 0 0-1.42l-2.34-2.34a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/></svg>');
}
.mk-ent-icon-del{
  border-radius:999px;
  border:2px solid rgba(200,0,0,.45);
  background-repeat:no-repeat;background-position:center;background-size:16px 16px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23b00000" d="M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12 5.7 16.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4Z"/></svg>');
}
.mk-ent-icon-dl{
  background-repeat:no-repeat;background-position:center;background-size:18px 18px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23111" d="M5 20h14v-2H5v2zM12 2v12l4-4 1.41 1.41L12 17.83l-5.41-5.42L8 10l4 4V2h0z"/></svg>');
}
.mk-ent-icon-btn:hover{box-shadow:0 8px 20px rgba(0,0,0,.10);transform:translateY(-1px)}

/* Invoice status badge */
.mk-ent-status{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;font-weight:800;font-size:clamp(11px,1vw,13px);border:1px solid rgba(0,0,0,.12)}
.mk-ent-status[data-status="offen"]{background:rgba(220,0,0,.10);border-color:rgba(220,0,0,.35)}
.mk-ent-status[data-status="in_bearbeitung"]{background:rgba(220,180,0,.14);border-color:rgba(220,180,0,.45)}
.mk-ent-status[data-status="zahlung_erhalten"]{background:rgba(0,180,60,.12);border-color:rgba(0,180,60,.35)}

/* Contract status (Dashboard tile + table) */
.mk-ent-contract-no{font-weight:900}
.mk-ent-contract-no[data-contract-status="active"]{color:rgba(0,140,55,.95)}
.mk-ent-contract-no[data-contract-status="expired"]{color:rgba(200,0,0,.92)}

.mk-ent-contract-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;font-weight:800;font-size:clamp(11px,1vw,13px);border:1px solid rgba(0,0,0,.12)}
.mk-ent-contract-badge[data-status="active"]{background:rgba(0,180,60,.12);border-color:rgba(0,180,60,.35)}
.mk-ent-contract-badge[data-status="expired"]{background:rgba(220,0,0,.10);border-color:rgba(220,0,0,.35)}


/* Card header with actions (Invoices total + year filter) */
.mk-ent-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.mk-ent-card-title{margin:0}
.mk-ent-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.mk-ent-pill{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:rgba(0,0,0,.03);font-weight:800;user-select:none;white-space:nowrap}
.mk-ent-select{padding:8px 10px;border-radius:12px;border:1px solid rgba(0,0,0,.18);background:#fff;font-weight:700}

/* Make status badge always readable on smaller screens */
.mk-ent-status{display:inline-block;max-width:100%;white-space:normal;line-height:1.15;text-align:center;padding:6px 10px}


/* Enterprise account popover */
.mk-ent-account-box{padding:12px}
.mk-ent-account-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mk-ent-account-icon{width:46px;height:46px;border-radius:14px;border:1px solid rgba(0,0,0,.12);display:flex;align-items:center;justify-content:center;background:#fafafa}
.mk-ent-account-icon .mk-ent-initials{width:auto;height:auto;font-size:14px}
.mk-ent-account-actions{display:flex;align-items:center;gap:10px}
.mk-ent-account-logout{font-weight:700;text-decoration:none}

/* Render menu as a clean list (no "tiles") */
.mk-ent-account-menu{
  list-style:none;
  margin:10px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.mk-ent-account-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  border:none;
  border-radius:10px;
  text-decoration:none;
  font-weight:500;
  font-size:12.5px;
  background:transparent;
}
.mk-ent-account-link + .mk-ent-account-link{border-top:1px solid rgba(0,0,0,.08);border-top-left-radius:0;border-top-right-radius:0}
.mk-ent-account-link:hover{background:rgba(0,0,0,.05);color:#111}
.mk-ent-account-mandant{margin-top:6px}
.mk-ent-mandant-select{width:100%;padding:8px 10px;border-radius:10px;border:1px solid rgba(0,0,0,.15);font-size:13px;font-weight:600}
.mk-ent-small{font-size:12px;color:#666;margin:0 0 6px}

/* Eye icon button */
.mk-ent-icon-eye{
  width:34px;height:34px;border-radius:999px;border:1px solid rgba(0,0,0,.15);
  background:#fff;color:#111;cursor:pointer;vertical-align:middle;
  display:inline-flex;align-items:center;justify-content:center;
  background-image:none!important;
}
.mk-ent-icon-eye svg{width:18px;height:18px;fill:currentColor;display:block}
.mk-ent-icon-eye.is-on{
  background:#111;color:#fff;border-color:#111;
}
.mk-ent-pw{display:inline-block;min-width:64px}


/* Hover-mode for account popover: no backdrop, aligns to button */
.mk-ent-popover.is-hover .mk-ent-popover-backdrop{display:none;}
.mk-ent-logout-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border-radius:9px;
  border:1px solid rgba(200,0,0,.35);
  background:#fff;
  color:#b00000;
  font-weight:700;
  font-size:13px;
  text-decoration:none;
  line-height:1;
}
.mk-ent-logout-btn:hover{background:rgba(200,0,0,.06);}



/* Compact popover sizing */
.mk-ent-popover .mk-ent-nav-item{font-size:14px;}
.mk-ent-popover .mk-ent-nav{padding:8px;}

/* --- Realtime badges (Invoices / Docs) --- */
.mk-ent-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:auto;padding:0 6px;border-radius:999px;font-size:11px;font-weight:700;line-height:1;background:#2b6cb0;color:#fff;flex:0 0 auto}
.mk-ent-nav-item.active .mk-ent-badge{background:#1f4f86}


/* Neuigkeiten */
.mk-ent-news { padding: 6px 0; }
.mk-ent-news-item { display:flex; gap:10px; padding:10px 12px; border-bottom:1px solid rgba(0,0,0,.06); }
.mk-ent-news-item:last-child { border-bottom:0; }
.mk-ent-news-meta { flex:1; min-width:0; }
.mk-ent-news-title { font-size:13px; font-weight:600; margin:0 0 2px 0; }
.mk-ent-news-body { font-size:12px; opacity:.85; margin:0; white-space:normal; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.mk-ent-news-time { font-size:11px; opacity:.65; white-space:nowrap; margin-left:8px; }
.mk-ent-news-link { text-decoration:none; color:inherit; }
.mk-ent-news-badge { font-size:11px; padding:2px 6px; border-radius:999px; background:rgba(0,0,0,.06); }/* Floating badge (Neuigkeiten count) */
.mk-ent-float-btn{position:relative; overflow:visible}
.mk-ent-float-badge{
  position:absolute;
  top:0;
  right:0;
  transform:translate(55%,-55%);
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#d63638;
  color:#fff;
  font-size:12px;
  font-weight:800;
  display:none;
  align-items:center;
  justify-content:center;
  line-height:20px;
  z-index:5;
  box-shadow:0 6px 16px rgba(0,0,0,.18);
}
/* Base safety to prevent theme overrides / overflow */
.mk-ent-float, .mk-ent-float *,.mk-ent-popover, .mk-ent-popover *, .mk-ent-dashboard, .mk-ent-dashboard *{
  box-sizing:border-box;
}
.mk-ent-user-icon{width:18px;height:18px;display:inline-block;flex:0 0 18px;background-repeat:no-repeat!important;background-position:center!important;background-size:contain!important;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23111" d="M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5Zm0 2c-4.418 0-8 2.239-8 5v1h16v-1c0-2.761-3.582-5-8-5Z"/></svg>')!important}
.mk-ent-initials{width:18px;height:18px;display:flex;align-items:center;justify-content:center;font-weight:800;letter-spacing:.5px;line-height:1}

/* Floating icon -> hover expands to 'Konto' */
.mk-ent-float{position:fixed;right:18px;z-index:9998}
.mk-ent-float-btn{
  display:flex;align-items:center;gap:10px;
  height:44px;
  width:44px;
  padding:0 14px 0 13px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.15);
  background:#fff;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.10);
  overflow:hidden;
  transition:width .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mk-ent-float-btn:hover{width:118px;transform:translateY(-1px);justify-content:flex-start;padding:0 14px 0 13px}
.mk-ent-float-text{
  white-space:nowrap;
  opacity:0;
  transform:translateX(-6px);
  transition:opacity .16s ease, transform .16s ease;
  font-weight:800;
}
.mk-ent-float-btn:hover .mk-ent-float-text{opacity:1;transform:translateX(0)}

/* Float button badge (Neuigkeiten count) */
.mk-ent-float-btn{position:relative}
.mk-ent-float-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:#d63638;
  color:#fff;
  font-size:11px;
  font-weight:800;
  display:none;
  align-items:center;
  justify-content:center;
  line-height:18px;
  box-shadow:0 6px 16px rgba(0,0,0,.18);
}

/* Small popover (rectangle block) */
.mk-ent-popover{position:fixed;inset:0;z-index:10001;pointer-events:none;display:none}
.mk-ent-popover.is-open{pointer-events:auto;display:block}
.mk-ent-popover-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.06);opacity:0;transition:opacity .18s ease}
.mk-ent-popover.is-open .mk-ent-popover-backdrop{opacity:1}
.mk-ent-popover-box{
  position:absolute;
  top:72px;
  right:18px;
  width:260px;
  max-width:92vw;
  background:#fff;
  border:1px solid rgba(0,0,0,.15);
  border-radius:12px;
  box-shadow:0 10px 26px rgba(0,0,0,.10);
  padding:8px;
  opacity:0;
  transform:translateY(-6px);
  transition:opacity .18s ease, transform .18s ease;
;overflow:hidden}
.mk-ent-popover.is-open .mk-ent-popover-box{opacity:1;transform:translateY(0)}
.mk-ent-popover-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.mk-ent-popover-title{font-size:14px;font-weight:900}
.mk-ent-close{border:none;background:transparent;font-size:22px;cursor:pointer;line-height:1}
.mk-ent-popover-body{margin-top:8px;max-height:60vh;overflow:auto;padding-right:2px;overflow-x:hidden}

/* Tabs + forms (fix overlap) */
.mk-ent-tabs{display:flex;gap:6px;margin-top:4px}
.mk-ent-tab{border:1px solid rgba(0,0,0,.15);background:#f7f7f7;border-radius:10px;padding:6px 10px;cursor:pointer}
.mk-ent-tab.active{background:#111;color:#fff;border-color:#111}
.mk-ent-tab-body{display:none}
.mk-ent-tab-body.active{display:block}

.mk-ent-form label{display:block;font-size:12px;color:#444;margin:10px 0 4px}
.mk-ent-form input,.mk-ent-form select{max-width:100%;display:block;width:100%;padding:8px;border:1px solid rgba(0,0,0,.15);border-radius:8px}
.mk-ent-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mk-ent-grid .full{grid-column:1/-1}
.mk-ent-primary{margin-top:12px;width:100%;padding:10px 12px;border-radius:12px;border:1px solid #111;background:#111;color:#fff;font-weight:700;cursor:pointer}
.mk-ent-secondary{padding:7px 10px;border-radius:10px;border:1px solid rgba(0,0,0,.2);background:#fff;cursor:pointer}
.mk-ent-danger{padding:7px 10px;border-radius:10px;border:1px solid rgba(160,0,0,.3);background:#fff;color:#a00;cursor:pointer}
.mk-ent-msg{margin-top:10px;font-size:13px}
.mk-ent-msg.is-error{color:#a00}
.mk-ent-msg.is-ok{color:#0a6}
.mk-ent-hint{font-size:12px;color:#666;margin-top:6px}

/* Buttons (modern) */
.mk-ent-btn{appearance:none;border:1px solid rgba(0,0,0,.18);background:#fff;color:#111;border-radius:10px;padding:8px 12px;font-size:13px;font-weight:700;cursor:pointer;line-height:1;display:inline-flex;align-items:center;gap:8px}
.mk-ent-btn:hover{background:#f3f4f6}
.mk-ent-btn:active{transform:translateY(1px)}
.mk-ent-btn-primary{background:#111;color:#fff;border-color:#111}
.mk-ent-btn-primary:hover{background:#000}

/* Dashboard */
.mk-ent-dashboard{margin:12px 0}
.mk-ent-tiles{display:grid;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));gap:12px}
.mk-ent-tile{border:1px solid rgba(0,0,0,.12);border-radius:16px;padding:12px;background:#fff}
.mk-ent-tile-title{font-size:12px;color:#666}
.mk-ent-tile-val{margin-top:6px;font-size:16px;font-weight:800}

.mk-ent-mandant-select{width:100%;padding:10px 12px;border-radius:12px;border:1px solid rgba(0,0,0,.2);background:#fff;font-weight:700}

.mk-ent-layout{display:grid;grid-template-columns:260px 1fr;gap:12px;margin-top:12px}
.mk-ent-nav{border:1px solid rgba(0,0,0,.12);border-radius:12px;padding:8px;background:#fff;height:fit-content}
.mk-ent-nav-item{display:flex;width:100%;align-items:center;justify-content:space-between;gap:10px;text-align:left;padding:8px 10px;border-radius:10px;border:1px solid transparent;background:transparent;cursor:pointer;font-weight:800}
.mk-ent-nav-item.active{background:#111;color:#fff}
.mk-ent-content{min-width:0}
.mk-ent-pane{display:none}
.mk-ent-pane.active{display:block}

/* Pane header (e.g. Neuigkeiten) */
.mk-ent-pane-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px 0}
.mk-ent-pane-title{font-size:20px;font-weight:700;letter-spacing:.2px}
.mk-ent-pane-head .mk-ent-btn{white-space:nowrap}

.mk-ent-card{border:1px solid rgba(0,0,0,.12);border-radius:16px;padding:14px;background:#fff}
.mk-ent-flex{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mk-ent-small{font-size:12px;color:#666;margin-top:6px}

.mk-ent-table table{width:100%;border-collapse:collapse;margin-top:10px}
.mk-ent-table th,.mk-ent-table td{padding:10px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}
.mk-ent-loading{color:#666;font-size:13px;padding:10px}

/* Dokumentationen: Details */
.mk-ent-doc-details td{background:#fafafa}
.mk-ent-doc-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;margin:2px 0 12px}
.mk-ent-doc-files{margin:6px 0 0 18px;list-style:disc}
.mk-ent-doc-content{margin-top:10px;padding-top:10px;border-top:1px solid rgba(0,0,0,.08)}
@media (max-width: 700px){
  .mk-ent-doc-detail-grid{grid-template-columns:1fr}
}

/* Credentials modal (dashboard) */
.mk-ent-modal{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:10000;display:flex;align-items:center;justify-content:center;padding:12px}
.mk-ent-modal-box{width:520px;max-width:95vw;background:#fff;border-radius:16px;border:1px solid rgba(0,0,0,.12);padding:12px}
.mk-ent-modal-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}

@media (max-width: 900px){
  .mk-ent-tiles{grid-template-columns:repeat(2, minmax(0, 1fr))}
  .mk-ent-layout{grid-template-columns:1fr}
  .mk-ent-float-btn:hover{width:44px}
  .mk-ent-float-text{display:none}
}

/* Popover registration grid: prevent overlap on narrow widths */
.mk-ent-grid > div{min-width:0}
.mk-ent-popover-box .mk-ent-grid{grid-template-columns:1fr 1fr}
@media (max-width: 520px){
  .mk-ent-popover-box .mk-ent-grid{grid-template-columns:1fr}
}

.mk-ent-hint{overflow-wrap:anywhere;word-break:break-word}

.mk-ent-welcome{margin:14px 2px 2px;font-size:clamp(16px,1.6vw,22px);font-weight:800;letter-spacing:.2px;color:#111}

.mk-ent-search{margin-top:10px;display:flex;gap:8px;align-items:center}
.mk-ent-search input{width:100%;padding:10px;border:1px solid rgba(0,0,0,.15);border-radius:12px}
.mk-ent-table table{table-layout:fixed}
.mk-ent-table th,.mk-ent-table td{text-align:center}
.mk-ent-table th{font-size:clamp(11px,1vw,13px)}
.mk-ent-table td{font-size:clamp(11px,1.05vw,14px)}
.mk-ent-table td, .mk-ent-table th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Tables: allow horizontal scroll container (safety net) */
.mk-ent-table{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Mobile table -> card layout (Invoices / Contracts / Zugangsdaten) */
@media (max-width: 700px){
  .mk-ent-table table{table-layout:auto;width:100%}
  .mk-ent-table thead{display:none}
  .mk-ent-table tr{display:block;margin:0 0 12px 0;background:#fff;border:1px solid rgba(0,0,0,.10);border-radius:16px;padding:8px 10px}
  .mk-ent-table td{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;text-align:left;white-space:normal;overflow:visible;text-overflow:unset;padding:7px 2px}
  .mk-ent-table td::before{content:attr(data-label);flex:0 0 44%;font-weight:800;color:#666}
  .mk-ent-table td:last-child{justify-content:flex-end}
}

.mk-ent-float-link{text-decoration:none;color:inherit;}

.mk-ent-form label{display:block}
.mk-ent-form label input[type=checkbox]{margin-right:8px;transform:translateY(1px)}

/* Icon buttons (Zugangsdaten) */
.mk-ent-icon-btn{
  width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;border:1px solid rgba(0,0,0,.14);
  background:#fff;cursor:pointer;
}
.mk-ent-icon-edit{
  background-repeat:no-repeat;background-position:center;background-size:18px 18px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23111" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zm2.92 2.83H5v-.92l9.06-9.06.92.92L5.92 20.08zM20.71 7.04a1.003 1.003 0 0 0 0-1.42l-2.34-2.34a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/></svg>');
}
.mk-ent-icon-del{
  border-radius:999px;
  border:2px solid rgba(200,0,0,.45);
  background-repeat:no-repeat;background-position:center;background-size:16px 16px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23b00000" d="M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12 5.7 16.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4Z"/></svg>');
}
.mk-ent-icon-dl{
  background-repeat:no-repeat;background-position:center;background-size:18px 18px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23111" d="M5 20h14v-2H5v2zM12 2v12l4-4 1.41 1.41L12 17.83l-5.41-5.42L8 10l4 4V2h0z"/></svg>');
}
.mk-ent-icon-btn:hover{box-shadow:0 8px 20px rgba(0,0,0,.10);transform:translateY(-1px)}

/* Invoice status badge */
.mk-ent-status{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;font-weight:800;font-size:clamp(11px,1vw,13px);border:1px solid rgba(0,0,0,.12)}
.mk-ent-status[data-status="offen"]{background:rgba(220,0,0,.10);border-color:rgba(220,0,0,.35)}
.mk-ent-status[data-status="in_bearbeitung"]{background:rgba(220,180,0,.14);border-color:rgba(220,180,0,.45)}
.mk-ent-status[data-status="zahlung_erhalten"]{background:rgba(0,180,60,.12);border-color:rgba(0,180,60,.35)}

/* Contract status (Dashboard tile + table) */
.mk-ent-contract-no{font-weight:900}
.mk-ent-contract-no[data-contract-status="active"]{color:rgba(0,140,55,.95)}
.mk-ent-contract-no[data-contract-status="expired"]{color:rgba(200,0,0,.92)}

.mk-ent-contract-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;font-weight:800;font-size:clamp(11px,1vw,13px);border:1px solid rgba(0,0,0,.12)}
.mk-ent-contract-badge[data-status="active"]{background:rgba(0,180,60,.12);border-color:rgba(0,180,60,.35)}
.mk-ent-contract-badge[data-status="expired"]{background:rgba(220,0,0,.10);border-color:rgba(220,0,0,.35)}


/* Card header with actions (Invoices total + year filter) */
.mk-ent-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.mk-ent-card-title{margin:0}
.mk-ent-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.mk-ent-pill{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:rgba(0,0,0,.03);font-weight:800;user-select:none;white-space:nowrap}
.mk-ent-select{padding:8px 10px;border-radius:12px;border:1px solid rgba(0,0,0,.18);background:#fff;font-weight:700}

/* Make status badge always readable on smaller screens */
.mk-ent-status{display:inline-block;max-width:100%;white-space:normal;line-height:1.15;text-align:center;padding:6px 10px}


/* Enterprise account popover */
.mk-ent-account-box{padding:12px}
.mk-ent-account-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mk-ent-account-icon{width:46px;height:46px;border-radius:14px;border:1px solid rgba(0,0,0,.12);display:flex;align-items:center;justify-content:center;background:#fafafa}
.mk-ent-account-icon .mk-ent-initials{width:auto;height:auto;font-size:14px}
.mk-ent-account-actions{display:flex;align-items:center;gap:10px}
.mk-ent-account-logout{font-weight:700;text-decoration:none}

/* Render menu as a clean list (no "tiles") */
.mk-ent-account-menu{
  list-style:none;
  margin:10px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.mk-ent-account-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  border:none;
  border-radius:10px;
  text-decoration:none;
  font-weight:500;
  font-size:12.5px;
  background:transparent;
}
.mk-ent-account-link + .mk-ent-account-link{border-top:1px solid rgba(0,0,0,.08);border-top-left-radius:0;border-top-right-radius:0}
.mk-ent-account-link:hover{background:rgba(0,0,0,.05);color:#111}
.mk-ent-account-mandant{margin-top:6px}
.mk-ent-mandant-select{width:100%;padding:8px 10px;border-radius:10px;border:1px solid rgba(0,0,0,.15);font-size:13px;font-weight:600}
.mk-ent-small{font-size:12px;color:#666;margin:0 0 6px}

/* Eye icon button */
.mk-ent-icon-eye{
  width:34px;height:34px;border-radius:999px;border:1px solid rgba(0,0,0,.15);
  background:#fff;color:#111;cursor:pointer;vertical-align:middle;
  display:inline-flex;align-items:center;justify-content:center;
  background-image:none!important;
}
.mk-ent-icon-eye svg{width:18px;height:18px;fill:currentColor;display:block}
.mk-ent-icon-eye.is-on{
  background:#111;color:#fff;border-color:#111;
}
.mk-ent-pw{display:inline-block;min-width:64px}


/* Hover-mode for account popover: no backdrop, aligns to button */
.mk-ent-popover.is-hover .mk-ent-popover-backdrop{display:none;}
.mk-ent-logout-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border-radius:9px;
  border:1px solid rgba(200,0,0,.35);
  background:#fff;
  color:#b00000;
  font-weight:700;
  font-size:13px;
  text-decoration:none;
  line-height:1;
}
.mk-ent-logout-btn:hover{background:rgba(200,0,0,.06);}



/* Compact popover sizing */
.mk-ent-popover .mk-ent-nav-item{font-size:14px;}
.mk-ent-popover .mk-ent-nav{padding:8px;}

/* --- Realtime badges (Invoices / Docs) --- */
.mk-ent-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:8px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:700;line-height:1;background:#2b6cb0;color:#fff}
.mk-ent-nav-item.active .mk-ent-badge{background:#1f4f86}


/* Neuigkeiten */
.mk-ent-news { padding: 6px 0; }
.mk-ent-news-item { display:flex; gap:10px; padding:10px 12px; border-bottom:1px solid rgba(0,0,0,.06); }
.mk-ent-news-item:last-child { border-bottom:0; }
.mk-ent-news-meta { flex:1; min-width:0; }
.mk-ent-news-title { font-size:13px; font-weight:600; margin:0 0 2px 0; }
.mk-ent-news-body { font-size:12px; opacity:.85; margin:0; white-space:normal; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.mk-ent-news-time { font-size:11px; opacity:.65; white-space:nowrap; margin-left:8px; }
.mk-ent-news-link { text-decoration:none; color:inherit; }
.mk-ent-news-badge { font-size:11px; padding:2px 6px; border-radius:999px; background:rgba(0,0,0,.06); }
