:root {
    --surface: #ffffff;
    --border: #d8dde6;
    --text: #111827;
    --muted: #475569;
    --primary: #1d4ed8;
    --primary-strong: #1e40af;
    --primary-soft: #dbeafe;
    --success: #047857;
    --success-soft: #d1fae5;
    --warning: #b45309;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --focus-ring: #2563eb;
}

[x-cloak] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

*:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: top 150ms ease;
}

.skip-link:focus {
    top: 16px;
}

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

body {
    margin: 0;
    background: #f8fafc;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.breadcrumb {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-shell {
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: 18rem;
    max-width: 88vw;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 180ms ease;
}

.admin-shell.is-sidebar-open .admin-sidebar {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    background: rgb(2 6 23 / 0.46);
}

.admin-shell.is-sidebar-open .sidebar-overlay {
    display: block;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.sidebar-close-button {
    margin-left: auto;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.brand-mark,
.login-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-weight: 800;
}

.brand strong,
.sidebar-user strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
}

.brand small,
.sidebar-user small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.nav-section {
    margin-top: 22px;
}

.nav-section p,
.eyebrow {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-section a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 4px 0;
    padding: 10px 12px;
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 650;
}

.nav-section a svg,
.logout-button svg,
.icon-button svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    stroke-width: 2;
}

.nav-section a.is-active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-section a:hover,
.nav-section a.is-active {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.nav-section.group-management a.is-active {
    background: #e0ecff;
}

.nav-section.group-security a.is-active {
    background: #ffe8e8;
    color: #9f1239;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 800;
}

.logout-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    cursor: pointer;
}

.logout-button {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
}

.logout-button:hover,
.icon-button:hover {
    background: #f1f5f9;
    color: var(--primary-strong);
}

.icon-button {
    width: 44px;
    height: 44px;
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 16px;
    background: rgb(255 255 255 / 0.94);
    border-bottom: 1px solid var(--border);
}

.mobile-topbar span {
    font-weight: 800;
}

.admin-content {
    min-width: 0;
}

.main-shell {
    width: min(1220px, 100%);
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 36px);
    line-height: 1.15;
}

.page-header p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 16px;
}

.primary-button,
.secondary-button,
.login-card > button[type="submit"] {
    border-radius: 8px;
    cursor: pointer;
    font-weight: 750;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.primary-button,
.login-card > button[type="submit"] {
    min-height: 44px;
    padding: 12px 20px;
    border: 0;
    background: var(--primary);
    color: white;
}

.primary-button:hover,
.login-card > button[type="submit"]:hover {
    background: var(--primary-strong);
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--primary-strong);
    border: 1px solid var(--border);
}

.notice,
.form-error {
    padding: 14px 16px;
    border-radius: 8px;
}

.notice {
    border: 1px solid #fcd34d;
    background: #fff7ed;
    color: var(--warning);
}

.notice.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: var(--success);
}

.notice.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

/* Settings-Formular */
.settings-form {
    display: grid;
    gap: 20px;
    margin-top: 16px;
}

.settings-form label {
    display: grid;
    gap: 6px;
}

.settings-form label > span {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.settings-form input[type="text"],
.settings-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 150ms;
}

.settings-form input[type="text"]:focus,
.settings-form select:focus {
    border-color: var(--primary);
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.settings-form .checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-form .checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.settings-form .form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

/* System-Info-Liste */
.info-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list li strong {
    font-weight: 650;
    color: var(--muted);
    font-size: 13px;
    flex-shrink: 0;
}

.info-list li span {
    text-align: right;
    color: var(--text);
}

.info-list li code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Security-Konfiguration */
.security-config {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.security-config li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.security-config li:last-child {
    border-bottom: none;
}

.security-config .config-label {
    font-weight: 650;
    color: var(--muted);
    font-size: 13px;
    min-width: 140px;
    flex-shrink: 0;
}

.security-config .config-value {
    text-align: right;
    color: var(--text);
}

.security-config .config-value code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.security-config .config-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.config-badge.ok {
    background: #dcfce7;
    color: #166534;
}

.config-badge.warn {
    background: #fff7ed;
    color: var(--warning);
}

.form-error {
    margin: 0;
    border: 1px solid #fecaca;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 14px;
    font-weight: 700;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.kpi-card,
.table-card,
.login-card,
.page-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.kpi-card,
.page-panel {
    padding: 22px;
}

.page-panel h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.page-panel p {
    margin: 0;
    color: var(--muted);
}

.kpi-card dl {
    margin: 0;
}

.kpi-card dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kpi-card .kpi-value {
    display: block;
    margin: 20px 0 4px;
    font-size: 36px;
    font-weight: 700;
}

.kpi-card .kpi-detail {
    color: var(--muted);
    font-size: 14px;
}

.kpi-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.kpi-indicator {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 10px;
}

.kpi-indicator.ok {
    background: var(--success);
}

.kpi-indicator.warning {
    background: var(--warning);
}

.kpi-indicator.danger {
    background: var(--danger);
}

.inline-hint {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--primary-strong);
    font-size: 11px;
    font-weight: 800;
    cursor: help;
}

.kpi-card.warning .kpi-value {
    color: var(--danger);
}

.kpi-card.warning .kpi-detail {
    color: var(--danger);
    font-weight: 700;
}

.kpi-card.warning {
    border-color: #fecaca;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
    margin-bottom: 28px;
}

.risk-card,
.activity-card {
    padding: 20px;
}

.risk-card header,
.activity-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.risk-card h2,
.activity-card h2 {
    margin: 0;
    font-size: 19px;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #334155;
}

.risk-hoch .risk-badge {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.risk-mittel .risk-badge {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.risk-niedrig .risk-badge {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.risk-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.risk-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.risk-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.activity-card header a {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-strong);
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.activity-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #edf2f7;
}

.activity-list li:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.activity-dot.ok {
    background: var(--success);
}

.activity-dot.warn {
    background: var(--warning);
}

.activity-list strong {
    display: block;
    line-height: 1.25;
}

.activity-list small,
.activity-time,
.activity-empty {
    color: var(--muted);
    font-size: 13px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.toolbar-search {
    flex: 1 1 auto;
    position: relative;
}

.toolbar-search input {
    width: 100%;
    padding-right: 40px;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.search-clear:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.toolbar-filters label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
}

.toolbar-filters select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    padding: 6px 10px;
}

.table-card {
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #fbfbfc;
    border-bottom: 1px solid var(--border);
}

.table-toolbar input {
    width: min(460px, 100%);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    background: #f8fafc;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #eff6ff;
}

.strength-meter {
    width: 150px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.strength-meter span {
    display: block;
    height: 100%;
    background: var(--success);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.status-pill.success {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 15% 20%, #dbeafe 0, #f8fafc 35%),
                radial-gradient(circle at 85% 80%, #dcfce7 0, #f8fafc 32%),
                #f8fafc;
}

.login-shell {
    width: min(440px, 100%);
}

.login-brand {
    display: grid;
    justify-items: center;
    margin-bottom: 28px;
    text-align: center;
}

.login-brand h1 {
    margin: 16px 0 4px;
    font-size: 32px;
}

.login-brand p {
    margin: 0;
    color: var(--muted);
}

.login-card {
    display: grid;
    gap: 20px;
    padding: 28px;
}

.login-card label {
    display: grid;
    gap: 8px;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.password-toggle:hover {
    background: #f1f5f9;
    color: #1e40af;
}

.password-toggle:focus-visible {
    border-color: #93c5fd;
    background: #eff6ff;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .icon-eye-off {
    display: none;
}

.password-toggle.is-revealed .icon-eye {
    display: none;
}

.password-toggle.is-revealed .icon-eye-off {
    display: inline-block;
}

.login-card label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-card input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.login-card footer {
    margin: 4px -28px -28px;
    padding: 16px 28px;
    color: var(--success);
    background: #f8fafc;
    border-top: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
}

.security-note {
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-note-prominent {
    border-radius: 8px;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
}

.security-note svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.session-modal-backdrop {
    background: rgb(15 23 42 / 0.54);
}

.session-modal {
    color: var(--text);
}

.session-modal-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    background: var(--surface);
    box-shadow: 0 18px 54px rgb(15 23 42 / 0.18);
}

.session-modal-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fff7ed;
    color: var(--warning);
    border: 1px solid #fed7aa;
}

.session-modal-icon svg {
    width: 22px;
    height: 22px;
}

.session-modal h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.35;
}

.session-modal p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.session-modal-countdown {
    grid-column: 1 / -1;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #fff7ed;
    color: var(--warning);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.session-modal-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 2px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.session-modal-actions .primary-button,
.session-modal-actions .secondary-button {
    min-height: 42px;
}

.session-modal-actions .primary-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 40px 24px;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--border);
}

.empty-state svg {
    width: 28px;
    height: 28px;
    color: var(--primary-strong);
}

.empty-state strong {
    color: var(--text);
}

.placeholder-panel {
    background:
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.placeholder-checklist {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}

.compact-panel {
    margin-top: 14px;
}

.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgb(30 64 175 / 0.16);
    font-size: 14px;
    font-weight: 650;
    animation: toast-in 280ms ease;
}

.toast.toast-dismissing {
    animation: toast-out 220ms ease forwards;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.toast.toast-success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #14532d;
    box-shadow: 0 10px 24px rgb(4 120 87 / 0.14);
}

.toast.toast-error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #7f1d1d;
    box-shadow: 0 10px 24px rgb(185 28 28 / 0.14);
}

.toast button {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: grid;
    place-items: center;
}

.toast button:hover {
    background: rgb(0 0 0 / 0.06);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(8px) scale(0.96); }
}

.skeleton {
    display: grid;
    gap: 14px;
    padding: 24px 20px;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-line:nth-child(2) { width: 85%; }
.skeleton-line:nth-child(3) { width: 70%; }
.skeleton-line:nth-child(4) { width: 60%; }

.skeleton-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px 60px 80px;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.skeleton-row .skeleton-line {
    width: 100%;
    height: 12px;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--muted);
}

/* Split-View (Passwords) */
.split-view {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    min-height: 480px;
}

.split-list {
    flex: 1 1 auto;
    min-width: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.split-list .table-toolbar {
    border-bottom: 1px solid var(--border);
}

.split-detail {
    flex: 0 0 0;
    width: 0;
    overflow: hidden;
    transition: flex-basis 200ms ease, width 200ms ease;
    background: #fafbfc;
}

.split-detail.is-open {
    flex: 0 0 400px;
    width: 400px;
}

.password-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.password-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 100ms ease;
}

.password-item:hover {
    background: #f8fafc;
}

.password-item.is-selected {
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.password-group-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.password-mini-kpi {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #fcfdff;
}

.kpi-chip {
    border: 1px solid #dbe4f3;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
}

.kpi-chip small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kpi-chip strong {
    display: block;
    margin-top: 3px;
    font-size: 16px;
    color: #0f172a;
}

.owner-chip-row {
    display: flex;
    gap: 8px;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    background: #fff;
}

.owner-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 12px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
}

.owner-chip small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 11px;
}

.owner-chip.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}

.password-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.password-icon.large {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.password-meta {
    flex: 1;
    min-width: 0;
}

.password-meta strong {
    display: block;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.password-meta small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.password-time {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
    color: var(--muted);
    gap: 12px;
}

.detail-placeholder i,
.detail-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.password-skeleton-title {
    width: 60%;
    height: 20px;
}

.password-skeleton-line {
    height: 16px;
    margin-top: 8px;
}

.password-skeleton-line-lg {
    width: 80%;
    margin-top: 12px;
}

.password-skeleton-line-sm {
    width: 40%;
}

.detail-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.detail-header p {
    margin: 2px 0 0;
    font-size: 13px;
}

.detail-header > div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.detail-header .icon-button {
    flex-shrink: 0;
}

.detail-fields {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-field dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.detail-field dd {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-field dd code {
    font-size: 13px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 100ms;
}

.copy-button:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.detail-footer {
    margin-top: auto;
    padding-top: 16px;
}

.text-muted {
    color: var(--muted);
}

@media (max-width: 768px) {
    .split-view {
        flex-direction: column;
        min-height: auto;
    }

    .split-list {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .split-detail {
        flex: 0 0 auto;
        width: 100%;
    }

    .split-detail.is-open {
        flex: 0 0 auto;
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .admin-sidebar {
        transform: translateX(0);
    }

    .admin-content {
        padding-left: 18rem;
    }

    .sidebar-overlay,
    .admin-shell.is-sidebar-open .sidebar-overlay,
    .sidebar-close-button {
        display: none;
    }

    .main-shell {
        padding: 40px;
    }

    .mobile-topbar {
        display: none;
    }
}

@media (max-width: 900px) {
    .page-header,
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .primary-button,
    .header-actions .secondary-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .table-card {
        overflow-x: auto;
    }

    .main-shell {
        padding: 20px 16px 28px;
    }

    .session-modal-panel {
        grid-template-columns: 1fr;
    }

    .session-modal-actions {
        flex-direction: column-reverse;
    }
}
