:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #1f4fd1;
    --primary-dark: #153aa0;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #067647;
    --success-bg: #ecfdf3;
    --shadow: 0 16px 40px rgba(16, 24, 40, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }
.auth-brand { padding: 64px; color: white; background: linear-gradient(145deg, #122861, #1f4fd1 62%, #4775eb); display: flex; flex-direction: column; justify-content: space-between; }
.brand-mark { font-size: 1.15rem; font-weight: 800; letter-spacing: .01em; }
.brand-sub { font-weight: 400; color: #98a2b3; }
.auth-brand h1 { max-width: 680px; font-size: clamp(2.5rem, 5vw, 5.4rem); line-height: .98; margin: 32px 0 18px; letter-spacing: -.045em; }
.auth-brand p { max-width: 560px; font-size: 1.08rem; line-height: 1.65; color: rgba(255,255,255,.78); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.login-card { width: min(100%, 430px); }
.login-card h2 { font-size: 2rem; margin: 0 0 8px; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 32px; color: var(--muted); line-height: 1.6; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: 8px; }
.form-control { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; background: white; color: var(--text); outline: none; transition: border .15s, box-shadow .15s; }
select.form-control { cursor: pointer; }
.form-control:focus { border-color: #7898ef; box-shadow: 0 0 0 4px rgba(31,79,209,.1); }
.field-help { margin-top: 7px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.btn { border: 0; border-radius: 10px; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 750; }
.btn-primary { width: 100%; min-height: 50px; color: white; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: #344054; background: #fff; border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { filter: brightness(.92); }
.btn-ghost { color: var(--text); background: transparent; }
.btn-auto { width: auto; min-height: 44px; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; font-size: .92rem; }
.alert-error { color: var(--danger); background: var(--danger-bg); border: 1px solid #fecdca; }
.alert-success { color: var(--success); background: var(--success-bg); border: 1px solid #abefc6; }
.error-list { margin: 7px 0 0; padding-left: 20px; }
.security-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; line-height: 1.6; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { padding: 26px 18px; background: #101828; color: #f8fafc; display: flex; flex-direction: column; }
.sidebar .brand-mark { padding: 0 12px 24px; }
.nav { display: grid; gap: 6px; }
.nav-section { padding: 18px 12px 8px; color: #98a2b3; text-transform: uppercase; font-size: .7rem; font-weight: 800; letter-spacing: .1em; }
.nav a { padding: 11px 12px; border-radius: 9px; color: #d0d5dd; font-size: .93rem; }
.nav a:hover, .nav a.active { background: #1d2939; color: white; }
.sidebar-footer { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid #344054; }
.sidebar-user { font-weight: 700; font-size: .9rem; }
.sidebar-role { color: #98a2b3; font-size: .78rem; margin-top: 3px; }
.logout-form { margin-top: 12px; }
.logout-form .btn { color: #d0d5dd; padding: 0; min-height: auto; }

.main { min-width: 0; }
.topbar { height: 76px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 34px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.environment-badge { padding: 6px 10px; border-radius: 999px; background: #eef4ff; color: #3538cd; font-size: .75rem; font-weight: 800; }
.content { padding: 34px; }
.hero { margin-bottom: 26px; }
.hero-compact { margin-bottom: 0; }
.hero h2 { margin: 0 0 7px; font-size: 1.75rem; letter-spacing: -.035em; }
.hero p { margin: 0; color: var(--muted); line-height: 1.6; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(16,24,40,.02); }
.card h3 { margin: 0 0 8px; font-size: 1.03rem; }
.card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.section-copy { margin-bottom: 22px !important; }
.card-value { margin-top: 18px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.04em; }
.card-link { margin-top: 18px; display: inline-flex; color: var(--primary); font-weight: 750; font-size: .88rem; }
.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-ready { color: var(--success); background: var(--success-bg); }
.status-planned { color: #344054; background: #f2f4f7; }
.muted { color: var(--muted); font-size: .82rem; font-weight: 400; }



table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: .88rem; white-space: nowrap; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

.text-link { color: var(--primary); font-weight: 750; }

.pagination-actions { display: flex; gap: 14px; }
.pagination-actions a { color: var(--primary); font-weight: 700; }

.form-card { max-width: 900px; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; margin-top: 4px; border-top: 1px solid var(--border); }
.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.toggle-row input { margin-top: 4px; }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row small { color: var(--muted); line-height: 1.4; }

.choice-list { display: grid; gap: 10px; margin-bottom: 20px; }
.choice-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: #7898ef; background: #f5f8ff; box-shadow: 0 0 0 3px rgba(31,79,209,.07); }
.choice-card input { margin-top: 4px; }
.choice-card span { display: grid; gap: 4px; }
.choice-card small { color: var(--muted); line-height: 1.45; }
.stack-form { display: grid; gap: 0; }

.danger-zone { max-width: 900px; margin-top: 24px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--danger-bg); border: 1px solid #fecdca; border-radius: var(--radius); }
.danger-zone h3 { margin: 0 0 5px; color: var(--danger); }
.danger-zone p { margin: 0; color: #912018; font-size: .88rem; line-height: 1.5; }

@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-panel { min-height: 100vh; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid, .settings-grid, .form-grid { grid-template-columns: 1fr; }
    .form-span-2 { grid-column: auto; }
    .page-heading, .danger-zone { flex-direction: column; align-items: stretch; }
    .content { padding: 22px; }
    .topbar { padding: 0 22px; }
}

/* Delta 03: Kopfzeile, globale Suche, Portale */
.sidebar { min-height: 100vh; }
.main { min-width: 0; background: var(--bg); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 76px;
    display: grid;
    grid-template-columns: minmax(150px, .65fr) minmax(320px, 1.5fr) minmax(260px, .85fr);
    gap: 22px;
    align-items: center;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(10px);
}
.topbar-title { font-size: 1.02rem; font-weight: 800; letter-spacing: -.015em; white-space: nowrap; }
.global-search { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.global-search-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    padding: 0 14px;
    background: #f8fafc;
    color: var(--text);
    outline: none;
}
.global-search-input:focus { background: #fff; border-color: #7898ef; box-shadow: 0 0 0 3px rgba(31,79,209,.08); }
.global-search-button {
    height: 42px;
    border: 1px solid var(--primary);
    border-radius: 0 10px 10px 0;
    padding: 0 15px;
    background: var(--primary);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}
.global-search-button:hover { background: var(--primary-dark); }
.topbar-account { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.account-profile { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 5px 7px; border-radius: 10px; }
.account-profile:hover { background: var(--surface-2); }
.account-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: #eef4ff; color: #3538cd; font-size: .76rem; font-weight: 900; }
.account-copy { min-width: 0; display: grid; line-height: 1.15; }
.account-copy strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.topbar-logout { border: 0; background: transparent; padding: 8px 0; color: var(--muted); font-weight: 700; cursor: pointer; }
.topbar-logout:hover { color: var(--danger); }
.dashboard-card { min-height: 190px; display: flex; flex-direction: column; }
.dashboard-card .card-link { margin-top: auto; padding-top: 24px; }
.form-textarea { min-height: 120px; padding-top: 12px; padding-bottom: 12px; resize: vertical; }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.portal-card { min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.portal-card h3 { font-size: 1.08rem; }
.portal-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-detail { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.detail-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.detail-value { overflow-wrap: anywhere; font-weight: 700; }
.empty-state { grid-column: 1 / -1; }
.url-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.search-syntax { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 18px; padding: 14px 18px; font-size: .84rem; }
.search-syntax span { color: var(--muted); }
.search-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.result-heading h3 { margin: 0; }
.result-heading span { color: var(--muted); font-size: .8rem; }
.result-list { display: grid; }
.result-item { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.result-item:last-child { border-bottom: 0; }
.result-item:hover strong { color: var(--primary); }
.result-item span { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.result-item small { color: var(--danger); font-size: .72rem; font-weight: 750; }
.empty-copy { padding-top: 14px; color: var(--muted); }

@media (max-width: 1180px) {
    .topbar { grid-template-columns: auto minmax(260px, 1fr) auto; gap: 14px; }
    .account-copy { display: none; }
    .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .sidebar { min-height: auto; }
    .topbar { position: static; height: auto; min-height: 76px; grid-template-columns: 1fr auto; padding-top: 12px; padding-bottom: 12px; }
    .global-search { grid-column: 1 / -1; grid-row: 2; }
    .topbar-account { grid-column: 2; grid-row: 1; }
    .portal-grid, .search-results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .topbar-title { display: none; }
    .topbar { grid-template-columns: 1fr; }
    .topbar-account { grid-column: 1; justify-content: space-between; }
    .global-search { grid-column: 1; }
    .account-copy { display: grid; }
    .portal-detail { flex-direction: column; align-items: stretch; }
}

/* Delta 04: Account-Dropdown, Profil/Sicherheit, Portal-Sperre */
.topbar-account { position: relative; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 5px 8px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
}
.account-trigger:hover,
.account-menu[open] .account-trigger { background: var(--surface-2); }
.account-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .84rem;
}
.account-chevron { color: var(--muted); font-size: .9rem; transform: translateY(-1px); }
.account-menu[open] .account-chevron { transform: rotate(180deg) translateY(1px); }
.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .16);
    z-index: 50;
}
.account-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.account-avatar-large { width: 42px; height: 42px; flex-basis: 42px; font-size: .82rem; }
.account-dropdown-head > div { min-width: 0; display: grid; gap: 3px; }
.account-dropdown-head strong,
.account-dropdown-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown-head strong { font-size: .9rem; }
.account-dropdown-head small { color: var(--muted); font-size: .74rem; }
.account-dropdown-links { padding: 7px; }
.account-dropdown-links a,
.account-dropdown-links button {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
}
.account-dropdown-links a:hover,
.account-dropdown-links button:hover { background: var(--surface-2); }
.account-dropdown-links .account-logout { color: var(--danger); }
.settings-security-card { grid-column: 1 / -1; }
.settings-section-heading { margin-bottom: 8px; }
.settings-section-heading p { margin-top: 6px; }
.security-list { display: grid; }
.security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.security-row:last-child { border-bottom: 0; }
.security-row > div { min-width: 0; display: grid; gap: 5px; }
.security-row strong { font-size: .9rem; }
.security-row small { color: var(--muted); line-height: 1.45; }
.lock-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: var(--bg);
}
.lock-card {
    width: min(100%, 430px);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    text-align: center;
}
.lock-brand { margin-bottom: 28px; font-size: 1rem; font-weight: 800; }
.lock-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef4ff;
    color: #3538cd;
    font-size: 1.15rem;
    font-weight: 900;
}
.lock-card h1 { margin: 0 0 7px; font-size: 1.55rem; letter-spacing: -.035em; }
.lock-card > p { margin: 0 0 24px; color: var(--muted); }
.lock-form { text-align: left; }
.lock-logout { margin-top: 14px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.lock-logout:hover { color: var(--danger); }
.field-error { margin-top: 6px; color: var(--danger); font-size: .78rem; }

@media (max-width: 1180px) {
    .account-name { display: none; }
}

@media (max-width: 640px) {
    .account-name { display: inline; max-width: 145px; }
    .account-dropdown { width: min(290px, calc(100vw - 36px)); }
    .settings-security-card { grid-column: auto; }
    .security-row { align-items: flex-start; flex-direction: column; }
}

/* Delta 04: Account-Dropdown, Profil/Sicherheit, Portal-Sperre */
.topbar-account { position: relative; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 5px 8px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
}
.account-trigger:hover,
.account-menu[open] .account-trigger { background: var(--surface-2); }
.account-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .84rem;
}
.account-chevron { color: var(--muted); font-size: .9rem; transform: translateY(-1px); }
.account-menu[open] .account-chevron { transform: rotate(180deg) translateY(1px); }
.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .16);
    z-index: 50;
}
.account-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.account-avatar-large { width: 42px; height: 42px; flex-basis: 42px; font-size: .82rem; }
.account-dropdown-head > div { min-width: 0; display: grid; gap: 3px; }
.account-dropdown-head strong,
.account-dropdown-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown-head strong { font-size: .9rem; }
.account-dropdown-head small { color: var(--muted); font-size: .74rem; }
.account-dropdown-links { padding: 7px; }
.account-dropdown-links a,
.account-dropdown-links button {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
}
.account-dropdown-links a:hover,
.account-dropdown-links button:hover { background: var(--surface-2); }
.account-dropdown-links .account-logout { color: var(--danger); }
.settings-security-card { grid-column: 1 / -1; }
.settings-section-heading { margin-bottom: 8px; }
.settings-section-heading p { margin-top: 6px; }
.security-list { display: grid; }
.security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.security-row:last-child { border-bottom: 0; }
.security-row > div { min-width: 0; display: grid; gap: 5px; }
.security-row strong { font-size: .9rem; }
.security-row small { color: var(--muted); line-height: 1.45; }
.lock-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: var(--bg);
}
.lock-card {
    width: min(100%, 430px);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    text-align: center;
}
.lock-brand { margin-bottom: 28px; font-size: 1rem; font-weight: 800; }
.lock-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef4ff;
    color: #3538cd;
    font-size: 1.15rem;
    font-weight: 900;
}
.lock-card h1 { margin: 0 0 7px; font-size: 1.55rem; letter-spacing: -.035em; }
.lock-card > p { margin: 0 0 24px; color: var(--muted); }
.lock-form { text-align: left; }
.lock-logout { margin-top: 14px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.lock-logout:hover { color: var(--danger); }
.field-error { margin-top: 6px; color: var(--danger); font-size: .78rem; }

@media (max-width: 1180px) {
    .account-name { display: none; }
}

@media (max-width: 640px) {
    .account-name { display: inline; max-width: 145px; }
    .account-dropdown { width: min(290px, calc(100vw - 36px)); }
    .settings-security-card { grid-column: auto; }
    .security-row { align-items: flex-start; flex-direction: column; }
}

/* Delta 05: Account-Menü und Portalpfad */
.account-trigger { padding-right: 8px; }
.account-chevron { display: none !important; }

.portal-path-control {
    display: flex;
    width: 100%;
    min-height: 48px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    transition: border .15s, box-shadow .15s;
}
.portal-path-control:focus-within {
    border-color: #7898ef;
    box-shadow: 0 0 0 4px rgba(31,79,209,.1);
}
.portal-path-prefix {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 12px;
    border-right: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    font-size: .88rem;
    white-space: nowrap;
    user-select: none;
}
.portal-path-input {
    min-width: 120px;
    width: 100%;
    border: 0;
    outline: 0;
    padding: 0 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
.portal-path-status.is-checking { color: var(--muted); }
.portal-path-status.is-available { color: var(--success); font-weight: 700; }
.portal-path-status.is-unavailable { color: var(--danger); font-weight: 700; }
#portal-submit:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 760px) {
    .portal-path-control { display: grid; }
    .portal-path-prefix {
        min-height: 38px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .portal-path-input { min-height: 48px; }
}

/* Delta 06: Portalreihenfolge */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.portal-sort-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.portal-sort-root { position: relative; }
.portal-sort-status {
    min-height: 20px;
    margin: 0 2px 8px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-align: right;
}
.portal-sort-status[data-state="saved"] { color: var(--success); }
.portal-sort-status[data-state="error"] { color: var(--danger); }
.portal-sort-column,
.portal-sort-cell {
    width: 54px;
    min-width: 54px;
    text-align: center;
}
.portal-drag-handle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    letter-spacing: -4px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.portal-drag-handle:hover,
.portal-drag-handle:focus-visible {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
}
.portal-drag-handle:active { cursor: grabbing; }
.portal-sort-root [data-smart-table-key="admin.portals"] tbody tr[data-portal-id] { transition: background .12s ease, opacity .12s ease; }
.portal-sort-root [data-smart-table-key="admin.portals"] tbody tr.is-dragging {
    background: var(--surface-2);
    opacity: .72;
}
.portal-sort-root.is-sorting [data-smart-table-key="admin.portals"] tbody tr[data-portal-id] { user-select: none; }

@media (max-width: 760px) {
    .portal-sort-hint { max-width: 34rem; line-height: 1.4; }
    .portal-sort-status { text-align: left; }
    .portal-sort-root .smart-table-col--control { width: 48px; min-width: 48px; max-width: 48px; }
    .portal-drag-handle {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

/* Delta 07: Portal-Arbeitsbereich, Dokumente, zentrale Modale */
body.modal-open { overflow: hidden; }
.modal-shell {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}
.modal-shell[hidden] { display: none !important; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, .58);
    backdrop-filter: blur(2px);
}
.modal-dialog {
    position: relative;
    width: min(980px, 100%);
    max-height: min(880px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(16, 24, 40, .25);
    outline: none;
}
.modal-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px 16px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.025em; }
.modal-close {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover,
.modal-close:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.modal-body { min-height: 0; overflow-y: auto; padding: 24px; }

.portal-workspace-heading { align-items: center; }
.portal-workspace-path {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}
.portal-workspace-path code { color: var(--primary); }

.document-manager { display: grid; gap: 18px; }
.document-manager-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.document-manager-heading h2 { margin: 0 0 6px; font-size: 1.25rem; letter-spacing: -.025em; }
.document-manager-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.document-list { display: grid; gap: 12px; }
.document-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.document-main { min-width: 0; flex: 1 1 auto; }
.document-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.document-title-row h3 { margin: 0 0 4px; font-size: 1rem; }
.document-filename { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.document-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.document-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 20px;
    margin: 16px 0 0;
}
.document-meta > div { min-width: 0; }
.document-meta dt,
.document-technical dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .055em;
}
.document-meta dd,
.document-technical dd { margin: 0; font-size: .82rem; overflow-wrap: anywhere; }
.document-meta-wide { grid-column: 1 / -1; }
.document-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.document-technical { margin-top: 14px; }
.document-technical summary { color: var(--muted); font-size: .76rem; font-weight: 750; cursor: pointer; }
.document-technical dl { display: grid; gap: 8px; margin: 12px 0 0; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.document-technical code { font-size: .76rem; overflow-wrap: anywhere; }
.document-empty {
    padding: 42px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}
.document-empty h3 { margin: 0 0 6px; }
.document-empty p { margin: 0; color: var(--muted); }
.document-action-error { margin: 0; }

.document-upload-form { display: grid; gap: 18px; }
.document-dropzone {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 26px;
    border: 2px dashed #cfd6e4;
    border-radius: 14px;
    background: var(--surface-2);
    text-align: center;
    outline: none;
    transition: border .15s, background .15s, box-shadow .15s;
}
.document-dropzone:focus-visible,
.document-dropzone.is-dragover {
    border-color: var(--primary);
    background: #f5f8ff;
    box-shadow: 0 0 0 4px rgba(31,79,209,.08);
}
.document-dropzone > span { max-width: 620px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.document-picker-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.document-selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.document-selection-heading span { color: var(--muted); font-size: .8rem; }
.document-selected-files { display: grid; gap: 12px; }
.document-no-selection { margin: 0; padding: 18px; border-radius: 10px; background: var(--surface-2); color: var(--muted); text-align: center; }
.document-file-editor { padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.document-file-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.document-file-editor-head strong { min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.document-file-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.document-extract-toggle { margin: 0; }
.document-upload-error { margin: 0; }
.document-upload-progress { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.document-upload-progress-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #eaecf0; }
.document-upload-progress-bar span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .15s linear; }

@media (max-width: 960px) {
    .document-manager-heading,
    .document-item,
    .document-title-row { flex-direction: column; align-items: stretch; }
    .document-badges,
    .document-actions { justify-content: flex-start; }
    .document-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .modal-shell { padding: 0; place-items: stretch; }
    .modal-dialog { width: 100%; max-height: 100vh; min-height: 100vh; border: 0; border-radius: 0; }
    .modal-body { padding: 18px; }
    .document-manager-heading .btn { width: 100%; }
    .document-meta,
    .document-file-editor-grid { grid-template-columns: 1fr; }
    .document-actions .btn { width: 100%; }
    .document-picker-actions { width: 100%; }
    .document-picker-actions .btn { flex: 1 1 140px; }
}

/* Delta 08: Portal runtime + admin file placement */
.page-heading-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.portal-admin-files { margin-top: 24px; }
.portal-runtime-shell-card { height: calc(100vh - 116px); min-height: 560px; margin: -4px -2px 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.portal-runtime-frame { width:100%; height:100%; border:0; display:block; background:#fff; }
.portal-runtime-empty { display:flex; flex-direction:column; align-items:flex-start; gap:12px; }
@media (max-width: 960px) {
    .portal-runtime-shell-card { height: calc(100vh - 180px); min-height: 480px; }
}

/* Delta 09: zentraler Tabellenkopf + Versionsanzeige */
.sidebar-version {
    margin-top: auto;
    padding: 16px 12px 2px;
    border-top: 1px solid #344054;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #98a2b3;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}


























.portal-drag-handle.is-disabled { cursor: default; opacity: .28; border-color: transparent; }
.portal-drag-handle.is-disabled:hover { background: transparent; color: var(--muted); }

@media (max-width: 960px) {
    .sidebar-version { margin-top: 18px; }
    
    
    
}



/* Delta 10: kompakte Portaladministration, zentrale Icons, Portal-Datei-Explorer */
.ui-icon { flex: 0 0 auto; display: block; }
.btn-compact { width: auto; min-height: 36px; padding: 0 11px; border-radius: 8px; gap: 7px; font-size: .82rem; }
.icon-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.icon-actions form { margin: 0; }
.icon-button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475467;
    cursor: pointer;
}
.icon-button:hover,
.icon-button:focus-visible { background: var(--surface-2); border-color: var(--border); color: var(--primary); outline: none; }
.icon-button-danger { color: var(--danger); background: var(--danger-bg); border-color: #fecdca; }
.icon-button-danger:hover,
.icon-button-danger:focus-visible { background: #fee4e2; border-color: #fda29b; color: var(--danger); }
.compact-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.portal-admin-compact-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}
.portal-admin-title { min-width: 0; }
.portal-admin-title h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.portal-admin-pathline { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.portal-settings-card { max-width: none; padding: 14px 16px; border-radius: 12px; }
.portal-settings-grid {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(360px, 1.35fr) minmax(220px, .85fr);
    gap: 10px 14px;
    align-items: start;
}
.portal-settings-grid .form-group { margin: 0; }
.portal-settings-description { grid-column: 1 / -1; }
.form-control-compact { min-height: 38px; border-radius: 8px; padding: 0 10px; font-size: .86rem; }
.form-textarea-compact { min-height: 58px; padding: 8px 10px; resize: vertical; }
.portal-settings-card .form-label { margin-bottom: 5px; font-size: .76rem; }
.portal-settings-card .field-help { margin-top: 4px; font-size: .7rem; }
.portal-settings-card .portal-path-control { min-height: 38px; }
.portal-settings-card .portal-path-prefix,
.portal-settings-card .portal-path-input { min-height: 36px; font-size: .82rem; }
.public-root-control { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; }
.public-root-prefix { display: grid; place-items: center; min-width: 30px; padding: 0 8px; border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; background: var(--surface-2); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.public-root-input { border-radius: 0 8px 8px 0; }
.portal-toggle-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); }
.compact-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; color: #344054; font-size: .78rem; font-weight: 700; cursor: pointer; }
.compact-toggle input[type="hidden"] { display: none; }
.compact-toggle input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.portal-settings-card .form-actions { padding-top: 10px; margin-top: 10px; }
.danger-zone-compact { max-width: none; margin-top: 14px; padding: 10px 14px; border-radius: 10px; }
.danger-zone-compact h3 { font-size: .9rem; margin-bottom: 2px; }
.danger-zone-compact p { font-size: .74rem; }

.portal-file-manager { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.file-manager-toolbar { min-height: 48px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.file-manager-location { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; }
.file-manager-location a { color: var(--primary); font-weight: 700; padding: 3px 4px; border-radius: 5px; }
.file-manager-location a:hover { background: #eef4ff; }
.file-manager-separator { color: #98a2b3; }
.file-manager-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.file-manager-status { min-height: 0; padding: 0 10px; color: var(--muted); font-size: .72rem; }
.file-manager-status:not(:empty) { min-height: 31px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.file-manager-status.is-error { color: var(--danger); background: var(--danger-bg); }
.file-manager-status.is-busy { color: var(--primary); }
.file-manager-status.is-success { color: var(--success); background: var(--success-bg); }
.file-manager-dropzone { position: relative; min-height: 250px; }
.file-manager-dropzone.is-dragover { outline: 2px solid var(--primary); outline-offset: -2px; }
.file-manager-drop-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(245,248,255,.92); color: var(--primary); pointer-events: none; }
.file-manager-drop-overlay[hidden] { display: none !important; }
.file-manager-table-wrap { overflow: auto; }
.file-manager-table { width: 100%; min-width: 680px; }
.file-manager-table th,
.file-manager-table td { padding: 7px 10px; height: 40px; font-size: .78rem; }
.file-manager-table th { font-size: .68rem; letter-spacing: .045em; }
.file-manager-row:hover td { background: #fafbfc; }
.file-manager-name { min-width: 0; display: flex; align-items: center; gap: 8px; }
.file-manager-name span,
.file-manager-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-manager-folder-row .file-manager-name { color: #344054; }
.file-manager-folder-row .file-manager-name .ui-icon { color: #e0a800; }
.file-manager-folder-row .icon-button-danger,
.file-manager-folder-row .icon-button-danger .ui-icon { color: var(--danger); }
.file-col-size { width: 110px; color: var(--muted); }
.file-col-date { width: 145px; color: var(--muted); }
.file-col-status { width: 115px; }
.file-col-actions { width: 118px; text-align: right; }
.file-manager-empty-row td { height: 150px; color: var(--muted); text-align: center; font-size: .8rem; }
.file-manager-footer { min-height: 34px; padding: 6px 10px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: .7rem; }
.file-manager-footer code { color: #344054; font-size: .7rem; }




@media (max-width: 1100px) {
    .portal-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-settings-description { grid-column: 1 / -1; }
    .portal-settings-path { grid-column: span 1; }
}

@media (max-width: 720px) {
    .portal-admin-compact-heading { align-items: stretch; flex-direction: column; }
    .portal-settings-grid { grid-template-columns: 1fr; }
    .portal-settings-description { grid-column: auto; }
    .portal-settings-card { padding: 12px; }
    .portal-toggle-strip { display: grid; grid-template-columns: 1fr; }
    .file-manager-toolbar { align-items: stretch; flex-direction: column; }
    .file-manager-actions { width: 100%; }
    .file-manager-actions .btn { flex: 1 1 0; min-height: 42px; }
    .file-manager-table { min-width: 560px; }
    .file-col-date { display: none; }
    .file-col-status { width: 105px; }
    .danger-zone-compact { align-items: stretch; }
}

/* Delta 11: Mini-App Runtime und Projektdateisystem */
.status-warning { color: #9a6700; background: #fff4cc; }
.file-manager-runtime-note {
    min-height: 36px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    color: #475467;
    font-size: .72rem;
}
.file-manager-runtime-note > span:not(.status) { flex: 1 1 420px; }
.file-manager-runtime-note .status { margin-left: auto; padding: 3px 7px; font-size: .62rem; }
.file-manager-footer-stack { display: grid; align-items: start; gap: 4px; }
.file-manager-footer-stack > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.file-manager-footer-stack code { overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 720px) {
    .file-manager-runtime-note .status { margin-left: 0; }
}

/* Delta 17: Tabellenvertrag + kompakte Portalbearbeitung */



.table-result-count { color: var(--muted); font-size: .76rem; font-weight: 700; }










.portal-primary-cell { min-width: 220px; }





.modal-copy-stack { display: grid; gap: 12px; }
.modal-copy-stack p { margin: 0; color: var(--muted); line-height: 1.55; }










.portal-admin-compact-heading { margin-bottom: 8px; }
.portal-admin-title h2 { font-size: 1.12rem; }
.portal-settings-card { padding: 10px 12px; }
.portal-settings-grid {
    grid-template-columns: minmax(150px, .75fr) minmax(330px, 1.5fr) minmax(175px, .8fr) minmax(175px, .8fr);
    gap: 8px 12px;
}
.portal-settings-card .form-label { margin-bottom: 3px; font-size: .72rem; }
.portal-settings-card .field-help { margin-top: 3px; font-size: .66rem; line-height: 1.3; }
.portal-settings-card .portal-path-control,
.portal-settings-card .portal-path-prefix,
.portal-settings-card .portal-path-input,
.portal-settings-card .form-control-compact { min-height: 34px; }
.portal-settings-card .portal-path-prefix,
.portal-settings-card .portal-path-input,
.portal-settings-card .form-control-compact { font-size: .8rem; }
.portal-toggle-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding-top: 8px;
    margin-top: 8px;
}
.compact-toggle-card {
    min-height: 50px;
    padding: 7px 9px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}
.compact-toggle-card > input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 auto; }
.compact-toggle-card > span { min-width: 0; display: grid; gap: 1px; }
.compact-toggle-card strong { font-size: .74rem; line-height: 1.25; }
.compact-toggle-card small { color: var(--muted); font-size: .64rem; line-height: 1.25; }
.page-bottom-actions { margin-top: 12px; padding: 12px 0 2px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.portal-info-grid { display: grid; gap: 18px; }
.portal-info-description textarea { min-height: 96px; resize: vertical; }
.portal-tech-info { margin: 0; display: grid; gap: 1px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.portal-tech-info > div { min-width: 0; padding: 9px 11px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; background: #fff; border-bottom: 1px solid var(--border); }
.portal-tech-info > div:last-child { border-bottom: 0; }
.portal-tech-info dt { color: var(--muted); font-size: .72rem; font-weight: 700; }
.portal-tech-info dd { min-width: 0; margin: 0; font-size: .75rem; }
.portal-tech-info code { overflow-wrap: anywhere; word-break: break-word; }

.portal-file-manager { margin-top: 10px; }
.file-manager-toolbar { min-height: 44px; padding: 6px 9px; }
.file-manager-heading-block { min-width: 0; display: flex; align-items: center; gap: 12px; flex: 1 1 auto; }
.file-manager-title { flex: 0 0 auto; font-size: .82rem; }
.file-manager-location { gap: 2px; }
.file-manager-location a { padding: 2px 3px; }
.file-manager-table { min-width: 600px; }
.file-col-actions { width: 118px; }

@media (max-width: 1199px) {
    .portal-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-settings-path { grid-column: span 1; }
    .portal-toggle-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 699px) {
    
    
    
    
    
    .portal-admin-compact-heading { align-items: stretch; }
    .page-heading-actions { width: 100%; }
    .page-heading-actions .btn { flex: 1 1 auto; }
    .portal-settings-grid { grid-template-columns: 1fr; }
    .portal-toggle-strip { grid-template-columns: 1fr; }
    .compact-toggle-card { min-height: 54px; }
    .file-manager-heading-block { align-items: flex-start; flex-direction: column; gap: 3px; }
    .file-manager-table { min-width: 520px; }
    .portal-tech-info > div { grid-template-columns: 1fr; gap: 3px; }
    .page-bottom-actions { position: sticky; bottom: 0; z-index: 8; margin-left: -22px; margin-right: -22px; padding: 10px 22px; background: rgba(246,243,238,.96); backdrop-filter: blur(8px); }
    .page-bottom-actions .btn { flex: 1 1 0; }
}


/* Delta 18: kompaktere Portalbearbeitung + integrierter Code-Editor */
.portal-settings-grid {
    grid-template-columns: minmax(280px, 1.6fr) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 8px 12px;
}
.portal-settings-name { min-width: 0; }
.portal-settings-path,
.portal-settings-entry { min-width: 0; }
.portal-toggle-strip { gap: 6px; padding-top: 7px; margin-top: 7px; }
.compact-toggle-card { min-height: 42px; padding: 5px 8px; align-items: center; }
.compact-toggle-card > input[type="checkbox"] { margin-top: 0; }
.compact-toggle-card > span { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.compact-toggle-card strong { font-size: .72rem; }
.compact-toggle-card small { font-size: .62rem; }
.portal-path-status:empty { display: none; }
.file-manager-table-wrap { min-height: 340px; background: #fff; }
.file-manager-editable-row { cursor: default; }
.file-manager-editable-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
[id^="portal-file-editor-"] .modal-dialog { width: min(1080px, 84vw); max-width: 1080px; max-height: 88vh; }
.file-editor { display: grid; gap: 10px; }
.file-editor-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-editor-head > div { min-width: 0; display: grid; gap: 2px; }
.file-editor-head strong { font-size: .9rem; }
.file-editor-head code { color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.file-editor-language { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .62rem; font-weight: 800; }
.file-editor-status { min-height: 18px; color: var(--muted); font-size: .72rem; }
.file-editor-status.is-error { color: var(--danger); }
.file-editor-status.is-success { color: #067647; }
.file-editor-status.is-busy { color: var(--primary); }
.file-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; min-height: 480px; }
.file-editor-pane { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 5px; }
.file-editor-input,
.file-editor-preview { width: 100%; min-height: 440px; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: #111827; color: #e5e7eb; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; overflow: auto; white-space: pre; }
.file-editor-input { resize: none; outline: none; }
.file-editor-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45, 91, 209, .12); }
.file-editor-preview code { font: inherit; }
.file-editor-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.syn-comment { color: #7dd3fc; }
.syn-string { color: #fde68a; }
.syn-tag { color: #f0abfc; }
.syn-number { color: #fdba74; }
.syn-literal { color: #c4b5fd; }
.syn-keyword { color: #93c5fd; font-weight: 700; }
.syn-property { color: #86efac; }

@media (max-width: 1199px) {
    .portal-settings-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
    .portal-settings-entry { grid-column: 1 / -1; }
}

@media (max-width: 899px) {
    .file-editor-grid { grid-template-columns: 1fr; min-height: 0; }
    .file-editor-input,
    .file-editor-preview { min-height: 300px; }
}

@media (max-width: 699px) {
    .portal-settings-grid { grid-template-columns: 1fr; }
    .portal-settings-entry { grid-column: auto; }
    .compact-toggle-card { min-height: 44px; }
    .file-manager-table-wrap { min-height: 280px; }
    [id^="portal-file-editor-"] .modal-dialog { width: calc(100vw - 16px); }
    .file-editor-preview-pane { display: none; }
    .file-editor-input { min-height: 55vh; }
}

/* Delta 27: einheitlicher Tabellenvertrag + filigranere Portal-Dichte */
:root {
    --radius: 12px;
    --shadow: 0 10px 28px rgba(16, 24, 40, .07);
}

body { font-size: 14px; }
.app-shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { padding: 18px 14px; }
.sidebar .brand-mark { padding: 0 10px 16px; font-size: 1rem; }
.nav { gap: 4px; }
.nav-section { padding: 13px 10px 6px; font-size: .64rem; }
.nav a { padding: 8px 10px; border-radius: 8px; font-size: .82rem; }
.sidebar-version { padding: 12px 10px 0; font-size: .68rem; justify-content: flex-start; }

.topbar { height: 62px; padding: 0 24px; grid-template-columns: minmax(130px, .55fr) minmax(300px, 1.55fr) minmax(220px, .8fr); gap: 16px; }
.topbar-title { font-size: .9rem; }
.global-search-input { height: 36px; font-size: .82rem; }
.global-search-button { min-height: 36px; padding: 0 12px; font-size: .78rem; }
.account-trigger { min-height: 38px; padding: 4px 7px; gap: 7px; }
.account-avatar { width: 30px; height: 30px; font-size: .72rem; }
.account-name { font-size: .78rem; }
.account-dropdown { font-size: .82rem; }

.content { width: min(100%, 1500px); padding: 24px; }
.hero { margin-bottom: 18px; }
.hero h2 { margin-bottom: 5px; font-size: 1.42rem; }
.hero p { font-size: .86rem; line-height: 1.48; }
.page-heading { gap: 14px; margin-bottom: 18px; }
.grid { gap: 13px; }
.settings-grid { gap: 14px; }
.card { padding: 16px; }
.card h3 { font-size: .92rem; }
.card p { font-size: .82rem; line-height: 1.45; }
.card-value { margin-top: 12px; font-size: 1.42rem; }
.card-link { margin-top: 12px; font-size: .8rem; }

.form-group { margin-bottom: 13px; }
.form-label { margin-bottom: 5px; font-size: .8rem; }
.form-control { min-height: 40px; padding: 0 11px; border-radius: 9px; font-size: .84rem; }
.field-help { margin-top: 4px; font-size: .7rem; }
.btn { min-height: 38px; padding: 0 12px; border-radius: 8px; gap: 6px; font-size: .82rem; }
.btn-primary { min-height: 40px; }
.btn-auto { min-height: 38px; }
.btn-compact { min-height: 34px; padding: 0 10px; font-size: .76rem; }
.alert { padding: 9px 11px; margin-bottom: 13px; font-size: .82rem; }
.form-card { padding: 18px; }
.form-grid { gap: 0 14px; }
.form-actions { gap: 7px; padding-top: 14px; }

/* Master-Tabelle: identische Dichte für Portal- und Benutzerverwaltung */




.table-result-count { font-size: .68rem; }












.status { padding: 3px 7px; font-size: .64rem; }
.icon-button { width: 32px; height: 32px; flex-basis: 32px; border-radius: 7px; }
.icon-actions { gap: 2px; }


.portal-drag-handle { width: 30px; height: 30px; }
.portal-primary-cell,
.user-primary-cell { min-width: 150px; }










/* Portal bearbeiten ebenfalls dichter halten */
.portal-admin-compact-heading { margin-bottom: 6px; }
.portal-admin-title h2 { font-size: 1rem; }
.portal-settings-card { padding: 8px 10px; }
.portal-settings-grid { gap: 6px 10px; }
.portal-settings-card .form-label { font-size: .68rem; }
.portal-settings-card .field-help { font-size: .62rem; }
.portal-settings-card .portal-path-control,
.portal-settings-card .portal-path-prefix,
.portal-settings-card .portal-path-input,
.portal-settings-card .form-control-compact { min-height: 32px; }
.portal-settings-card .portal-path-prefix,
.portal-settings-card .portal-path-input,
.portal-settings-card .form-control-compact { font-size: .74rem; }
.portal-toggle-strip { gap: 5px; padding-top: 5px; margin-top: 5px; }
.compact-toggle-card { min-height: 38px; padding: 4px 7px; }
.compact-toggle-card strong { font-size: .68rem; }
.compact-toggle-card small { font-size: .58rem; }
.page-bottom-actions { margin-top: 9px; padding-top: 9px; }
.portal-file-manager { margin-top: 8px; }
.file-manager-toolbar { min-height: 40px; padding: 5px 7px; }
.file-manager-title { font-size: .76rem; }
.file-manager-location { font-size: .69rem; }
.file-manager-table th,
.file-manager-table td { padding: 6px 8px; height: 36px; font-size: .72rem; }
.file-manager-table th { font-size: .62rem; }

@media (max-width: 1199px) {
    .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
    .topbar { padding: 0 18px; }
    .content { padding: 20px; }
}

@media (max-width: 960px) {
    body { font-size: 14px; }
    .app-shell { grid-template-columns: 1fr; }
    .content { width: 100%; padding: 18px; }
    .topbar { min-height: 62px; padding: 9px 16px; }
    .sidebar { padding: 16px; }
    .btn { min-height: 40px; }
    
    .icon-button { width: 38px; height: 38px; flex-basis: 38px; }
    .form-control { min-height: 42px; }
    
    
}

@media (max-width: 699px) {
    .content { padding: 14px; }
    
    
    
    
    .portal-settings-card { padding: 8px; }
    .compact-toggle-card { min-height: 44px; }
}




/* V0.28.0 – File Explorer selection, bulk actions and ZIP conflict flow */
.file-col-select { width: 38px; min-width: 38px; text-align: center; }
.file-col-select input[type="checkbox"] { width: 15px; height: 15px; margin: 0; vertical-align: middle; accent-color: var(--primary); cursor: pointer; }
.file-manager-row.is-selected td { background: #f1f6ff; }
.file-manager-row.is-selected:hover td { background: #eaf2ff; }
.file-manager-bulk-delete:disabled { opacity: .52; cursor: not-allowed; }
.file-manager-selection-count { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(31, 79, 153, .1); color: var(--primary); font-size: .62rem; font-weight: 800; line-height: 1; }
.zip-extract-form { margin-top: 14px; }
.zip-extract-form .form-actions { justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 699px) {
    .file-col-select { width: 42px; min-width: 42px; }
    .file-col-select input[type="checkbox"] { width: 18px; height: 18px; }
    .file-manager-bulk-delete span:not(.file-manager-selection-count) { display: none; }
}

/* V0.29.0 – benutzerbezogen einklappbare Desktop-Sidebar + mobile Off-Canvas-Navigation */
:root { --app-sidebar-width: 224px; }

.app-shell {
    grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns .2s ease;
}

.sidebar {
    width: var(--app-sidebar-width);
    position: relative;
    z-index: 41;
    transition: transform .2s ease, opacity .16s ease;
}

.sidebar-toggle-tab {
    position: fixed;
    z-index: 60;
    top: 84px;
    left: calc(var(--app-sidebar-width) - 11px);
    width: 26px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid #344054;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #101828;
    color: #d0d5dd;
    box-shadow: 4px 4px 12px rgba(16, 24, 40, .12);
    cursor: pointer;
    transition: left .2s ease, background .15s ease, color .15s ease;
}
.sidebar-toggle-tab:hover,
.sidebar-toggle-tab:focus-visible { background: #1d2939; color: #fff; outline: 2px solid rgba(255,255,255,.22); outline-offset: 2px; }
.sidebar-toggle-expand { display: none; }

body.sidebar-collapsed .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); opacity: 0; pointer-events: none; }
body.sidebar-collapsed .sidebar-toggle-tab { left: 0; }
body.sidebar-collapsed .sidebar-toggle-collapse { display: none; }
body.sidebar-collapsed .sidebar-toggle-expand { display: inline-flex; }

.sidebar-backdrop { display: none; }
.topbar-leading { min-width: 0; display: flex; align-items: center; gap: 9px; }
.mobile-menu-button {
    display: none;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}
.mobile-menu-button:hover { background: var(--surface-2); }
.mobile-menu-button:focus-visible { outline: 2px solid rgba(31,79,209,.28); outline-offset: 2px; }

@media (max-width: 1199px) and (min-width: 981px) {
    :root { --app-sidebar-width: 210px; }
}

@media (max-width: 980px) {
    :root { --app-sidebar-width: min(82vw, 280px); }

    .app-shell,
    body.sidebar-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }

    .sidebar,
    body.sidebar-collapsed .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--app-sidebar-width);
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        transform: translateX(-100%);
        opacity: 1;
        pointer-events: auto;
        box-shadow: 14px 0 36px rgba(16,24,40,.22);
    }

    body.sidebar-mobile-open { overflow: hidden; }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }

    .mobile-menu-button { display: grid; }

    .sidebar-toggle-tab,
    body.sidebar-collapsed .sidebar-toggle-tab { display: none; }
    body.sidebar-mobile-open .sidebar-toggle-tab {
        display: grid;
        top: 78px;
        left: calc(var(--app-sidebar-width) - 11px);
    }
    body.sidebar-mobile-open .sidebar-toggle-collapse { display: inline-flex !important; }
    body.sidebar-mobile-open .sidebar-toggle-expand { display: none !important; }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(16, 24, 40, .44);
        opacity: 0;
        pointer-events: none;
        display: block;
        transition: opacity .18s ease;
    }
    body.sidebar-mobile-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    .topbar-leading { min-width: 0; }
    .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 640px) {
    .topbar-leading { grid-column: 1; }
    .topbar-title { display: none; }
}

@media (max-width: 640px) {
    .topbar { grid-template-columns: auto minmax(0, 1fr); }
    .topbar-leading { grid-column: 1; grid-row: 1; }
    .topbar-account { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    .global-search { grid-column: 1 / -1; grid-row: 2; }
}

/* V0.30.0 – nahtlose Sidebar-Lasche, entkoppelter Datei-Explorer, Tabellenvertrag */
.sidebar-toggle-tab {
    top: 68px;
    left: calc(var(--app-sidebar-width) - 1px);
    width: 22px;
    height: 36px;
    border: 0;
    border-radius: 0 7px 7px 0;
    background: #101828;
    box-shadow: none;
    color: #cbd5e1;
}
.sidebar-toggle-tab:hover { background: #172235; color: #fff; outline: 0; box-shadow: none; }
.sidebar-toggle-tab:focus { outline: 0; }
.sidebar-toggle-tab:focus-visible { outline: 2px solid rgba(194, 138, 58, .7); outline-offset: 2px; }
body.sidebar-collapsed .sidebar-toggle-tab { left: 0; }

.file-select-checkbox {
    display: inline-block !important;
    position: static !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    appearance: auto !important;
    accent-color: var(--primary);
    cursor: pointer;
}
.file-col-select { width: 42px; min-width: 42px; padding-left: 8px !important; padding-right: 8px !important; text-align: center; }
.file-manager-table-wrap { min-height: 420px; }
.file-manager-progress { padding: 8px 10px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.file-manager-progress[hidden] { display: none !important; }
.file-manager-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .72rem; }
.file-manager-progress-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.file-manager-progress-track { height: 7px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: #e7ebf2; }
.file-manager-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .12s linear; }
.portal-file-manager.is-uploading .file-manager-dropzone { cursor: progress; }
.portal-path-input[readonly] { background: #f2f4f7; color: var(--muted); cursor: wait; }

/* Spaltenfilter sind auf Desktop/Tablet Teil des Tabellenkopfs und damit standardmäßig sichtbar. */






@media (max-width: 980px) {
    .sidebar-toggle-tab,
    body.sidebar-mobile-open .sidebar-toggle-tab {
        top: 68px;
        left: calc(var(--app-sidebar-width) - 1px);
        width: 22px;
        height: 36px;
        border: 0;
        box-shadow: none;
    }
}

@media (max-width: 699px) {
    .file-manager-table-wrap { min-height: 300px; }
    .file-select-checkbox { width: 19px !important; height: 19px !important; min-width: 19px; }
}

/* Delta 31: aktuelle Login-/Startseitenlogik */
.auth-shell-current .auth-brand { padding: 46px; }
.auth-shell-current .auth-brand h1 { max-width: 620px; font-size: clamp(2.15rem, 4vw, 3.65rem); line-height: 1.02; margin: 18px 0 14px; letter-spacing: -.04em; }
.auth-shell-current .auth-brand p { max-width: 590px; font-size: .96rem; line-height: 1.55; }
.auth-brand-copy { max-width: 650px; }
.auth-kicker { display: inline-flex; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; color: rgba(255,255,255,.68); }
.auth-feature-list { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 590px; color: rgba(255,255,255,.82); font-size: .84rem; }
.auth-feature-list li { position: relative; padding-left: 18px; }
.auth-feature-list li::before { content: ""; position: absolute; left: 0; top: .48em; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.72); }
.auth-shell-current .auth-panel { padding: 34px; }
.auth-shell-current .login-card { width: min(100%, 390px); }
.auth-shell-current .login-card h2 { font-size: 1.6rem; }
.auth-shell-current .login-card > p { margin-bottom: 24px; font-size: .88rem; }
.auth-shell-current .form-control { min-height: 42px; }
.auth-shell-current .btn-primary { min-height: 44px; }
.auth-shell-current .form-group { margin-bottom: 14px; }
.auth-shell-current .security-note { margin-top: 18px; padding-top: 15px; font-size: .77rem; }

.landing-portal-fields { margin: -4px 0 18px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.landing-portal-fields[hidden], [data-portal-landing-fields][hidden] { display: none !important; }
.dashboard-section + .dashboard-section { margin-top: 28px; }
.section-heading-inline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading-inline h3 { margin: 0 0 4px; font-size: 1rem; }
.section-heading-inline p { margin: 0; color: var(--muted); font-size: .82rem; }
.dashboard-portal-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.dashboard-portal-card { min-height: 150px; }
.dashboard-admin-section .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 699px) {
    .auth-shell-current .auth-panel { padding: 24px 18px; }
    .section-heading-inline { align-items: stretch; flex-direction: column; }
    .dashboard-admin-section .grid { grid-template-columns: 1fr; }
}

/* V0.32.0 – volle Arbeitsbreite, reine Syntaxvorschau und Portalzugriff */
.content {
    width: 100%;
    max-width: none;
}

.file-manager-previewable-row { cursor: default; }
.file-manager-previewable-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
[id^="portal-file-preview-"] .modal-dialog { width: min(1180px, 92vw); max-width: 1180px; max-height: 88vh; }
.file-preview { display: grid; gap: 10px; }
.file-preview-pane { min-width: 0; }
.file-preview-code {
    min-height: 58vh;
    max-height: 68vh;
    padding: 14px 16px;
    border-radius: 9px;
    overflow: auto;
}
.file-preview-code:focus-visible { outline: 2px solid rgba(31,79,209,.34); outline-offset: 2px; }

[id^="portal-access-"] .modal-dialog { width: min(760px, 92vw); max-width: 760px; max-height: 88vh; }
.portal-access-form { display: grid; gap: 10px; }
.portal-access-intro { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.portal-access-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.portal-access-search { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--muted); }
.portal-access-search:focus-within { border-color: #7898ef; box-shadow: 0 0 0 3px rgba(31,79,209,.08); }
.portal-access-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .78rem; }
.portal-access-select-all { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: #344054; font-size: .74rem; font-weight: 700; cursor: pointer; }
.portal-access-select-all input,
.portal-access-user > input { width: 17px; height: 17px; accent-color: var(--primary); }
.portal-access-count { min-height: 18px; color: var(--muted); font-size: .72rem; }
.portal-access-status { min-height: 18px; font-size: .74rem; }
.portal-access-status.is-busy { color: var(--primary); }
.portal-access-status.is-success { color: var(--success); }
.portal-access-status.is-error { color: var(--danger); }
.portal-access-list { max-height: 48vh; overflow: auto; display: grid; gap: 5px; padding: 2px; }
.portal-access-user { min-height: 52px; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.portal-access-user:hover { background: #fafbfc; }
.portal-access-user:has(input:checked) { border-color: #b9c8f5; background: #f7f9ff; }
.portal-access-avatar { width: 30px; height: 30px; font-size: .66rem; }
.portal-access-user-copy { min-width: 0; display: grid; gap: 2px; }
.portal-access-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.portal-access-user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .68rem; }
.portal-access-actions { margin-top: 2px; }
.portal-access-empty,
.portal-access-no-results { padding: 20px 10px; text-align: center; color: var(--muted); font-size: .78rem; }

@media (max-width: 699px) {
    .portal-access-toolbar { grid-template-columns: 1fr; }
    .portal-access-select-all { justify-content: flex-start; }
    .portal-access-user { grid-template-columns: auto auto minmax(0, 1fr); }
    .portal-access-user .status { grid-column: 3; justify-self: start; }
    [id^="portal-file-preview-"] .modal-dialog { width: calc(100vw - 16px); }
    .file-preview-code { min-height: 62vh; max-height: 68vh; }
}

/* V0.33.0 – shared portal access selector in user administration */
.user-portal-access { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.user-portal-access-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.user-portal-access-head h3 { margin: 0 0 3px; font-size: .9rem; }
.user-portal-access-head .field-help { margin: 0; }
.user-portal-access-list { max-height: 320px; }
.user-portal-access-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.user-portal-access-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #f2f5fb; color: var(--primary); }
@media (max-width: 699px) {
    .user-portal-access-head { display: grid; gap: 4px; }
    .user-portal-access-row { grid-template-columns: auto auto minmax(0, 1fr); }
    .user-portal-access-row .status { grid-column: 3; justify-self: start; }
}

/* V0.34.0: schlichte phi.itservice Loginseite */
.auth-login-page {
    min-height: 100vh;
    background: #f2f4f7;
}

.auth-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.auth-login-card {
    width: min(100%, 430px);
    padding: 26px;
    background: #fff;
    border: 1px solid #e3e7ed;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 31, 46, .07);
}

.auth-login-logo-wrap {
    min-height: 102px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    padding: 18px 20px;
    background: #f8fafc;
    border-radius: 13px;
}

.auth-login-logo {
    display: block;
    width: 100%;
    max-width: 335px;
    height: auto;
    object-fit: contain;
}

.auth-login-card h1 {
    margin: 0 0 22px;
    color: #172033;
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.auth-login-form .form-group {
    margin-bottom: 16px;
}

.auth-login-form .form-label {
    margin-bottom: 7px;
    color: #4f5f70;
    font-size: .78rem;
    font-weight: 500;
}

.auth-login-form .form-control {
    min-height: 42px;
    border-color: #cbd5e1;
    border-radius: 9px;
    padding: 0 12px;
}

.auth-login-form .form-control:focus {
    border-color: #0086c5;
    box-shadow: 0 0 0 3px rgba(0, 134, 197, .12);
}

.auth-login-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 2px;
    border-radius: 9px;
    background: #007fb8;
    color: #fff;
}

.auth-login-submit:hover {
    background: #006a9a;
}

.auth-login-submit:focus-visible {
    outline: 3px solid rgba(0, 134, 197, .25);
    outline-offset: 2px;
}

.auth-login-card .alert {
    margin-bottom: 18px;
}

@media (max-width: 520px) {
    .auth-login-shell {
        align-items: flex-start;
        padding: 18px 12px;
    }

    .auth-login-card {
        margin-top: 24px;
        padding: 22px 18px;
        border-radius: 16px;
    }

    .auth-login-logo-wrap {
        min-height: 90px;
        margin-bottom: 22px;
        padding: 16px;
    }

    .auth-login-card h1 {
        font-size: 1.4rem;
    }

    .auth-login-form .form-control,
    .auth-login-submit {
        min-height: 44px;
    }
}

/* V0.36.0 – Live-Quick-Search, ruhige mobile Shell und erste zentrale Seiten-Aktionsleiste */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    overflow: visible;
}

.global-search {
    position: relative;
    width: 100%;
    min-width: 0;
    display: block;
}
.global-search-field {
    position: relative;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
}
.global-search-icon {
    position: absolute;
    z-index: 2;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: #667085;
    pointer-events: none;
}
.global-search-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 82px 0 39px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text);
    outline: none;
}
.global-search-input:focus {
    background: #fff;
    border-color: #7898ef;
    box-shadow: 0 0 0 3px rgba(31,79,209,.08);
}
.global-search-shortcut {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 58px;
    padding: 3px 6px;
    border: 1px solid #d0d5dd;
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #fff;
    color: #667085;
    font: inherit;
    font-size: .66rem;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
}
.global-search-button { display: none !important; }
.global-search-dropdown {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: min(560px, calc(100vh - 110px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(16,24,40,.18);
}
.global-search-dropdown[hidden] { display: none !important; }
.global-search-group + .global-search-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid #eaecf0; }
.global-search-group-title {
    padding: 6px 9px 5px;
    color: #667085;
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.global-search-result {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
}
.global-search-result:hover,
.global-search-result.is-active {
    background: #eef4ff;
    color: var(--text);
}
.global-search-result strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .82rem;
}
.global-search-result span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667085;
    font-size: .71rem;
}
.global-search-state {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    color: #667085;
    font-size: .78rem;
    text-align: center;
}
.global-search-state[data-state="error"] { color: var(--danger); }
.global-search[aria-busy="true"] .global-search-icon { animation: phi-search-pulse .8s ease-in-out infinite alternate; }
@keyframes phi-search-pulse { from { opacity: .45; } to { opacity: 1; } }

.page-actionbar {
    position: sticky;
    top: 76px;
    z-index: 29;
    min-height: 52px;
    padding: 7px 34px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.page-actionbar-title {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .88rem;
    font-weight: 800;
    color: #344054;
}
.page-actionbar-content {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.page-actionbar-secondary,
.page-actionbar-primary {
    display: flex;
    align-items: center;
    gap: 7px;
}
.page-actionbar-more { position: relative; display: none; }
.page-actionbar-more > summary { list-style: none; }
.page-actionbar-more > summary::-webkit-details-marker { display: none; }
.page-actionbar-more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(260px, calc(100vw - 24px));
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(16,24,40,.18);
}
.page-actionbar-more-menu a,
.page-actionbar-more-menu button {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.page-actionbar-more-menu a:hover,
.page-actionbar-more-menu button:hover { background: var(--surface-2); }
.page-actionbar-more-menu .is-danger { color: var(--danger); }

@media (max-width: 1199px) {
    .page-actionbar { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 980px) {
    .topbar { position: sticky; top: 0; }
    .sidebar-version { margin-top: auto !important; }
    body.sidebar-mobile-open { padding-right: var(--sidebar-scrollbar-compensation, 0px); }
}

@media (max-width: 699px) {
    .topbar {
        height: 58px;
        min-height: 58px;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        grid-template-rows: 1fr;
        gap: 8px;
        padding: 8px 10px;
    }
    .topbar-leading {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 38px;
    }
    .topbar-title { display: none !important; }
    .mobile-menu-button { width: 38px; height: 38px; flex-basis: 38px; }
    .global-search {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0;
    }
    .global-search-input {
        height: 40px;
        padding-right: 10px;
        padding-left: 36px;
        font-size: .8rem;
    }
    .global-search-icon { left: 11px; }
    .global-search-shortcut { display: none; }
    .global-search-dropdown {
        position: fixed;
        top: 64px;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: calc(100vh - 74px);
    }
    .topbar-account {
        grid-column: 3 !important;
        grid-row: 1 !important;
        justify-content: flex-end;
        min-width: 38px;
    }
    .account-trigger { padding: 2px; }
    .account-name { display: none !important; }
    .account-avatar { width: 36px; height: 36px; flex-basis: 36px; }
    .account-dropdown { right: 0; width: min(290px, calc(100vw - 20px)); }

    .page-actionbar {
        top: 58px;
        min-height: 50px;
        padding: 6px 10px;
        gap: 7px;
    }
    .page-actionbar-content { display: contents; }
    .page-actionbar-title {
        order: 2;
        flex: 1 1 auto;
        font-size: .78rem;
        text-align: left;
    }
    .page-actionbar-secondary { order: 1; flex: 0 0 auto; }
    .page-actionbar-secondary > :not(.page-action-back) { display: none !important; }
    .page-actionbar-secondary .page-action-back {
        width: 38px;
        min-width: 38px;
        min-height: 38px;
        padding: 0;
    }
    .page-actionbar-secondary .page-action-back span { display: none; }
    .page-actionbar-primary { order: 3; flex: 0 0 auto; }
    .page-actionbar-primary .btn { min-height: 38px; padding-left: 10px; padding-right: 10px; }
    .page-actionbar-primary .btn span { display: none; }
    .page-actionbar-more { order: 4; display: block; flex: 0 0 auto; }
    .page-actionbar-more > summary { width: 38px; height: 38px; flex-basis: 38px; }

    .content { padding-top: 16px; }
}

/* V0.38.0 – zentrale Rechteverwaltung und sicherer Identitätswechsel */
.impersonation-banner {
    position: sticky;
    top: 76px;
    z-index: 29;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 34px;
    border-bottom: 1px solid #f1c96b;
    background: #fff7d6;
    color: #6b4f00;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .05);
}
.impersonation-banner-copy { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.impersonation-banner-copy strong { font-size: .82rem; }
.impersonation-banner-copy span { font-size: .72rem; color: #806000; }
.impersonation-banner form { margin: 0; flex: 0 0 auto; }
body.is-impersonating .page-actionbar { top: 122px; }

.rights-hero { margin-bottom: 16px; }
.rights-rules {
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px solid #d9e2f5;
    border-radius: 14px;
    background: #f7f9ff;
}
.rights-rules h3 { margin: 0 0 7px; font-size: .92rem; }
.rights-rules p { margin: 4px 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.rights-section { margin-top: 30px; }
.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading-row h2 { margin: 0; font-size: 1.08rem; }
.section-heading-row p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.rights-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rights-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(16,24,40,.035);
}
.rights-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rights-card-head h3 { margin: 0; font-size: 1rem; }
.rights-card-head span:not(.status) { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.rights-permission-list { display: grid; gap: 10px; }
.rights-permission-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #eaecf0;
    border-radius: 11px;
    background: #fbfcfe;
}
.rights-permission-copy { min-width: 0; display: grid; gap: 4px; }
.rights-permission-copy strong { font-size: .82rem; }
.rights-permission-copy small { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.permission-state { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 3px; padding: 3px; border: 1px solid #d0d5dd; border-radius: 10px; background: #fff; }
.permission-state-option { position: relative; cursor: pointer; }
.permission-state-option input { position: absolute; opacity: 0; pointer-events: none; }
.permission-state-option span {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border-radius: 7px;
    color: #475467;
    font-size: .69rem;
    font-weight: 800;
    white-space: nowrap;
}
.permission-state-option input:focus-visible + span { outline: 2px solid #7898ef; outline-offset: 1px; }
.permission-state-undefined input:checked + span { background: #f2f4f7; color: #344054; }
.permission-state-allow input:checked + span { background: var(--success-bg); color: var(--success); }
.permission-state-deny input:checked + span { background: var(--danger-bg); color: var(--danger); }
.rights-card-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid #eaecf0; }
.rights-user-picker { max-width: 760px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; }
.rights-user-picker .form-group { margin: 0; }
.rights-user-card { max-width: 1100px; }
.rights-user-head { align-items: center; }
.rights-user-subsection + .rights-user-subsection { margin-top: 20px; padding-top: 18px; border-top: 1px solid #eaecf0; }
.rights-memberships { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rights-membership {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.rights-membership input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--primary); }
.rights-membership > span { min-width: 0; display: grid; gap: 2px; }
.rights-membership strong { font-size: .8rem; }
.rights-membership small { color: var(--muted); font-size: .68rem; }
.rights-effective { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.rights-effective .status { padding: 3px 7px; font-size: .65rem; }

@media (max-width: 980px) {
    .impersonation-banner { padding-left: 20px; padding-right: 20px; }
    .rights-group-grid { grid-template-columns: 1fr; }
}

@media (max-width: 699px) {
    .impersonation-banner {
        top: 58px;
        min-height: 48px;
        padding: 6px 10px;
        gap: 8px;
    }
    .impersonation-banner-copy { display: grid; gap: 1px; }
    .impersonation-banner-copy strong { font-size: .72rem; }
    .impersonation-banner-copy span { font-size: .64rem; }
    .impersonation-banner .btn span { display: none; }
    .impersonation-banner .btn { width: 38px; min-width: 38px; padding: 0; justify-content: center; }
    body.is-impersonating .page-actionbar { top: 106px; }
    .rights-card { padding: 13px; }
    .rights-permission-row { grid-template-columns: 1fr; gap: 9px; }
    .permission-state { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .permission-state-option span { min-height: 38px; padding: 0 6px; }
    .rights-user-picker { grid-template-columns: 1fr; }
    .rights-user-picker .btn { width: 100%; }
    .rights-memberships { grid-template-columns: 1fr; }
    .rights-user-head { align-items: stretch; flex-direction: column; }
    .rights-user-head .btn { width: 100%; justify-content: center; }
}

/* V0.39.0 – globale Portal-Designvorlage, Branding und Dirty-State */
.sidebar .brand-mark {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 0 10px 20px;
}
.brand-logo {
    display: block;
    width: min(100%, 196px);
    height: auto;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
}

.btn,
.icon-button { transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease, box-shadow .15s ease; }
.btn:disabled,
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    pointer-events: none;
}
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
    color: #98a2b3;
    background: #eaecf0;
    border: 1px solid #d0d5dd;
    box-shadow: none;
}
.page-action-info { flex: 0 0 auto; }
.danger-zone-passive { justify-content: flex-start; }

/* Quick Search bleibt vollständig geschlossen, solange keine echten Treffer vorliegen. */
.global-search-dropdown[hidden] { display: none !important; }

@media (max-width: 699px) {
    .sidebar .brand-mark { padding-top: 2px; padding-bottom: 16px; }
    .brand-logo { max-width: 178px; max-height: 52px; }
}

/* V0.40.0 – nahtlose Shell-Verbindung und Original-Branding */
:root { --portal-topbar-height: 62px; }

.page-actionbar {
    top: var(--portal-topbar-height);
    border-top: 0;
}

.impersonation-banner { top: var(--portal-topbar-height); }
body.is-impersonating .page-actionbar { top: calc(var(--portal-topbar-height) + 46px); }

.sidebar .brand-mark {
    min-height: 86px;
    align-items: flex-start;
    padding: 0 10px 16px;
}
.brand-logo {
    width: auto;
    max-width: 100%;
    max-height: 76px;
    border-radius: 6px;
    object-fit: contain;
    object-position: left top;
}

@media (max-width: 699px) {
    :root { --portal-topbar-height: 58px; }
    .sidebar .brand-mark { min-height: 78px; padding: 0 8px 14px; }
    .brand-logo { max-height: 68px; }
    body.is-impersonating .page-actionbar { top: calc(var(--portal-topbar-height) + 48px); }
}

/* V0.41.0 – Original-Logo unverändert, klar getrennte Shell-Leisten */
.sidebar .brand-mark {
    width: 100%;
    height: 108px;
    min-height: 108px;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    align-items: flex-start;
    justify-content: flex-start;
}
.brand-logo {
    display: block;
    width: auto;
    height: 108px;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: left top;
    flex: 0 0 auto;
}

/* Die globale Topbar bleibt weiß, die Seiten-Aktionsleiste erhält nur eine
   minimale blau-graue Abstufung. Beide schließen ohne Zwischenraum aneinander an. */
.page-actionbar {
    background: #f7f9fc;
    border-top: 0;
    border-bottom-color: #dfe5ee;
    box-shadow: inset 0 1px 0 #eef2f6;
    backdrop-filter: none;
}

@media (max-width: 699px) {
    .sidebar .brand-mark {
        height: 96px;
        min-height: 96px;
        padding: 0;
    }
    .brand-logo { height: 96px; }
}

/* V0.42.0 – kompaktes horizontales Sidebar-Branding wie Referenz */
.sidebar .brand-mark {
    width: auto;
    height: 50px;
    min-height: 50px;
    margin: 0 4px 14px;
    padding: 0;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-decoration: none;
}

.brand-symbol {
    position: relative;
    display: block;
    width: 39px;
    height: 30px;
    flex: 0 0 39px;
    overflow: hidden;
    border-radius: 50%;
    background: #1f6f99;
}

.brand-symbol-image {
    position: absolute;
    top: 50%;
    left: 0;
    display: block;
    width: auto;
    height: 38px;
    max-width: none;
    max-height: none;
    transform: translateY(-50%);
    object-fit: none;
}

.brand-wordmark {
    display: block;
    color: #e4e7ec;
    font-size: 1.42rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.035em;
    white-space: nowrap;
}

.sidebar .brand-mark:hover .brand-wordmark,
.sidebar .brand-mark:focus-visible .brand-wordmark { color: #fff; }
.sidebar .brand-mark:focus-visible { outline: 2px solid rgba(255,255,255,.42); outline-offset: 4px; border-radius: 6px; }

@media (max-width: 699px) {
    .sidebar .brand-mark {
        height: 48px;
        min-height: 48px;
        margin: 0 2px 14px;
        padding: 0;
    }
    .brand-symbol { width: 37px; height: 29px; flex-basis: 37px; }
    .brand-symbol-image { height: 36px; }
    .brand-wordmark { font-size: 1.34rem; }
}

/* V0.43.0 – zentrale Portaleinstellungen / konfigurierbares Branding */
.brand-symbol {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    overflow: visible;
    border-radius: 0;
    background: transparent;
}
.brand-symbol-image {
    position: static;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    transform: none;
    object-fit: contain;
    object-position: center;
}
.sidebar .brand-mark {
    min-height: 54px;
    height: auto;
    gap: 9px;
}

.portal-settings-page { min-width: 0; }
.portal-settings-intro {
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.portal-settings-intro h1 { margin: 0; font-size: 1.12rem; }
.portal-settings-intro p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.portal-branding-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.portal-branding-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(16,24,40,.035);
}
.portal-branding-card-head {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.portal-branding-card-head > div { min-width: 0; }
.portal-branding-card h2 { margin: 0; font-size: 1rem; }
.portal-branding-card p { margin: 6px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.portal-branding-preview {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}
.portal-branding-preview img {
    display: block;
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
}
.portal-branding-preview-sidebar { background: #101828; border-color: #27364d; }
.portal-branding-preview-sidebar img { width: 56px; height: 56px; max-width: 56px; max-height: 56px; }
.portal-file-input { min-height: 44px; height: auto; padding: 7px 9px; }
.portal-file-input::file-selector-button {
    min-height: 30px;
    margin-right: 10px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: .75rem;
    font-weight: 750;
    cursor: pointer;
}
.portal-file-input::file-selector-button:hover { background: var(--surface-2); }
.portal-setting-remove {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f8fafc;
    color: #475467;
    font-size: .76rem;
    cursor: pointer;
}
.portal-setting-remove input { width: 17px; height: 17px; }
.portal-branding-default-note { margin-top: 14px; color: var(--muted); font-size: .74rem; }

@media (max-width: 900px) {
    .portal-branding-grid { grid-template-columns: 1fr; }
}

@media (max-width: 699px) {
    .brand-symbol { width: 36px; height: 36px; flex-basis: 36px; }
    .sidebar .brand-mark { min-height: 50px; height: auto; }
    .portal-settings-intro,
    .portal-branding-card { padding: 16px; }
    .portal-branding-card-head { gap: 12px; }
    .portal-branding-preview { width: 64px; height: 64px; flex-basis: 64px; }
    .portal-branding-preview img { width: 46px; height: 46px; max-width: 46px; max-height: 46px; }
}

/* V0.44.0 – Sidebar zeigt ausschließlich das hochgeladene Brandingbild */
.sidebar .brand-mark-uploaded {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0 0 16px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    line-height: 0;
}

.brand-uploaded-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: left center;
}

.sidebar .brand-mark-uploaded:hover,
.sidebar .brand-mark-uploaded:focus-visible {
    background: transparent;
}

.sidebar .brand-mark-uploaded:focus-visible {
    outline: 2px solid rgba(255,255,255,.42);
    outline-offset: 3px;
}

@media (max-width: 699px) {
    .sidebar .brand-mark-uploaded {
        margin-bottom: 14px;
    }
}

/* Portaleinstellungen: Sidebar-Branding als breite Vorschau darstellen. */
.portal-branding-preview-sidebar {
    width: 148px;
    height: 72px;
    flex-basis: 148px;
    padding: 6px;
}
.portal-branding-preview-sidebar img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 699px) {
    .portal-branding-preview-sidebar {
        width: 118px;
        height: 62px;
        flex-basis: 118px;
    }
}

/* V0.45.0 – getrennte Logos für dunkle und helle Flächen */
@media (min-width: 1101px) {
    .portal-branding-grid-three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-branding-preview-light {
    width: 148px;
    height: 72px;
    flex-basis: 148px;
    padding: 6px;
    background: #fff;
}

.portal-branding-preview-light img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.portal-branding-preview img[hidden] {
    display: none;
}

@media (max-width: 1100px) {
    .portal-branding-grid-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 699px) {
    .portal-branding-preview-light {
        width: 118px;
        height: 62px;
        flex-basis: 118px;
    }
}

/* V0.46.0 – mobile Tabellen ohne vertikale Toolbar-Verzerrung + helles Logo auf Sperrseite */
.lock-logo-wrap {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #f8fafc;
}
.lock-logo {
    display: block;
    width: 100%;
    max-width: 320px;
    max-height: 92px;
    height: auto;
    object-fit: contain;
}

@media (max-width: 699px) {
    .content {
        min-width: 0;
        overflow-x: clip;
    }
    
    
    
    
    
    
    
    
    
    
    .lock-shell { padding: 18px; }
    .lock-card { padding: 24px 20px; }
    .lock-logo-wrap { min-height: 72px; margin-bottom: 20px; padding: 12px 14px; }
    .lock-logo { max-width: 280px; max-height: 76px; }
}

/* V0.47.0 – globale Topbar auf Tablet wieder einzeilig
 *
 * Historische <=960px-Regeln verschoben die portalweite Suche in eine zweite
 * Grid-Zeile. Auf Smartphone wurde das später bereits korrekt überschrieben,
 * im Tablet-Bereich 700–980px blieb die alte Zweizeilen-Regel jedoch aktiv.
 * Tablet verwendet wie Desktop und Smartphone wieder eine einzige Topbar-Zeile.
 */
@media (min-width: 700px) and (max-width: 980px) {
    .topbar {
        position: sticky;
        top: 0;
        height: var(--portal-topbar-height);
        min-height: var(--portal-topbar-height);
        grid-template-columns: minmax(38px, auto) minmax(220px, 1fr) auto !important;
        grid-template-rows: 1fr !important;
        align-items: center;
        gap: 10px;
        padding: 0 14px;
    }

    .topbar-leading {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 38px;
        max-width: 180px;
    }

    .topbar-title {
        min-width: 0;
        max-width: 132px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .global-search {
        grid-column: 2 !important;
        grid-row: 1 !important;
        width: 100%;
        min-width: 0;
    }

    .global-search-input {
        height: 40px;
    }

    .topbar-account {
        grid-column: 3 !important;
        grid-row: 1 !important;
        min-width: 38px;
        justify-content: flex-end;
    }

    .account-name {
        display: none !important;
    }
}

/* V0.48.0 – zentrale Smart-Table-Architektur
 * Alle echten Daten-/Listen-Tabellen verwenden diese Komponentenfamilie.
 * Fachseiten liefern nur Definition, Daten und optionale Renderer/Extension Points.
 */
.smart-table-card {
    --smart-table-min-width: 720px;
    --smart-table-row-py: 9px;
    --smart-table-row-px: 12px;
    --smart-table-secondary-size: .68rem;
    --smart-table-sticky-base: var(--portal-topbar-height, 62px);
    --smart-table-card-header-height: 46px;
    --smart-table-toolbar-height: 46px;
    position: relative;
    overflow: visible;
    padding: 0;
    border-radius: var(--radius);
}
.smart-table-filter-form { display: none; }
.smart-table-card-header {
    position: sticky;
    top: var(--smart-table-sticky-base);
    z-index: 18;
    min-height: 46px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface);
}
.smart-table-title-group { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.smart-table-title-group h2 { margin: 0; font-size: .94rem; letter-spacing: -.02em; }
.smart-table-result-count { color: var(--muted); font-size: .68rem; font-weight: 700; }
.smart-table-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.smart-table-toolbar {
    position: sticky;
    top: calc(var(--smart-table-sticky-base) + var(--smart-table-card-header-height));
    z-index: 17;
    min-height: 46px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.smart-table-toolbar-search { position: relative; flex: 1 1 500px; min-width: 0; }
.smart-table-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.smart-table-search-input,
.smart-table-filter-input {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 9px;
    background: #fff;
    color: var(--text);
    outline: none;
    font: inherit;
    font-size: .78rem;
}
.smart-table-search-input { padding-left: 31px; }
.smart-table-search-input:focus,
.smart-table-filter-input:focus {
    border-color: #7898ef;
    box-shadow: 0 0 0 3px rgba(31,79,209,.09);
}
.smart-table-toolbar-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.smart-table-toolbar-button { min-height: 34px; padding: 0 10px; gap: 6px; white-space: nowrap; font-size: .74rem; }
.smart-table-scroll {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
}
.smart-table-grid {
    width: 100%;
    min-width: var(--smart-table-min-width);
    border-collapse: collapse;
    table-layout: auto;
}
.smart-table-grid th,
.smart-table-grid td {
    height: auto;
    padding: var(--smart-table-row-py) var(--smart-table-row-px);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    font-size: .78rem;
}
.smart-table-grid th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .045em;
}
.smart-table-grid tbody tr:last-child td { border-bottom: 0; }
.smart-table-grid tbody tr[data-row-href]:hover td { background: #fafbfc; }
.smart-table-grid .is-column-hidden { display: none !important; }
.smart-table-heading-row th { height: 36px; }
.smart-table-sort-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}
.smart-table-sort-link:hover { color: var(--text); }
.smart-table-sort-link [data-smart-table-sort-mark] { color: var(--muted); font-size: .75rem; font-weight: 700; }
.smart-table-filter-row[hidden] { display: none; }
.smart-table-filter-row th { padding: 5px 7px; background: #f8fafc; text-transform: none; letter-spacing: normal; }
.smart-table-filter-row .smart-table-filter-input { min-height: 32px; padding: 0 8px; font-size: .72rem; border-radius: 7px; }
.smart-table-filter-range { display: grid; grid-template-columns: repeat(2, minmax(72px, 1fr)); gap: 4px; }
.smart-table-col--identity { min-width: 150px; }
.smart-table-col--wide { min-width: 210px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.smart-table-col--nowrap { white-space: nowrap; }
.smart-table-col--fit { width: 1%; white-space: nowrap; }
.smart-table-col--elastic { width: auto; min-width: 0; }
.smart-table-col--wrap { white-space: normal; overflow-wrap: break-word; word-break: normal; }
.smart-table-col--control { width: 46px; min-width: 46px; max-width: 46px; text-align: center; }
.smart-table-col--actions { width: 70px; min-width: 54px; text-align: right !important; }
.smart-table-col--numeric,
.smart-table-col--monetary { text-align: right !important; font-variant-numeric: tabular-nums; }
.smart-table-col--monetary { white-space: nowrap; }
.smart-table-col--compact { padding-top: 6px !important; padding-bottom: 6px !important; }
.smart-table-col--dense { padding-top: 4px !important; padding-bottom: 4px !important; }
.smart-table-col--status,
.smart-table-col--badge { text-align: center; }
.smart-table-col--editable { background: #fffdf5; }
.smart-table-col--sticky { position: sticky; left: 0; z-index: 3; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.smart-table-grid thead .smart-table-col--sticky { z-index: 5; background: var(--surface-2); }
.smart-cell { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.smart-cell-copy { min-width: 0; display: grid; gap: 2px; }
.smart-cell-primary { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 750; color: var(--text); }
.smart-cell-secondary { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: var(--smart-table-secondary-size); font-weight: 400; }
.smart-cell-meta { display: flex; gap: 5px; flex-wrap: wrap; color: var(--muted); font-size: .62rem; }
.smart-cell-meta span + span::before { content: "·"; margin-right: 5px; }
.smart-cell-image { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.smart-cell-icon { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--muted); }
.smart-cell-primary-link,
.smart-table-value-link { color: inherit; text-decoration: none; }
.smart-cell-primary-link:hover,
.smart-table-value-link:hover { color: var(--primary); text-decoration: underline; }
.smart-table-value-image { display: block; width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.smart-table-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.smart-cell-badge { justify-self: end; }
.smart-table-card [data-smart-cell-profiles] { display: none; }
.smart-table-card[data-smart-profile="desktop"] [data-smart-cell-profiles~="desktop"],
.smart-table-card[data-smart-profile="tablet"] [data-smart-cell-profiles~="tablet"],
.smart-table-card[data-smart-profile="smartphone"] [data-smart-cell-profiles~="smartphone"] { display: grid; }
.smart-table-footer {
    min-height: 0;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0 0 var(--radius) var(--radius);
}
.smart-table-lazy-footer { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.smart-table-lazy-footer[hidden] { display: none !important; }
.smart-table-lazy-footer [data-smart-table-lazy-status] { color: var(--muted); font-size: .7rem; }
.smart-table-empty-state { padding: 26px 12px; color: var(--muted); text-align: center; white-space: normal; }
.smart-table-card[aria-busy="true"] .smart-table-scroll { opacity: .62; }
.smart-table-card.has-live-error .smart-table-scroll { box-shadow: inset 0 0 0 1px #fecdca; }

/* Spaltenprofile: ausschließlich zentrale Smart-Table-Komponente. */
.smart-table-profile-editor { display: grid; gap: 12px; }
.smart-table-profile-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.smart-table-profile-tabs button {
    min-height: 38px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-weight: 700; cursor: pointer;
}
.smart-table-profile-tabs button[aria-selected="true"] { border-color: var(--primary); color: var(--primary); background: #f5f8ff; }
.smart-table-profile-panel { display: grid; gap: 10px; }
.smart-table-profile-panel[hidden] { display: none !important; }
.smart-table-column-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.smart-table-column-option { min-height: 36px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.smart-table-column-option.is-locked { color: var(--muted); background: var(--surface-2); cursor: default; }
.smart-table-column-option input { width: 17px; height: 17px; }
.smart-table-profile-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.smart-table-profile-save-state { min-height: 20px; color: var(--muted); font-size: .72rem; }
.smart-table-profile-save-state.is-error { color: var(--danger); }
.smart-table-profile-save-state.is-success { color: var(--success); }

/* Multi-Filter / Chips ist als zentraler Filtertyp vorbereitet. */
.smart-table-multi-filter { position: relative; min-width: 150px; }
.smart-table-filter-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.smart-table-filter-chip { max-width: 100%; min-height: 24px; padding: 2px 6px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: var(--text); font-size: .68rem; cursor: pointer; }
.smart-table-filter-chip span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-table-multi-options { position: absolute; z-index: 100; top: calc(100% + 4px); left: 0; right: 0; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.smart-table-multi-options button { width: 100%; min-height: 32px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.smart-table-multi-options button:hover { background: var(--surface-2); }

/* Zentraler Sticky-Spaltenkopf. Horizontalposition und reale Spaltenbreiten werden von smart-table.js synchronisiert. */
.smart-table-sticky-viewport {
    position: fixed;
    z-index: 19;
    overflow: hidden;
    pointer-events: auto;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 9px rgba(16, 24, 40, .06);
}
.smart-table-sticky-viewport[hidden] { display: none !important; }
.smart-table-sticky-grid { margin: 0; background: var(--surface-2); table-layout: fixed; will-change: transform; }
.smart-table-sticky-grid th { box-sizing: border-box; }

/* Der Datei-Explorer ist eine hierarchische Fachansicht, verwendet aber dieselbe zentrale Grid-Basis. */
.smart-table-grid--file-manager { min-width: 600px; }
.smart-table-grid--file-manager th,
.smart-table-grid--file-manager td { padding: 6px 8px; height: 36px; font-size: .72rem; }
.smart-table-grid--file-manager th { font-size: .62rem; }

@media (max-width: 1199px) {
    .smart-table-card { --smart-table-row-px: 10px; }
    .smart-table-toolbar-search { flex-basis: 0; }
}

@media (max-width: 699px) {
    .smart-table-card {
        --smart-table-row-py: 10px;
        --smart-table-row-px: 9px;
        --smart-table-secondary-size: .64rem;
        --smart-table-min-width: 100%;
        border-radius: 10px;
    }
    .smart-table-card-header { padding: 8px; }
    .smart-table-title-group h2 { font-size: .98rem; }
    .smart-table-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px 8px; }
    .smart-table-toolbar-search { min-width: 0; }
    .smart-table-toolbar-actions { display: flex; width: auto; margin: 0; gap: 5px; }
    .smart-table-toolbar-button { width: 38px; min-width: 38px; min-height: 38px; padding: 0; justify-content: center; }
    .smart-table-toolbar-button span { display: none; }
    .smart-table-search-input { min-height: 38px; }
    .smart-table-grid { min-width: max(100%, min-content); }
    .smart-table-grid th,
    .smart-table-grid td { font-size: .74rem; }
    .smart-table-filter-row th { padding: 5px; }
    .smart-table-column-options { grid-template-columns: 1fr; }
    .smart-table-col--actions { width: 54px; min-width: 54px; }
}

/* SmartTable owns horizontal scrolling inside the file manager as well. */
.file-manager-table-wrap { overflow: visible; }
.smart-table-live-state {
    position: absolute;
    z-index: 21;
    right: 10px;
    top: calc(var(--smart-table-card-header-height) + var(--smart-table-toolbar-height) + 5px);
    max-width: min(360px, calc(100% - 20px));
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255,255,255,.96);
    color: var(--muted);
    font-size: .68rem;
    box-shadow: 0 2px 8px rgba(16,24,40,.06);
}
.smart-table-live-state[data-state="error"] { border-color: #fecdca; color: var(--danger); }
.smart-table-grid tr[data-row-href]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* V0.50.0 — zentrale Gruppen-/ID-Darstellung */
.rights-group-create {
    display: grid;
    grid-template-columns: minmax(260px, 520px) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 16px;
}
.rights-group-create .form-group { margin: 0; }
.user-group-memberships { margin-top: 8px; }
.smart-table-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.smart-table-badge-list .status { white-space: nowrap; }
@media (max-width: 699px) {
    .rights-group-create { grid-template-columns: 1fr; }
}

/* V0.57.0 – persönliche Sidebar-Navigation mit Favoriten und einklappbaren Gruppen */
.content--full-width,
.content--full-width .smart-table-card {
    width: 100%;
    max-width: none;
}

.nav {
    min-width: 0;
    gap: 4px;
}

.nav-item-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 3px;
    align-items: center;
}

.nav-item-row .nav-link {
    min-width: 0;
    min-height: 38px;
    padding: 8px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    color: #d0d5dd;
    font-size: .82rem;
}

.nav-item-row .nav-link > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item-row .nav-link:hover,
.nav-item-row .nav-link.active {
    background: #1d2939;
    color: #fff;
}

.nav-item-row.is-muted .nav-link { opacity: .62; }

.nav-favorite-button {
    width: 30px;
    height: 30px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #667085;
    cursor: pointer;
}

.nav-favorite-button:hover,
.nav-favorite-button:focus-visible {
    background: #1d2939;
    color: #dbe6ff;
}

.nav-favorite-button.is-favorite { color: #8fb0ff; }
.nav-favorite-button.is-favorite .ui-icon { fill: currentColor; }
.nav-favorite-button:disabled { opacity: .45; cursor: wait; }

.nav-group {
    min-width: 0;
    margin-top: 5px;
}

.nav-group-summary {
    min-height: 34px;
    padding: 7px 8px 5px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
    color: #98a2b3;
    text-transform: uppercase;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .09em;
    border-radius: 7px;
    cursor: pointer;
    user-select: none;
}

.nav-group-summary::-webkit-details-marker { display: none; }
.nav-group-summary:hover { color: #d0d5dd; background: rgba(255,255,255,.035); }
.nav-group-summary:focus-visible { outline: 2px solid rgba(143,176,255,.72); outline-offset: 1px; }
.nav-group-chevron { transition: transform .16s ease; }
.nav-group:not([open]) .nav-group-chevron { transform: rotate(-90deg); }
.nav-group-items { display: grid; gap: 3px; padding-top: 2px; }
.nav-group-empty { padding: 7px 10px 9px; color: #667085; font-size: .69rem; line-height: 1.4; }
.nav-preference-status { margin: 8px 8px 0; padding: 7px 8px; border-radius: 7px; background: rgba(180,35,24,.16); color: #fecaca; font-size: .69rem; line-height: 1.35; }
.nav-preference-status[hidden] { display: none !important; }

@media (max-width: 980px) {
    .nav-item-row .nav-link { min-height: 42px; font-size: .86rem; }
    .nav-favorite-button { width: 38px; height: 38px; }
    .nav-item-row { grid-template-columns: minmax(0, 1fr) 38px; }
    .nav-group-summary { min-height: 40px; }
}

/* V0.59.0 – Favoriten nur bei Inhalt + kompakte Smart-Table-Spalten */
[data-sidebar-favorites-shell][hidden] {
    display: none !important;
}

.nav-item-row--without-favorite {
    grid-template-columns: minmax(0, 1fr);
}

.smart-table-card[data-smart-table-column-layout="compact"] {
    --smart-table-row-px: 6px;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-scroll {
    scrollbar-gutter: auto;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-grid {
    width: 100%;
    min-width: var(--smart-table-min-width, 0);
    table-layout: auto;
}

/*
 * Content-aware width model for dense master lists:
 * - fit: atomic values occupy only their natural content width
 * - elastic: descriptive values share the remaining width
 * - wrap: wrapping is allowed only at normal word break opportunities
 *
 * Never use overflow-wrap:anywhere for a complete compact table. It collapses
 * min-content width to almost one character and creates vertical names/statuses.
 */
.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-grid th,
.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-grid td {
    box-sizing: border-box;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-heading-row th {
    white-space: nowrap;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-col--identity {
    min-width: 0;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-col--fit {
    width: 1%;
    min-width: 0;
    white-space: nowrap;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-col--elastic {
    width: auto;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-col--wrap {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-filter-row th {
    padding-left: 4px;
    padding-right: 4px;
}

.smart-table-card[data-smart-table-column-layout="compact"] .smart-table-filter-row .smart-table-filter-input {
    min-width: 0;
}


/* V26.9.2.67 – inhaltsgewichtete Smart-Table-Spaltenbreiten
 * Im balanced-Modus ist die echte Inhaltsbreite die Ausgangsbasis. Kurze Werte
 * bleiben kompakt; längere Inhalte wie E-Mail/Gruppen erhalten zuerst den Platz,
 * den sie tatsächlich benötigen. Nur danach verbleibender Leerraum wird fair
 * verteilt. Beim Verkleinern wird gleichmäßig bis zu lesbaren Mindestbreiten
 * reduziert; anschließend ist horizontales Scrollen besser als Quetschen.
 */
.smart-table-card[data-smart-table-column-layout="balanced"] {
    --smart-table-row-px: 7px;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-scroll {
    scrollbar-gutter: auto;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-grid {
    width: 100%;
    min-width: var(--smart-table-min-width, 0);
    table-layout: fixed;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-grid th,
.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-grid td {
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
    overflow-wrap: normal;
    word-break: normal;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--identity,
.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--fit,
.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--elastic {
    width: auto;
    min-width: 0;
    max-width: none;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--fit {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--wrap {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-heading-row th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-filter-row th {
    padding-left: 5px;
    padding-right: 5px;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-filter-row .smart-table-filter-input {
    min-width: 0;
}

/* Strukturspalten werden nicht künstlich mit Leerraum aufgeblasen. */
.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--control {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-col--actions {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
}

/* V0.63.0 – stabile SmartTable-Geometrie bei 0 Treffern
 * Die zentrale colgroup ist die Breitenquelle. Ausgeblendete Profilspalten
 * müssen auch als echte Tabellenspalten kollabieren, damit table-layout:fixed
 * keinen unsichtbaren Leerraum für sie reserviert.
 */
.smart-table-grid col.is-column-hidden {
    visibility: collapse;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
}

.smart-table-card[data-smart-table-column-layout="balanced"] .smart-table-grid col[data-smart-table-col] {
    box-sizing: border-box;
}


/* V0.64.0 – profilabhängige SmartTable-Spaltenbezeichnungen
 * Zusammengesetzte responsive Zellen dürfen je Geräteprofil eine semantisch
 * passendere Überschrift verwenden. Standardmäßig ist Desktop sichtbar; die
 * Viewport-Media-Queries schalten ohne JavaScript-Flackern auf Tablet/Smartphone.
 */
.smart-table-profile-label--tablet,
.smart-table-profile-label--smartphone {
    display: none;
}

@media (min-width: 700px) and (max-width: 1199px) {
    .smart-table-profile-label--desktop,
    .smart-table-profile-label--smartphone {
        display: none;
    }

    .smart-table-profile-label--tablet {
        display: inline;
    }
}

@media (max-width: 699px) {
    .smart-table-profile-label--desktop,
    .smart-table-profile-label--tablet {
        display: none;
    }

    .smart-table-profile-label--smartphone {
        display: inline;
    }
}

/* V0.66.0 – portalweites Select-Control
 * Native Single-Selects behalten Formularwert/Validierung, die sichtbare
 * Bedienung folgt jedoch vollständig dem Portal-UI statt dem Browser-Dropdown.
 */
.phi-select {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.phi-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip-path: inset(50%) !important;
}

.phi-select-trigger {
    appearance: none;
    -webkit-appearance: none;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 100%;
    padding-right: 13px !important;
    text-align: left;
    cursor: pointer;
}

.phi-select-trigger:disabled {
    cursor: not-allowed;
    color: #98a2b3;
    background: #f2f4f7;
}

.phi-select-value {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phi-select-chevron {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin: -3px 2px 0 4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .14s ease, margin .14s ease;
    opacity: .8;
}

.phi-select.is-open .phi-select-chevron {
    margin-top: 3px;
    transform: rotate(225deg);
}

.phi-select-trigger:focus-visible {
    border-color: #7898ef;
    box-shadow: 0 0 0 4px rgba(31,79,209,.1);
    outline: none;
}

.smart-table-filter-row .phi-select-trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(31,79,209,.09);
}

.phi-select-menu {
    position: fixed;
    z-index: 5000;
    max-height: min(320px, calc(100vh - 16px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(16,24,40,.16), 0 3px 8px rgba(16,24,40,.08);
}

.phi-select-menu[hidden] { display: none !important; }

.phi-select-option {
    position: relative;
    width: 100%;
    min-height: 36px;
    padding: 8px 34px 8px 10px;
    border: 0;
    border-radius: 7px;
    display: flex;
    align-items: center;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .82rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.phi-select-option:hover,
.phi-select-option.is-active {
    background: var(--surface-2);
}

.phi-select-option.is-selected {
    color: var(--primary);
    background: #eef4ff;
    font-weight: 750;
}

.phi-select-option.is-selected::after {
    content: "✓";
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: .84rem;
    font-weight: 900;
}

.phi-select-option:disabled {
    cursor: not-allowed;
    color: #98a2b3;
    background: transparent;
}

.phi-select-group-label {
    padding: 8px 10px 4px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .phi-select-option { min-height: 42px; font-size: .86rem; }
}

/* V26.9.4.1 – persönliche Tabellenbedienung + Superadmin-Entwicklungsmodus */
.settings-developer-card { grid-column: 1 / -1; }
.developer-mode-toggle {
    width: min(100%, 460px);
    min-height: 46px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.developer-mode-toggle:hover { border-color: #b8c4d6; background: var(--surface-2); }
.developer-mode-toggle:focus-visible { outline: none; border-color: #7898ef; box-shadow: 0 0 0 4px rgba(31,79,209,.1); }
.developer-mode-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
}
.developer-mode-toggle.is-active .developer-mode-icon { background: #eef4ff; color: var(--primary); }
.developer-mode-copy { min-width: 0; }
.developer-mode-copy strong { display: block; font-size: .83rem; }
.developer-mode-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.developer-mode-dot { width: 8px; height: 8px; border-radius: 999px; background: #98a2b3; box-shadow: 0 0 0 3px rgba(152,162,179,.14); }
.developer-mode-toggle.is-active .developer-mode-dot { background: #2e9d63; box-shadow: 0 0 0 3px rgba(46,157,99,.14); }

.developer-user-switch { position: relative; min-width: 0; width: 100%; }
.developer-user-switch-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    color: var(--primary);
    pointer-events: none;
}
.developer-user-switch-input {
    width: 100%;
    height: 40px;
    padding: 0 38px 0 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8faff;
    color: var(--text);
    font: inherit;
    font-size: .78rem;
    outline: none;
}
.developer-user-switch-input:focus { border-color: #7898ef; box-shadow: 0 0 0 3px rgba(31,79,209,.08); background: var(--surface); }
.developer-user-switch-dropdown {
    position: absolute;
    z-index: 5100;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 260px;
    max-height: min(390px, calc(100vh - 90px));
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 16px 36px rgba(16,24,40,.17), 0 3px 8px rgba(16,24,40,.08);
}
.developer-user-switch-dropdown[hidden] { display: none !important; }
.developer-user-switch-message { padding: 10px 11px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.developer-user-switch-result {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.developer-user-switch-result:hover,
.developer-user-switch-result:focus-visible { background: var(--surface-2); outline: none; }
.developer-user-switch-result[aria-current="true"] { background: #eef4ff; }
.developer-user-switch-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8eef9;
    color: var(--primary);
    font-size: .68rem;
    font-weight: 900;
}
.developer-user-switch-result-copy { min-width: 0; display: grid; gap: 2px; }
.developer-user-switch-result-copy strong,
.developer-user-switch-result-copy small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.developer-user-switch-result-copy strong { font-size: .76rem; }
.developer-user-switch-result-copy small { color: var(--muted); font-size: .66rem; }
.developer-user-switch-result-state { color: var(--primary); font-size: .62rem; font-weight: 850; white-space: nowrap; }

@media (min-width: 981px) {
    body.developer-mode-active .topbar {
        grid-template-columns: minmax(120px, .45fr) minmax(260px, 1.25fr) minmax(230px, .8fr) minmax(180px, .62fr);
        gap: 12px;
    }
}

@media (min-width: 700px) and (max-width: 980px) {
    body.developer-mode-active .topbar {
        grid-template-columns: minmax(38px, auto) minmax(190px, 1fr) minmax(190px, .85fr) auto !important;
    }
    body.developer-mode-active .global-search { grid-column: 2 !important; }
    body.developer-mode-active .developer-user-switch { grid-column: 3 !important; grid-row: 1 !important; }
    body.developer-mode-active .topbar-account { grid-column: 4 !important; }
    body.developer-mode-active .topbar-title { display: none !important; }
}

@media (max-width: 699px) {
    body.developer-mode-active { --portal-topbar-height: 106px; }
    body.developer-mode-active .topbar {
        height: var(--portal-topbar-height);
        min-height: var(--portal-topbar-height);
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        grid-template-rows: 42px 42px;
        align-content: center;
        row-gap: 4px;
    }
    body.developer-mode-active .topbar-leading { grid-column: 1 !important; grid-row: 1 !important; }
    body.developer-mode-active .global-search { grid-column: 2 !important; grid-row: 1 !important; }
    body.developer-mode-active .topbar-account { grid-column: 3 !important; grid-row: 1 !important; }
    body.developer-mode-active .developer-user-switch { grid-column: 1 / -1 !important; grid-row: 2 !important; }
    body.developer-mode-active .developer-user-switch-input { height: 40px; font-size: .8rem; }
    body.developer-mode-active .developer-user-switch-dropdown {
        position: fixed;
        top: 110px;
        left: 8px;
        right: 8px;
        min-width: 0;
        max-height: calc(100vh - 118px);
    }
    body.developer-mode-active .impersonation-banner { top: var(--portal-topbar-height); }
    body.developer-mode-active .page-actionbar { top: var(--portal-topbar-height); }
    body.developer-mode-active.is-impersonating .page-actionbar { top: calc(var(--portal-topbar-height) + 48px); }
    .settings-developer-card { grid-column: auto; }
    .developer-mode-toggle { width: 100%; min-height: 50px; }
}

/* V26.9.4.2 – Entwickler-Schnellwechsel: häufige Benutzer */
.developer-user-switch-heading {
    padding: 7px 10px 5px;
    color: var(--muted);
    font-size: .64rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* V26.9.4.3 – aktiver Entwicklungsmodus als Statuspunkt im Schnellwechselfeld */
.developer-mode-status {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
.developer-mode-status-trigger {
    width: 26px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.developer-mode-status-trigger:hover,
.developer-mode-status-trigger:focus-visible {
    background: #fff0f1;
    outline: none;
}
.developer-mode-status-trigger:focus-visible { box-shadow: 0 0 0 3px rgba(201, 38, 48, .13); }
.developer-mode-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #d92d3a;
    box-shadow: 0 0 0 3px rgba(217, 45, 58, .13);
    animation: developer-mode-pulse 1.65s ease-in-out infinite;
}
@keyframes developer-mode-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(217, 45, 58, .13); }
    50% { opacity: .62; box-shadow: 0 0 0 6px rgba(217, 45, 58, .04); }
}
@media (prefers-reduced-motion: reduce) {
    .developer-mode-status-dot { animation: none; }
}
.developer-mode-status-dropdown {
    position: absolute;
    z-index: 5200;
    top: 100%;
    right: -4px;
    width: max-content;
    min-width: 205px;
    padding: 5px;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 16px 36px rgba(16,24,40,.17), 0 3px 8px rgba(16,24,40,.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity .12s ease, transform .12s ease, visibility .12s;
}
.developer-mode-status:hover .developer-mode-status-dropdown,
.developer-mode-status:focus-within .developer-mode-status-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.developer-mode-status-dropdown form { margin: 0; }
.developer-mode-status-stop {
    width: 100%;
    min-height: 38px;
    justify-content: flex-start;
    white-space: nowrap;
}
body.developer-mode-active .developer-user-switch { justify-self: end; }
body.developer-mode-active .topbar-account { min-width: 0; }

@media (min-width: 981px) {
    body.developer-mode-active .topbar {
        grid-template-columns: minmax(90px, .3fr) minmax(220px, 1.6fr) minmax(220px, 300px) auto;
        gap: 8px;
    }
    body.developer-mode-active .developer-user-switch { width: min(100%, 300px); }
}

@media (min-width: 981px) and (max-width: 1199px) {
    body.developer-mode-active .account-name { display: none !important; }
}

@media (min-width: 700px) and (max-width: 980px) {
    body.developer-mode-active .topbar {
        grid-template-columns: minmax(38px, auto) minmax(160px, 1fr) minmax(180px, 230px) 38px !important;
        gap: 6px;
    }
    body.developer-mode-active .global-search { grid-column: 2 !important; grid-row: 1 !important; }
    body.developer-mode-active .developer-user-switch { grid-column: 3 !important; grid-row: 1 !important; width: 100%; }
    body.developer-mode-active .topbar-account { grid-column: 4 !important; grid-row: 1 !important; }
}

@media (max-width: 699px) {
    body.developer-mode-active .developer-user-switch {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        width: 100%;
    }

    /* V26.9.4.4 – Statusmenü mobil direkt am roten Punkt verankern.
     * Die frühere fixe Position unterhalb der kompletten 106px-Topbar ließ
     * „Entwicklungsmodus beenden“ sichtbar zu tief erscheinen. */
    body.developer-mode-active .developer-mode-status-dropdown {
        position: absolute;
        top: calc(100% - 4px);
        right: -4px;
        min-width: 205px;
    }
}


/* V26.9.4.5 / Delta 72 – zentrale Schnell-PIN-, Passkey- und Inaktivitätssperre */
.privacy-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}
.privacy-lock-overlay[hidden] { display: none !important; }
.privacy-lock-overlay-content { display: grid; justify-items: center; gap: 14px; color: var(--text); }
.privacy-lock-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: privacy-lock-spin .8s linear infinite;
}
@keyframes privacy-lock-spin { to { transform: rotate(360deg); } }
html.privacy-lock-active,
html.privacy-lock-active body { overflow: hidden !important; }

.lock-card { width: min(100%, 470px); }
.lock-instruction { margin: -10px 0 20px; color: var(--muted); line-height: 1.5; }
.lock-state-message {
    margin: 0 0 22px;
    padding: 14px 16px;
    display: grid;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    text-align: left;
}
.lock-state-message strong { font-size: .9rem; }
.lock-state-message span { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.lock-alert { margin-bottom: 18px; text-align: left; }
.lock-pin-label { text-align: center; }
.lock-pin-auto-help { margin-top: 10px; text-align: center; }
.lock-passkey { margin-top: 18px; }
.lock-passkey-button,
.lock-password-button { width: 100%; justify-content: center; }
.lock-full-auth-form { margin-top: 10px; }
.lock-separator {
    position: relative;
    margin: 4px 0 16px;
    color: var(--muted);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.lock-separator::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.lock-separator span { position: relative; z-index: 1; padding: 0 10px; background: var(--surface); }
.passkey-status { margin-top: 10px; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.passkey-status.is-error { color: var(--danger); }

.pin-input { width: 100%; }
.pin-input-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
    width: 100%;
}
.pin-input-field {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    text-align: center;
    font: inherit;
    font-size: 1.2rem;
    font-weight: 800;
    outline: none;
}
.pin-input-field:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.security-row-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}
.security-row-detail > .security-row-copy { min-width: 0; }
.security-inline-form,
.security-remove-form,
.security-passkey-control,
.passkey-list {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 14px;
}
.security-inline-form { max-width: 760px; }
.security-pin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.security-remove-row { display: grid; grid-template-columns: minmax(220px, 420px) auto; gap: 10px; align-items: center; }
.security-passkey-control { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.security-passkey-control .passkey-status { margin-top: 0; }
.passkey-list { display: grid; gap: 8px; }
.passkey-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}
.passkey-list-item > div { display: grid; gap: 3px; min-width: 0; }
.passkey-list-item strong { font-size: .84rem; }
.passkey-list-item small { color: var(--muted); font-size: .76rem; }

@media (max-width: 699px) {
    .pin-input-fields { gap: 6px; }
    .pin-input-field { height: 48px; border-radius: 9px; font-size: 1.08rem; }
    .security-row-detail { grid-template-columns: 1fr; }
    .security-row-detail > .status { justify-self: start; }
    .security-pin-grid { grid-template-columns: 1fr; gap: 14px; }
    .security-remove-row { grid-template-columns: 1fr; }
    .passkey-list-item { align-items: flex-start; flex-direction: column; }
    .passkey-list-item form,
    .passkey-list-item button { width: 100%; }
}
.security-passkey-password { flex: 1 1 300px; max-width: 420px; margin: 0; }
.passkey-remove-form { display: flex; align-items: center; gap: 8px; }
.passkey-remove-form .form-control { width: min(280px, 40vw); min-width: 180px; }
@media (max-width: 699px) {
    .security-passkey-control { align-items: stretch; flex-direction: column; }
    .security-passkey-password { width: 100%; max-width: none; }
    .passkey-remove-form { width: 100%; align-items: stretch; flex-direction: column; }
    .passkey-remove-form .form-control { width: 100%; min-width: 0; }
}
.alert-info { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.security-row-detail > .security-passkey-control { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
@media (max-width: 699px) {
    .security-row-detail > .security-passkey-control { align-items: stretch; flex-direction: column; }
}

/* V26.9.9.1 – Portal cron jobs */
.cronjobs-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 14px 16px; }
.cronjobs-intro p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.cronjobs-intro code { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.cronjob-form-card { max-width: 980px; }
.cronjob-form-grid { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.5fr) minmax(180px, .8fr) minmax(130px, .55fr); gap: 14px; align-items: start; }
.cronjob-run-card { max-width: 980px; margin-top: 14px; padding: 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cronjob-run-card > div { min-width: 0; }
.cronjob-run-card span { display: block; color: var(--muted); font-size: .7rem; margin-bottom: 3px; }
.cronjob-run-card strong { display: block; font-size: .82rem; overflow-wrap: anywhere; }
.cronjob-run-card .cronjob-run-error { grid-column: 1 / -1; }
.cronjob-run-error pre { margin: 0; padding: 10px 12px; max-height: 220px; overflow: auto; border: 1px solid #fecdca; border-radius: 9px; background: #fff6f5; color: #912018; white-space: pre-wrap; overflow-wrap: anywhere; font: 500 .74rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.table-actions form { display: inline-flex; margin: 0; }
.page-actionbar-more-menu form { display: block; margin: 0; width: 100%; }

@media (max-width: 1199px) {
    .cronjob-form-grid { grid-template-columns: 1fr 1fr; }
    .cronjob-form-path { grid-column: 1 / -1; }
    .cronjob-run-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 699px) {
    .cronjobs-intro { align-items: flex-start; flex-direction: column; padding: 12px; }
    .cronjobs-intro code { max-width: 100%; width: 100%; }
    .cronjob-form-grid { grid-template-columns: 1fr; gap: 10px; }
    .cronjob-form-path { grid-column: auto; }
    .cronjob-run-card { grid-template-columns: 1fr; padding: 12px; }
}

/* 26.9.9.3 – zentrale SMTP-Konfiguration */
.portal-smtp-card {
    margin-top: 16px;
}
.portal-smtp-toggle {
    margin-bottom: 18px;
}
.portal-smtp-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) minmax(100px, .45fr) minmax(170px, .7fr) minmax(200px, 1fr);
    gap: 14px;
    align-items: start;
}
.portal-smtp-host { grid-column: span 2; }
.portal-smtp-domains { grid-column: span 2; }
.portal-smtp-security-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.portal-smtp-test-card {
    margin-top: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    align-items: end;
    gap: 18px;
}
.portal-smtp-test-card h2 { margin: 0; font-size: 1rem; }
.portal-smtp-test-card p { margin: 6px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.portal-smtp-test-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
}
@media (max-width: 1100px) {
    .portal-smtp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-smtp-host,
    .portal-smtp-domains { grid-column: span 2; }
}
@media (max-width: 699px) {
    .portal-smtp-grid,
    .portal-smtp-test-card,
    .portal-smtp-test-controls { grid-template-columns: 1fr; }
    .portal-smtp-host,
    .portal-smtp-domains { grid-column: auto; }
}
